I’m looking at the example customClasses from the pymel svn. I keep getting  
an error and I feel like I am missing something obvious.
Here is my module with the custom subclass (called rigNode.py):

######################
import maya.cmds as cmds
from pymel import *
class BFDTransform(Transform):
_BFDRigNodeClassID = 'BFDTransform'
@classmethod
def createVirtual(cls, **kwargs):
t = group(**kwargs)
#t.addAttr(cls._BFDTransformClassID)
return t

@classmethod
def callback( cls, obj, name ):
fn = api.MFnDependencyNode(obj)
try:
return fn.hasAttribute( cls._BFDRigNodeClassID)
except: pass
return False

BFDTransform.registerVirtualSubClass(BFDTransform.callback,  
nameRequired=False )
######################

And here is my Maya call:
######################
import rigNode
rigNode.BFDTransform()
######################

The group gets made, but then I get this stack trace:

# Error: Determined type is Transform, which is not a subclass of desired  
type BFDTransform
# Traceback (most recent call last):
# File "<maya console>", line 1, in <module>
#  
File 
"C:\dev\Python\thirdParty\pymel\pymel_0.9.1\Windows32\Python2.5\pymel\core\general.py",
  
line 1226, in __new__
# return cls(res)
#  
File 
"C:\dev\Python\thirdParty\pymel\pymel_0.9.1\Windows32\Python2.5\pymel\core\general.py",
  
line 1274, in __new__
# raise TypeError, "Determined type is %s, which is not a subclass of  
desired type %s" % ( pymelType.__name__, cls.__name__ )
# TypeError: Determined type is Transform, which is not a subclass of  
desired type BFDTransform #


Any ideas? Thanks for your time.

--~--~---------~--~----~------------~-------~--~----~
http://groups.google.com/group/python_inside_maya
-~----------~----~----~----~------~----~------~--~---

Reply via email to