maya-usd icon indicating copy to clipboard operation
maya-usd copied to clipboard

How To Get Full Parent USD Prim Path from Selected Maya Data

Open saikumarbonigala opened this issue 8 months ago • 6 comments

When I select Maya data in the USD stage and try to get the selected prim path, it only returns the Maya data path (e.g., |world|mayaUsd|RigParent1|Rig|USDT_TestPropABC:TestPropABC|USDT_TestPropABC:Geometry|USDT_TestPropABC:Render|USDT_TestPropABC:Render_Geo). But I want the full parent USD prim path of the selected Maya data instead.

saikumarbonigala avatar Aug 21 '25 08:08 saikumarbonigala

What command are you using to get the selected prim path. I suspect that you were using ls -sl which will only list Maya objects. A prim is a Ufe selected object so you just need to ask for that using ls -sl -ufe. This will show both Ufe and Maya selection.

Sean

seando-adsk avatar Aug 22 '25 13:08 seando-adsk

"I am using ufe.GlobalSelection.get(). When I select USD data, it returns the full prim path as expected. However, when I select Maya data, it only returns Maya paths and not the corresponding USD prim paths."

saikumarbonigala avatar Aug 25 '25 04:08 saikumarbonigala

I think maybe I understand now.

The Ufe selection is a superset of the Maya selection, meaning it will contains any Maya selected objects and any USD selected prims. When you select a Maya object or USD prim, the Ufe selection behaves just like the Maya selection - any previous selection is overridden with the newly selected object/prim.

So if you select a USD prim, the Ufe selection will contain just that prim. If you then select a Maya object, the Ufe selection will contain only that Maya object.

If you want the USD prim to remain selected, you need to add the Maya object to the selection.

Sean

seando-adsk avatar Aug 25 '25 14:08 seando-adsk

"Let’s assume my stage is structured like /AssetRoot/AssetName/mayaData. In this, mayaData represents Maya edits, while /AssetRoot/AssetName are USD prims. If I select mayaData, I currently get |world|mayaUsd|mayaData, but I want the full prim path like /AssetRoot/AssetName/mayaData." any commands for that.

saikumarbonigala avatar Aug 26 '25 03:08 saikumarbonigala

Hello @saikumarbonigala,

Do you mind providing a small scene followed by step by step instructions to reproduce your observations so we can understand it better? Please include all the commands you're running and all the steps on selections etc.

Thanks.

AramAzhari-adsk avatar Aug 26 '25 13:08 AramAzhari-adsk

I'm running into similar issues where exporting maya data as usd totally ignores parent usd paths. Let say /Characters/goalkeeper. First exported primitive would be /Cache1

Like don't you find problematic that path structure has suddenly being injected with cache1 group?

Any serious production. Framestore, Dneg, Weta wants structure of the scene to remain intact.

bogdanamidzic avatar Oct 17 '25 22:10 bogdanamidzic