Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using the adsk plug-in from refactoring sandbox #51

Closed
BigRoy opened this issue Oct 10, 2019 · 4 comments
Closed

Using the adsk plug-in from refactoring sandbox #51

BigRoy opened this issue Oct 10, 2019 · 4 comments

Comments

@BigRoy
Copy link
Contributor

BigRoy commented Oct 10, 2019

Issue

It seems largely undocumented on how to play and potentially contribute to the development of maya-usd.

The master branch seems to be the straight Animal Logic and Pixar plug-ins combined into a single repository and seem to do little to understand exactly what is being developed. The refactoring_sandbox branch is seeing some commits being merged into it with PRs from time to time and seems to be the goal for a next version, currently including a Hydra viewport with mtoh and its own adsk plug-in for USD. Other than that it's hard to pinpoint what the status is.

Is there some documentation on how to get up and running and what to expect?

What I tried and issues/questions I ran into.

I tested on Windows 10 with Maya 2019.

Display of the mayaUsdProxyShape seems to not react much

I tried to create the proxy shape but it seems it's picky on how it updates and displays in Viewport 2.0

from maya import cmds

path = "path/to/Kitchen_set/Kitchen_set.usd"
node = cmds.createNode("mayaUsdProxyShape")
cmds.setAttr(node + ".filePath", path, type="string")

Whenever I triggered that it does seem to instantly display it. But then:

  1. Trying to transform (move) things around kept it visually in the same location.
  2. Hiding the node still displayed it.
  3. Deleting the node and the display of it was instantly gone, apparently it does display the actual node. (This basically related to visual bug point 1)

It did seem to move around fine using the GL (Hydra) viewport. Notes below are in Hydra viewport

  • However when switching to the Hydra renderer and the object was already invisible would still initially make it visible. Until I unhide it and hide it again.
  • The same happens when you duplicate it when the object was hidden. The new object then turns visible even though it is actually hidden.
  • Also duplicating sometimes doesn't seem to show the new object in the correct position until it's "nudged" by transforming it. Best noticable with Smart Duplicate where it gets transformation directly with duplicating... the new duplicate shows at the origin as opposed to where it's actually located.

Can't select the separate things inside the USD scene with the proxy resolved

I recall previously with the Master Branch and the AL plug-in I was able to have the selection work correctly where I could select the items inside the USD file and move them around. With the current refactoring_sandbox branch I seem to be unable to do so with any of the plug-ins.

Whenever using the GL (Hydra) viewport I did see the selection color popping up, but solely the full kitchen set got selected. I was still unable to select individual elements.

Do I need to somehow enable UFE? I don't think it's compiling with UFE on my end however the .mod file does show:

MAYA_WANT_UFE_SELECTION=1

Applying a deformer to the proxy shape crashes Maya can't reproduce

I'm not sure what I expected, haha. But as I was just trying some random things to see if I could break some bits of it this resulted in a Fatal Error. :) I was expecting it do just do nothing.

Edit: I can't seem to reproduce this now. Maybe this was only an issue when the UFE failed to be included in the build. Not sure.


Maybe there's a forum or chat somewhere to be found where the development is being actively discussed? :) Dropping these notes here could clutter things because most seem like individual issues of their own.

@BigRoy
Copy link
Contributor Author

BigRoy commented Oct 10, 2019

Can't select the separate things inside the USD scene with the proxy resolved

I resolved this issue. Looking at my build_log.txt it stated that it failed to find UFE:

-- UFE not found. UFE features will be disabled.

I corrected some things with my Maya 2019.2 devkit and its location and the new build compiled with UFE enabled. Now I am able to select the separate elements inside the USD. 👍

However it does seem impossible to select only the front most object, as if the selection raytraces through all the way back into the scene. Even if I just click. It sounds like it could be related to this. Also, it actually seems to be the case with only somewhat "thin" objects. Example the chair's seat in the example Kitchen Set I always click-through onto the floor tiles. But when selecting the table's top side the floor remains unselected. Interesting.


The other issues seem to remain as is.


Bug: Translating an object in objectSpace does not take into account it's local rotation

Whenever you select a part of the USD scene and rotate the object, and then translate in "Object Space" the translation moves in the direction of the 'original rotation' in the USD scene as opposed to the 'current rotation' that you have with your local changes in your maya scene.

Question: how can I interact with the "USD scene hierarchy"?

I noticed that the outliner is capable of showing the USD scene hierarchy, awesome! Is there any way to query that? And/or even query what is selected there? Or use some sort of API from within Maya (e.g. Python) to query the local scene overrides? Etc.

For example:

maya_outliner_usd_insides

Are there any commands or ways to interact with that data through scripting?

Bug: In GL (Hydra) viewport moving the transform of the proxy moves things correctly, however selection still interacts as if it is on the origin

