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,
KineFX rigpose viewerstate get current joint xform
2938 6 0-
- sdugaro
- Member
- 382 posts
- Joined: July 2005
- Offline
-
- sdugaro
- 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?
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
-
- sdugaro
- 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)
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
-
- willh
- Member
- 134 posts
- Joined: Dec. 2006
- Offline
-
- sdugaro
- 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.
Thanks.
-
- sdugaro
- 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.
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.
-
- made-by-geoff
- Member
- 84 posts
- Joined: July 2018
- Offline
-
- Quick Links


