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
    • Unread
    • Recent
    • Tags
    • Users
    • Login

    MergeDocument isn't importing/assigning textures

    Scheduled Pinned Locked Moved PYTHON Development
    4 Posts 0 Posters 556 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 19/05/2017 at 09:47, xxxxxxxx wrote:

      I'm working on a script to merge a file into my scene. I have polygon objects with materials assigned to them, but when I import using SCENEFILTER_OBJECTS (flag 1), it only imports the objects, not the materials. The SDK says it should import the objects "and associated items, such as materials used". Am I missing something?

      Here's what I'm using:

      import c4d
      from c4d import gui
      #Welcome to the world of Python

      resourceFile="D:\[***]\Interior.c4d"

      def main() :
          c4d.documents.MergeDocument(doc, resourceFile, 1)
          c4d.EventAdd()

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

        On 19/05/2017 at 10:12, xxxxxxxx wrote:

        1. don't use numerals for flags when there are symbols available
        2. the docs are wrong here, you need to tell it to load objects AND materials
        MergeDocument(doc, fn, c4d. SCENEFILTER_OBJECTS | c4d.SCENEFILTER_MATERIALS)
        
        1 Reply Last reply Reply Quote 0
        • H Offline
          Helper
          last edited by

          On 19/05/2017 at 10:24, xxxxxxxx wrote:

          This fixed, it thanks!

          Also, thanks for the tip re: symbols - I'm new to all this and have so much to learn 🙂

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

            On 22/05/2017 at 08:51, xxxxxxxx wrote:

            Hi theleast,

            welcome to the Plugin Café forums.

            We'll correct the documentation.

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