[I have so many questions in this thread. So first, please let me thank you for taking time! ]
Hi,
I want to access user data in a more "procedural way". Here is the code after I do lots of searching on the Python (and C++) SDK document:
import c4d
from c4d import gui
#Welcome to the world of Python
def main():
obj = doc.GetActiveObject()
objBc = obj.GetData()
userdataList = obj.GetUserDataContainer()
userdata = userdataList[0]
userdataBc = userdata[1]
DescIDList = userdata[0]
id0 = DescIDList[0].id
id1 = DescIDList[1].id
print(objBc[id0][id1])
if __name__=='__main__':
main()
After this, I really want to know how the data of a BaseObject
organized and stored. And I make a picture:
I don't know if this reveals some of the data structure of BaseObject
.
And I have some doubts in or out of the picture:
-
[In the picture] After I search in the
BaseContainer
ofBaseObject
, I don't find anything data related to aUserdata
:long name
,short name
,min/max value/default value
, etc.
Where is theBaseContainer
of all these data stored? -
[In the picture] Is
DescID
is similar toUUID
of aBaseContainer
? And where are they stored? -
[In the picture] What is
CreatorId
ofDescLevel
? I only find0
in this field. -
[Out the picture] As for now, is there any easier way to get a
textual form
ofDescLevel.id
andDescLevel.dtype
? Comparing and searching in branches of*.h
files is not friendly for us without C++ experience. -
[Off topic] The name
index
in sample code ofBaseContainer.__iter__()
inPython SDK Document
is confusing. Especially that all other function documents refer the same thing asid
on the same page. -
[Off topic] Is there any articles that have more detail about the foundation concepts for cinema 4d coding?
Here I find some pages inPython SDK Document
:
Cookbook, Plugin Structure, Introduction into the GUI of Cinema 4D.
But they are lack of details and relation with other document.
Also, some foundation concepts only have few introduction paragraphs:
BaseList2D
,BaseContainer
, etc.
I don't mean to complain, but it's frustrating after spending hours and hours searching in the SDK and the Internet but only get some obscure results. I hope the document could be more friendly to new developers.
Thanks a lot!