work
save startup blend for animation tab & whatnot
This commit is contained in:
@@ -2,7 +2,7 @@ import bpy
|
||||
|
||||
from .info_messages import RENAMING_MESSAGES, WarningError_MESSAGES, INFO_MESSAGES
|
||||
from .renaming_panels import VIEW3D_PT_tools_renaming_panel, VIEW3D_PT_tools_type_suffix, VIEW3D_OT_SetVariable, \
|
||||
VIEW3D_OT_RenamingPopupOperator, OBJECT_MT_suffix_prefix_presets, AddPresetRenamingPresets
|
||||
VIEW3D_OT_RenamingPopupOperator, OBJECT_MT_suffix_prefix_presets, AddPresetRenamingPresets, RENAMING_MT_caseMenu
|
||||
from .renaming_panels import panel_func
|
||||
from .renaming_popup import VIEW3D_PT_renaming_popup, VIEW3D_PT_info_popup, VIEW3D_PT_error_popup
|
||||
from .renaming_variables import RENAMING_MT_variableMenu, VIEW3D_OT_inputVariables
|
||||
@@ -10,6 +10,7 @@ from .ui_helpers import PREFERENCES_OT_open_addon
|
||||
|
||||
classes = (
|
||||
RENAMING_MT_variableMenu,
|
||||
RENAMING_MT_caseMenu,
|
||||
VIEW3D_OT_inputVariables,
|
||||
VIEW3D_PT_error_popup,
|
||||
VIEW3D_PT_info_popup,
|
||||
@@ -42,6 +43,8 @@ def register():
|
||||
def unregister():
|
||||
from bpy.utils import unregister_class
|
||||
|
||||
VIEW3D_PT_tools_type_suffix.remove(panel_func)
|
||||
|
||||
for cls in reversed(classes):
|
||||
unregister_class(cls)
|
||||
|
||||
|
||||
@@ -15,6 +15,13 @@ types_of_selected = (
|
||||
|
||||
|
||||
def draw_renaming_panel(layout, context):
|
||||
from ..operators.version_check import update_available, latest_version_str
|
||||
|
||||
if update_available:
|
||||
row = layout.row(align=True)
|
||||
row.alert = True
|
||||
row.label(text=f"Update available: v{latest_version_str}", icon='ERROR')
|
||||
|
||||
scene = context.scene
|
||||
|
||||
row = layout.row(align=True)
|
||||
@@ -25,8 +32,18 @@ def draw_renaming_panel(layout, context):
|
||||
# SELECTED
|
||||
if str(scene.renaming_object_types) == 'OBJECT':
|
||||
layout.prop(scene, "renaming_object_types_specified", expand=True)
|
||||
layout.prop(scene, "renaming_also_rename_data")
|
||||
if str(scene.renaming_object_types) in types_of_selected:
|
||||
layout.prop(scene, "renaming_only_selection", text="Only Of Selected Objects")
|
||||
if str(scene.renaming_object_types) in ('UVMAPS', 'COLORATTRIBUTES', 'ATTRIBUTES', 'VERTEXGROUPS', 'SHAPEKEYS'):
|
||||
col = layout.column(align=True)
|
||||
if str(scene.renaming_object_types) in ('UVMAPS', 'COLORATTRIBUTES'):
|
||||
col.prop(scene, "renaming_active_only")
|
||||
row = col.row(align=True)
|
||||
row.prop(scene, "renaming_filter_by_index")
|
||||
sub = row.row(align=True)
|
||||
sub.enabled = scene.renaming_filter_by_index
|
||||
sub.prop(scene, "renaming_index_target", text="")
|
||||
elif str(scene.renaming_object_types) in types_selected:
|
||||
layout.prop(scene, "renaming_only_selection", text="Only Selected")
|
||||
elif str(scene.renaming_object_types) == 'COLLECTION':
|
||||
@@ -44,7 +61,7 @@ def draw_renaming_panel(layout, context):
|
||||
|
||||
box = layout
|
||||
# Sorting
|
||||
if str(scene.renaming_object_types) not in ['COLLECTION', 'IMAGE']:
|
||||
if str(scene.renaming_object_types) not in ['COLLECTION', 'IMAGE', 'NODE_GROUPS']:
|
||||
col = box.column(align=True)
|
||||
col.prop(scene, "renaming_sorting")
|
||||
if scene.renaming_sorting:
|
||||
@@ -140,7 +157,9 @@ def draw_renaming_panel(layout, context):
|
||||
layout.label(text="Other")
|
||||
|
||||
row = layout.row(align=True)
|
||||
row.operator("renaming.numerate", icon="LINENUMBERS_ON")
|
||||
row.operator("renaming.numerate", icon="LINENUMBERS_ON")
|
||||
row = layout.row(align=True)
|
||||
row.menu("RENAMING_MT_case_menu", text="Case Transform")
|
||||
|
||||
if str(scene.renaming_object_types) in ('DATA', 'OBJECT', 'ADDOBJECTS'):
|
||||
layout.separator()
|
||||
@@ -178,6 +197,7 @@ class VIEW3D_PT_tools_renaming_panel(bpy.types.Panel):
|
||||
op = row.operator("preferences.rename_addon_search", text="", icon='PREFERENCES')
|
||||
op.addon_name = addon_name
|
||||
op.prefs_tabs = 'UI'
|
||||
row.operator("renaming.reload_addon", text="", icon='FILE_REFRESH')
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
@@ -282,10 +302,30 @@ class VIEW3D_PT_tools_type_suffix(bpy.types.Panel):
|
||||
row.prop(scene, "renaming_suffix_prefix_lightprops", text="")
|
||||
row.operator('renaming.add_suffix_prefix_by_type', text="Light Probes").option = 'lightprops'
|
||||
|
||||
row = col.row()
|
||||
row.prop(scene, "renaming_suffix_prefix_pointcloud", text="")
|
||||
row.operator('renaming.add_suffix_prefix_by_type', text="Point Clouds").option = 'pointcloud'
|
||||
|
||||
row = col.row()
|
||||
row.operator('renaming.add_suffix_prefix_by_type', text="Rename All").option = 'all'
|
||||
|
||||
|
||||
class RENAMING_MT_caseMenu(bpy.types.Menu):
|
||||
bl_label = "Case"
|
||||
bl_idname = "RENAMING_MT_case_menu"
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
layout.operator("renaming.case_upper", text="UPPERCASE")
|
||||
layout.operator("renaming.case_lower", text="lowercase")
|
||||
layout.separator()
|
||||
layout.operator("renaming.case_pascal", text="PascalCase")
|
||||
layout.operator("renaming.case_camel", text="camelCase")
|
||||
layout.separator()
|
||||
layout.operator("renaming.case_snake", text="snake_case")
|
||||
layout.operator("renaming.case_kebab", text="kebab-case")
|
||||
|
||||
|
||||
class VIEW3D_OT_SetVariable(bpy.types.Operator):
|
||||
"""Tooltip"""
|
||||
bl_idname = "object.renaming_set_variable"
|
||||
@@ -353,6 +393,7 @@ class AddPresetRenamingPresets(AddPresetBase, Operator):
|
||||
"scene.renaming_suffix_prefix_bone",
|
||||
"scene.renaming_suffix_prefix_speakers",
|
||||
"scene.renaming_suffix_prefix_lightprops",
|
||||
"scene.renaming_suffix_prefix_pointcloud",
|
||||
]
|
||||
|
||||
# where to store the preset
|
||||
|
||||
@@ -31,10 +31,26 @@ class RENAMING_MT_variableMenu(bpy.types.Menu):
|
||||
layout.operator("object.renaming_multivariables", text="PARENT").renaming_variables = "PARENT"
|
||||
layout.operator("object.renaming_multivariables", text="DATA").renaming_variables = "DATA"
|
||||
layout.operator("object.renaming_multivariables", text="ACTIVE").renaming_variables = "ACTIVE"
|
||||
layout.operator("object.renaming_multivariables", text='FILE').renaming_variables = 'OBJECT'
|
||||
layout.operator("object.renaming_multivariables", text='OBJECT').renaming_variables = 'OBJECT'
|
||||
layout.operator("object.renaming_multivariables", text="TYPE").renaming_variables = "TYPE"
|
||||
layout.operator("object.renaming_multivariables", text="COLLECTION").renaming_variables = "COLLECTION"
|
||||
|
||||
if wm.renaming_object_types == 'NODE_GROUPS':
|
||||
layout.separator()
|
||||
layout.operator("object.renaming_multivariables", text="TYPE").renaming_variables = "TYPE"
|
||||
|
||||
if wm.renaming_object_types in (
|
||||
'UVMAPS', 'MATERIAL', 'BONE', 'MODIFIERS', 'SHAPEKEYS',
|
||||
'VERTEXGROUPS', 'PARTICLESYSTEM', 'COLORATTRIBUTES', 'ATTRIBUTES',
|
||||
):
|
||||
layout.separator()
|
||||
layout.operator("object.renaming_multivariables", text="OBJECT").renaming_variables = "OBJECT"
|
||||
layout.operator("object.renaming_multivariables", text="TYPE").renaming_variables = "TYPE"
|
||||
layout.operator("object.renaming_multivariables", text="PARENT").renaming_variables = "PARENT"
|
||||
layout.operator("object.renaming_multivariables", text="DATA").renaming_variables = "DATA"
|
||||
layout.operator("object.renaming_multivariables", text="ACTIVE").renaming_variables = "ACTIVE"
|
||||
layout.operator("object.renaming_multivariables", text="COLLECTION").renaming_variables = "COLLECTION"
|
||||
|
||||
|
||||
class VIEW3D_OT_inputVariables(bpy.types.Operator):
|
||||
"""Tooltip"""
|
||||
|
||||
@@ -22,7 +22,7 @@ class PREFERENCES_OT_open_addon(bpy.types.Operator):
|
||||
prefs.prefs_tabs = self.prefs_tabs
|
||||
|
||||
import addon_utils
|
||||
mod = addon_utils.addons_fake_modules.get('collider_tools')
|
||||
mod = addon_utils.addons_fake_modules.get('simple_renaming')
|
||||
|
||||
# mod is None the first time the operation is called :/
|
||||
if mod:
|
||||
|
||||
Reference in New Issue
Block a user