[Closed] Script for lookAt constraint, can't find UpNode Control property
Hi there,
Im trying to create a script to help me create custom Spline IK rigs.
Im using LookAt contraints for my bones, however I need to change the default behaviour set by the Upnode Control radio buttons from Axis Alignment to LookAt. Ive been searching the help and the web but I cant find a MAXScript accessible property to change that behaviour, is there a way to script that I do I have to manually change it for each bone?
Thanks!
There sure is.
[b]lc = LookAt_Constraint()[/b]
show lc
lc.[b]target_axis[/b] 0
lc.[b]target_axisFlip[/b] false
-- etc.
Also checkout the maxscript helpfile : “LookAt_Constraint : RotationController”
-Johan
that worked!
does that mean that radio button simply sets that combination of target axis and flip?
Thanks!
Actually, I may have been too hasty on that reply. The default behaviour on the lookAt constraint seems to be to match the axis of the bone to the one on the upnode.
For example if on the default UpNode control value of “Axis alignment” the bone will align the “Source axis” with the one in the “aligned to Upnode Axis”. However if I change the Upnode Control manually in the motion panel the bone’s “Source axis” will always look at the position of the Upnode rather that trying to align it.
In the MAXScript help file there are properties to define the axis that will be aligned but I can’t find any that switches the Upnode Control value from “Axis alignment” to “Look at”.
Thanks!
Any ideas?
Sorry for the thread necromancy, but maybe it’ll be of use for someone still searching as I was.
The upnode control switch is not documented in maxscript help, but if you have an object with a lookat controller applied and you type in the listener:
show $.rotation.controller
You get:
.weight (LookAt_Weight) : float array
.relative : boolean
.lookat_vector_length (Vector_Length) : float
.set_orientation : boolean
.target_axis : integer
.target_axisFlip : boolean
.upnode_axis : integer
.upnode_world : boolean
.pickUpNode (Pick_Upnode) : node
.StoUP_axis : integer
.StoUP_axisFlip : boolean
.viewline_length_abs (Viewline_Abs) : boolean
.upnode_ctrl (Upnode_Control) : integer
So Upnode control is actually there and you can reach it via (in this case) $.rotation.controller.upnode_ctrl = …
0 – LookAt
1 – Axis alignment
[edit]Yeah, basically what JHN said.