I want to encapsulate a custom public class in the motionbuilder, similar to what python code does:
es.py:
class Fun:
def __init__(self, topModel=None, caption='Save Path...', prevdir='', fileName=None, charNList=[], currentFilePath=None,
FileNames=None, ComponentList=None, CharList=None, Model=None, OpenAnimFilePath=''):
self.topModel = topModel
self.caption = caption
self.prevdir = prevdir
self.fileName = fileName
self.charNList = charNList
self.currentFilePath = currentFilePath
self.FileNames = FileNames
# self.ComponentList = FBComponentList()
# self.CharList = FBSystem().Scene.Characters
self.Model = Model
self.OpenAnimFilePath = OpenAnimFilePath
# 打开文件
def FileOpens(self):
AnimPath= self.OpenAnimFilePath + '\\' + self.fileName
print 'AnimPath'
tt.py:
import sys
sys.path.append(‘F:\vs\PyS\Test’)
import es
f = es.Fun(OpenAnimFilePath=‘C:\WildDogFile’)
f.FileOpens()
However, there is an error when the MB environment is running:
TypeError: init() got an unexpected keyword argument ‘OpenAnimFilePath’
I am very strange why so, I do not know how to solve, any friends know what the reason is?
Could you help me out,Thank you very much~~