Page 2 of 2
Re: Add materials with one click - toolbar
Posted: Thu Mar 24, 2016 9:57 am
by formatio
Hi
prehabitat - yes. I'll add more features in the future so they would go underneath the current icons (or cascade icon/menu when it gets crowded)
I have it like this:

- toolbar location
If you guys have any suggestions for the toolbar post them in this thread
Re: Add materials with one click - toolbar
Posted: Sat Mar 26, 2016 7:09 am
by neiwei845458454
Code: Select all
# This Python file uses the following encoding: utf-8
import rhinoscriptsyntax as rs
import scriptcontext
rs.Command("_RenderLoadMaterialFromFile C:\\glass.rmtl")
def FindMaterialByName(mat_name):
# find a material by name
mat_table = scriptcontext.doc.Materials
mat_index = mat_table.Find(mat_name, True)
if mat_index >= 0:
print("{0} found at index {1}").format(mat_name, mat_index)
else:
print("material named {} not found in table").format(mat_name)
if __name__=="__main__":
FindMaterialByName("glass")
obj = rs.GetObject()
if obj:
index = rs.ObjectMaterialIndex(obj)
if index==-1: index = rs.AddMaterialToObject(obj)
this will help you
Re: Add materials with one click - toolbar
Posted: Fri Apr 01, 2016 2:19 am
by Marvez
thanks
Re: Add materials with one click - toolbar
Posted: Wed Jan 11, 2017 1:29 pm
by formatio
Hi guys.
I just added toolbar for octane for rhino 3.x.x .
Download link is in the first post of this thread.
Regards,
Mac
Re: Add materials with one click - toolbar
Posted: Sat Feb 18, 2017 11:26 am
by fabrizio_s
Hi formatio,
your toolbar is great.
Unfortunately materials don't work. Rhino says: Unknow Command
I' seem like "RenderLoadMaterialFromFile" isn't recognised...
Bye
Re: Add materials with one click - toolbar
Posted: Sat Feb 18, 2017 7:32 pm
by formatio
Hi Fabrizio.
This command comes from rdk - do you have it installed/up to date?
This command (and many others starting with Render...) do not autocomplete.
Regards,
Mac
Re: Add materials with one click - toolbar
Posted: Sat Feb 18, 2017 11:50 pm
by fabrizio_s
Hi,
I have solved...my Rhino is in the Italian version...so I have to insert an underscore before the commands.
_RenderLoadMaterialFromFile
Now everything works fine
thanx a lot
Re: Add materials with one click - toolbar
Posted: Sun Feb 19, 2017 11:24 am
by formatio
Hi, Thank you for the info - I changed the toolbar so it works in every language now

(see first post in this thread)
Hey Guys - if you have any suggestions or need another feature - let me know here and I try to implement it.
Regards,
Mac
Re: Add materials with one click - toolbar
Posted: Sun Feb 19, 2017 7:05 pm
by fabrizio_s
Thanx a lot!!!
Fabrizio