(
on execute do
(
for object in selection do
if (classOf object.material == Standard) then
(
if object.material.selfIllumAmount != 100 then
(
object.material.showInViewport = on
object.material.selfIllumAmount = 100
)
Else
(
object.material.showInViewport = on
object.material.selfIllumAmount = 0
)
)
else if (classOf object.material == Multimaterial) then
(
for b = 1 to b = object.material.numsubs do
(
if (classOf object.material.materialList[b] == Standard) then
(
object.material.showInViewport = on
object.material.selfIllumAmount = 100
)
)
)
)
)
Forum topic · General Scripting
How do I get this script that would work with Multimaterials? Get an error. Thanks
By Nikolay Litvinov · 2013-08-06
Comments (5)
Comment policy
Budi G Great thanks!!
it works
Try this one. If not works then put fn inside execute event
(
fn changeMtl mtl =
(
if isKindOf mtl Standard do
(
mtl.showInViewport = on
mtl.selfIllumAmount = if mtl.selfIllumAmount != 100 then 100 else 0
)
)
on execute do
(
if selection.count != 0 do
(
for obj in selection where obj.material != null do
(
case (classof obj.material) of
(
(multimaterial): for m in obj.material.materialList do changeMtl m
(standard): changeMtl obj.material
)
)
)
)
)
Thanx barigazy
And How to make this for button is pressed when mtl.selfIllumAmount == 100
And If mtl.selfIllumAmount != 100 then button is not pressed.
For example as well as here but i not сan make this script as well as here
are you want to toggle VertexTicks properties ei. when VertexTicks == on then macro button is checked and if VertexTicks == off then uncheck button?
I've check your script Nik,
Don't forget to write ".materialList[b]" for Multimaterial
The result of the correction :