On 07/05/2018 at 04:47, xxxxxxxx wrote:
I'm using c4d.documents.MergeDocument() in a script to import a bunch of OBJ files into a BaseDocument.
Here are two questions:
1. Materials and texture paths
If I manually use "Merge" from Cinema's file menu, everything works fine. Materials are also imported from the .MTL files including textures (located in the same folder where the OBJ and MTL files are). If I call c4d.documents.MergeDocument() from a script, the textures are not found, as Cinema assumes that all textures would be located in a standard folder. The material editor shows the message:
file:///Applications/MAXON/CINEMA 4D R19/tex Cause: Errno #2: No such file or directory
Question: How can I make Cinema load the textures from the correct folder, just as if I imported the files manually?
2. Import settings
I need to specify some settings for the import (most importantly the scale). I can show the import dialog with c4d.documents.MergeDocument(load flags = c4d.SCENEFILTER_DIALOGSALLOWED), but since I'm importing an arbitrary numbers of files, I don't want the dialog to show up for each of them.
Question: How can I set the import parameters used for MergeDocument() via script?
Thanks in advance!