Page 1 of 1

Target Bone keying

Posted: Wed Jul 08, 2015 1:33 pm
by mkelley
Either I'm once again blind or it isn't available anywhere, but I can't find any information on how to set and retrieve keys for bone targets (scripting, naturally). If there was a tool that did this I could just examine it, but apparently it's only done via the constraints menu.

Anyone have the syntax? (if this is just as easy as bone.fTarget:SetValue(frame, boneID) I'll be pretty embarassed).

Re: Target Bone keying

Posted: Wed Jul 08, 2015 3:46 pm
by Stan
bone.fTargetBone is an AnimVal that contains the ID of the current target bone.

So, this should get you the target bone:

local currentTargetBoneID = bone.fTargetBone.getValue(moho.layerFrame)
local currentTargetBone = skel:Bone(currentTargetBoneID)

Then you can manipulate the target bone's keys as usual.

Re: Target Bone keying

Posted: Thu Jul 09, 2015 4:56 pm
by mkelley
Thanks. I assume I can SetValue the same way, although using both frame and the value:

bone.fTargetBone.setValue(frame, value)