Notifications
Clear all
[Closed] setProperty in renderelement?
Apr 06, 2014 2:59 pm
Hello everyone,
is it possible to set properties in then render element?
Something like this I need:
(
clearlistener()
rM = maxOps.GetCurRenderElementMgr()
rName = mr_A_D_Output__Beauty
rM.AddRenderElement ( rName elementName:"beauty" )
setproperty rName #shadowOn false
)
I know I can set properties in the AddRenderElement command. But this is not dynamical. I need something more flexible because in my real Script fill a array with all properties from the current elements, and write this properties later back.
It goes in this direction:
(
clearlistener()
rM = maxOps.GetCurRenderElementMgr()
element = #()
rElement = #()
rElementN = #()
rElementS = #()
rElementA = #()
for i = 0 to rM.numrenderelements() do (
if ( classof ( rM.GetRenderElement i ) ) != UndefinedClass do (
join rElement #( element = #( rM.GetRenderElement i, rM.GetRenderElementFilename i ) )
)
)
for r = 1 to rElement.count do (
rElementN = #()
rElementS = #()
join rElementS #( rElementN = #( rElement[r][1] ) )
join rElementS #( rElementN = #( rElement[r][2] ) )
propNames = getPropNames rElement[r][1]
for p in propNames where p != #bitmap do (
join rElementS #( rElementN = #( p, getProperty rElement[r][1] p ) )
)
append rElementA rElementS
)
rM.AddRenderElement ( ( classof rElementA[1][1][1] ) elementName:rElementA[1][7][2] )
--setproperty rElementA[1][1][1] shadowOn false
)
Edit: ok I have it now… I need to loop a second time truth the elements array.