Several objects and hooks in CINEMA 4D allow Python to access the internal data on low-level. These functions can be used to handle raw data. ByteSeq is similar to the built-in Buffer Object but is optimized to work with CINEMA 4D.
Allocates a byte sequence.
Parameters: |
|
---|---|
Return type: | |
Returns: |
The byte sequence object. |
Creates a string object from the byte sequence.
Return type: | string |
---|---|
Returns: | The byte-sequence returned as a string. |
Parameters: | other (int) – The offset value. |
---|---|
Return type: | ByteSeq |
Returns: | New ByteSeq object. |
Compares two byte sequences.
Parameters: | other (ByteSeq) – The other byte sequence. |
---|---|
Return type: | bool |
Returns: | True if the byte sequences are equal, otherwise False. |
Iterates over the bytes of the object, interpreted as one-element string:
for b in bs:
print b
Return type: | iter for str |
---|---|
Returns: | The iterator. |
Returns a hash of the byte sequence. The hash value is cached if the object owns the byte sequence and it’s flagged as read-only:
print hash(bs)
Return type: | int |
---|---|
Returns: | The hash. |
Returns the length of the byte sequence.
Return type: | int |
---|---|
Returns: | The length. |
Replaces a byte at position key with the new value:
bs1[5:7] = "ab"
bs2[100] = "a"
bs3[:100] = "0"*100
Raises TypeError: | |
---|---|
Raised if byte sequence is flagged as read-only. |
|
Parameters: |
|
Gets the bytes at position key:
print bs1[5:7] #output: "ab"
print bs2[100] # output "a"
print bs3[:100] # output "0000..."
Parameters: | key (int or slice) – The index |
---|---|
Return type: | str |
Returns: | The bytes at the requested position. |
Returns a buffer object with a relative point.
Parameters: | o (int) – The offset length. |
---|---|
Return type: | |
Returns: | The buffer object. |