forked from bartvdbraak/blender
Cleanup: follow naming conventions
Using panels for presets printed warnings for classes named as menus.
This commit is contained in:
parent
1ccd70b7c1
commit
ab9e2dccd3
@ -297,7 +297,7 @@ class AddPresetRender(AddPresetBase, Operator):
|
||||
"""Add or remove a Render Preset"""
|
||||
bl_idname = "render.preset_add"
|
||||
bl_label = "Add Render Preset"
|
||||
preset_menu = "RENDER_MT_presets"
|
||||
preset_menu = "RENDER_PT_presets"
|
||||
|
||||
preset_defines = [
|
||||
"scene = bpy.context.scene"
|
||||
@ -320,7 +320,7 @@ class AddPresetCamera(AddPresetBase, Operator):
|
||||
"""Add or remove a Camera Preset"""
|
||||
bl_idname = "camera.preset_add"
|
||||
bl_label = "Add Camera Preset"
|
||||
preset_menu = "CAMERA_MT_presets"
|
||||
preset_menu = "CAMERA_PT_presets"
|
||||
|
||||
preset_defines = [
|
||||
"cam = bpy.context.camera"
|
||||
@ -351,7 +351,7 @@ class AddPresetSafeAreas(AddPresetBase, Operator):
|
||||
"""Add or remove a Safe Areas Preset"""
|
||||
bl_idname = "safe_areas.preset_add"
|
||||
bl_label = "Add Safe Area Preset"
|
||||
preset_menu = "SAFE_AREAS_MT_presets"
|
||||
preset_menu = "SAFE_AREAS_PT_presets"
|
||||
|
||||
preset_defines = [
|
||||
"safe_areas = bpy.context.scene.safe_areas"
|
||||
@ -371,7 +371,7 @@ class AddPresetCloth(AddPresetBase, Operator):
|
||||
"""Add or remove a Cloth Preset"""
|
||||
bl_idname = "cloth.preset_add"
|
||||
bl_label = "Add Cloth Preset"
|
||||
preset_menu = "CLOTH_MT_presets"
|
||||
preset_menu = "CLOTH_PT_presets"
|
||||
|
||||
preset_defines = [
|
||||
"cloth = bpy.context.cloth"
|
||||
@ -393,7 +393,7 @@ class AddPresetFluid(AddPresetBase, Operator):
|
||||
"""Add or remove a Fluid Preset"""
|
||||
bl_idname = "fluid.preset_add"
|
||||
bl_label = "Add Fluid Preset"
|
||||
preset_menu = "FLUID_MT_presets"
|
||||
preset_menu = "FLUID_PT_presets"
|
||||
|
||||
preset_defines = [
|
||||
"fluid = bpy.context.fluid"
|
||||
@ -411,7 +411,7 @@ class AddPresetHairDynamics(AddPresetBase, Operator):
|
||||
"""Add or remove a Hair Dynamics Preset"""
|
||||
bl_idname = "particle.hair_dynamics_preset_add"
|
||||
bl_label = "Add Hair Dynamics Preset"
|
||||
preset_menu = "PARTICLE_MT_hair_dynamics_presets"
|
||||
preset_menu = "PARTICLE_PT_hair_dynamics_presets"
|
||||
|
||||
preset_defines = [
|
||||
"psys = bpy.context.particle_system",
|
||||
@ -467,7 +467,7 @@ class AddPresetTrackingCamera(AddPresetBase, Operator):
|
||||
"""Add or remove a Tracking Camera Intrinsics Preset"""
|
||||
bl_idname = "clip.camera_preset_add"
|
||||
bl_label = "Add Camera Preset"
|
||||
preset_menu = "CLIP_MT_camera_presets"
|
||||
preset_menu = "CLIP_PT_camera_presets"
|
||||
|
||||
preset_defines = [
|
||||
"camera = bpy.context.edit_movieclip.tracking.camera"
|
||||
@ -501,7 +501,7 @@ class AddPresetTrackingTrackColor(AddPresetBase, Operator):
|
||||
"""Add or remove a Clip Track Color Preset"""
|
||||
bl_idname = "clip.track_color_preset_add"
|
||||
bl_label = "Add Track Color Preset"
|
||||
preset_menu = "CLIP_MT_track_color_presets"
|
||||
preset_menu = "CLIP_PT_track_color_presets"
|
||||
|
||||
preset_defines = [
|
||||
"track = bpy.context.edit_movieclip.tracking.tracks.active"
|
||||
@ -519,7 +519,7 @@ class AddPresetTrackingSettings(AddPresetBase, Operator):
|
||||
"""Add or remove a motion tracking settings preset"""
|
||||
bl_idname = "clip.tracking_settings_preset_add"
|
||||
bl_label = "Add Tracking Settings Preset"
|
||||
preset_menu = "CLIP_MT_tracking_settings_presets"
|
||||
preset_menu = "CLIP_PT_tracking_settings_presets"
|
||||
|
||||
preset_defines = [
|
||||
"settings = bpy.context.edit_movieclip.tracking.settings"
|
||||
@ -549,7 +549,7 @@ class AddPresetNodeColor(AddPresetBase, Operator):
|
||||
"""Add or remove a Node Color Preset"""
|
||||
bl_idname = "node.node_color_preset_add"
|
||||
bl_label = "Add Node Color Preset"
|
||||
preset_menu = "NODE_MT_node_color_presets"
|
||||
preset_menu = "NODE_PT_node_color_presets"
|
||||
|
||||
preset_defines = [
|
||||
"node = bpy.context.active_node"
|
||||
@ -662,7 +662,7 @@ class AddPresetUnitsLength(AddPresetBase, Operator):
|
||||
"""Add or remove length units preset"""
|
||||
bl_idname = "scene.units_length_preset_add"
|
||||
bl_label = "Add Length Units Preset"
|
||||
preset_menu = "SCENE_MT_units_length_presets"
|
||||
preset_menu = "SCENE_PT_units_length_presets"
|
||||
|
||||
preset_defines = [
|
||||
"scene = bpy.context.scene"
|
||||
|
@ -34,7 +34,7 @@ class CameraButtonsPanel:
|
||||
return context.camera and (engine in cls.COMPAT_ENGINES)
|
||||
|
||||
|
||||
class CAMERA_MT_presets(PresetMenu):
|
||||
class CAMERA_PT_presets(PresetMenu):
|
||||
bl_label = "Camera Presets"
|
||||
preset_subdir = "camera"
|
||||
preset_operator = "script.execute_preset"
|
||||
@ -42,7 +42,7 @@ class CAMERA_MT_presets(PresetMenu):
|
||||
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'}
|
||||
|
||||
|
||||
class SAFE_AREAS_MT_presets(PresetMenu):
|
||||
class SAFE_AREAS_PT_presets(PresetMenu):
|
||||
bl_label = "Camera Presets"
|
||||
preset_subdir = "safe_areas"
|
||||
preset_operator = "script.execute_preset"
|
||||
@ -187,7 +187,7 @@ class DATA_PT_camera(CameraButtonsPanel, Panel):
|
||||
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'}
|
||||
|
||||
def draw_header_preset(self, context):
|
||||
CAMERA_MT_presets.draw_panel_header(self.layout)
|
||||
CAMERA_PT_presets.draw_panel_header(self.layout)
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
@ -409,7 +409,7 @@ class DATA_PT_camera_safe_areas(CameraButtonsPanel, Panel):
|
||||
self.layout.prop(cam, "show_safe_areas", text="")
|
||||
|
||||
def draw_header_preset(self, context):
|
||||
SAFE_AREAS_MT_presets.draw_panel_header(self.layout)
|
||||
SAFE_AREAS_PT_presets.draw_panel_header(self.layout)
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
@ -449,8 +449,8 @@ def draw_display_safe_settings(layout, safe_data, settings):
|
||||
|
||||
|
||||
classes = (
|
||||
CAMERA_MT_presets,
|
||||
SAFE_AREAS_MT_presets,
|
||||
CAMERA_PT_presets,
|
||||
SAFE_AREAS_PT_presets,
|
||||
DATA_PT_context_camera,
|
||||
DATA_PT_lens,
|
||||
DATA_PT_camera,
|
||||
|
@ -83,7 +83,7 @@ class PARTICLE_MT_specials(Menu):
|
||||
layout.operator("particle.duplicate_particle_system")
|
||||
|
||||
|
||||
class PARTICLE_MT_hair_dynamics_presets(PresetMenu):
|
||||
class PARTICLE_PT_hair_dynamics_presets(PresetMenu):
|
||||
bl_label = "Hair Dynamics Presets"
|
||||
preset_subdir = "hair_dynamics"
|
||||
preset_operator = "script.execute_preset"
|
||||
@ -349,7 +349,7 @@ class PARTICLE_PT_hair_dynamics(ParticleButtonsPanel, Panel):
|
||||
|
||||
layout = self.layout
|
||||
layout.enabled = psys.use_hair_dynamics and psys.point_cache.is_baked is False
|
||||
PARTICLE_MT_hair_dynamics_presets.draw_panel_header(layout)
|
||||
PARTICLE_PT_hair_dynamics_presets.draw_panel_header(layout)
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
@ -1879,7 +1879,7 @@ class PARTICLE_PT_custom_props(ParticleButtonsPanel, PropertyPanel, Panel):
|
||||
|
||||
classes = (
|
||||
PARTICLE_MT_specials,
|
||||
PARTICLE_MT_hair_dynamics_presets,
|
||||
PARTICLE_PT_hair_dynamics_presets,
|
||||
PARTICLE_UL_particle_systems,
|
||||
PARTICLE_PT_context_particles,
|
||||
PARTICLE_PT_emission,
|
||||
|
@ -31,7 +31,7 @@ def cloth_panel_enabled(md):
|
||||
return md.point_cache.is_baked is False
|
||||
|
||||
|
||||
class CLOTH_MT_presets(PresetMenu):
|
||||
class CLOTH_PT_presets(PresetMenu):
|
||||
bl_label = "Cloth Presets"
|
||||
preset_subdir = "cloth"
|
||||
preset_operator = "script.execute_preset"
|
||||
@ -54,7 +54,7 @@ class PHYSICS_PT_cloth(PhysicButtonsPanel, Panel):
|
||||
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'}
|
||||
|
||||
def draw_header_preset(self, context):
|
||||
CLOTH_MT_presets.draw_panel_header(self.layout)
|
||||
CLOTH_PT_presets.draw_panel_header(self.layout)
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
@ -258,7 +258,7 @@ class PHYSICS_PT_cloth_field_weights(PhysicButtonsPanel, Panel):
|
||||
|
||||
|
||||
classes = (
|
||||
CLOTH_MT_presets,
|
||||
CLOTH_PT_presets,
|
||||
PHYSICS_PT_cloth,
|
||||
PHYSICS_PT_cloth_cache,
|
||||
PHYSICS_PT_cloth_collision,
|
||||
|
@ -23,7 +23,7 @@ from bpy.app.translations import pgettext_iface as iface_
|
||||
from bl_operators.presets import PresetMenu
|
||||
|
||||
|
||||
class FLUID_MT_presets(PresetMenu):
|
||||
class FLUID_PT_presets(PresetMenu):
|
||||
bl_label = "Fluid Presets"
|
||||
preset_subdir = "fluid"
|
||||
preset_operator = "script.execute_preset"
|
||||
@ -242,7 +242,7 @@ class PHYSICS_PT_domain_gravity(PhysicButtonsPanel, Panel):
|
||||
col.prop(fluid, "simulation_scale", text="Meters")
|
||||
|
||||
col = split.column()
|
||||
FLUID_MT_presets.draw_menu(col, text="Viscosity Presets")
|
||||
FLUID_PT_presets.draw_menu(col, text="Viscosity Presets")
|
||||
|
||||
sub = col.column(align=True)
|
||||
sub.prop(fluid, "viscosity_base", text="Base")
|
||||
@ -306,7 +306,7 @@ class PHYSICS_PT_domain_particles(PhysicButtonsPanel, Panel):
|
||||
|
||||
|
||||
classes = (
|
||||
FLUID_MT_presets,
|
||||
FLUID_PT_presets,
|
||||
PHYSICS_PT_fluid,
|
||||
PHYSICS_PT_domain_gravity,
|
||||
PHYSICS_PT_domain_boundary,
|
||||
|
@ -23,14 +23,14 @@ from bpy.types import Menu, Panel, UIList
|
||||
from bl_operators.presets import PresetMenu
|
||||
|
||||
|
||||
class RENDER_MT_presets(PresetMenu):
|
||||
class RENDER_PT_presets(PresetMenu):
|
||||
bl_label = "Render Presets"
|
||||
preset_subdir = "render"
|
||||
preset_operator = "script.execute_preset"
|
||||
preset_add_operator = "render.preset_add"
|
||||
|
||||
|
||||
class RENDER_MT_ffmpeg_presets(PresetMenu):
|
||||
class RENDER_PT_ffmpeg_presets(PresetMenu):
|
||||
bl_label = "FFMPEG Presets"
|
||||
preset_subdir = "ffmpeg"
|
||||
preset_operator = "script.python_file_run"
|
||||
@ -85,7 +85,7 @@ class RENDER_PT_dimensions(RenderButtonsPanel, Panel):
|
||||
_preset_class = None
|
||||
|
||||
def draw_header_preset(self, context):
|
||||
RENDER_MT_presets.draw_panel_header(self.layout)
|
||||
RENDER_PT_presets.draw_panel_header(self.layout)
|
||||
|
||||
@staticmethod
|
||||
def _draw_framerate_label(*args):
|
||||
@ -300,7 +300,7 @@ class RENDER_PT_encoding(RenderButtonsPanel, Panel):
|
||||
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'}
|
||||
|
||||
def draw_header_preset(self, context):
|
||||
RENDER_MT_ffmpeg_presets.draw_panel_header(self.layout)
|
||||
RENDER_PT_ffmpeg_presets.draw_panel_header(self.layout)
|
||||
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
@ -764,8 +764,8 @@ class RENDER_PT_hair(RenderButtonsPanel, Panel):
|
||||
|
||||
|
||||
classes = (
|
||||
RENDER_MT_presets,
|
||||
RENDER_MT_ffmpeg_presets,
|
||||
RENDER_PT_presets,
|
||||
RENDER_PT_ffmpeg_presets,
|
||||
RENDER_MT_framerate_presets,
|
||||
RENDER_PT_context,
|
||||
RENDER_PT_dimensions,
|
||||
|
@ -33,7 +33,7 @@ from .properties_physics_common import (
|
||||
)
|
||||
|
||||
|
||||
class SCENE_MT_units_length_presets(PresetMenu):
|
||||
class SCENE_PT_units_length_presets(PresetMenu):
|
||||
"""Unit of measure for properties that use length values"""
|
||||
bl_label = "Unit Presets"
|
||||
preset_subdir = "units_length"
|
||||
@ -83,7 +83,7 @@ class SCENE_PT_unit(SceneButtonsPanel, Panel):
|
||||
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'}
|
||||
|
||||
def draw_header_preset(self, context):
|
||||
SCENE_MT_units_length_presets.draw_panel_header(self.layout)
|
||||
SCENE_PT_units_length_presets.draw_panel_header(self.layout)
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
@ -503,7 +503,7 @@ class SCENE_PT_custom_props(SceneButtonsPanel, PropertyPanel, Panel):
|
||||
|
||||
|
||||
classes = (
|
||||
SCENE_MT_units_length_presets,
|
||||
SCENE_PT_units_length_presets,
|
||||
SCENE_UL_keying_set_paths,
|
||||
SCENE_PT_scene,
|
||||
SCENE_PT_unit,
|
||||
|
@ -279,7 +279,7 @@ class CLIP_PT_tracking_settings(CLIP_PT_tracking_panel, Panel):
|
||||
bl_category = "Track"
|
||||
|
||||
def draw_header_preset(self, context):
|
||||
CLIP_MT_tracking_settings_presets.draw_panel_header(self.layout)
|
||||
CLIP_PT_tracking_settings_presets.draw_panel_header(self.layout)
|
||||
|
||||
def draw(self, context):
|
||||
|
||||
@ -621,7 +621,7 @@ class CLIP_PT_track(CLIP_PT_tracking_panel, Panel):
|
||||
layout.separator()
|
||||
|
||||
row = layout.row(align=True)
|
||||
CLIP_MT_track_color_presets.draw_menu(row, 'Color Presets')
|
||||
CLIP_PT_track_color_presets.draw_menu(row, 'Color Presets')
|
||||
row.menu('CLIP_MT_track_color_specials', text="", icon='DOWNARROW_HLT')
|
||||
|
||||
row = layout.row()
|
||||
@ -713,7 +713,7 @@ class CLIP_PT_tracking_camera(Panel):
|
||||
return False
|
||||
|
||||
def draw_header_preset(self, context):
|
||||
CLIP_MT_camera_presets.draw_panel_header(self.layout)
|
||||
CLIP_PT_camera_presets.draw_panel_header(self.layout)
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
@ -1419,7 +1419,7 @@ class CLIP_MT_tracking_specials(Menu):
|
||||
text="Unlock Tracks").action = 'UNLOCK'
|
||||
|
||||
|
||||
class CLIP_MT_camera_presets(PresetMenu):
|
||||
class CLIP_PT_camera_presets(PresetMenu):
|
||||
"""Predefined tracking camera intrinsics"""
|
||||
bl_label = "Camera Presets"
|
||||
preset_subdir = "tracking_camera"
|
||||
@ -1427,7 +1427,7 @@ class CLIP_MT_camera_presets(PresetMenu):
|
||||
preset_add_operator = "clip.camera_preset_add"
|
||||
|
||||
|
||||
class CLIP_MT_track_color_presets(PresetMenu):
|
||||
class CLIP_PT_track_color_presets(PresetMenu):
|
||||
"""Predefined track color"""
|
||||
bl_label = "Color Presets"
|
||||
preset_subdir = "tracking_track_color"
|
||||
@ -1435,7 +1435,7 @@ class CLIP_MT_track_color_presets(PresetMenu):
|
||||
preset_add_operator = "clip.track_color_preset_add"
|
||||
|
||||
|
||||
class CLIP_MT_tracking_settings_presets(PresetMenu):
|
||||
class CLIP_PT_tracking_settings_presets(PresetMenu):
|
||||
"""Predefined tracking settings"""
|
||||
bl_label = "Tracking Presets"
|
||||
preset_subdir = "tracking_settings"
|
||||
@ -1524,9 +1524,9 @@ classes = (
|
||||
CLIP_MT_select,
|
||||
CLIP_MT_select_grouped,
|
||||
CLIP_MT_tracking_specials,
|
||||
CLIP_MT_camera_presets,
|
||||
CLIP_MT_track_color_presets,
|
||||
CLIP_MT_tracking_settings_presets,
|
||||
CLIP_PT_camera_presets,
|
||||
CLIP_PT_track_color_presets,
|
||||
CLIP_PT_tracking_settings_presets,
|
||||
CLIP_MT_track_color_specials,
|
||||
CLIP_MT_stabilize_2d_specials,
|
||||
CLIP_MT_stabilize_2d_rotation_specials,
|
||||
|
@ -290,7 +290,7 @@ class NODE_MT_node(Menu):
|
||||
layout.operator("node.read_fullsamplelayers")
|
||||
|
||||
|
||||
class NODE_MT_node_color_presets(PresetMenu):
|
||||
class NODE_PT_node_color_presets(PresetMenu):
|
||||
"""Predefined node color"""
|
||||
bl_label = "Color Presets"
|
||||
preset_subdir = "node_color"
|
||||
@ -375,7 +375,7 @@ class NODE_PT_active_node_color(Panel):
|
||||
self.layout.prop(node, "use_custom_color", text="")
|
||||
|
||||
def draw_header_preset(self, context):
|
||||
NODE_MT_node_color_presets.draw_panel_header(self.layout)
|
||||
NODE_PT_node_color_presets.draw_panel_header(self.layout)
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
@ -584,7 +584,7 @@ classes = (
|
||||
NODE_MT_view,
|
||||
NODE_MT_select,
|
||||
NODE_MT_node,
|
||||
NODE_MT_node_color_presets,
|
||||
NODE_PT_node_color_presets,
|
||||
NODE_MT_node_color_specials,
|
||||
NODE_MT_specials,
|
||||
NODE_PT_active_node_generic,
|
||||
|
@ -3511,7 +3511,7 @@ class VIEW3D_MT_edit_gpencil_interpolate(Menu):
|
||||
layout.operator("gpencil.interpolate_sequence", text="Sequence")
|
||||
|
||||
|
||||
class VIEW3D_PIE_object_mode(Menu):
|
||||
class VIEW3D_MT_object_mode_pie(Menu):
|
||||
bl_label = "Mode"
|
||||
|
||||
def draw(self, context):
|
||||
@ -3521,9 +3521,9 @@ class VIEW3D_PIE_object_mode(Menu):
|
||||
pie.operator_enum("OBJECT_OT_mode_set", "mode")
|
||||
|
||||
|
||||
class VIEW3D_PIE_view(Menu):
|
||||
class VIEW3D_MT_view_pie(Menu):
|
||||
bl_label = "View"
|
||||
bl_idname = "VIEW3D_PIE_view"
|
||||
bl_idname = "VIEW3D_MT_view_pie"
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
@ -4302,8 +4302,8 @@ classes = (
|
||||
VIEW3D_MT_edit_armature_delete,
|
||||
VIEW3D_MT_edit_gpencil_transform,
|
||||
VIEW3D_MT_edit_gpencil_interpolate,
|
||||
VIEW3D_PIE_object_mode,
|
||||
VIEW3D_PIE_view,
|
||||
VIEW3D_MT_object_mode_pie,
|
||||
VIEW3D_MT_view_pie,
|
||||
VIEW3D_PT_grease_pencil,
|
||||
VIEW3D_PT_grease_pencil_palettecolor,
|
||||
VIEW3D_PT_view3d_properties,
|
||||
|
@ -297,7 +297,7 @@ void ED_keymap_object(wmKeyConfig *keyconf)
|
||||
RNA_enum_set(kmi->ptr, "mode", OB_MODE_EDIT);
|
||||
RNA_boolean_set(kmi->ptr, "toggle", true);
|
||||
|
||||
kmi = WM_keymap_add_menu_pie(keymap, "VIEW3D_PIE_object_mode", TABKEY, KM_CLICK_DRAG, 0, 0);
|
||||
kmi = WM_keymap_add_menu_pie(keymap, "VIEW3D_MT_object_mode_pie", TABKEY, KM_CLICK_DRAG, 0, 0);
|
||||
|
||||
WM_keymap_add_item(keymap, "OBJECT_OT_origin_set", CKEY, KM_PRESS, KM_ALT | KM_SHIFT | KM_CTRL, 0);
|
||||
|
||||
|
@ -302,7 +302,7 @@ void view3d_keymap(wmKeyConfig *keyconf)
|
||||
kmi = WM_keymap_add_item(keymap, "VIEW3D_OT_view_all", CKEY, KM_PRESS, KM_SHIFT, 0);
|
||||
RNA_boolean_set(kmi->ptr, "center", true);
|
||||
|
||||
WM_keymap_add_menu_pie(keymap, "VIEW3D_PIE_view", ACCENTGRAVEKEY, KM_CLICK_DRAG, 0, 0);
|
||||
WM_keymap_add_menu_pie(keymap, "VIEW3D_MT_view_pie", ACCENTGRAVEKEY, KM_CLICK_DRAG, 0, 0);
|
||||
|
||||
/* numpad view hotkeys*/
|
||||
RNA_enum_set(WM_keymap_add_item(keymap, "VIEW3D_OT_viewnumpad", PAD0, KM_PRESS, 0, 0)->ptr, "type", RV3D_VIEW_CAMERA);
|
||||
|
Loading…
Reference in New Issue
Block a user