-
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
Merged
seando-adsk
merged 1 commit into
dev
from
donnels/EMSUSD-1120/stage_loading_problems_using_script
Mar 20, 2024
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -77,6 +77,18 @@ def testCreateStageFromFile(self): | |
nt = cmds.nodeType(shapeNode) | ||
self.assertEqual('mayaUsdProxyShape', nt) | ||
|
||
# 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()) | ||
Comment on lines
+80
to
+90
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added some test cases to ensure the stage was correctly loaded. |
||
|
||
# Verify that the shape node has the correct file path. | ||
filePathAttr = cmds.getAttr(shapeNode+'.filePath') | ||
self.assertTrue(self.samefile(filePathAttr, ballFilePath)) | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.