예제 #1
0
    def __init__(self, pluginName, name=None):
        # create an instance of the plugin
        #plugin = eval("PtPluginManager.getPlugin('%s').%s"%(pluginName,pluginName))
        plugin = eval("PtPluginManager.getPlugin('%s')" % pluginName)
        if not inspect.isclass(plugin):
            plugin = eval("plugin.%s" % pluginName)

        ins = plugin()
        self.name = name if name else PtCommon.getRandomName(ins.name)
        self.type = ins.name
        self.params = ins.params
        for i in self.params:
            exec("self.%s = self.params[i]" % i)

        for i in ins.methods:
            exec("self.%s = ins.methods[i]" % i)

        # add to the world
        if ins.type == PtCommon.TDC_PLUGIN_CAMERA:
            PtWorld.cameras.append(self)
        elif ins.type == PtCommon.TDC_PLUGIN_SHAPE:
            PtWorld.shapes.append(self)
예제 #2
0
    def __init__(self,pluginName,name=None):
        # create an instance of the plugin
        #plugin = eval("PtPluginManager.getPlugin('%s').%s"%(pluginName,pluginName))
        plugin = eval("PtPluginManager.getPlugin('%s')"%pluginName)
        if not inspect.isclass(plugin):
            plugin = eval("plugin.%s"%pluginName)

        ins = plugin()
        self.name   = name if name else PtCommon.getRandomName(ins.name)
        self.type   = ins.name
        self.params = ins.params 
        for i in self.params:
            exec("self.%s = self.params[i]"%i)

        for i in ins.methods:
            exec("self.%s = ins.methods[i]"%i)

        # add to the world
        if ins.type == PtCommon.TDC_PLUGIN_CAMERA:
            PtWorld.cameras.append(self)
        elif ins.type == PtCommon.TDC_PLUGIN_SHAPE:
            PtWorld.shapes.append(self)
예제 #3
0
 def __init__(self,name=None,value=None,parmType=None):
     self.type   = parmType if parmType else None
     self.name   = name if name else PtCommon.getRandomName("Param") 
     self.__value  = value if value else None
     self.default  = value 
예제 #4
0
파일: PtParam.py 프로젝트: camer/videofiles
 def __init__(self, name=None, value=None, parmType=None):
     self.type = parmType if parmType else None
     self.name = name if name else PtCommon.getRandomName("Param")
     self.__value = value if value else None
     self.default = value