Example #1
0
 def __init(self):
     """ start COVISE Module and connect output to COVER """
     if self.__addAttribute == None:
         self.__addAttribute = AddAttribute()
         theNet().add(self.__addAttribute)
         self.__addAttribute.set_attrName("COLOR")
         addAttributeIn = ConnectionPoint(self.__addAttribute, 'inObject')
         self.__addAttributeOut = ConnectionPoint(self.__addAttribute,
                                                  'outObject')
         connect(self.importModule.geoConnectionPoint(), addAttributeIn)
         VisItem.connectToCover(self, self)
Example #2
0
 def __update(self):
     """ __update is called from the run method to update the module parameter before execution
         + update module parameters """
     if self.performerScene == None:
         self.performerScene = PerformerScene()
         theNet().add(self.performerScene)
         self.addAttribute = AddAttribute()
         theNet().add(self.addAttribute)
         theNet().connect(self.performerScene, 'model', self.addAttribute,
                          'inObject')
         # we dont get a register message for some filetypes so dont expect one!
         if self.params.filename.split(".")[-1].lower() in [
                 "via",
                 "vim",
                 "vis",  # Molecules Plugin
                 "dyn",
                 "geoall",
                 "str",
                 "sensor"  # VRAnim Plugin
         ]:
             Neg2Gui.theGrMsgHandler().decreaseNumVisItemsToBeRegistered()
     # update params
     self.performerScene.set_modelPath(self.params.filename)
     self.performerScene.set_scale(self.params.scale)
     if (self.params.backface == True):
         self.performerScene.set_backface('TRUE')
     else:
         self.performerScene.set_backface('FALSE')
     if (self.params.orientation_iv == True):
         self.performerScene.set_orientation_iv('TRUE')
     else:
         self.performerScene.set_orientation_iv('FALSE')
     if (self.params.convert_xforms_iv == True):
         self.performerScene.set_convert_xforms_iv('TRUE')
     else:
         self.performerScene.set_convert_xforms_iv('FALSE')
     # add attribute
     self.addAttribute.set_attrName('SCENEGRAPHITEMS_STARTINDEX')
     self.addAttribute.set_attrVal(
         str(self.params.sceneGraphItems_startIndex))