, 'UNDO'}

    items = [
        ('ABSOLUTE', "Absolute value", "", 1),
        ('RELATIVE', "Relative value", "", 2),
    ]
    mode: bpy.props.EnumProperty(items=items, name="Mode")
    levels: bpy.props.IntProperty(name="Level", default=2, min=-20, max=20, soft_min=-20, soft_max=20, step=1)

    def execute(self, context):
        for obj in bpy.data.objects:
            if (obj.type != 'MESH' and obj.type != 'CURVE'):
                continue
            for mod in obj.modifiers:
                if (mod.type == 'SUBSURF'):
                    if (self.mode == 'ABSOLUTE'):
                        mod.render_levels = self.levels
                    elif (self.mode == 'RELATIVE'):
                        mod.render_levels += self.levels
                    else:
                        self.report(type={'ERROR'}, message="Setting value is invalid")
                        return {'CANCELLED'}
        for area in context.screen.areas:
            area.tag_redraw()
        return {'FINISHED'}


class SyncAllSubsurfRenderLevels(bpy.types.Operator):
    bl_idname = "render.sync_all_subsurf_render_levels"
    bl_label = "Sync All Subsurf Levels"
    bl_description = "sync_all_subsurf_render_levels"
    bl_options = {'REGISTER', 'UNDO'}

    level_offset: bpy.props.IntProperty(name="Sync Levels", default=0, min=-20, max=20, soft_min=-20, soft_max=20, step=1)

    def execute(self, context):
        for obj in bpy.data.objects:
            if (obj.type != 'MESH'):
                continue
            for mod in obj.modifiers:
                if (mod.type == 'SUBSURF'):
                    mod.render_levels = mod.levels + self.level_offset
        for area in context.screen.areas:
            area.tag_redraw()
        return {'FINISHED'}

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

################
# Render Size
################


class RenderResolutionPercentageMenu(bpy.types.Menu):
    bl_idname = "TOPBAR_MT_render_resolution_percentage"
    bl_label = "Render