Finding the local space of a Control Rig control in order to set its transform from an Animation Blueprint

I’d like to be able to set the transform for a Control Rig control object using the Control Rig node in an Animation Blueprint and I’ve been having difficulty getting the transform into the correct space.

More specifically, the control expects the transform being passed in to be in the control’s local space, but it’s not clear how to figure out what that local space is. What’s the best way of asking Control Rig what the local space is for a given control?

Alternately, is there a way of specifying the control transform in what Control Rig calls “Global Space,” ie the mesh’s component space?

The Control Rig’s Anim BP node has a very convenient “Use Pin” checkbox for exposing all the custom controls, which I’d love to use, but doing so seems to require knowing the custom local space for each control. One workaround I’ve found is creating and then exposing a transform variable on the Control Rig, then setting THAT variable from the AnimBP, then inside the Control Rig applying the variable to the control and specifying “Global Space” on the SetTransform node inside the Control Rig, but that’s a pretty cumbersome process to do for every control so I was hoping there was a simpler method…


To go from Global space to rig space use “From World”. The reverse would be “To World”

Thanks for the suggestion, but the issue here is that I don’t KNOW what a control’s local space is when trying to set its transform from the AnimBP, so I don’t have a space transform to give the “From World” function.

Each control can have a unique local space that’s setup in the Control Rig, which you can see when a control is selected by looking at the Offset subcategory of its Transform. I’m trying to find a way of asking the Control Rig what that local transform is for a given control.

Can you make a quick bluetility call and query the control manually?

Have it print out to a string - which puts it in your output log.
It shpuld be simple/painless.

The local space position would probably be the world position of the control - the world space of the actor. Though that is never a guarantee…

Can’t you just force the rig to get the transform in local space??

Yes, it’s easy to convert to local space within the Control Rig graph, but the problem I’m trying to solve is how to convert to local space from the AnimBP graph. That would require knowing the local space of a given control from outside the Control Rig and it doesn’t look like it exposes that information anywhere.

Converting the control space at the point it’s being accessed in the Control Rig graph, like you suggested, is an interesting approach but I don’t think would work – if the control’s transform were set in the AnimBP then those transforms are already presumed to be in Local Space, so asking for the Local Space version is just going to give you whatever transform was passed in, it’s not going to know it needs to do any space conversion.

Though I think it WOULD be possible to write a custom function inside the Control Rig graph to fixup the supplied transforms, since the control’s local transforms are known there. And that might end up being the most elegant fix here. It still feels quite cumbersome but at least it’s less hacky than having to create shadow variables for every control like I’ve been doing…

I guess I’m just surprised that Control Rig makes it so easy to pass in transforms for controls from the AnimBP (all you have to do is click “Use Pin” on the AnimBP’s Control Rig node), but requires the transforms be converted into control space without providing any straightforward way to do that.

Hey, in case you haven’t found the answer yet, the trick is to use the FromWorld node:

image

1 Like

Hello @Ian_Dallas , did you ever solve this problem? I have a similar problem where I am trying to do some control rig rotations based on vectors from the world, and am having trouble translating everything appropriately.

Use print nodes in control rig. Helped me a ton. Just make several and change colors to know which one you’re looking at. Then just hook different nodes into it, taking in account movement changes. If you have some number that moves up and down in x in one direction, but taking a right you see the number change in the y direction, thats world space. If you see a zero, that adds in y space whenever moving forward, no matter your direction in the map, that is global space. If the x and y change according which direction you move on the map but returns to zero when you stop, thats local space. Dont quote me, I’m still figuring it out. But using the print nodes to see the change, to get like changes when you need things to work together, and remember if use the “to world” node, then your transform will most likely need a “from world” node. Just a heads up.