Pull material from a .mat file

Hi, how do i create a small material library for myself by pulling material from mtl file..I use the following scenario now,but this is quite laborious..

Example

rollout unnamedRollout "Untitled" width:386 height:446
(
button 'btn1' "Assign Material" pos:[45,339] width:81 height:29 align:#left
dropdownList 'ddl1' "DropDownList" pos:[51,65] width:231 height:40 items:#("white", "red", "blue") selection:1 align:#left
button 'btn3' "Assign Select Obj" pos:[150,340] width:81 height:29 align:#left

on btn1 pressed do
if ddl1.selection==1 then
(
mtl_1 = coronamtl ()
mtl_1.color.diffuse = color 250 250 250
meditmaterials[activemeditslot] = mtl_1
)
else
if ddl1.selection==2 then
(
mtl_1 = coronamtl ()
mtl_1.color.diffuse = color 100 100 100
meditmaterials[activemeditslot] = mtl_2
)
)
createdialog unnamedRollout

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
miauu's picture

.

If you already have a mtl file with all materials that you need then use the

loadTempMaterialLibrary

You can find a lots of examples on the net how to use loadTempMaterialLibrary to get the materials from a specific mtl file.

ahmetss's picture

Thank you

Very Very Thanks

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.