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

    Object Childs get Layer

    Scheduled Pinned Locked Moved PYTHON Development
    6 Posts 0 Posters 505 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 09/08/2015 at 01:53, xxxxxxxx wrote:

      Hello ,

      I work with a own Object and like to automatic pass on the layer to all childs of that object. 
      the childs of the object are invisible in the tree and it react correct but unexplainable for the user.

      Thanks

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

        On 10/08/2015 at 03:56, xxxxxxxx wrote:

        Hi,

        I think, we will need more details. I guess you have an ObjectData generator plugin. Now, which childs are you talking about. The ones generated in GVO() or the childs in the Object Manager?
        And then, what is the correct but unexplainable result?

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

          On 10/08/2015 at 04:34, xxxxxxxx wrote:

          Hi Andreas,

          Correct I use an ObjetData plugin. Under that Object is a bunch of Polygone object, lights and other objects - as childs in the Object Manager - for better overview the plugin hide the childs under my object and only show the main object.

          by changing the Layer for the Main object - the childs will not be effected from that. But the user can`t see the childs so he expect an other behavior - because the work with the main object.

          Thanks

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

            On 10/08/2015 at 04:50, xxxxxxxx wrote:

            maybe need to make rules for hierarchy or for name of child objects

            such primitive

            i'm walking through aov of c4dtoa and get only light_group named ops under driver.
            i can easy make rules for parent driver and childs like light_group_

            import re  
              
            def walk(obj) :  
              if not obj: return  
              while obj.GetUp() and not obj.GetNext() :  
                  obj = obj.GetUp()  
              return obj.GetNext()  
            def initlgs() :  
              obj  = doc.GetFirstObject()  
              while obj:  
                  if obj.GetType() == 1030141:  
                      ch = obj.GetChildren()  
                      lgl = []  
                      for i in ch:                  
                          if re.findall("light_group_", i.GetName()) :  
                              lgl.append(i)  
                      return lgl                  
                      break  
                  obj = walk(obj)
            
            1 Reply Last reply Reply Quote 0
            • H Offline
              Helper
              last edited by

              On 11/08/2015 at 02:06, xxxxxxxx wrote:

              Thanks Ilay

              is there a "change Layer" Message I can use to do that - I like to run this as rarely as possible

              I don`t found one in the documentation

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

                On 11/08/2015 at 06:16, xxxxxxxx wrote:

                post simplified example in python gen + Annotation tags with description

                is there a "change Layer" Message I can use to do that - I like to run this as rarely as possible

                hmm, i'm hobbyist-coder, but if wrap such to message callback
                _messcall = returned_op.SetLayerObject(new layer with turn off op.manager)
                if messcall:
                return True
                _and etc. _

                _

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