Exporter creates duplicate materials

Forums: Exporter creates duplicate materials
Blender (Export script developed by yoyoz; Integrated Plugin developed by JimStar)

Exporter creates duplicate materials

Postby matej » Thu Aug 19, 2010 8:40 am

matej Thu Aug 19, 2010 8:40 am
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.
Attachments
exporting_test.zip
(242.76 KiB) Downloaded 297 times
SW: Octane 3.05 | Linux Mint 18.1 64bit | Blender 2.78 HW: EVGA GTX 1070 | i5 2500K | 16GB RAM Drivers: 375.26
cgmo.net
User avatar
matej
Licensed Customer
Licensed Customer
 
Posts: 2083
Joined: Fri Jun 25, 2010 7:54 pm
Location: Slovenia

Re: Exporter creates duplicate materials

Postby matej » Thu Aug 19, 2010 11:26 am

matej Thu Aug 19, 2010 11:26 am
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)
Attachments
oct_matdupli.png
SW: Octane 3.05 | Linux Mint 18.1 64bit | Blender 2.78 HW: EVGA GTX 1070 | i5 2500K | 16GB RAM Drivers: 375.26
cgmo.net
User avatar
matej
Licensed Customer
Licensed Customer
 
Posts: 2083
Joined: Fri Jun 25, 2010 7:54 pm
Location: Slovenia

Re: Exporter creates duplicate materials

Postby enricocerica » Thu Aug 19, 2010 5:17 pm

enricocerica Thu Aug 19, 2010 5:17 pm
I'll check that asap.
Modeling system : I7 32GB Windows 10 & Fujitsu Celsius H720
GPU : 1x Gigabyte GTX580 3GB + 1x MSI GTX780 3GB + 1x PALIT GTX780 6GB +1x Asus Stix GTX1070 8GB
http://www.myline.be
User avatar
enricocerica
Licensed Customer
Licensed Customer
 
Posts: 1012
Joined: Wed Nov 25, 2009 7:32 pm

Re: Exporter creates duplicate materials

Postby enricocerica » Sun Aug 22, 2010 7:03 pm

enricocerica Sun Aug 22, 2010 7:03 pm
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.
Modeling system : I7 32GB Windows 10 & Fujitsu Celsius H720
GPU : 1x Gigabyte GTX580 3GB + 1x MSI GTX780 3GB + 1x PALIT GTX780 6GB +1x Asus Stix GTX1070 8GB
http://www.myline.be
User avatar
enricocerica
Licensed Customer
Licensed Customer
 
Posts: 1012
Joined: Wed Nov 25, 2009 7:32 pm

Re: Exporter creates duplicate materials

Postby samschad » Sun Aug 22, 2010 8:16 pm

samschad Sun Aug 22, 2010 8:16 pm
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
Workhorse: Alienware M17X, Core2 Duo 2.4Ghz, Dual GTX 280m, Windows 7 Ultimate 64bit
Renderer: Core i7 920, 2 x EVGA GTX 470, Coolermaster Cosmos S case, Thermaltake 1200w psu.
Windows 7 Ultimate 64 bit
Octane 23_5 beta
samschad
Licensed Customer
Licensed Customer
 
Posts: 19
Joined: Thu Feb 25, 2010 2:01 pm

Re: Exporter creates duplicate materials

Postby matej » Mon Aug 23, 2010 11:04 am

matej Mon Aug 23, 2010 11:04 am
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
SW: Octane 3.05 | Linux Mint 18.1 64bit | Blender 2.78 HW: EVGA GTX 1070 | i5 2500K | 16GB RAM Drivers: 375.26
cgmo.net
User avatar
matej
Licensed Customer
Licensed Customer
 
Posts: 2083
Joined: Fri Jun 25, 2010 7:54 pm
Location: Slovenia

Re: Exporter creates duplicate materials

Postby enricocerica » Wed Sep 08, 2010 5:33 am

enricocerica Wed Sep 08, 2010 5:33 am
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.
Modeling system : I7 32GB Windows 10 & Fujitsu Celsius H720
GPU : 1x Gigabyte GTX580 3GB + 1x MSI GTX780 3GB + 1x PALIT GTX780 6GB +1x Asus Stix GTX1070 8GB
http://www.myline.be
User avatar
enricocerica
Licensed Customer
Licensed Customer
 
Posts: 1012
Joined: Wed Nov 25, 2009 7:32 pm

Re: Exporter creates duplicate materials

Postby matej » Wed Sep 08, 2010 8:09 am

matej Wed Sep 08, 2010 8:09 am
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!
SW: Octane 3.05 | Linux Mint 18.1 64bit | Blender 2.78 HW: EVGA GTX 1070 | i5 2500K | 16GB RAM Drivers: 375.26
cgmo.net
User avatar
matej
Licensed Customer
Licensed Customer
 
Posts: 2083
Joined: Fri Jun 25, 2010 7:54 pm
Location: Slovenia

Return to Blender


Who is online

Users browsing this forum: No registered users and 14 guests

Wed Apr 24, 2024 6:02 am [ UTC ]