Page 1 of 1
Exporter creates duplicate materials
Posted: Thu Aug 19, 2010 8:40 am
by matej
I have a scene comprised of some objects that can have multiple materials assigned to their mesh. Some materials are shared between multiple objects. When I export it, the .mtl file contains duplicate / redundant materials.
1.) Could someone check the attached .blend scene and verify this. In it there are 3 materials, but the exporters in my case (octane and obj exporter) write down 4 materials in the .mtl file.
2.) Is there a way in Octane to re-assign materials to different parts of the mesh - ie. replace the redundant material indexes with only one instance? Something like 'expanding' the mesh node to see the material nodes and their connections, and then re-assign them?
Also, it seems that the obj exporter writes down only the names of textures in the .mtl file, which is not very useful. Couldn't the Octane exporter write down absolute texture paths for existing texture channels (COL -> diffuse, SPEC -> specular, NOR -> bump...) assigned in Blender, and pass them to Octane? The exporter could still comply to the .obj specification in the .mtl, but write down additional data in the .ocs file.
Re: Exporter creates duplicate materials
Posted: Thu Aug 19, 2010 11:26 am
by matej
I created material nodes and then attached them to all the duplicate material indexes. That did the trick, but it's messy.
Anyway, when I saved and reloaded, the mesh object contained new duplicates (this is from another project, not the zip above)
Re: Exporter creates duplicate materials
Posted: Thu Aug 19, 2010 5:17 pm
by enricocerica
I'll check that asap.
Re: Exporter creates duplicate materials
Posted: Sun Aug 22, 2010 7:03 pm
by enricocerica
I had a look to the script and indeed when objects have multi materials assignment, the script creates as many definition in the mtl file as there are objects, duno why the obj exporter was made like that. I changed the script to only have one occurance of each material and it seems to work fine. I'm doing some tests and will release the script asap.
By the way the materials saved in the ocs files will be lost and should be redefined as the name will change.
Re: Exporter creates duplicate materials
Posted: Sun Aug 22, 2010 8:16 pm
by samschad
Afternoon-
I tried posting this to it's own post, but the website kept kicking me out.
I would like to take advantage of the multiple GPUs I have (two GTX280m's) when using the export from Blender. But whenever I try to specify the names of the GPU's, Octane crashes once it is served up.
Any ideas?
Many thanks gang-
Sam
Re: Exporter creates duplicate materials
Posted: Mon Aug 23, 2010 11:04 am
by matej
Hi, Enrico!
What do you think about passing absolute paths of image files to the octane scene .xml? The .obj exporter just notes down names of texturemaps, which is not useful, unless the images are copied to the export directory (which is messy and not practical).
I know that Octane workflow consists of creating materials anew, but I (and I think also a lot of others) have a lot of projects in Blender that are already neatly mapped, and such an automation feature would save time. The conversion from Blender texture channels to Octane could go something like this:
Col -> diffuse
Nor -> bump
Nor (if "Normal M" is enabled in "Map Image" tab) -> normal
Spec -> specular
Alpha -> opacity
If the texture channel is inverted, then the "invert" checkbox in the respective parameter should be enabled.
Anyway, thanks for your work!
@samschad,
Try to disable "GPU devices to use" toggle in the export script (if enabled, this crashes Octane for me) and setup your videocards within Octane - File/Device manager
Re: Exporter creates duplicate materials
Posted: Wed Sep 08, 2010 5:33 am
by enricocerica
The duplicate materials issue is solved and the new script is available, see the release note for details.
Regarding the absolute path, this should be a new option and would change the actual behavior of the script, we'll see later on if this could be added.
Re: Exporter creates duplicate materials
Posted: Wed Sep 08, 2010 8:09 am
by matej
Just to clarify; with absolute paths I meant "make it so that Octane will find & load images without having to copy all of them in the folder where .ocs is", because that includes additional copypasting / manual deleting, if the images are re-edited. I like to have my project folders neatly structured and draw images also from other parts of the filesystem (material libraries), having all the images copied in one folder is not practical. Anyway, until this is addressed, there's a partial shortcut: make a toggle "always overwrite images on export".
Another minor thing:
If a texture is applied to NOR in the materials Map To tab and the respective image is tagged as a normalmap (Texture buttons, Map Image tab, Normal Ma enabled), it should be loaded to the normal material parameter, not to bump. Normalmaps should take precedence in case there's also a bump map enabled.
Thank you for your work!