Save Material RhinoCommon

material

(Harper) #1

Hi There!

Does anyone know if a material Rhino.DocObjects.Material can be saved using Rhinocommon as .rmtl file?

Thanks in advance.


#2

Hi @Harper, one way would be to script below commands:

RenderSaveMaterialToFile
RenderLoadMaterialFromFile

_
c.


(Harper) #3

Hi @clement, I’m afraid it doesn’t work in Rhino 6… there is no commands like that, probably it’s only for Rhino 5.

Thanks anyway.


#4

Hi @Harper, sorry i only tested this in V5, in V6 try to script the _Materials command. You’ll need to pass material name or id and the path to save to when saving. For loading the path is required too:

_-Materials _Options _SaveToFile 
_-Materials _Options _LoadFromFile 

@pascal, probably saving needs some love. On my system, which i admit is a bit old, saving a single material does take a lot of time and _EnterEnd is not recognized. I used this instead:

_-Materials _Options _SaveToFile "MatName" "C:\Folder\MatName.rmtl" _Enter _Enter

_
c.


(Pascal Golay) #5

Hi Clement - thanks, that reminds me to check on EnterEnd on RDK commands in general, I think it may not be hooked up there, I’ve run into that a couple of times it seems to me - I’ll check.

https://mcneel.myjetbrains.com/youtrack/issue/RH-49825

-Pascal


(Harper) #6

Thanks, it works a little bit slow but working.

Thanks again!