Skip to content
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-109455 UFE USD camera commands #2789

Merged
merged 3 commits into from
Jan 13, 2023

Conversation

pierrebai-adsk
Copy link
Collaborator

Implemeted the UFE commands necessary to set values on a camera via UFE.

Extended the available base classes to implement UFE commands that modify USD data. Make each base class do one thing only, to clarify the purpose of each.

Add UsdUndoCapture class:

  • It captures the changes to USD data within a UFE command.
  • Its sub-classes only need to implement executeImplementation() and optionally setImplementation().
  • It provides executeWithUndoCapture to do the command execution implementation while capture USD changes.
  • Same for setWithUndoCapture.
  • Provides undoUsdChanges() to undo all changes that were capture.
  • Same with redoUsdChanges, to redo the changes.

Refactor UsdUndoableCommand class:

  • Make UsdUndoableCommand use UsdUndoCapture class.
  • Add templated variable-arguments constructor to support any command base classs that can take arguments in its constructor.
  • This includes taking zero argument.

Add UsdFunctionUndoableCommand class:

  • This is a UFE command implementation where the actual command execution is done in a free function.
  • Avoids having to declare entire classes only to implement a single execute function.

Added UsdUndoableSetCommand class:

  • This is for undoable commands that sets value and must implement a set function.
  • Also has a Function sub-class to impelment it with a single free function.

Refactor existing command to use the new base class:

  • Refactor UsdAttribute commands to use the new classes.
  • Refactor UsdLight commands to use the new classes.
  • Refactor UsdSetMatridx4Undoable command the same way,
  • This avoids code duplication.
  • There are more commands that could be refactored, but this is a starting set.

Implement USDCamera commands.

  • Implement various commands related to UFE/USD cameras.
  • These use the new funciton-base command helper classes.
  • Added helper function to convert units.
  • Re-verified the units used by the camera and documented them.

Implemeted the UFE commands necessary to set values on a camera via UFE.

Extended the available base classes to implement UFE commands that modify USD
data. Make each base class do one thing only, to clarify the purpose of each.

Add UsdUndoCapture class:
- It captures the changes to USD data within a UFE command.
- Its sub-classes only need to implement executeImplementation() and optionally setImplementation().
- It provides executeWithUndoCapture to do the command execution implementation while capture USD changes.
- Same for setWithUndoCapture.
- Provides undoUsdChanges() to undo all changes that were capture.
- Same with redoUsdChanges, to redo the changes.

Refactor UsdUndoableCommand class:
- Make UsdUndoableCommand use UsdUndoCapture class.
- Add templated variable-arguments constructor to support any command base classs that can take arguments in its constructor.
- This includes taking zero argument.

Add UsdFunctionUndoableCommand class:
- This is a UFE command implementation where the actual command execution is done in a free function.
- Avoids having to declare entire classes only to implement a single execute function.

Added UsdUndoableSetCommand class:
- This is for undoable commands that sets value and must implement a set function.
- Also has a Function sub-class to impelment it with a single free function.

Refactor existing command to use the new base class:
- Refactor UsdAttribute commands to use the new classes.
- Refactor UsdLight commands to use the new classes.
- Refactor UsdSetMatridx4Undoable command the same way,
- This avoids code duplication.
- There are more commands that could be refactored, but this is a starting set.

Implement USDCamera commands.
- Implement various commands related to UFE/USD cameras.
- These use the new funciton-base command helper classes.
- Added helper function to convert units.
- Re-verified the units used by the camera and documented them.
@pierrebai-adsk pierrebai-adsk added adsk Related to Autodesk plugin ufe-usd Related to UFE-USD plugin in Maya-Usd labels Dec 19, 2022
Copy link
Collaborator

@vlasovi vlasovi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good

@pierrebai-adsk pierrebai-adsk added the ready-for-merge Development process is finished, PR is ready for merge label Jan 12, 2023
@seando-adsk seando-adsk merged commit 04f7d29 into dev Jan 13, 2023
@seando-adsk seando-adsk deleted the bailp/MAYA-109455/UFE-camera-commands branch January 13, 2023 16:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
adsk Related to Autodesk plugin ready-for-merge Development process is finished, PR is ready for merge ufe-usd Related to UFE-USD plugin in Maya-Usd
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants