Current material in material browser
-
I have searched through the docs to find a call that returns a reference to the currently selected material in the material browser - to no avail. I was hoping for a call active_material
Does anyone have any ideas?
Thanks
Bill Wood
-
-
cmat=Sketchup.active_model.materials.current cmatName=cmat.name Sketchup.active_model.materials.current="AnExistingMaterialNameInModel" # or a e.g. #<Sketchup;;Material;0xa5eb790>
returns the current material, its name and will change the current-material to another pre-existing one...
-
Excellent! Thanks very much Jim and Tig.
This will come in handy. I am converting some of my Studio Max tools and am using wxSU to create some very sophisticated autosizing dialogs all working in ruby (no javascript/web pages). I am a fan of wxSU even though there are some rough edges.
Regards
Bill Wood
-
Hi BillW, just to pass on a warning about WxSU....but apparently it has some issues. Adam Billyard (AdamB here on the forum and the developer of LightUp) said he is finding that having it installed might interfere with other non-related Rubies (specifically some things he's working on). I think he also said that he is contact with the person that is developing WxSU and trying to get some of those rough edges resolved. And that is all I know.
Chris
-
Hi Chris
I did notice Adam Billyard's comments. I am working on the assumption that the wxSU rough edges will be ironed out and am skirting around any current problem areas. Also, I probably wont be using Lightup anyway. As I understand it there is a more recent version of wx which can be downloaded and used to overwrite parts of the wxSU installation, but I will leave that till wxSU is updated.Thanks
Bill
-
Sounds like a plan to me!
Advertisement