Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware API
      • ZBrush Python 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
    • Recent
    • Tags
    • Users
    • Login

    Dis-/Enable UserData

    Scheduled Pinned Locked Moved PYTHON Development
    6 Posts 0 Posters 568 Views
    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.
    • H Offline
      Helper
      last edited by

      On 29/01/2015 at 02:36, xxxxxxxx wrote:

      Hello,

      I've got the small problem of not understanding the GetDEnabling(....) function.

      I wan't to dis-/enable a UserData field, currently working with "[c4d.DESC_HIDE]" provided by the forum here.

      This is my small code in a PythonNode:

      import c4d  
        
      def main() :  
        UD = myObject.GetUserDataContainer() #myObject is a link from the current object holding the UserData information  
        for descId, container in UD:  
            if descId[1].id == 2:  
                container[c4d.DESC_HIDE] = Input1 #Input1 is the result of a Checkbox in the same UserData  
                myObject.SetUserDataContainer(descId, container)
      

      Now I "just" want to change hide into disable, but that seems to be a bigger problem?

      1 Reply Last reply Reply Quote 0
      • H Offline
        Helper
        last edited by

        On 29/01/2015 at 06:48, xxxxxxxx wrote:

        Hi ,

        '''Edit
        didn´t read carefully sorry for that...

        please look at this thread:
        ~~https://developers.maxon.net/forum/topic/8350/10900_pluginsobjectdata-enablegadget-solved
        ~~

        Best wishes
        Martin

        1 Reply Last reply Reply Quote 0
        • H Offline
          Helper
          last edited by

          On 29/01/2015 at 07:47, xxxxxxxx wrote:

          Hi,

          GetDEnabling() has to be implemented in an ObjectData plugin to enable/disable user data of the object. It cannot be used to enable/disable user data on other objects.

          1 Reply Last reply Reply Quote 0
          • H Offline
            Helper
            last edited by

            On 30/01/2015 at 03:07, xxxxxxxx wrote:

            and there is no way around this problem? Any ideas?

            1 Reply Last reply Reply Quote 0
            • H Offline
              Helper
              last edited by

              On 30/01/2015 at 09:09, xxxxxxxx wrote:

              Originally posted by xxxxxxxx

              and there is no way around this problem? Any ideas?

              I'm afraid there's no workaround for this.

              1 Reply Last reply Reply Quote 0
              • H Offline
                Helper
                last edited by

                On 03/02/2015 at 21:26, xxxxxxxx wrote:

                If I understand you correctly you want to enable/disable an object??

                This is for a Cube, maybe this will put you on the right track.

                    
                    obj = doc.SearchObject("Cube")
                        
                    obj[c4d.ID_BASEOBJECT_GENERATOR_FLAG,] = False
                
                1 Reply Last reply Reply Quote 0
                • First post
                  Last post