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

EMSUSD-1120 - Stage loading problems using MEL proc #3667

Merged

Conversation

seando-adsk
Copy link
Collaborator

EMSUSD-1120 - Stage loading problems using MEL proc

  • Make sure to init the optionvars used by the MEL command.

…oblems

* Make sure to init the optionvars used by the MEL command.
// This proc is used by the unit tests (which run in standalone mode).
// In that case we need to make sure the optionVars are initialized as
// they are queried in doCreateStage().
setOptionVars(false);
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So what happens is on line 141 it would do:
string $ppath = optionVar -q stageFromFile_primPath;
If we are running in standalone (say from a unit test) the options vars would not have been init, and in Maya when you query an option var that doesn't exist it returns 0. The MEL code above converts that to a string and you get "0". That would then we set as the primPath on the stage. In Dan's new code this is not a valid primPath so the compute would bail early. With this fix the option vars are init and it will set "" as the primpath which converts to the root prim "/" and the compute works.

Comment on lines +80 to +90
# Verify that the we have a good stage.
stage = mayaUsd.ufe.getStage(shapeNode)
self.assertTrue(stage)

# This stage has five layers.
layerStack = stage.GetLayerStack()
self.assertEqual(5, len(layerStack))

# Finally, verify that we can get at least one of the ball prims.
ballPrim = stage.GetPrimAtPath('/Room_set/Props/Ball_1')
self.assertTrue(ballPrim.IsValid())
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added some test cases to ensure the stage was correctly loaded.

@seando-adsk seando-adsk added unit test Related to unit tests (both python or c++) bug Something isn't working labels Mar 19, 2024
@seando-adsk seando-adsk self-assigned this Mar 20, 2024
@seando-adsk seando-adsk added the ready-for-merge Development process is finished, PR is ready for merge label Mar 20, 2024
@seando-adsk seando-adsk merged commit 2ffe9dc into dev Mar 20, 2024
11 checks passed
@seando-adsk seando-adsk deleted the donnels/EMSUSD-1120/stage_loading_problems_using_script branch March 20, 2024 15:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working ready-for-merge Development process is finished, PR is ready for merge unit test Related to unit tests (both python or c++)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants