Notifications
Clear all
[Closed] Set all material's diffuse to white
Jan 19, 2021 2:05 pm
Hello,
I want to set diffuse color to white for all selection material.
I could set white by new material. But I want to overwrite existing material to keep texture.
Is there any way to do that?
thank you
for o in selection do
(
Rr= 255
Rg= 255
Rb= 255
m = standardmaterial()
m.diffuse = color Rr Rg Rb
o.material = m
)
7 Replies
Jan 19, 2021 2:05 pm
Maybe like this:
(
whiteClr = (color 255 255 255)
for o in selection where (mat = o.material) != undedined do
(
case classOf mat of
(
standardMaterial: mat.diffuse = whiteClr
coronaMtl: mat.colorDiffuse = whiteClr
vrayMtl: mat.diffuse = whiteClr
)
)
)
Jan 19, 2021 2:05 pm
Hi sir, Thank you for your help
Your script worked in single material! But it can’t work on multimat…
Anything tips for me?
Thank you
Jan 19, 2021 2:05 pm
(
whiteClr = (color 255 255 255)
for o in selection where (mat = o.material) != undedined do
(
case classOf mat of
(
standardMaterial: mat.diffuse = whiteClr
coronaMtl: mat.colorDiffuse = whiteClr
vrayMtl: mat.diffuse = whiteClr
Multimaterial:
(
for i = 1 to mat.numsubs do
(
case classOf mat[i] of
(
standardMaterial: mat[i].diffuse = whiteClr
coronaMtl: mat[i].colorDiffuse = whiteClr
vrayMtl: mat[i].diffuse = whiteClr
)
)
)
)
)
)
1 Reply
for obj in selection do
(
(mats = getclassinstances Standard target:obj).diffuse = white
)