Also in the forum topic, the user ask for help on how to sort the list by 2 ways - ObjectName + ObjectMaterial and ObjectMaterial + ObjectName. For this task can be tested many ways, dependent on that method we prefer to collect and print the list. If someone interesting about current script, there it is:
---------------------------------------
sel = selection as array
arrObjMtl = #()
arrMtlObj = #()
for i in sel do
(
if i.material != undefined then (
append arrObjMtl (i.name + " :: " + i.material.name)
append arrMtlObj (i.material.name + " :: " + i.name)
)
else (
append arrObjMtl (i.name + " :: " + "--")
append arrMtlObj ("--" + " :: " + i.name)
)
)
sort arrObjMtl ; sort arrMtlObj
for i in arrObjMtl do print i
for i in arrMtlObj do print i
---------------------------------------
No comments:
Post a Comment
Thanks for your comment