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

    change userdata by id - update childs

    Scheduled Pinned Locked Moved PYTHON Development
    7 Posts 0 Posters 518 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 06/06/2013 at 10:01, xxxxxxxx wrote:

      hi

      i try to change userdata by code - it work but the child don`t change - i try to use setdirty without success

      fixtures[c4d.ID_USERDATA,11] = presetobejct[c4d.P_LIGHT_COLOR]
      		fixtures.GetDown().SetDirty(0)
      
      1 Reply Last reply Reply Quote 0
      • H Offline
        Helper
        last edited by

        On 06/06/2013 at 10:19, xxxxxxxx wrote:

        its simply :

        fixtures[c4d.ID_USERDATA,11] = presetobejct[c4d.P_LIGHT_COLOR]
        c4d.EventAdd()

        dirty flags don't do anything for them self, they only do the object to be reevaluated on 
        the next pass. overwriting the user data will automatically flag the object and its data
        container dirty.

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

          On 06/06/2013 at 10:23, xxxxxxxx wrote:

          i have the EventAdd 4 lines after the code - its dont work

          the code change the user data of the object but the child don`t get the change

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

            On 06/06/2013 at 10:53, xxxxxxxx wrote:

            not sure why you do think the child has to be changed, you don't do anything to the child.
            you flag the first child of fixtures dirty in your example, but you haven't changed anything 
            in that child so the flag is pointless.

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

              On 06/06/2013 at 11:07, xxxxxxxx wrote:

              Sorry littedevil - a few Details

              The Child has own userdata - they are connect by xpresso to the Patent Object

              Now i change the userdata by code of the parent obeject - there the userdata change but the userdata of the Child don't change -

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

                On 06/06/2013 at 11:43, xxxxxxxx wrote:

                not sure why your setup does not work, your error has to lie somewhere else.
                fyi, you do not have to flag the child dirty in a xpresso scenario, as changing the
                user data on your object will flag the objects base container dirty and if that
                basecontainer is connected to the childs basecontainer in xpresso it will be
                updated automatically.

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

                  On 06/06/2013 at 11:44, xxxxxxxx wrote:

                  change by Hand - it work but Not by Code

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