Search - User list
Full Version: APEX extract a static xform from a generated live xform ?
Root » Rigging » APEX extract a static xform from a generated live xform ?
Goffer
Hello,

Is there a way to extract a static xform from creation time out of a live xform in the APEX graph? Or can it only be done via APEX script graph or APEX script to drop the pre-populated static xform in the APEX graph?

Maybe do it 2 edit graphs? the first one would be evaluated in the 2nd one in which case I could read the values of my xform and manually transfer them onto another one?

Cheers,
Max Rose
Interesting question - what are you trying to do with the extracted xform? Typically you'd do this by grabbing the restlocal of a transform object, and not the xform - this gives you it's initial "static" position.
Goffer
Yeah ideally I need the restlocal.

But in the case of the rig::primConstraint, all I get is the resulting xform.
So you're saying I could create an extra transform and connect it to my primConstraint xform, this would capture the initial static position at connection time?
EDIT:
Creating and connecting a new xform didn't capture the restlocal unfortunately


The idea here is to be able to attach an existing transform (ctrl) to a new transform (primConstraint) with different position and orientation while maintaining the offset.
I'm trying to do this with matrix operations (and I need to calculate my initial offset from static xforms) as I haven't found a node that allowed me to do this simply.
The localTransformConstraint looked like the solution but I didn't get it to behave and the doc doesn't seem available for this node.
william_harley
Hi.

Here is an example of how to parent and constrain controls, either using the nodes directly or using the guides.
Goffer
Thx for the example file William!

I was somewhat on the right track conceptually but not at all in terms of execution. My idea was to invoke the graph to evaluate my xform via the SOPInvokeGraph node instead of a graph::Compile

I've had a go at implementing something based on your example but the xform post compile seems incorrect and I also have this error:

I have removed the offset calculation just so I can debug my 2 xforms. All nodes are present but for some reason it doesn't seem to take into account the compiled static xform

Am I missing something?

Image Not Found
esttri
ah we actually have an example of exactly that setup in the addGroom autorig component.

Theoretically the most generic answer would be an invokation of the graph itself. But in most cases you can avoid that. It can also have a performance impact if you constantly need to run you whole rig just to get an xform value out. Luckily we usually all the data needed to get that rest info directly at your disposal when you build your component.

And in your cases its very convenient you can simply use a prim constraint IN you component script on your rest shape to quickly generate the rest for you. Its a very easy trick to get rests for those kinds of setups.
I added a small snippet to your example where exactly that is happening. And i marked the important section. The rest is nothing but a small apex script version of what you where doing in the graphs


In the picture you can also see the important bits as nodes: You get your rest shape. You generate a prim constraint in the component script and then you multiply the inverted primconstraint_xform with the the xform from your guide.
Goffer
Thx for the update!

I think I get it now, I thought about doing this way but my worry was to have a duplicated setup simply to get static values but it's not actually duplicated since one is in the APEX script so it's not actually creating the final rig nodes, it's just doing a static set of operations during the 'component build'.

Because I currently do it via nodes, I keep on forgetting that it is still nodes scripting and not actually the final graph.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Powered by DjangoBB