For myself at least I have solved the problem of multiple duplicated material nodes appearing in octane when exporting from Rhino.
I am using Rhino V4 SR9 32 bit on Vista X64, so this solution may or may not work on your setup. Yes, I know I could use Rhino V5, but the texture mapping does not work well with imported V4 files, and at the moment I'm working on a lot of V4 files.
I'm using the OBJ exporter from here: http://wiki.mcneel.com/labs/objio (it may or may not work with the default obj exporter, not tried it)
Lets assume we have 9 cubes, where 3 have a material called 'Stone', 3 called 'Plastic' and the last 3 called 'Wood'.
Depening on how you assign materials in Rhino, it is critical that you assign a material name to each and every object. I tend to put different materials on different layers. This way you can right click on the layer name choose 'Select Objects' and either assign a material created in the material editor (use command MaterialEditor) in which called the material will be assigned as a plugin, or you can manually type in a material name and changed its properties under Basic.
When you're done, export as obj with the setting below... the rest of this assumes you called the exported file cubes.obj
The reason we get the multiple material nodes in octane is that in the cubes.mtl created by the exporter, that a material definition is created for each object, so we get 3 x Stone, 3 x Plastic, 3 x Wood etc as is shown below.
- Code: Select all
# Rhino
newmtl Wood
Ka 0.0000 0.0000 0.0000
Kd 0.3098 1.0000 0.4667
Ks 1.0000 1.0000 1.0000
Tf 0.0000 0.0000 0.0000
d 1.0000
Ns 0
newmtl Wood
Ka 0.0000 0.0000 0.0000
Kd 0.3098 1.0000 0.4667
Ks 1.0000 1.0000 1.0000
Tf 0.0000 0.0000 0.0000
d 1.0000
Ns 0
newmtl Wood
Ka 0.0000 0.0000 0.0000
Kd 0.3098 1.0000 0.4667
Ks 1.0000 1.0000 1.0000
Tf 0.0000 0.0000 0.0000
d 1.0000
Ns 0
newmtl Plastic
Ka 0.0000 0.0000 0.0000
Kd 1.0000 0.7765 0.3098
Ks 1.0000 1.0000 1.0000
Tf 0.0000 0.0000 0.0000
d 1.0000
Ns 0
newmtl Plastic
Ka 0.0000 0.0000 0.0000
Kd 1.0000 0.7765 0.3098
Ks 1.0000 1.0000 1.0000
Tf 0.0000 0.0000 0.0000
d 1.0000
Ns 0
newmtl Plastic
Ka 0.0000 0.0000 0.0000
Kd 1.0000 0.7765 0.3098
Ks 1.0000 1.0000 1.0000
Tf 0.0000 0.0000 0.0000
d 1.0000
Ns 0
newmtl Stone
Ka 0.0000 0.0000 0.0000
Kd 1.0000 0.3098 0.1569
Ks 1.0000 1.0000 1.0000
Tf 0.0000 0.0000 0.0000
d 1.0000
Ns 0
newmtl Stone
Ka 0.0000 0.0000 0.0000
Kd 1.0000 0.3098 0.1569
Ks 1.0000 1.0000 1.0000
Tf 0.0000 0.0000 0.0000
d 1.0000
Ns 0
newmtl Stone
Ka 0.0000 0.0000 0.0000
Kd 1.0000 0.3098 0.1569
Ks 1.0000 1.0000 1.0000
Tf 0.0000 0.0000 0.0000
d 1.0000
Ns 0
When we import cubes.obj into octane, we get this:
The way around this is to ensure in the cubes.mtl file that it shows only unique material definitions.
I'm sure there is a way to automate this, but at the moment I haven't had the time to work out how to do it quickly.
I have sorted it with using a spreadsheet (LibreOffice Calc), if anyone is interested, let me know and I can post how I do it in a spreadsheet...
You end up with this:
# Rhino
newmtl Wood
Ka 0.0000 0.0000 0.0000
Kd 0.3098 1.0000 0.4667
Ks 1.0000 1.0000 1.0000
Tf 0.0000 0.0000 0.0000
d 1.0000
Ns 0
newmtl Plastic
Ka 0.0000 0.0000 0.0000
Kd 1.0000 0.7765 0.3098
Ks 1.0000 1.0000 1.0000
Tf 0.0000 0.0000 0.0000
d 1.0000
Ns 0
newmtl Stone
Ka 0.0000 0.0000 0.0000
Kd 1.0000 0.3098 0.1569
Ks 1.0000 1.0000 1.0000
Tf 0.0000 0.0000 0.0000
d 1.0000
Ns 0
Saving the above to cubes.mtl and importing in Octane, we now get this:
Before sorting the .mtl files problem, I used to export from Rhino > Blender > Octane but this is another process and I also lost smooth materials and other probs as are mentioned elsewhere in the forum.
2 things that could be done:
Refractive Software: Provide an option on import or in preferences to ignore duplicate material definitions in the .mtl file
McNeel: Provide an option on export not to export duplicated material definitions
Hope this helps.