work: restore shift+spacebar for media play/pause
maybe put in maya config? idk what funiman's preference is
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
schema_version = "1.0.0"
|
||||
|
||||
id = "simple_renaming_panel"
|
||||
version = "2.1.5"
|
||||
version = "2.1.6"
|
||||
name = "Simple Renaming"
|
||||
tagline = "Effortlessly rename multiple objects with this simple addon"
|
||||
maintainer = "Matthias Patscheider <patscheider.matthias@gmail.com>"
|
||||
|
||||
@@ -150,12 +150,20 @@ def register():
|
||||
default='X', # Set a default value
|
||||
)
|
||||
|
||||
id_store.renaming_new_name = StringProperty(name="New Name", default='')
|
||||
id_store.renaming_new_name = StringProperty(
|
||||
name="New Name",
|
||||
description="Name pattern for renaming. Use @n for a numbered variable (configure its digits in Preferences). Use # in the Numerate field (right) to set the auto-suffix digit count",
|
||||
default='',
|
||||
)
|
||||
id_store.renaming_search = StringProperty(name='Search', default='')
|
||||
id_store.renaming_replace = StringProperty(name='Replace', default='')
|
||||
id_store.renaming_suffix = StringProperty(name="Suffix", default='')
|
||||
id_store.renaming_prefix = StringProperty(name="Prefix", default='')
|
||||
id_store.renaming_numerate = StringProperty(name="Numerate", default='###')
|
||||
id_store.renaming_numerate = StringProperty(
|
||||
name="Numerate Pattern",
|
||||
description="Pattern for the auto-numeration suffix appended when Numerate is enabled. Each # represents one digit (e.g. ### → 001, 002, …). This does not affect the @n variable",
|
||||
default='###',
|
||||
)
|
||||
|
||||
id_store.renaming_sorting = bpy.props.BoolProperty(
|
||||
name="Sort Target Objects",
|
||||
@@ -169,12 +177,11 @@ def register():
|
||||
|
||||
id_store.renaming_matchcase = BoolProperty(name="Match Case", description="", default=True)
|
||||
id_store.renaming_useRegex = BoolProperty(name="Use Regex", description="", default=False)
|
||||
id_store.renaming_use_enumerate = BoolProperty(name="Numerate",
|
||||
description="Enable and Disable the numeration of objects. This can "
|
||||
"be especially useful in combination with the numeration "
|
||||
"variable @n",
|
||||
default=True,
|
||||
)
|
||||
id_store.renaming_use_enumerate = BoolProperty(
|
||||
name="Numerate",
|
||||
description="Automatically appends an incrementing numeric suffix to each renamed object. Configure the suffix format with # in the Numerate field, and the digit count for the @n variable in Preferences",
|
||||
default=True,
|
||||
)
|
||||
id_store.renaming_base_numerate = IntProperty(name="Step Size", default=1)
|
||||
id_store.renaming_start_number = IntProperty(name="Step Size", default=1)
|
||||
id_store.renaming_digits_numerate = IntProperty(name="Number Length", default=3)
|
||||
|
||||
@@ -53,7 +53,11 @@ class BUTTON_OT_change_key(bpy.types.Operator):
|
||||
|
||||
|
||||
def add_keymap():
|
||||
km = bpy.context.window_manager.keyconfigs.active.keymaps.new(name="Window")
|
||||
wm = bpy.context.window_manager
|
||||
kc = wm.keyconfigs.addon
|
||||
if kc is None:
|
||||
return
|
||||
km = kc.keymaps.new(name="Window")
|
||||
prefs = bpy.context.preferences.addons[base_package].preferences
|
||||
|
||||
kmi = km.keymap_items.new(idname='wm.call_panel', type=prefs.renaming_panel_type, value='PRESS',
|
||||
@@ -76,23 +80,34 @@ def add_key_to_keymap(idname, kmi, km, active=True):
|
||||
def remove_key(context, idname, properties_name):
|
||||
"""Removes addon hotkeys from the keymap"""
|
||||
wm = bpy.context.window_manager
|
||||
km = wm.keyconfigs.active.keymaps['Window']
|
||||
kc = wm.keyconfigs.addon
|
||||
if kc is None:
|
||||
return
|
||||
km = kc.keymaps.get('Window')
|
||||
if km is None:
|
||||
return
|
||||
|
||||
for kmi in km.keymap_items:
|
||||
if kmi.idname == idname and kmi.properties.name == properties_name:
|
||||
km.keymap_items.remove(kmi)
|
||||
items_to_remove = [kmi for kmi in km.keymap_items
|
||||
if kmi.idname == idname and kmi.properties.name == properties_name]
|
||||
for kmi in items_to_remove:
|
||||
km.keymap_items.remove(kmi)
|
||||
|
||||
|
||||
def remove_keymap():
|
||||
"""Removes keys from the keymap. Currently, this is only called when unregistering the addon. """
|
||||
# only works for menus and pie menus
|
||||
wm = bpy.context.window_manager
|
||||
km = wm.keyconfigs.active.keymaps['Window']
|
||||
kc = wm.keyconfigs.addon
|
||||
if kc is None:
|
||||
return
|
||||
km = kc.keymaps.get('Window')
|
||||
if km is None:
|
||||
return
|
||||
|
||||
for kmi in km.keymap_items:
|
||||
if hasattr(kmi.properties, 'name') and kmi.properties.name in ['VIEW3D_PT_tools_renaming_panel',
|
||||
'VIEW3D_PT_tools_type_suffix']:
|
||||
km.keymap_items.remove(kmi)
|
||||
items_to_remove = [kmi for kmi in km.keymap_items
|
||||
if hasattr(kmi.properties, 'name') and kmi.properties.name in
|
||||
{'VIEW3D_PT_tools_renaming_panel', 'VIEW3D_PT_tools_type_suffix'}]
|
||||
for kmi in items_to_remove:
|
||||
km.keymap_items.remove(kmi)
|
||||
|
||||
|
||||
class REMOVE_OT_hotkey(bpy.types.Operator):
|
||||
|
||||
@@ -28,7 +28,12 @@ def add_key(km, idname, properties_name, button_assignment_type, button_assignme
|
||||
def update_key(context, operation, operator_name, property_prefix):
|
||||
# This functions gets called when the hotkey assignment is updated in the preferences
|
||||
wm = context.window_manager
|
||||
km = wm.keyconfigs.active.keymaps["Window"]
|
||||
kc = wm.keyconfigs.addon
|
||||
if kc is None:
|
||||
return
|
||||
km = kc.keymaps.get("Window")
|
||||
if km is None:
|
||||
return
|
||||
|
||||
prefs = context.preferences.addons[base_package].preferences
|
||||
|
||||
@@ -129,7 +134,7 @@ class VIEW3D_OT_renaming_preferences(bpy.types.AddonPreferences):
|
||||
|
||||
numerate_digits: bpy.props.IntProperty(
|
||||
name="Digits",
|
||||
description="Defines digits used for numerating. Number 1 with digits 3 would result in 001",
|
||||
description="Number of digits used for the @n variable in the New Name field (e.g. @n with 3 digits: 001). To configure the auto-suffix digit count, use # characters in the Numerate field instead",
|
||||
default=3,
|
||||
)
|
||||
numerate_step: bpy.props.IntProperty(
|
||||
|
||||
Reference in New Issue
Block a user