-
Notifications
You must be signed in to change notification settings - Fork 201
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
EMSUSD-1120 - Stage loading problems using MEL proc #3667
Conversation
…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); |
There was a problem hiding this comment.
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.
# 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()) |
There was a problem hiding this comment.
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.
EMSUSD-1120 - Stage loading problems using MEL proc