Skip to content

Commit

Permalink
#473 Regenerate Name uses USER_01 for renaming instead of user set name
Browse files Browse the repository at this point in the history
  • Loading branch information
Weisl committed Jan 31, 2024
1 parent c7a1bce commit 44d803c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion collider_conversion/regenerate_name.py
@@ -1,6 +1,7 @@
from bpy.types import Operator

from ..collider_shapes.add_bounding_primitive import OBJECT_OT_add_bounding_object
from ..groups.user_groups import get_groups_identifier

default_shape = 'box_shape'
default_group = 'USER_01'
Expand Down Expand Up @@ -53,8 +54,9 @@ def execute(self, context):
# get collider shape and group and set to default there is no previous data
shape_identifier = default_shape if obj.get('collider_shape') is None else obj.get('collider_shape')
user_group = default_group if obj.get('collider_group') is None else obj.get('collider_group')
group_identifier = get_groups_identifier(user_group)

new_name = OBJECT_OT_add_bounding_object.class_collider_name(shape_identifier, user_group,
new_name = OBJECT_OT_add_bounding_object.class_collider_name(shape_identifier, group_identifier,
basename=basename)
obj.name = new_name
OBJECT_OT_add_bounding_object.set_data_name(obj, new_name, "_data")
Expand Down
4 changes: 2 additions & 2 deletions rigid_body/rigid_body.py
Expand Up @@ -3,7 +3,7 @@
class OBJECT_OT_make_rigid_body(bpy.types.Operator):
"""Tooltip"""
bl_idname = "object.set_rigid_body"
bl_label = "Make_rigid_body"
bl_label = "Set Rigid Body"
bl_description = 'Convert object to be a rigid body'

@classmethod
Expand All @@ -15,7 +15,7 @@ def execute(self, context):

for obj in bpy.context.selected_objects.copy():
new_name = obj.name

if prefs.rigid_body_naming_position == 'SUFFIX':
if not obj.name.endswith(prefs.rigid_body_extension):
new_name = obj.name + prefs.rigid_body_separator + prefs.rigid_body_extension
Expand Down

0 comments on commit 44d803c

Please sign in to comment.