如何使用用户定义的上下文应用自定义maya操纵器

时间:2016-11-13 04:17:50

标签: python maya

我从最近几天开始学习maya脚本,并对如何将自定义操纵器应用于用户定义的上下文感到困惑。选择对象,然后点击Show Manipulator Tool无效。这个问题可能很愚蠢,但我不知道该怎么做。

devkit filmMoveManip.py中有一个例子,我想知道如何使用它。我知道如何加载它,就像如何显示操纵器并使用它一样。

1 个答案:

答案 0 :(得分:0)

将脚本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