e_current), '-t', str(self.thread)])
        elif (self.mode == 'ANIME'):
            subprocess.Popen([sys.argv[0], '-b', blend_path, '-a', '-t', str(self.thread)])
        if (self.is_quit):
            bpy.ops.wm.quit_blender()
        return {'FINISHED'}

    def invoke(self, context, event):
        return context.window_manager.invoke_props_dialog(self)


class SetRenderResolutionPercentage(bpy.types.Operator):
    bl_idname = "render.set_render_resolution_percentage"
    bl_label = "Set Resolution"
    bl_description = "Percent of the size of the resolution"
    bl_options = {'REGISTER', 'UNDO'}

    size: bpy.props.IntProperty(name="Rendering size (%)", default=100, min=1, max=1000, soft_min=1, soft_max=1000, step=1)

    def execute(self, context):
        context.scene.render.resolution_percentage = self.size
        return {'FINISHED'}


class ToggleThreadsMode(bpy.types.Operator):
    bl_idname = "render.toggle_threads_mode"
    bl_label = "Set Threads"
    bl_description = "I will switch the number of threads in the CPU to be used for rendering"
    bl_options = {'REGISTER', 'UNDO'}

    threads: bpy.props.IntProperty(name="Number of threads", default=1, min=1, max=16, soft_min=1, soft_max=16, step=1)

    def execute(self, context):
        if (context.scene.render.threads_mode == 'AUTO'):
            context.scene.render.threads_mode = 'FIXED'
            context.scene.render.threads = self.threads
        else:
            context.scene.render.threads_mode = 'AUTO'
        return {'FINISHED'}

    def invoke(self, context, event):
        if (context.scene.render.threads_mode == 'AUTO'):
            self.threads = context.scene.render.threads
            return context.window_manager.invoke_props_dialog(self)
        else:
            return self.execute(context)


class SetAllSubsurfRenderLevels(bpy.types.Operator):
    bl_idname = "render.set_all_subsurf_render_levels"
    bl_label = "Set Global Subsurf"
    bl_description = "Level of Subsurf to apply when rendering"
    bl_options = {'REGISTER'