Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware API
      • ZBrush GoZ API
      • Code Examples on Github
    • Forum
    • Downloads
    • Support
      • Support Procedures
      • Registered Developer Program
      • Plugin IDs
      • Contact Us
    • Categories
      • Overview
      • News & Information
      • Cinema 4D SDK Support
      • Cineware SDK Support
      • ZBrush 4D SDK Support
      • Bugs
      • General Talk
    • Unread
    • Recent
    • Tags
    • Users
    • Register
    • Login

    How to hide an object's native attributes

    Cinema 4D SDK
    windows 2024 python
    2
    3
    370
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • O
      Oliver
      last edited by

      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 😞
      e2f961ced0af4a2316cf21f92cc6fe5.png

      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()
      
      i_mazlovI 1 Reply Last reply Reply Quote 0
      • i_mazlovI
        i_mazlov @Oliver
        last edited by i_mazlov

        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:
        24c8521c-e34e-432a-92ec-e06d0f24cb9e-image.png

        This effectively means that you don't have any control to hide existing attributes in the description your plugin doesn't own.

        Cheers,
        Ilia

        MAXON SDK Specialist
        developers.maxon.net

        O 1 Reply Last reply Reply Quote 1
        • O
          Oliver @i_mazlov
          last edited by

          @i_mazlov Thank you

          1 Reply Last reply Reply Quote 0
          • First post
            Last post