maya-usd
maya-usd copied to clipboard
USD Layer Editor - List layer Edits
Is your feature request related to a problem? Please describe. When using the USD Layer editor, we miss the ability to undo some of the edits in a dirty layer. we might not want to delete all edits and redo the work we really want to keep.
example: if someone is making edits inside a layer, layout.usd, they might edit multiple prims in multiple ways. to keep it simple let's say we change two prim's transform. cube and sphere. The layer will get dirty and if I save I will save both edits. But I might want to undo the cube xform edit to only save the sphere edits.
Right now, I believe the only way to do this is to either revert layer to file, losing both edits and having to redo sphere xform edit. Or save both edits and then open the layout.usd in a text editor and remove the edits we don't want to keep.
Describe the solution you'd like I would suggest adding a new button when right-clicking on a layer from the USD layer editor. This button will work similarly to the List Reference Edits window from the reference editor.
Maybe I'm missing something and there is a way to do this. If not maybe there is a better way to handle this problem. Thanks
any updates on a way to list the edits on a layer?
@Lucas3Dspain We agree that the solution @lucasIllusorium is proposing sounds like one we'd pursue. Currently we are not putting our resources on this unfortunately. That's the update.
Purely as a reference for beginners to the USD API I've started a topic on the USD Alliance forums on How to use USD API basics to design a "List Edits" editor.
Potentially it can aid anyone familiar with Maya / Qt but unfamiliar with the USD API to prototype tooling for this particular issue and learn the USD API along the way.
Here's a quick prototype I did in Maya 2024 with Maya USD.
The code is available here.
It's not optimized, it doesn't filter, it also shows the session layer, etc. but you can go through the edits, multiselect and then click delete
to remove the authored opinion in a layer so I guess even though a draft implementation might solve some of @lucasIllusorium issue.
Side question: What would be the most trivial way to get icons matching the Maya Outliner for the USD types?
I tried doing this:
import os
import glob
def get_maya_usd_type_icon_paths():
icon_by_typename = {}
prefix = len("out_USD_")
suffix = len(".png")
for folder in os.getenv("XBMLANGPATH").split(os.pathsep):
files = glob.glob(os.path.join(folder, "out_USD_*.png"))
if not files:
continue
for filepath in files:
basename = os.path.basename(filepath)
typename = basename[prefix:-suffix]
if typename.endswith("_200") or typename.endswith("_150"):
# Ignore different sizes
continue
if typename not in icon_by_typename:
icon_by_typename[typename] = filepath
return icon_by_typename
print(get_usd_icons())
But it'd basically not get the icons for xform, curves, etc. I assume those are actually taking other internal icons Maya already has but I'm wondering if there's any way to easily find which one should match which USD Prim Type (or if maybe I could get the resource path through Ufe API?)
Just wanted to ping back in regarding this question:
Side question: What would be the most trivial way to get icons matching the Maya Outliner for the USD types?
Aside of that @Lucas3Dspain @lucasIllusorium any chance the prototype has been of use for you already? Just curious to hear if you might have any notes/feedback in the meantime.
Hi @BigRoy!
I had some time to use the tool in non-production data. So far this looks really powerful ! I only had the chance to use the tool outside of Maya, so I'm running the tool standalone.
This is what I found:
- collapse by default the layers without specifiers
- find a way to see what specs are animated (have time samples) maybe use color/font like in usdView
- this might be an issue on my end but I couldn't find a way to make permanent changes to the stage.
I want to explore what kind of filters can/make sense to be implemented. Some ideas:
- filter by spec type/typeName (combobox behaviour, multiple on/off at the same time)
- mask by prim and only show specs in their children's prims.
- mask by prim type?
Another thing that I feel will be valuable is to be able to see the references and their path. Right now if I define/over a prim(xform, sphere ...) I see that as a def (that's alright) but if I def/over a prim and add a reference, I can't see anything that shows that there is a reference there. I think usdView does this with font/color but I'm not sure that's enough, I think showing the referenced path somewhere will be valuable.
I hope you find this helpful, and as I said before, this looks very powerful !! Thanks.
Side question: What would be the most trivial way to get icons matching the Maya Outliner for the USD types?
The Outliner first looks for an icon matching the nodeType of the prim: out_USD_
Sean
The Outliner first looks for an icon matching the nodeType of the prim: out_USD_.png. If not found then we loop thru all the Ufe::SceneItem::ancestoryNodeTypes() looking for one that matches: out_USD_<ancestor_nodetype>.png
That's great knowledge. For anyone else, here's Python code to get that type list:
import mayaUsd.ufe
import ufe
# Using Ufe
def createUfeSceneItem(dagPath, sdfPath=None):
ufePath = ufe.PathString.path('{},{}'.format(dagPath,sdfPath) if sdfPath != None else '{}'.format(dagPath))
ufeItem = ufe.Hierarchy.createItem(ufePath)
return ufeItem
path = "|stage1|stageShape1,/root/cube"
item = createUfeSceneItem(path)
print(item.ancestorNodeTypes())
# Using just the UsdPrim
def get_types(prim):
types = []
for t in schema_type.GetAllAncestorTypes():
name = Usd.SchemaRegistry.GetConcreteSchemaTypeName(t) or t.typeName
types.append(name)
return types
prim = mayaUsd.ufe.ufePathToPrim(path)
print(get_types(prim))
@Lucas3Dspain Thanks for the input. Try this version.
It's a bit quick and dirty so might give errors but at least you can test the design, etc.
Note: It does not highlight whether it's animated. ;)
this might be an issue on my end but I couldn't find a way to make permanent changes to the stage.
Could you elaborate on that issue? It should provide live changes to the USD Stage - to persist them I suppose you need to save the USD layer you tweaked?
Thanks for sharing this @BigRoy!
Let me know if there's any need to collaborate more on tools for these. Maybe Autodesk team has some UX design ideas/proposals of their own that can be used to prototype some more?
I missed this point before:
maybe use color/font like in usdView
That's definitely a good idea to ensure familiarity to some. So just sharing this quick reference here.
I've fiddled some more with this prototype and started setting up some more prototype USD Qt tools - here's a demo video that also contains the Prim Spec Editor https://github.com/BigRoy/usd-qtpy/releases/tag/0.0.2 running live in Maya.