maya.core.decorators¶
Decorator functions for Tikmaya core functionalities.
Functions¶
|
Attach alias properties to a class. |
|
Available as a decorator for loose functions. |
|
Decorator method to keep the current selection. Useful where |
|
Decorator that skips execution if the node no longer exists. |
|
Puts the wrapped func into a single Maya Undo action. |
Module Contents¶
- add_aliases(aliases)¶
Attach alias properties to a class.
- Example Usage:
- @add_aliases({
“alias_name”: “original_property_name”, …
}) class MyClass:
…
- Args:
aliases: A mapping of alias_name -> original_property_name.
- alias(alias_name)¶
Available as a decorator for loose functions. It injects ‘alias_name’ into the module’s global scope pointing to the function.
- keepselection(func)¶
Decorator method to keep the current selection. Useful where the wrapped method messes with the current selection
- protected(func: Callable[Ellipsis, Any]) Callable[Ellipsis, Any]¶
Decorator that skips execution if the node no longer exists.
Assumes the first argument (self) has an exists() method.
- undo(func)¶
Puts the wrapped func into a single Maya Undo action.