From 5bebd5a1f5ab16df1c788cef79408314b88c98d0 Mon Sep 17 00:00:00 2001 From: Matthias Patscheider Date: Wed, 31 Jan 2024 17:39:54 +0200 Subject: [PATCH] #474 Fix Suffix --- collider_shapes/add_bounding_primitive.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/collider_shapes/add_bounding_primitive.py b/collider_shapes/add_bounding_primitive.py index da306cf..eb53502 100644 --- a/collider_shapes/add_bounding_primitive.py +++ b/collider_shapes/add_bounding_primitive.py @@ -1112,6 +1112,21 @@ def set_object_collider_group(self, obj): def set_collider_name(self, new_collider, parent_name): new_name = self.collider_name(basename=parent_name) + prefs = self.prefs + + #Ignore rigid body in base_name + if prefs.rigid_body_extension: + if prefs.rigid_body_naming_position == 'SUFFIX': + end = prefs.rigid_body_separator + prefs.rigid_body_extension + if new_name.endswith(end): + new_name = new_name[:-(len(end))] + + else: + start = prefs.rigid_body_extension + prefs.rigid_body_separator + if new_name.startswith(start): + new_name = new_name[len(start):] + + new_collider.name = new_name self.set_data_name(new_collider, new_name, self.data_suffix)