[SOLUTION] Remove duplicate materials from Rhino MTL files

Rhino 3D (Export script developed by SamPage; Integrated Plugin developed by Paul Kinnane)

Moderator: face_off

Post Reply
tom_holly
Licensed Customer
Posts: 24
Joined: Thu Feb 24, 2011 2:41 pm

I've uploaded a script to remove and sort the duplicate materials in MTL files when exporting OBJ files from Rhino 3D.

It works for Rhino 4. It may or may not work for other versions.

This is not fully tested, so use at your own risk. You may post any bugs to me on this thread.

http://rhino-3d-obj-mtl-fix.zzl.org/

Cheers, Tom
AMD Athlon(tm) II X4 640 @ 3.0 HGz | 4.00 GB | Octane beta 2.44 | Rhino V4 SR9 | Windows Vista x64 | GTX 570
tom_holly
Licensed Customer
Posts: 24
Joined: Thu Feb 24, 2011 2:41 pm

Just updated the content on the website link to include instructions on exporting from Rhino.
AMD Athlon(tm) II X4 640 @ 3.0 HGz | 4.00 GB | Octane beta 2.44 | Rhino V4 SR9 | Windows Vista x64 | GTX 570
rock1ng
Licensed Customer
Posts: 85
Joined: Fri Apr 09, 2010 1:51 pm

Hello Tom, I was trying to solve the problem with your solution, but the program shows me this message:


There was an error parsing the command-line arguments:

Couldn't find match for argument Argument: octane.obj

USAGE:

dummy program name [-m <string>] [-r <filename>] [-l <filename>] [-n
<filename>] [--imager-exposure <float>]
[--daylight-sundir-z <float>] [--daylight-sundir-y
<float>] [--daylight-sundir-x <float>]
[--cam-lensshift-right <float>] [--cam-lensshift-up
<float>] [--cam-aperture <float>] [--cam-focaldepth
<float>] [--cam-fov <float>] [--cam-motion-up-z
<float>] [--cam-motion-up-y <float>]
[--cam-motion-up-x <float>] [--cam-motion-target-z
<float>] [--cam-motion-target-y <float>]
[--cam-motion-target-x <float>] [--cam-motion-pos-z
<float>] [--cam-motion-pos-y <float>]
[--cam-motion-pos-x <float>] [--cam-up-z <float>]
[--cam-up-y <float>] [--cam-up-x <float>]
[--cam-target-z <float>] [--cam-target-y <float>]
[--cam-target-x <float>] [--cam-pos-z <float>]
[--cam-pos-y <float>] [--cam-pos-x <float>] [-q] [-g
<int>] ... [-s <int>] [-o <filename>]
[--film-height <int>] [--film-width <int>] [-e] [--]
[--version] [-h] <filename>


Where:

-m <string>, --mesh-node <string>
Name of meshnode to render

-r <filename>, --relink-meshnode <filename>
Name of OBJ mesh file to relink rendered meshnoded with

-l <filename>, --link-meshnode <filename>
Name of OBJ mesh file to link after startup

-n <filename>, --new <filename>
Create a new OCS project file from given command line arguments

--imager-exposure <float>
Imager Exposure Amount

--daylight-sundir-z <float>
Daylight Sun Direction Vector Z Component

--daylight-sundir-y <float>
Daylight Sun Direction Vector Y Component

--daylight-sundir-x <float>
Daylight Sun Direction Vector X Component

--cam-lensshift-right <float>
Lens Shift Right

--cam-lensshift-up <float>
Lens Shift Up

--cam-aperture <float>
Camera Aperture Radius

--cam-focaldepth <float>
Camera Focal Depth

--cam-fov <float>
Camera FOV (degrees)

--cam-motion-up-z <float>
Camera Up Motion 2nd Vector Z Component

--cam-motion-up-y <float>
Camera Up Motion 2nd Vector Y Component

--cam-motion-up-x <float>
Camera Up Motion 2nd Vector X Component

--cam-motion-target-z <float>
Camera Target Motion 2nd Position Z Component

--cam-motion-target-y <float>
Camera Target Motion 2nd Position Y Component

--cam-motion-target-x <float>
Camera Target Motion 2nd Position X Component

--cam-motion-pos-z <float>
Camera Motion 2nd Position Z Component

--cam-motion-pos-y <float>
Camera Motion 2nd Position Y Component

--cam-motion-pos-x <float>
Camera Motion 2nd Position X Component

