Hi all,
I'd like to ask a few questions to establish the basics on using basecontainers.
- How to use the Unique ID? The SDK says if we store something in the Top Level we need it. Let's say want to store a value in an object's base container, is the following example correct?
uniqueID = 12345
bc = c4d.BaseContainer()
bc[12345] = "My new value"
obj.SetData(bc, True)
There's nothing really stopping anyone from overwriting this id, so I was wondering if this is how the unique id is being used.
- Are the types of values we can store in the base container limited? I tried to store a list, a tuple and a dictionary and it always fails. Here's an example:
bc = c4d.BaseContainer()
bc[12345] = (1,2,3,4,5)
obj.SetData(bc, True)
print (op.GetData())
This produces this error:
TypeError: could not convert 'tuple'
- In the SDK sub-containers are mentioned. Is the following code the correct way of using subcontainers?
bc = c4d.BaseContainer
subContainer = c4d.BaseContainer
subcontainer[0] = "My subcontainer value"
bc[12345] = subcontainer
Thanks in advance