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
    • Login

    Copying / cloning a Volume Builder object.

    Cinema 4D SDK
    python r20
    2
    4
    831
    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.
    • P
      pim
      last edited by pim

      I think there is a bug when cloning a Volume Builder object.
      Here the hierarchy and the Volume Builder properties.
      See the cloner is set to Intersect!

      0d670b4c-ca02-4961-a05c-83611b3e0509-image.png

      Now I clone the volume builder with the following script.

      import c4d
      from c4d import gui
      
      def main():
          doc.InsertObject(op.GetClone()) 
          print op.GetName() + " Inserted."   
          c4d.EventAdd()
      
      # Execute main()
      if __name__=='__main__':
          main()
      

      Here the resulting Volume Builder with its properties.
      0cd8294d-2889-408d-8d41-d05aba213070-image.png

      The cloner is now set to Union!

      Is my assumption correct that this is a bug and if so, is there a solution or a workaround?

      -Pim
      I have attached the scene file I used.
      volume builder issue.c4d

      1 Reply Last reply Reply Quote 0
      • r_giganteR
        r_gigante
        last edited by r_gigante

        Hi Pim, it looks like you've hit a bug here and I confirm I'm able to reproduce it on Python as well as on C++.

        Unfortunately at the moment, even using the VolumeBuilder.SetBoolMode() / VolumeBuilder::GetBoolMode() I've not been able to to workaround the issue.

        I'll keep update on the resolution.
        Best, Riccardo

        1 Reply Last reply Reply Quote 0
        • r_giganteR
          r_gigante
          last edited by r_gigante

          Hi Pim, I've good news here since I was wrong on my previous post, so please ignore it

          Actually it is necessary to translate the entries in the list to the new children that were cloned together with the generator. If that doesn’t happen, the list does not recognize the old entries, removes them and auto adds the new children with default settings. Default mix mode is Union in this case.

          That said, apologizing for the wrong information, the right way to clone the VolumeBuilder is:

          
          import c4d
          from c4d import gui
          
          def main():
              trans = c4d.AliasTrans()
              if not trans or not trans.Init(doc):
                  return False
              doc.InsertObject(op.GetClone(c4d.COPYFLAGS_NONE, trans))
              trans.Translate(True)
              print op.GetName() + " Inserted."   
              c4d.EventAdd()
          
          # Execute main()
          if __name__=='__main__':
              main()
          

          Best, Riccardo

          1 Reply Last reply Reply Quote 1
          • P
            pim
            last edited by pim

            @r_gigante said in Copying / cloning a Volume Builder object.:

            AliasTrans

            Great news, I will try it.
            Thanks.

            Edit: Yes, everything is ok now!

            But to be honest, I do not fully understand the functionality.
            The manual says "Normally Cinema 4D provides an alias translator when needed, for example in NodeData.CopyTo(). However, to copy objects manually use: ..."

            So, the advise is to use this functionality when copying objects?
            I see the functionality is here since R17, but this is the first time I came across this issue and this solution.

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