--cam-up-z <float>
Camera Up Vector Z Component

--cam-up-y <float>
Camera Up Vector Y Component

--cam-up-x <float>
Camera Up Vector X Component

--cam-target-z <float>
Camera Target Position Z Component

--cam-target-y <float>
Camera Target Position Y Component

--cam-target-x <float>
Camera Target Position X Component

--cam-pos-z <float>
Camera Position Z Component

--cam-pos-y <float>
Camera Position Y Component

--cam-pos-x <float>
Camera Position X Component

-q, --quiet
Start Application without splash and minimized window

-g <int>, --gpu <int> (accepted multiple times)
add GPU device to use for rendering (0 = first)

-s <int>, --samples <int>
Maximum number of samples per pixel (maxsamples)

-o <filename>, --output-png <filename>
Output PNG imagefile when maxsamples is reached

--film-height <int>
Film height

--film-width <int>
Film width

-e, --exit
Close the application when rendering is done

--, --ignore_rest
Ignores the rest of the labeled arguments following this flag.

--version
Displays version information and exits.

-h, --help
Displays usage information and exits.

<filename>
.OCS Project scene file


Octane Render



Can you tell me what is it ? thank you a lot.
WIN7x64,Asrock z87 killer/ i7 4770/16gb//GPU: GTX 780 Ti "superclocked" ; Rhino
tom_holly
Licensed Customer
Posts: 24
Joined: Thu Feb 24, 2011 2:41 pm

Hello,

You appear to be trying to process the OCS file, you should be processing the contents of the MTL file.

When you export an OBJ file from Rhino, it creates an MTL file which contains the list of materials. It is the contents of this file you paste and process.

If you have any problems, please let me know.

Cheers, Tom
AMD Athlon(tm) II X4 640 @ 3.0 HGz | 4.00 GB | Octane beta 2.44 | Rhino V4 SR9 | Windows Vista x64 | GTX 570
User avatar
pixelrush
Licensed Customer
Posts: 1618
Joined: Mon Jan 11, 2010 7:11 pm
Location: Nelson, New Zealand

Pardon me tacking on here but the link to the mod script doesnt seem to be working.
Can you re upload it somewhere please.
I recently bought Rhino and would like to try exporting to Octane.
thanks
i7-3820 @4.3Ghz | 24gb | Win7pro-64
GTS 250 display + 2 x GTX 780 cuda| driver 331.65
Octane v1.55
tom_holly
Licensed Customer
Posts: 24
Joined: Thu Feb 24, 2011 2:41 pm

Hi,

I just tried the link and it works fine for me.

Perhaps the site hosting it was down for a while?

Cheers, Tom
AMD Athlon(tm) II X4 640 @ 3.0 HGz | 4.00 GB | Octane beta 2.44 | Rhino V4 SR9 | Windows Vista x64 | GTX 570
rock1ng
Licensed Customer
Posts: 85
Joined: Fri Apr 09, 2010 1:51 pm

tom_holly wrote:Hello,

You appear to be trying to process the OCS file, you should be processing the contents of the MTL file.

When you export an OBJ file from Rhino, it creates an MTL file which contains the list of materials. It is the contents of this file you paste and process.

If you have any problems, please let me know.

Cheers, Tom

Thanks, i will try it. :)
WIN7x64,Asrock z87 killer/ i7 4770/16gb//GPU: GTX 780 Ti "superclocked" ; Rhino
User avatar
pixelrush
Licensed Customer
Posts: 1618
Joined: Mon Jan 11, 2010 7:11 pm
Location: Nelson, New Zealand

Sorry to say every time I try the link lately and today I get 'could not connect to server' error.
Tried both IE and Opera. The google cache version is missing the code... :roll:
Any reason why you cant put it here on the forum? We would appreciate it.
Thanks
i7-3820 @4.3Ghz | 24gb | Win7pro-64
GTS 250 display + 2 x GTX 780 cuda| driver 331.65
Octane v1.55
User avatar
pixelrush
Licensed Customer
Posts: 1618
Joined: Mon Jan 11, 2010 7:11 pm
Location: Nelson, New Zealand

ok still not working :roll: I give up. I'll go through Blender... ;)
i7-3820 @4.3Ghz | 24gb | Win7pro-64
GTS 250 display + 2 x GTX 780 cuda| driver 331.65
Octane v1.55
Post Reply

Return to “Rhinoceros 3D”