-
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
Ufe manipulation #962
Ufe manipulation #962
Conversation
Proof of concept for USD matrix transform op editing.
Merge dev to ufe manipulation
Merge dev to ufe manipulation 01
…stack_01 Tremblp/maya 106087/maya xform stack 01
… into ufe-manipulation
…stack_02 Tremblp/maya 106087/maya xform stack 02
…/merge_dev_with_clang_format
…/merge_dev_with_clang_format
…ormat Merge dev with clang format
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
// | ||
#pragma once |
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.
@ppt-adsk Nit-pick: use include guard instead based on our coding guideline. Same thing in other files.
@@ -0,0 +1,209 @@ | |||
# Editing USD Transformable Objects with maya-usd | |||
|
|||
Draft version 0.3, 19-Aug-2020, 4:52 P.M. |
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.
I wonder if we want to clean this up since it's now no longer a proposal.
Ufe::SceneItem::Ptr UsdTransform3dBase::sceneItem() const { return fItem; } | ||
|
||
Ufe::TranslateUndoableCommand::Ptr | ||
UsdTransform3dBase::translateCmd(double /* x */, double /* y */, double /* z */) |
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.
Is this base class ever instantiated? In other words, do we need a definition for these methods?
|
||
namespace { | ||
|
||
class UsdTranslateUndoableCmd : public Ufe::TranslateUndoableCommand |
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.
Pretty minimalistic when it comes to documentation :)
: _nextHandler->editTransform3d( | ||
item | ||
#if UFE_PREVIEW_VERSION_NUM >= 2030 | ||
, |
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.
another example of a clang-format issue. This particular one, unfortunately, doesn't have any good configuration, coma will have to go onto line 359 to get good formatting :(
// - Perform operations on a 4x4 matrix transform op. | ||
// - Perform operations using the USD common transform API. | ||
// - Perform operations using a Maya transform stack. | ||
auto& runTimeMgr = Ufe::RunTimeMgr::instance(); |
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.
We should communicate this better that for now, the new chain of responsibilities is available only with adsk proxy. It can be adopted by others easily by copying this configuration of the chain of responsibilities.
|
||
mayaUtils.openTestScene("xformOpFallback", "fallbackTest.ma") | ||
|
||
# We have three objects in the scene, one Maya, one USD with a Maya |
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.
Excellent tests. One addition that would be useful to make is for testing fallback when editing pivots on matrix stacks.
…es. According to USD docs, editing scene description via instance proxies and their properties is not allowed.
…_instance_proxies_not_allowed MAYA-108545: Prevent the crash when authoring edits to instance proxies.
…aya2020_fixes Compilation fixes for Maya 2020.
This reverts commit 120ae47.
…dy registered with our UsdUndoStateDelegate. If the cast fails, that means it needs to be set with a new one.
…ixes Fixes for pre-flight tests and clang-format.
…sh_switching_layers MAYA-108549: Fix undo crash when switching between target layers in a stage
…ght-fixes Fix unused variables and clang-format errors.
…ling-test-linux Disable failing test on Linux.
The goal of this pull request is to allow users to edit the transform of any transformable USD prim. See
UsdGeomXformable documentation for background material.
In particular, we wanted to meet the following requirements:
This pull request uses a recently-added method to the Ufe::Transform3d interface, the editTransform3d() method, to target transform ops within a larger stack of transform ops. See this discussion for more details.
It implements support for the Maya transform stack, the USD common transform API stack, and matrix op stacks, through a chain of responsibility scheme. If the prim matches a Maya transform stack, a Transform3d interface for Maya transform stacks will be created, otherwise if the prim matches the USD common transform API stack, a Transform3d interface for such a stack will be created, otherwise if the prim matches a transform stack with matrix transform ops, a Transform3d interface for such a stack will be created. If none of these transform stacks match, a fallback Maya transform stack will be appended to the original transform stack. This chain of responsibility can be manipulated at run time, and reverted back to the previous fixed scheme with conversion to the USD common transform API, though we plan on retiring this legacy code in the future. The capability to change the Transform3d creation scheme at run-time will remain, however.
A full undo / redo system is implemented using a USD state delegate. This ensures that the data model is restored to its previous state, even given prim spec or attribute spec creation. This is the great work of @HamedSabri-adsk.