ScriptSpot

Forum topic · General Scripting

Adjusting Arch & Design Material Parameters within a Blend Material

By TSuess · 2012-08-15

Description

I've hit a roadblock. I am creating a unverisal Ambient Occlusion controller. The following test script works perfectly.

--------------
for a in objects do

(
if (classof a.material == Arch___Design__mi) then
(
a.material.opts_ao_on = true
a.material.opts_ao_distance = 24
a.material.opts_ao_samples = 24
)

(
if (classof a.material == Multimaterial) then
(
for b = 1 to a.material.numsubs do
(

if (classof a.material.materialList[b] == Arch___Design__mi) then
(
a.material.materialList[b].opts_ao_on = true
a.material.materialList[b].opts_ao_distance = 24
a.material.materialList[b].opts_ao_samples = 24
)
)
)
)
)

-----------

I am able to adjust the parameters of a Arch & Design material within a Multimaterial. What I have not yet figured out is how to do the same within a Blend Material. It seems that something like this should work. See below.

----------

for a in objects do

(

(
if (classof a.material == blend) then
(
for b = 1 to a.material.numsubs do
(

if (classof a.material.materialList[b] == Arch___Design__mi) then
(
a.material.materialList[b].opts_ao_on = true
a.material.materialList[b].opts_ao_distance = 24
a.material.materialList[b].opts_ao_samples = 24
)
)
)
)
)

-----------------

can anyone show me the light? Thanks!!