Skip to content

Commit

Permalink
Shifter naming rule issue: If the {index} is removed fixes #221
Browse files Browse the repository at this point in the history
  • Loading branch information
miquelcampos committed Sep 1, 2023
1 parent 809cdbf commit d64331f
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions release/scripts/mgear/shifter/component/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -858,9 +858,6 @@ def addCtl(
if "degree" not in kwargs.keys():
kwargs["degree"] = 1

# print name
# fullName = self.getName(name)

# remove the _ctl hardcoded in component name
if name.endswith("_ctl"):
name = name[:-4]
Expand All @@ -870,15 +867,16 @@ def addCtl(
name = name[:-3]

# NOTE: this is a dirty workaround to keep backwards compatibility on
# control_01 component where the description of the cotrol was just
# the ctl suffix.
# control_01 and other component where the description of the cotrol
# was just the ctl suffix.
rule = self.options["ctl_name_rule"]
if not name:
if rule == naming.DEFAULT_NAMING_RULE:
rule = r"{component}_{side}{index}_{extension}"
else:
# this ensure we always have name if the naming rule is custom
name = "control"
# Replace '{description}_' with ''
rule = rule.replace(r"{description}_", "")
# Replace '_{description}' with ''
rule = rule.replace(r"_{description}", "")
# Replace '{description}' with ''
rule = rule.replace(r"{description}", "")

fullName = self.getName(
name,
Expand Down

0 comments on commit d64331f

Please sign in to comment.