' The following creates a 3 bones skeleton, asks for info using the second bone
' and prints out the bone index, the total number of elements in the skeleton
' and selects the root. It also activates the joints rotation limits.
dim MySkeleton, BoneIndex, NbElements, MyRoot
Create2DSkeleton -3.004, 2.152, 0.000, -1.531, -1.163, 0.000, 0.000, 0.000, 1.000, 1
AppendBone , 0.853, 1.396, 0.000
AppendBone , 2.578, -1.532, 0.000
set MySkeleton = GetSkeleton("bone1", BoneIndex )
NbElements = MySkeleton.count
LogMessage "Element Index: " & Index
LogMessage "Nb Elements: " & NbElements
'Select skeleton root
MyRoot = MySkeleton(0)
SelectObj( MyRoot )
for i=1 to NbElements-2
'Activate the RotationLimits on every joint (except the effector joint)
SetValue MySkeleton(i) & ".joint.rotlim_active", TRUE
next |