def invoke(self, context, event): gestSlide = SlidesManager() listSize = len( gestSlide.listSlides[gestSlide.posActiveSlide].listObjects) if listSize == 0: gestSlide.removeSlide() else: ops.operator.popupdelete('INVOKE_DEFAULT') return {'RUNNING_MODAL'}
class PropNumberSlide(Property): """ PropNumberSlide: switch slides """ gestSlide = SlidesManager() nbSlide = 0 def updateProp(self, context): """ On prop value change :arg context: context where the prop exists """ self.nbSlide = self.gestSlide.getNbSlides() if self.Active_Slide == 0: self.Active_Slide = 1 if self.Active_Slide > self.nbSlide: self.Active_Slide = self.Active_Slide - 1 self.gestSlide.setActiveSlide(self.Active_Slide) Active_Slide = props.IntProperty(name=XMLData["prop@SlideSize"], description=XMLData["desc@SlideSizeDesc"], default=0, max=10, min=0, update=updateProp)
def invoke(self, context, event): gestSlide = SlidesManager() gestSlide.listSlides[gestSlide.posActiveSlide].addAnimation('motion') context.scene.prop_custom_motion['is_Enable'] = False return {'RUNNING_MODAL'}
def invoke(self, context, event): gestSlide = SlidesManager() controllers = context.object.game.controllers if controllers: print('Etape 1') if controllers[0].actuators[0].name == "flash": print('Etape 2') gestSlide.listSlides[gestSlide.posActiveSlide].removeAnimation( 'delFlash') elif controllers[0].actuators[0].name == "motion": gestSlide.listSlides[gestSlide.posActiveSlide].removeAnimation( 'delMotion') elif controllers[0].actuators[0].name == "action": gestSlide.listSlides[gestSlide.posActiveSlide].removeAnimation( 'delAction') return {'RUNNING_MODAL'}
def register(): """ Register all Blender related classes contained inside the 'classes' container Also register all props from registerProps() contained inside Interface.Props file Create the first instance of SlidesManager singloton """ for cl in classes: try: utils.register_class(cl) except ValueError: utils.unregister_class(cl) utils.register_class(cl) registerProps() context.scene.prop_custom_motion['is_Enable'] = False SlidesManager()
def invoke(self, context, event): gestSlide = SlidesManager() gestSlide.listSlides[gestSlide.posActiveSlide].addAnimation('flash') return {'RUNNING_MODAL'}
def invoke(self, context, event): gestSlide = SlidesManager() gestSlide.addSlide() return {'RUNNING_MODAL'}
def execute(self, context): gestSlide = SlidesManager() gestSlide.removeSlide() return {'INTERFACE'}
def invoke(self, context, event): gestSlide = SlidesManager() if context.active_object.name[0:5] == "Slide": gestSlide.listSlides[gestSlide.posActiveSlide].removeObject( context.active_object) return {'RUNNING_MODAL'}
def invoke(self, context, event): gestSlide = SlidesManager() if gestSlide.nbSlides > 0: gestSlide.listSlides[gestSlide.posActiveSlide].addObject( context.active_object) return {'RUNNING_MODAL'}