如何在用户定义的上下文中应用自定义 Maya 操纵器
How to apply custom maya manipulator with user defined context
我最近几天在学习 Maya 脚本,对如何将自定义操纵器与用户定义的上下文一起应用感到困惑。 Select 对象并单击 Show Manipulator Tool
不起作用。这个问题可能很愚蠢,但我就是不知道该怎么做。
devkit filmMoveManip.py
中有一个示例,我想知道如何使用它。我知道如何加载它,知道如何显示和使用操纵器。
将脚本 filmMoveManip.py 添加到您的 plugin_path 并遵循文件头中的使用指南:
# filmMoveManip.py
# Scripted plug-in that displays a manipulator that
# modifies the film translate horizontal and vertical
# values.
#
# To use this plug-in:
# 1. execute the following Python:
# import maya
# maya.cmds.loadPlugin("filmMoveManip.py")
# maya.cmds.spFilmMoveManipCtxCmd( 'spFilmMoveManipContext1' )
# maya.cmds.setParent( 'Shelf1' )
# maya.cmds.toolButton( 'spFilmMoveManip1', cl='toolCluster', t='spFilmMoveManipContext1', i1="filmMoveManip.xpm" )
# 2. Open the outliner and select a camera shape such as perspShape
# 3. A manipulator with a horizontal and vertical axis will be displayed.
# 4. Move the axis to modify the film translate
我最近几天在学习 Maya 脚本,对如何将自定义操纵器与用户定义的上下文一起应用感到困惑。 Select 对象并单击 Show Manipulator Tool
不起作用。这个问题可能很愚蠢,但我就是不知道该怎么做。
devkit filmMoveManip.py
中有一个示例,我想知道如何使用它。我知道如何加载它,知道如何显示和使用操纵器。
将脚本 filmMoveManip.py 添加到您的 plugin_path 并遵循文件头中的使用指南:
# filmMoveManip.py
# Scripted plug-in that displays a manipulator that
# modifies the film translate horizontal and vertical
# values.
#
# To use this plug-in:
# 1. execute the following Python:
# import maya
# maya.cmds.loadPlugin("filmMoveManip.py")
# maya.cmds.spFilmMoveManipCtxCmd( 'spFilmMoveManipContext1' )
# maya.cmds.setParent( 'Shelf1' )
# maya.cmds.toolButton( 'spFilmMoveManip1', cl='toolCluster', t='spFilmMoveManipContext1', i1="filmMoveManip.xpm" )
# 2. Open the outliner and select a camera shape such as perspShape
# 3. A manipulator with a horizontal and vertical axis will be displayed.
# 4. Move the axis to modify the film translate