KineFX rigpose viewerstate get current joint xform

   2938   6   0
User Avatar
Member
382 posts
Joined: July 2005
Offline
Hi, I'd like to be able to script an action based off of the current rigpose viewerstate joint selection.

Would anyone be able to point me in the right direction here?

For starters, I'd like to query the transform of a single joint/control selection in an active viewerstate.

tia,
User Avatar
Member
382 posts
Joined: July 2005
Offline
I think this kind of thing might be possible with object level rigs (there's a match transform shelf button to do this at object level), but it feels a little more nuanced in kinefx.

I have an external controller positioned with a transform sop I want to be able to snap to a joints position and orientation.

My Maya animator is familiar with Maya | Modify > Match Transformations using maya rigs, where he can select a locator and then some control geo, run this, and the locator snaps to the control geo's full transform.

I'm not sure how this would be possible in kinefx/sops if you get a viewerstate handle for the transform, and then need to jump to rigpose viewerstate to get a joints transform or vice versa.

Is it possible to select a joint in a rigpose viewerstate then run a shelf script to set those transforms on a transform sop?
Edited by sdugaro - March 14, 2022 19:59:52
User Avatar
Member
382 posts
Joined: July 2005
Offline
Hmm, I thought it might be possible to leverage point snapping w/ 'orient on snap' somehow.
The viewerstate can only be active for the rig or the transform not both,
and point snapping to the skeleton joints wont get you the joint's actual transform (orientation ignored)
Edited by sdugaro - March 14, 2022 03:44:31
User Avatar
Member
134 posts
Joined: Dec. 2006
Offline
The joint is just a point. You can simply copy the transform and Position from one point to the other point. You can also use skeleton blend, just make sure to name the joints the same so they will blend.
Edited by willh - March 14, 2022 08:42:13
User Avatar
Member
382 posts
Joined: July 2005
Offline
Thanks for the reply, you are absolutely correct, and when inside a control rig hda that is straightforward, I suppose I'm at a miss of how to do this between sop nodes... but I think you're saying just toss a name attribute on the external controller chain and blend I'll have a go with that. Seems like it should work.
Thanks.
User Avatar
Member
382 posts
Joined: July 2005
Offline
Got this working! -- it really is a nice way to work with IK end effectors in a viewerstate that doesn't require the entire rig and all its controls. Obviously its much faster to work with a single control at a time. Once in the viewerstate you can select the rig node, or the locators nodes to pose as needed.

So first I reference in the skeleton (switch-ifs between an op, an input or by a reference to the rig sop itself where I have an expression that points to the last node just before the animation output)

I create some custom locator geo, followed by a transform for rotation and pivot with the Ouput xform attribute enabled. These are promoted as parms to the hda so they can be driven by a Transformer handle when the viewerstate is engaged.

The hda populates a menu of all the joints by querying the name attribute on the skeleton. Then a button on the hda reads world transform for the selected joint, setting the pivot and rotation values on the hda's interface. This snaps the orientation and position of the locator to match that of the joint. Now when the viewerstate handles for the locator is engaged, the custom controller can be driven in viewport relative to that initialized position.
User Avatar
Member
84 posts
Joined: July 2018
Offline
Any chance you'd be willing to share the HDA? I'd love to take a look.

In the back of my mind, I'm wondering if you could modify your approach to create a snap FK pose to IK pose tool? It's something that is currently missing from kineFX without some python work that is above my python abilities.
madebygeoff.com
  • Quick Links