On 07/05/2014 at 13:17, xxxxxxxx wrote:
I will, Scott. Thank you for giving me that information.
So, it is not possible to change the name of the UserData tab.
And is that also true about being possible to group userdata gizmos in multi-colums?
On 07/05/2014 at 14:24, xxxxxxxx wrote:
1.) AFAIK there's no way to change the name of the UserData tab.
2.) AFAIK there's no way to have multiple columns
The columns you see in certain UD gizmos like the Latitude/Longitude option are laid out in the gizmo's CustomDataType code. And not by the UD manager.
The UD manager itself is fairly weak. Which is baffling to me. Because UserData is one of the most heavily used features in C4D.
I was stunned that I had to write my own UD sort function for them.
We get a lot more control using descriptions in .res files for laying out our gizmos. But descriptions have problems too. Like not being able to delete them, and not being supported in Python.
So either way you turn. You will hit a wall.
On 07/05/2014 at 14:32, xxxxxxxx wrote:
It is so strange that we have attributes like DESC_COLUMNS but we can't use it for anything.
Also, we have DTYPE_GROUP but we can't set any groups.
I love using .res files but I can't change their content dynamically. For example, I can create a LONG field set to CYCLE go create a dropdown list. But I have to set the content of the CYCLE inside the .res file and I can't change it using code.
This is quite limiting :-(
On 07/05/2014 at 15:37, xxxxxxxx wrote:
We can make UD groups.
That one is possible.
#This example adds a UD group that has a child group of it's own import c4d def main() : obj = doc.GetActiveObject() if not obj: return False #The top most parent group rootGroup = c4d.GetCustomDatatypeDefault(c4d.DTYPE_GROUP) rootGroup[c4d.DESC_NAME] = "Root" rootGroup[c4d.DESC_TITLEBAR] = False rootGroup[c4d.DESC_LAYOUTGROUP] = True rootGroup[c4d.DESC_COLUMNS] = 3 obj.AddUserData(rootGroup) #A group that's a child of the root group childGroup = c4d.GetCustomDatatypeDefault(c4d.DTYPE_GROUP) childGroup[c4d.DESC_NAME] = "childGroup" childGroup[c4d.DESC_TITLEBAR] = True childGroup[c4d.DESC_DEFAULT] = True #The Default Open option childGroup[c4d.DESC_PARENTGROUP] = obj.GetUserDataContainer() obj.AddUserData(childGroup) #A string type UD entry for this group childGrp_Item1 = c4d.GetCustomDatatypeDefault(c4d.DTYPE_STRING) childGrp_Item1[c4d.DESC_NAME] = "Item1" childGrp_Item1[c4d.DESC_PARENTGROUP] = obj.GetUserDataContainer() obj[obj.AddUserData(childGrp_Item1)] ="Hello World" #A Real type UD entry for this group childGrp_Item2 = c4d.GetCustomDatatypeDefault(c4d.DTYPE_REAL) childGrp_Item2[c4d.DESC_NAME] = "Item2" childGrp_Item2[c4d.DESC_PARENTGROUP] = obj.GetUserDataContainer() obj[obj.AddUserData(childGrp_Item2)] = 55.6 c4d.EventAdd()
On 07/05/2014 at 15:43, xxxxxxxx wrote:
Thank you, Scott.
The documentation is not very clear in how to achieve that.
On 08/05/2014 at 11:56, xxxxxxxx wrote:
I finally managed to be able to change the name of the UserData tab!!! :-D
I contacted Maxon and I was told to create a group and set DESC_PARENTGROUP = c4d.DescID(0)
Then, all my interface elements need to be set to DESC_PARENTGROUP] = obj.GetUserDataContainer()
Also, it seems that the c4d.DESC_COLUMNS constant is not set properly in the coffeesymbols.h file. However, it is correct (value of 22) in the lib_description.h file.
Thank you Rick Barret :-)
On 08/05/2014 at 16:23, xxxxxxxx wrote:
Do you have a small example of using c4d.DESC_COLUMNS Rui?
I'm not sure how to use that one.
On 08/05/2014 at 17:34, xxxxxxxx wrote:
Actually, I didn't used multi-columns after all.
But I may try to make it work with my plugin.
On 08/05/2014 at 18:35, xxxxxxxx wrote:
Here is the code I used:
rootGroup = c4d.GetCustomDatatypeDefault(c4d.DTYPE_GROUP)
rootGroup[c4d.DESC_NAME] = "Presets"
rootGroup = 3
rootGroup[c4d.DESC_PARENTGROUP] = c4d.DescID(0)
ud_preset[c4d.DESC_NAME] = "Presets"
ud_preset[c4d.DESC_CUSTOMGUI] = c4d.CUSTOMGUI_CYCLE
ud_preset[c4d.DESC_PARENTGROUP] = node.GetUserDataContainer()
for i,f in enumerate(file_list) :
ud_preset[c4d.DESC_CYCLE] = datalist
ud2[c4d.DESC_NAME] = "Use preset"
ud2[c4d.DESC_CUSTOMGUI] = c4d.CUSTOMGUI_BUTTON
ud2[c4d.DESC_PARENTGROUP] = node.GetUserDataContainer()
ud3[c4d.DESC_NAME] = "Store new preset"
ud3[c4d.DESC_CUSTOMGUI] = c4d.CUSTOMGUI_BUTTON
ud3[c4d.DESC_PARENTGROUP] = node.GetUserDataContainer()
It creates a 3 column parent group, that also changes the same of the UserData tab.
On 08/05/2014 at 19:20, xxxxxxxx wrote:
Added these to my notes.
Now I just have to figure out how to do these in C++.
That's going to be another wonderful adventure.