Ejemplo n.º 1
0
    def execute(self, context):
        prefs = GetPreferences()

        script = prefs.postExportScripts.add()
        script.name = "Unnamed_" + str(len(prefs.postExportScripts))
        prefs.active_postExportScripts_index = len(prefs.postExportScripts) - 1

        return {'FINISHED'}
Ejemplo n.º 2
0
    def execute(self, context):
        prefs = GetPreferences()

        if prefs.active_postExportScripts_index >= 0:
            prefs.postExportScripts.remove(
                prefs.active_postExportScripts_index)
            prefs.active_postExportScripts_index = len(
                prefs.postExportScripts) - 1

        return {'FINISHED'}
Ejemplo n.º 3
0
    def execute(self, context):

        prefs = GetPreferences()
        print(self.type)
        print(prefs.active_postExportScripts_index)

        direction = 1 if self.type == 'DOWN' else -1

        if prefs.active_postExportScripts_index >= 0:
            newpos = prefs.active_postExportScripts_index + direction
            if newpos < len(prefs.postExportScripts) and newpos > -1:
                prefs.postExportScripts.move(
                    prefs.active_postExportScripts_index, newpos)
                prefs.active_postExportScripts_index = newpos

        return {'FINISHED'}