Python API 2.0 Reference
python/api1/py1CurveInterpolatorZero.py
1 #-
2 # ===========================================================================
3 # Copyright 2015 Autodesk, Inc. All rights reserved.
4 #
5 # Use of this software is subject to the terms of the Autodesk license
6 # agreement provided at the time of installation or download, or which
7 # otherwise accompanies this software in either electronic or hard copy form.
8 # ===========================================================================
9 #+
10 
11 import sys
12 import maya.OpenMayaMPx as OpenMayaMPx
13 import maya.OpenMayaAnim as OpenMayaAnim
14 
15 interpZeroId = OpenMayaAnim.MFnAnimCurve.kTangentShared3
16 
17 # Animcurve Type definition
18 class interpZero(OpenMayaMPx.MPxAnimCurveInterpolator):
19  def __init__(self):
20  OpenMayaMPx.MPxAnimCurveInterpolator.__init__(self)
21  def evaluate(self, time):
22  return 0
23 
24 # creator
25 def creator():
26  return OpenMayaMPx.asMPxPtr( interpZero() )
27 
28 # initialize the script plug-in
29 def initializePlugin(mobject):
30  mplugin = OpenMayaMPx.MFnPlugin(mobject)
31  try:
32  mplugin.registerAnimCurveInterpolator( "InterpZero", interpZeroId, creator )
33  except:
34  sys.stderr.write( "Failed to register type: InterpZero" )
35  raise
36 
37 # uninitialize the script plug-in
38 def uninitializePlugin(mobject):
39  mplugin = OpenMayaMPx.MFnPlugin(mobject)
40  try:
41  mplugin.deregisterAnimCurveInterpolator( interpZeroId )
42  except:
43  sys.stderr.write( "Failed to deregister type: InterpZero" )
44  raise