Load Scene Materials with Unique Suffix in Listbox
Hello --
1- I want to create listbox to only load scenematerials with name plus suffix "CPT", "WD", etc.
2- double click : Apply material to object / objects selected.
3- create button to load selected material from listbox to material editor.
Thanks in advance!
rollout drop_roll "Drop Down List" width:162 height:170 ( local obj_array = #() button updt "update" pos:[67,7] width:49 height:21 listbox mat_dd "Objects :" pos:[13,13] width:136 height:10 fn update_objs = ( mat_array = scenematerials mat_dd.items = for i in mat_array collect i.name ) on drop_roll open do update_objs() on updt pressed do update_objs() -- update list, if object has been deleted or added again in scene on mat_dd doubleClicked sel do select mat_array[i] ) createDialog drop_roll
Comments
...
I hope that this tool contains all tree requests
;)
bga
Respect! Thank you :)
Respect! Thank you :)
...
If prefix not exists you will load by pressing "U" button all scene material or (if exists) materials with prefix.
Another suggestion:
When you need to work on selected objects always check selection count to avoid errors. You will see this in my code not only for objects but for other stuffs.
Cheers!
bga