Notifications
Clear all

[Closed] Mr Lights Ind. Ilumination Cust Attrbutes ?

Wow, It´s been a while…

I´m back again using maxScript and… I´m 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

3 Replies
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)

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

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
)
	)
)