Animate USD Prims within Maya #2116
Replies: 5 comments 8 replies
-
The proxy accessor is the foundational piece we were planning to build on top of. I would be curious to learn more about the issues you run into with |
Beta Was this translation helpful? Give feedback.
-
It's good to know that using the Let me detail the issue we get animating the USD Prims within Maya.
from mayaUsd import lib as mayaUsdLib
import ufe
def keyUfeObject():
ufeObject = pa.getUfeSelection()
selDag, selPrim = pa.getDagAndPrimFromUfe(ufeObject)
stage = mayaUsdLib.GetPrim(selDag).GetStage()
primPath = Sdf.Path(selPrim)
prim = stage.GetPrimAtPath(primPath)
pa.createXformOps(ufeObject)
i = cmds.currentTime(query=True)
for usdAttr in ["xformOp:rotateXYZ", "xformOp:translate"]:
xformop = prim.GetAttribute(usdAttr)
pos = xformop.Get()
"""Add a time sample to the xformOp at frame i"""
xformop.Set(time=i, value=tuple(pos))
"""Add a keyframe to the proxyAccessor plug at frame i"""
pa.keyframeAccessPlug(ufeObject, usdAttr) This seems to work as expected, and we can use the "Save USD Edits" callback that will let us choose to save the animation in the Maya Scene or in the USD file. But there still are some limitations:
These are more limitations from a User point of view. And this actually is the only reason we tried to add a minimal rig on top of the prim to ease the user's experience. I think the perfect behaviour when animating USD Prims would be:
But maybe is that what you already have in mind, or even a better approach. Or maybe is that already working out of the box and I miss something in the proper way to animate USD Prims. We would like to stick as close as possible to the direction you are going to build this feature on, and the simpler might be the better. |
Beta Was this translation helpful? Give feedback.
-
Hello, We've been looking into migrating our USD pipe to maya2022. Our current maya2020 pipe involves using temporary rig setups created in-shot for USD assemblies. This is to simplify assembly selection, manipulation, and keying for animators. It also lightens up rigging's workload a lot. We also rely on animators being able to set keys on assembly hierarchies as they need, with or without a temporary rig. Transforms can then be baked out at publish. So it was a big surprise to find out we cannot freely constraint or key USD asset hierarchies in maya2022. Setting keys and constraints through Thanks to the insights from @christophezito, we will explore connecting our temporary rigs through access plugs instead of constraints. Thanks, |
Beta Was this translation helpful? Give feedback.
-
any updates? |
Beta Was this translation helpful? Give feedback.
-
Right now there is a proposal from Pixar for animation curves. Our intent is to work on supporting this when official. |
Beta Was this translation helpful? Give feedback.
-
Hello,
I've seen this question has already been asked in this discussion topic.
For setdress purposes or to quickly animate a prop in the stage (Open a door for example), it would be very interresting to be able to animate USD Prims within Maya.
We tried many things to achieve this goal and I wondered if Autodesk or any User have a better approach.
Custom Node
Implementing our custom node that will be placed between two
MayaUsdProxyShape
nodes, and allow us to interact with the selectedPrim
to animate it using Maya anim curves, and write time samples on the fly in the USD Stage.We still have some issues with the
LayerManager
, as if aMayaUsdProxyShape
node has an incoming Stage the incoming node will be in charge of saving the USD edits.This might not be the better way to do that, as we will have to maintain our custom node as well as a patch of Maya USD to let the leaf
MayaUsdProxyShape
node be in charge of saving the edits if our custom node is connected as an incoming stage.Use ProxyAccessor to animate Prims
Using the
ProxyAcessor
, we can have access toxfomOps
and animate thePrims
straight into maya setting keys on both side at the same time (Maya keys to the ProxyAccessor's Access Plugs and TimeSamples to the USD Prim)This Proove Of Concept might work, but we don't have access to Maya Anim curves, and the animation interpolation is linear (which is normal).
Use ProxyAccessor Access Plugs connected to Maya Rig
We tried another alternative: connect all the transform outputs of a Locator to the corresponding ProxyAccessor Access Plug, and an Offset Parent Matrix connection between the Locator and the current Prim's parent (to preserve previous transformation in the graph).
We can bake the Animation, setting Maya keys to the ProxyAccessor Access Plug and adding the corresponding (per frame) Time Samples To the Prim.
This seems to work, and we still need to improve the workflow to retrieve an already animated Prim.
Autodesk point of view
Does Autodesk have plans to make USD Prims animation within Maya?
I guess it would be great to be able to manipulate, animate USD Prims like any other DAG Object, having access to the keyframes on the timeline and in the graph editor, and letting Maya do all the heavy work to write keys on both sides (Maya and USD)
Users point of view
Does anyone else tried to achieve this goal and has a better approach?
Thanks,
Christophe
Beta Was this translation helpful? Give feedback.
All reactions