PDA

View Full Version : Mr Lights Ind. Ilumination Cust Attrbutes ?


Fabiomussarela
06-17-2011, 04:38 AM
Wow, Its been a while.....

Im back again using maxScript and....... Im stuck with a simple weird issue...

If I select a MrLight and execute this code, everything goes Ok

$.baseObject.mental_ray__Indirect_Illumination_custom_attribute.mrII_UseGlobals = true

But, when aplying this code in a for loop does not work... really weird

ex:

For o in arrLights do
(
o.baseObject.mental_ray__Indirect_Illumination_custom_attribute.mrII_UseGlobals = true
)

or

arrLights[1].baseObject.mental_ray__Indirect_Illumination_custom_attribute.mrII_UseGlobals = true


for loop in array or direct access to array member returns:

-- Unknown property: "mental_ray__Indirect_Illumination_custom_attribute" in Target Directional Light


Anyone???

Thanks a lot :)

lucpet
06-17-2011, 11:43 AM
Wow, Its been a while.....

Im back again using maxScript and....... Im stuck with a simple weird issue...

If I select a MrLight and execute this code, everything goes Ok

$.baseObject.mental_ray__Indirect_Illumination_custom_attribute.mrII_UseGlobals = true

But, when aplying this code in a for loop does not work... really weird

ex:

For o in arrLights do
(
o.baseObject.mental_ray__Indirect_Illumination_custom_attribute.mrII_UseGlobals = true
)

or

arrLights[1].baseObject.mental_ray__Indirect_Illumination_custom_attribute.mrII_UseGlobals = true


for loop in array or direct access to array member returns:

-- Unknown property: "mental_ray__Indirect_Illumination_custom_attribute" in Target Directional Light


Anyone???

Thanks a lot :)
for o in selection do
(
o.baseObject.mental_ray__Indirect_Illumination_custom_attribute.mrII_UseGlobals = true
)

the arrLights was not declared as an array just select all and use selection instead
oh and you need to use code quotes when putting script on the forum ;)
again oh the forum doesn't like the word "custom" either lol so make sure you remove the space(s)

lucpet
06-17-2011, 11:54 AM
If you don't want to select the lights and dont have any others in the scene you want left alone you could use

for o in lights do
(
o.baseObject.mental_ray__Indirect_Illumination_custom_attribute.mrII_UseGlobals = true
)

or

for o in lights do o.baseObject.mental_ray__Indirect_Illumination_custom_attribute.mrII_UseGlobals = true

don't forget to remove the spaces in custom

Kameleon
06-17-2011, 03:40 PM
I think the problem is that he's also trying to change that parameter in the target object of the light... which doenst have that property.

Try this:

for i in lights do
(
if superclassof i==light then
(
i.baseObject.mental_ray__Indirect_Illumination_custom_attribute.mrII_UseGlobals = true
)
)
)

CGTalk Moderation
06-17-2011, 03:40 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.