TheGrak
11-14-2010, 09:02 PM
I've run into a small maxcript problem that I don't understand. Any advice is appreciated:
local currentBoneUpNode = [0,0,1] --or[1,0,0], or[0,1,0] depending
local freshBone = BoneSys.createBone buildPOS1 buildPOS2 [0,0,1] --buildPOS1&2 = random .pos
case of
(
(currentBoneUpNode == [1,0,0]): freshBone.rotation.controller.upnode_axis = 0 --Xaxis upnode set
(currentBoneUpNode == [0,1,0]): freshBone.rotation.controller.upnode_axis = 1 --Yaxis upnode set
(currentBoneUpNode == [0,0,1]): freshBone.rotation.controller.upnode_axis = 2 --Zaxis upnode set
default: freshbone.rotation.controller.upnode_axis = 2 --defaults to Z axis
)
--ERROR: --Unknown property: "upnode_axis" in Controller:Euler_XYZ
I'm trying to set the upnode_axis property of the rotation controller of the bone by user input, but for some reason it's just not working. I can't find a property for the Euler_XYZ controller named upnode_axis, which the error is pointing out, I think.
But if I try:
$'SBChain1:stretchyB2'.rotation.controller.upnode_axis = 1
Max correctly changes the bone's upnode axis to the Y value.
*There is a strange bug on the CGTalk forum that will not allow me to delete the double spaces after the under score in the above code. It should read '.controller.upnode_axis = 1'.
Does the problem lie in how I'm addressing the node? Example: addressing by 'freshBone' rather than by $'SBChain1:stretchyB2'? I've also tried first selecting the 'freshBone', then trying $.rotation.controller.upnode_axis = 1, but it returns the same error.
I'm probably missing something very obvious and simple. Halp! :sad:
local currentBoneUpNode = [0,0,1] --or[1,0,0], or[0,1,0] depending
local freshBone = BoneSys.createBone buildPOS1 buildPOS2 [0,0,1] --buildPOS1&2 = random .pos
case of
(
(currentBoneUpNode == [1,0,0]): freshBone.rotation.controller.upnode_axis = 0 --Xaxis upnode set
(currentBoneUpNode == [0,1,0]): freshBone.rotation.controller.upnode_axis = 1 --Yaxis upnode set
(currentBoneUpNode == [0,0,1]): freshBone.rotation.controller.upnode_axis = 2 --Zaxis upnode set
default: freshbone.rotation.controller.upnode_axis = 2 --defaults to Z axis
)
--ERROR: --Unknown property: "upnode_axis" in Controller:Euler_XYZ
I'm trying to set the upnode_axis property of the rotation controller of the bone by user input, but for some reason it's just not working. I can't find a property for the Euler_XYZ controller named upnode_axis, which the error is pointing out, I think.
But if I try:
$'SBChain1:stretchyB2'.rotation.controller.upnode_axis = 1
Max correctly changes the bone's upnode axis to the Y value.
*There is a strange bug on the CGTalk forum that will not allow me to delete the double spaces after the under score in the above code. It should read '.controller.upnode_axis = 1'.
Does the problem lie in how I'm addressing the node? Example: addressing by 'freshBone' rather than by $'SBChain1:stretchyB2'? I've also tried first selecting the 'freshBone', then trying $.rotation.controller.upnode_axis = 1, but it returns the same error.
I'm probably missing something very obvious and simple. Halp! :sad:
