Autodesk / maya-usd

A common USD (Universal Scene Description) plugin for Autodesk Maya
758 stars 202 forks source link

[MAYA-114593] Load state seems to be tied to the prim path or parent instead of the object #1779

Closed gracekumagai closed 2 years ago

gracekumagai commented 2 years ago

Describe the bug The load state seems tied to the prim path or parent instead of the object. Grouping, parenting and renaming seem to ignore the current load state of the object and default to either:

Steps to reproduce There are a few different cases: If an object is loaded under parents that are loaded (ex: open the kitchen_set_instanced): Grouping:

  1. Unload |Kitchen_set_instanced|Kitchen_set_instancedShape,/Kitchen_set/Props_grp/West_grp/Ball_1
  2. Press Ctrl+g to create a group Now, the Ball_1 is loaded. We would expect the ball to remain unloaded.

Parenting:

  1. Unload |Kitchen_set_instanced|Kitchen_set_instancedShape,/Kitchen_set/Props_grp/West_grp/Ball_1
  2. Press Shift+p to unparent Ball_1 to the world Now, the Ball_1 is loaded. We would expect the ball to remain unloaded.

Renaming:

  1. Unload |Kitchen_set_instanced|Kitchen_set_instancedShape,/Kitchen_set/Props_grp/West_grp/Ball_1
  2. Press Ctrl+g to create a group (or another action to move Ball_1 from this scope)
  3. Rename |Kitchen_set_instanced|Kitchen_set_instancedShape,/Kitchen_set/Props_grp/West_grp/SteamCooker_1 to Ball_1 Now, the steam cooker named Ball_1 is unloaded. We would expect the steam cooker to remain loaded. unload_group_rename

Vice-versa: The steps above are for parenting unloaded objects to a loaded parent. The same behaviour occurs when parenting a loaded object to an unloaded parent. For example:

  1. Unload |Kitchen_set_instanced|Kitchen_set_instancedShape,/Kitchen_set/Props_grp/North_grp
  2. Parent |Kitchen_set_instanced|Kitchen_set_instancedShape,/Kitchen_set/Props_grp/West_grp/Ball_1 to |Kitchen_set_instanced|Kitchen_set_instancedShape,/Kitchen_set/Props_grp/North_grp Now, the ball is unloaded. We would expect the ball to remain loaded. unload_parent_reparent

Sets load state to the last state that it was set to in a particular scope If the object was set to a particular load state (which may differ from the parent's) in a particular scope, if an object is moved back to the scope, it will ignore it's current load state and be set back to whatever it was set to in that scope.

  1. Unload |Kitchen_set_instanced|Kitchen_set_instancedShape,/Kitchen_set/Props_grp/North_grp
  2. Parent |Kitchen_set_instanced|Kitchen_set_instancedShape,/Kitchen_set/Props_grp/West_grp/Ball_1 to |Kitchen_set_instanced|Kitchen_set_instancedShape,/Kitchen_set/Props_grp/North_grp1.
  3. Load |Kitchen_set_instanced|Kitchen_set_instancedShape,/Kitchen_set/Props_grp/North_grp/Ball_1
  4. Parent |Kitchen_set_instanced|Kitchen_set_instancedShape,/Kitchen_set/Props_grp/North_grp/Ball_1 to |Kitchen_set_instanced|Kitchen_set_instancedShape,/Kitchen_set/Props_grp/West_grp
  5. Load |Kitchen_set_instanced|Kitchen_set_instancedShape,/Kitchen_set/Props_grp/West_grp/Ball_1
  6. Parent |Kitchen_set_instanced|Kitchen_set_instancedShape,/Kitchen_set/Props_grp/West_grp/Ball_1 back to |Kitchen_set_instanced|Kitchen_set_instancedShape,/Kitchen_set/Props_grp/North_grp Now, the ball is loaded. We would expect the ball to be unloaded and maintain it's current state (set in step 5). We do not expect it to revert back to the load state (set in step 3) that it last had in this particular scope. unload parent reparent

Expected behavior I would expect the load state to be tied to the object, not the prim path / scope. When parenting, grouping or renaming an object, I would not expect the load state to change.

Specs (if applicable): OS (Linux 64 bit) Maya USD: dev at 4710d36 Pixar USD: dev at 96c5a3f Maya 2022.update2 (& Maya 2022.base)

wtelford commented 2 years ago

@santosg87 Can you please log this internally.

santosd commented 2 years ago

Hi @gracekumagai, We have implemented a fix for this issue, could you try this out building the latest to see if all is well on your end.

gracekumagai commented 2 years ago

Yay! @santosd - I went through my test cases listed above and the load state seems to be updating as expected. Thank you!

santosd commented 2 years ago

Excellent! Thank you for confirming, I will go ahead and close this one out.