Jump to content

Extracting object rotation relative to pretransform


Recommended Posts

Greetings to all!

Let's say I have the following situation:

  1. Object A is parented to object B
  2. Both Object A and Object B have pretransforms on them so the default transform is zeroed out
  3. Object A has a constraint network on it with a look at node overriding the rotation

How do I retrieve the rotation of Object A relative to the parent *and* pretransform? Ie, I want to calculate exactly how much Object A has rotated *away* from the pretransformed orientation (so basically what the effective rotation would be on the UI if the constraint network didn't hide the transformation in the background). I'm trying to do this so that I can calculate how much a limb on a character has rotated, and use that to throttle various corrective morphs. Functions like `origin()` just seem to return values without considering the pretransform, which is not what I want because I don't want to have to hardcode rotation angles as constants into all my expressions.

I suppose I could probably wire up the constraint network to export the information I need with the pretransform node instead (and stash that on an additional parameter added to the bone or a spare null or something), but I'd love to know if there's some way to do this directly in a parameter field using expressions instead.



Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...