How to hide an object's native attributes
-
Hello all, I would like to know if C4D can hide an object's native attributes (e.g., hiding the Object tab of a spline object). This would help avoid unnecessary attributes when selecting the corresponding controllers while animating, thus improving efficiency. In the following code, I found that SetParameter doesn't work. I can only hide custom user data attributes
import c4d def main(): obj = op description = obj.GetDescription(c4d.DESCFLAGS_DESC_NONE) doc.StartUndo() for bc, paramId, groupId in description: if bc[c4d.DESC_NAME] == 'Object Properties': doc.AddUndo(c4d.UNDOTYPE_CHANGE, obj) print(bc[c4d.DESC_HIDE]) # return None bc[c4d.DESC_HIDE] = False obj.SetParameter(groupId, bc, c4d.DESCFLAGS_SET_NONE) # obj.SetUserDataContainer(groupId, bc) # hide userData attr obj.Message(c4d.MSG_CHANGE) doc.EndUndo() c4d.EventAdd() if __name__ == '__main__': main()
-
Hi @Oliver,
Welcome to the Maxon developers forum and its community, it is great to have you with us!
Getting Started
Before creating your next postings, we would recommend making yourself accustomed with our forum and support procedures. You did not do anything wrong, we point all new users to these rules.
- Forum Overview: Provides a broad overview of the fundamental structure and rules of this forum, such as the purpose of the different sub-forums or the fact that we will ban users who engage in hate speech or harassment.
- Support Procedures: Provides a more in detail overview of how we provide technical support for APIs here. This topic will tell you how to ask good questions and limits of our technical support.
- Forum Features: Provides an overview of the technical features of this forum, such as Markdown markup or file uploads.
It is strongly recommended to read the first two topics carefully, especially the section Support Procedures: Asking Questions.
About your First Question
The GetDescription() function returns a copy of the object's description, which means that any modifications will be on the local description instance and will not be reflected on the object itself:
This effectively means that you don't have any control to hide existing attributes in the description your plugin doesn't own.
Cheers,
Ilia -
@i_mazlov Thank you