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

    Copying individual models to new documents

    Scheduled Pinned Locked Moved PYTHON Development
    11 Posts 0 Posters 871 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 17/01/2014 at 11:27, xxxxxxxx wrote:

      I tried reducing my project to one model in the object manager and then the script works.  Why would it work with one item but not more than one?

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

        On 17/01/2014 at 11:40, xxxxxxxx wrote:

        You should remove the object from the old document before inserting it into the new one.

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

          On 17/01/2014 at 11:44, xxxxxxxx wrote:

          I'll give that a try.

          Is there a way to make a copy of the object rather than using the original?  I would prefer not to alter the original project if possible.

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

            On 17/01/2014 at 11:53, xxxxxxxx wrote:

            BaseList2D.GetClone(), see the API reference

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

              On 17/01/2014 at 11:59, xxxxxxxx wrote:

              I appreciate your help but I was unable to find that function in the sdk documentation.  I looked in the BaseList2D section and came up with nothing so I tried using the search feature and it couldn't be found.  May I ask where did you find it?

              thanks again for your help.

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

                On 17/01/2014 at 12:10, xxxxxxxx wrote:

                My fault, sorry. 😉
                It's in the C4DAtom class.

                Best,
                -Niklas

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

                  On 17/01/2014 at 12:12, xxxxxxxx wrote:

                  I had seen that one but I'm a little fuzzy on the Atom class.  I'll see what I can figure out.

                  I tried removing the object like you suggested and the script is now functioning.  If I can't get the cloning aspect to work I'll at least have something working even if it isn't ideal.

                  Thank you.

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

                    On 17/01/2014 at 12:16, xxxxxxxx wrote:

                    You would not even need to look up the function, just give it a try already. 😉

                    >
                    > import c4d
                    >
                    > def main() :
                    > for op in doc.GetObjects() :
                    > newDoc = c4d.documents.BaseDocument()
                    > newDoc.SetDocumentName(op.GetName())
                    > c4d.documents.InsertBaseDocument(newDoc)
                    > newDoc.InsertObject(op.GetClone())
                    >
                    > main()

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

                      On 17/01/2014 at 12:27, xxxxxxxx wrote:

                      Niklas - that is sooooo much more streamlined than what I have right now.  I hope to be as skilled with this at some point.  I was on the right path but I'm using more variables instead of just putting the methods right into the functions.

                      If I understand this correctly I can use functions from higher up in the hierarchy and apply them to the lower class object as if it were documented that way?  (as if the clone command was listed down the hierarchy with the rest of the object commands)

                      Can we use our MSA training for Python?

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

                        On 17/01/2014 at 14:19, xxxxxxxx wrote:

                        Everything is working from the model standpoint but the textures don't follow.  I've created a script that identifies which of the objects tags are textures and then gets the associated material and transfers it to the new project but the texture tags still come up with question marks in them for missing textures.  Am I missing something or do I need to continue scripting to associate the material with the texture again?

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