Add materials with one click - toolbar

Forums: Add materials with one click - toolbar
Rhino 3D (Export script developed by SamPage; Integrated Plugin developed by Paul Kinnane)

Moderator: face_off

Re: Add materials with one click - toolbar

Postby formatio » Thu Mar 24, 2016 9:57 am

formatio Thu Mar 24, 2016 9:57 am
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:

location-toolbar.JPG
toolbar location


If you guys have any suggestions for the toolbar post them in this thread
User avatar
formatio
Licensed Customer
Licensed Customer
 
Posts: 131
Joined: Sun May 18, 2014 11:00 am
Location: EU

Re: Add materials with one click - toolbar

Postby neiwei845458454 » Sat Mar 26, 2016 7:09 am

neiwei845458454 Sat Mar 26, 2016 7:09 am
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
neiwei845458454
Licensed Customer
Licensed Customer
 
Posts: 86
Joined: Fri Jan 23, 2015 3:32 am

Re: Add materials with one click - toolbar

Postby Marvez » Fri Apr 01, 2016 2:19 am

Marvez Fri Apr 01, 2016 2:19 am
thanks
I7 5820K 16MB RAM SSD850PRO GTX 970/780
User avatar
Marvez
Licensed Customer
Licensed Customer
 
Posts: 97
Joined: Wed Oct 08, 2014 4:55 pm

Re: Add materials with one click - toolbar

Postby formatio » Wed Jan 11, 2017 1:29 pm

formatio Wed Jan 11, 2017 1:29 pm
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
User avatar
formatio
Licensed Customer
Licensed Customer
 
Posts: 131
Joined: Sun May 18, 2014 11:00 am
Location: EU

Re: Add materials with one click - toolbar

Postby fabrizio_s » Sat Feb 18, 2017 11:26 am

fabrizio_s Sat Feb 18, 2017 11:26 am
Hi formatio,
your toolbar is great.

Unfortunately materials don't work. Rhino says: Unknow Command

I' seem like "RenderLoadMaterialFromFile" isn't recognised...

Bye
fabrizio_s
Licensed Customer
Licensed Customer
 
Posts: 345
Joined: Fri Feb 03, 2017 12:14 pm

Re: Add materials with one click - toolbar

Postby formatio » Sat Feb 18, 2017 7:32 pm

formatio Sat Feb 18, 2017 7:32 pm
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
User avatar
formatio
Licensed Customer
Licensed Customer
 
Posts: 131
Joined: Sun May 18, 2014 11:00 am
Location: EU

Re: Add materials with one click - toolbar

Postby fabrizio_s » Sat Feb 18, 2017 11:50 pm

fabrizio_s Sat Feb 18, 2017 11:50 pm
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
fabrizio_s
Licensed Customer
Licensed Customer
 
Posts: 345
Joined: Fri Feb 03, 2017 12:14 pm

Re: Add materials with one click - toolbar

Postby formatio » Sun Feb 19, 2017 11:24 am

formatio Sun Feb 19, 2017 11:24 am
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
User avatar
formatio
Licensed Customer
Licensed Customer
 
Posts: 131
Joined: Sun May 18, 2014 11:00 am
Location: EU

Re: Add materials with one click - toolbar

Postby fabrizio_s » Sun Feb 19, 2017 7:05 pm

fabrizio_s Sun Feb 19, 2017 7:05 pm
Thanx a lot!!!

Fabrizio
fabrizio_s
Licensed Customer
Licensed Customer
 
Posts: 345
Joined: Fri Feb 03, 2017 12:14 pm
Previous

Return to Rhinoceros 3D


Who is online

Users browsing this forum: No registered users and 8 guests

Fri Mar 29, 2024 3:53 pm [ UTC ]