[Closed] problem with ArrayParameter value
Hi!
I am creating various position spring controllers in my scene via maxscript, and want to bind them to external forces also via maxscript, but found that the parameter containing the forces (<SpringPositionController>.forceNode) is an ArrayParameter value, wich seems to be of fixed size, therefore it can’t be modified (expanded) via maxscript… is this correct?, and if it is, is there a way to hack this?
note: if a assign a force manually, the array grows, and then I can modify its fields with maxscript.
Thanks in advance!
After a liittle poking around i found that although you cann’t append forces to the forcenode array directly… ie this does NOT work
append <SpringPositionController>.forcenode = $Gravity01
You can assign it a completly new array e.g.
<SpringPositionController>.forcenode = #($Gravity01,$Gravity02,$Gravity03)
Normally this would mean that you could make a ‘copy’ of the forcenode array and append to that e.g.
Ary = copy <SpringPositionController>.forcenode
Unfortunatly for some reason this does not return and array but a ReferenceTarget:ParamBlock2 value
so the hack solution is
Ary = for i in <SpringPositionController>.forcenode collect i
Append Ary <the new force node>
<SpringPositionController>.forcenode = Ary
but this doesn’t work either :banghead:
And as far as i can make out there does not seem to be a function to add forces either (like the addSpring function)
so i’m guessing that this is a bug
sorry dude
HI alfonsoperalta:
You can assign it a completly new array e.g.
<SpringPositionController>.forcenode = #($Gravity01,$Gravity02,$Gravity03)
Actualy, this isnt true either, it works as long as the number or items assigned is the same as it already has, if not, again the message that the array cannot be dinamically changed appears.
Rafael Polit Jr.
Quito, Ecuador.