MergeDocument isn't importing/assigning textures



  • 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()



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


  • 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 :)



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

    Hi theleast,

    welcome to the Plugin Café forums.

    We'll correct the documentation.


Log in to reply