-
Notifications
You must be signed in to change notification settings - Fork 202
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
MAYA-129059 - Add command to create stages. #3045
Conversation
20dc6a9
to
defb109
Compare
Hi @frohnej-adsk, I won't be reviewing this one. I will say that it needs a unit test :) |
0f221dc
to
60e93f7
Compare
@frohnej-adsk Before I review this code I just have a general question. In the comments you say that this will allow creating a new stage from C++ code. Is that all this is needed for? If so then you can do that now by using MGlobal::executePythonCommand() and import and call the existing python script. |
Hi @seando-adsk , I was told a while ago that it would be preferable to reproduce what the Python script is doing in C++. However, we can definitely challenge that. The new C++ code allows for:
These three points are required for a UFE interface I'm working on. Is it possible to wrap |
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.
Overall the changes are good. The ability to create the stage anywhere in Maya hier is nice.
But the execute() method needs to be reworked.
fd207b8
to
1fa67fb
Compare
Rebase on dev to fix formating. |
lib/mayaUsd/ufe/wrapUtils.cpp
Outdated
if (!parent) { | ||
return ""; | ||
} |
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.
Do we really need this check? Your create() method below and checks for and returns nullptr if input parent is empty.
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.
Good point, see 3e744caf9c23eb56b498fa5dcce0df9870c17536.
Add an undoable command that creates a stage with a new layer. The new command is a C++ implementation of the existing mayaUsd_createStageWithNewLayer.py Python script. The C++ command will: - enable the creation of stages from within the C++ code. - enable the creation of stages deep in the Maya hierarchy. - wrap stage creation into an Ufe::UndoableCommand so that it can be undone by UFE clients. This commit also adds a Python binding for the stage creation command, which is used in mayaUsd_createStageWithNewLayer.py to replace the current implementation.
3e744ca
to
7a0ee45
Compare
Squash commits for a clean history. |
Add an undoable command that creates a stage with a new layer.
The new command is a C++ implementation of the existing mayaUsd_createStageWithNewLayer.py Python script. The command enables the creation of stages from within the C++ code, which will be required by future work (MAYA-128151) and might also be generally useful.
This commit also adds a Python binding for the stage creation command, which is used in mayaUsd_createStageWithNewLayer.py to replace the current implementation.