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

    H2 clone an object without its children

    Scheduled Pinned Locked Moved PYTHON Development
    8 Posts 0 Posters 734 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 25/04/2013 at 12:23, xxxxxxxx wrote:

      Using GetUp I get my parent object I want to use / copy.
      So I use GetClone() to clone that parent

      However that gives me all the children of that parent.
      How to get only the parent and not the children?

      Of course I can clone the parent and then remove all (cloned) children, but I''m sure there is a better way?

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

        On 25/04/2013 at 12:30, xxxxxxxx wrote:

        Look at the documentation of GetClone(), there's a flag for exactly this.

        Best,
        -Niklas

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

          On 25/04/2013 at 12:31, xxxxxxxx wrote:

          getclone has an optional flag parameter which covers almost all cases.

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

            On 25/04/2013 at 12:56, xxxxxxxx wrote:

            Ok, I was looking at BaseSelect.GetClone() which has no flags.
            I see flags with C4DAtom.GetClone([ flags=0])

            However, I''m getting a run time error saying COPY_NO_HIERARCHY is not defined.
            Also when using c4d.COPY_NO_HIERARCHY
            Importing C4DAtom does not seem to help.

            What am I missing?

            import c4d
            from c4d import C4DAtom
            #Welcome to the world of Python
              
              
            def main() :
                pass  #put in your code here
                
                obj = op.GetObject()       
                parent = obj.GetUp()  
              
                source = parent.GetClone(COPY_NO_HIERARCHY)    #create clone
                pass
            
            1 Reply Last reply Reply Quote 0
            • H Offline
              Helper
              last edited by

              On 25/04/2013 at 13:28, xxxxxxxx wrote:

              myobj.GetClone(c4d. COPYFLAGS_NO_HIERARCHY) ** ** is correct.

              getclone is a member of c4datom.

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

                On 25/04/2013 at 14:49, xxxxxxxx wrote:

                Thanks.
                The R13 manual needs to be updated, R14 is correct.

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

                  On 26/04/2013 at 01:19, xxxxxxxx wrote:

                  Originally posted by xxxxxxxx

                  Thanks.
                  The R13 manual needs to be updated, R14 is correct.

                  Just like previous releases of CINEMA, manuals aren't updated neither.
                  Always make sure that you use the latest updated manual for the current version of CINEMA.

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

                    On 26/04/2013 at 07:51, xxxxxxxx wrote:

                    Yes, I understand.

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