-
Notifications
You must be signed in to change notification settings - Fork 202
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
In order to be able to apply some Maya more sophisticated transformations on USD prim that already use the USD common xform stack, we need to be able to use the Maya xform stack UFE Transformer3d. But that only accepted to be use if the existing USD form stack matched the Maya one. Unfortunately, the USD common API pivot ws not found in teh Maya stack. Adding the common pivot to the Maya stack allows using the Maya transferm 3d on the USD common stack, allowing more complex operations on the pivot. The real problem is that the chain of responsibility design pattern locks which xform-editor is used and thus what can be applied on the xform based on what opinions are already authored. Once chosen, the xform editor cannot be changed. This means some Maya operations cannot ever be applied on that prim. The real solution would be to allow conversions between differnt xform representations. These conversions would be triggered when an operation not supported by the current xform representation need to be applied. Concretely, instead of having multiple classes dereived from UFE Transform3d and which is used chosen at the time the Transform3d is created, we would have a single Transform3d class which would contain multiple implementations of the API and which implementation is used could change dynamically, with the USD xform representation converted from one to the other. It would be more of a hierarchy of more and more complex and complete representation of xform, with conversion from simpler forms to more complex forms. Also: - Remove spurious error generated by MayaSessionState. - Add a unit test for center pivot command - Fix unit test that expect that Maya stack cannot handle a custom xform stack: make the xform names really unique. The new change was able to handle the stack unit by the test. - Add documentations about transforms
- Loading branch information
1 parent
6877e0a
commit 7c0ebbf
Showing
12 changed files
with
418 additions
and
133 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
# USD Transforms Stack | ||
|
||
## Take Aways | ||
|
||
- Understand the USD transform stack (xformOp) | ||
- Know the available USD transform ops | ||
- Know the structure of the USD transform stack | ||
- Know how it maps to UFE | ||
- Know the various implementations of xformOp in MayaUSD | ||
|
||
## What is a USD Transform stack | ||
|
||
- Control the 3D position of a USD prim | ||
- It is an ordered list of transform operations (xformOp): | ||
translation, rotation, scale, 4x4 matrix | ||
- USD supports any number of xformOp, in any order | ||
- An individual xformOp is kept in a USD attribute | ||
- All transform-related attributes begin with the "xformOp:" prefix | ||
- An xformOp attribute name has two or three parts: | ||
- "xformOp:" | ||
- the transform type | ||
- optional suffix | ||
- For example: "xformOp:translate:pivot" | ||
- The xformOp order is kept in a special attribute: "xformOpOrder" | ||
|
||
## Quick Recap on Pivot | ||
|
||
Pivots... | ||
|
||
- ... are generally neutral: they don't move the prim | ||
- ... come as a pair of opposite translations, sandwhiching other transforms | ||
- ... are used in DCC to position the center of rotation and center of scaling | ||
|
||
## Quick Recap on Transform Maths | ||
|
||
- A single matrix is equivalent to any number of chained transforms | ||
- The inverse is not true | ||
- Some matrices cannot be expressed with translation, rotation and scaling... | ||
- ... but they are generally considered degenerate and are rarely seen | ||
- On the other hand, matrix cannot express pivot pairs, since they are neutral | ||
- In general, except for pivots, all transform representations are equivalent | ||
|
||
## USD Common Transform Stack | ||
|
||
- USD provides a recommended, simple transform stack it calls the "common API" | ||
- The goal is to have a baseline transform stack that all DCC should support | ||
- The USD common stack structure is: translate, pivot, rotate, scale | ||
- In particular, the pivot wraps both the rotation and scaling, unlike Maya | ||
|
||
## UFE Transforms | ||
|
||
UFE Transform3d ... | ||
|
||
- ... allows modifying a UFE scene item transforms | ||
- ... is created by the registered UFE Transform3dHandler | ||
- ... creates commands that when executed changes the transform | ||
- ... does *not* prescribe how the various transforms interact | ||
- ... is implicitly tied to Maya's view of how transforms are ordered | ||
|
||
## MayaUSD XformOp Implementations | ||
|
||
- MayaUSD provides multiple UFE Transform3d implementations | ||
- The implementations are: point instance, Maya stack, USD common API, 4x4 matrix and no comprendo + Maya stack | ||
- For the rest of the presentation, we will ignore point instance and no comprendo | ||
|
||
## MayaUSD XformOp Details | ||
|
||
- Only the Maya stack supports all the UFE commands. In particular, pivot commands | ||
- Which one is used is decided at the time of the creation of the Transform3d | ||
- Once decided, there is no turning back, we cannot switch dynamically | ||
- The decision is based on what is already authored on the prim | ||
- In case multiple implementations could be used, the priority order is: Maya stack, common API, matrix | ||
- The main goal was that we would privilege the Maya stack, but still support the others representations | ||
- One design decision is to *not* convert between representations |
Binary file not shown.
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
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
Oops, something went wrong.