When moving the transform of the mayaUsdProxyShape the selection still behaves as if the object has not moved from the origin. As such the selection does not align with what GL (Hydra) viewport shows as visual for the geometry's location.

The selection does match with Viewport 2.0 because that one faces the issue that the geometry does not seem to move at all when the transform of the mayaUsdProxyShape is moved.

Bug: UFE does not allow me to duplicate, errors out.

The UFE functionality seems to implement things like duplicate, delete and undo/redo for those options. However, pressing CTRL+D it seems to trigger the duplicate but failing in the actual code to duplicate the Prim, for example:

// Error: line 0: Duplication of '|world|mayaUsdProxy1|mayaUsdProxyShape1/Kitchen_set/Arch_grp/Kitchen_1/Geom/TileFloor/pPlane251' failed: No prim found at /Kitchen_set/Arch_grp/Kitchen_1/Geom/TileFloor/pPlane251. // 

BUG: UFE trying to rename a USD Prim in Maya outliner errors out.

When double clicking in the outliner on a USD prim it shows the regular "rename" line edit however, when completing the rename it fails with the following error:

// Error: line 1: Rename of '|world|mayaUsdProxy1|mayaUsdProxyShape1/Kitchen_set/Arch_grp/Kitchen_1/Geom/TileFloor/pPlane179' to 'blablabla' failed: Cannot append null item pointer to selection.. // 

BUG: Whenever deleting the proxy and then creating a new one it somehow "preserves" the previous edits. Even "new scene" and then creating it again has the same local edits

Say I run this:

from maya import cmds

path = "/path/to/Kitchen_set/Kitchen_set.usd"
node = cmds.createNode("mayaUsdProxyShape")
cmds.setAttr(node + ".filePath", path, type="string")

Then using UFE select some specific elements, delete some of them, move some around. And then I delete the proxy from the scene. Then I run the code above again, then I get a new proxy shape that somehow still has the previous edits. Even if I do "new scene" it magically remembers the previous edits.

It does not seem to be changing the .usd file on disk (which I wouldn't want it to do either!) so that's good. I can confirm that it's unchanged by then using the AL plug-in proxy to load it up and it comes in without the local scene changes. Also the date modified of the file on disk remains unchanged, so I assume it's definitely something in memory messing things up.

BUG: When trying to snap a locator to the USD shape with 'v' shortcut the UFE subscene selection takes precedence instead. It will continuously add to the selection as a "draw select".

When trying to snap to the USD scene the UFE subscene selection thinks it needs to be active and will continuously add whatever you hover over to the selection. Plus the first object in the USD scene that was under the cursor at the time of starting the snapping will move along too. The rest is just added to selection, but not moving along.

BUG: When trying to snap an object from the USD scene to something in the local scene, e.g. to a locator. The snapped position mismatches by the original difference of the object to the origin of the scene.

When selecting something from the USD subscene and trying to snap it to regular Maya content, e.g. a locator in the scene. It will perform snapping but will be misaligned. It does not snap using the pivot point but just applies the "translation" of the local scene on top of the original offset of the USD subscene.

For example, when trying to snap a floor tile of the example Kitchen Set it will have a similar distance to the locator as it originally had to the origin. The maya MEL command being issued from the snapping is:

move -rpr -300 10 50;

The snapping makes use of the -rotatePivotRelative flag which seems to fail to move correctly relative to the rotate pivot but instead just does a regular move like move -300 10 50; which gives the exact same result.

Once the -rotatePivotRelative flag will work the snapping should start to behave as expected.


It seems like I'm hitting a list of bugs that I should be separating into issues of their own. :) Should I?

@BigRoy
Copy link
Contributor Author

BigRoy commented Oct 25, 2019

Bug: Translating an object in objectSpace does not take into account it's local rotation

This issue is logically also present when doing the translation through the actual mel command: move -r -os -wd 0 0 10;. It should be a local objectSpace direction movement yet it also fails to apply the movement in the local space of the rotated object but instead uses the "original local space" from the USD file before any local scene changes.

@BigRoy
Copy link
Contributor Author

BigRoy commented Oct 25, 2019

BUG: UFE trying to rename a USD Prim in Maya outliner errors out.

Now separate in issue: #75

Hiding the node still displayed it.

Now separate in issue: #70

Bug: UFE does not allow me to duplicate, errors out.

This seems related to issue: #72
However the issue describes that at the very least it is capable of duplicating it.


For sake of tracking easily I'll separate the remainder of the issues mentioned here into their own respective issues. EDIT: I've linked the bugs/issues to other respective issues when relevant and for some I've created some standalone issues too.

@BigRoy
Copy link
Contributor Author

BigRoy commented Dec 8, 2019

I'll close this issue as most of the remaining problems it described have now been separated into their own issue.

@BigRoy BigRoy closed this as completed Dec 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant