Skip to content

Commit

Permalink
Shifter: build from selection should try to auto select the guide if …
Browse files Browse the repository at this point in the history
…nothing is selected closes #170
  • Loading branch information
miquelcampos committed Nov 7, 2022
1 parent e4eee2c commit 87a0f14
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion release/scripts/mgear/shifter/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ def buildFromSelection(self):
selection = pm.ls("guide")
if not selection:
mgear.log(
"Not guide found or selected.\n "
"Not guide found or selected.\n"
+ "Select one or more guide root or a guide model",
mgear.sev_error,
)
Expand Down
15 changes: 10 additions & 5 deletions release/scripts/mgear/shifter/guide.py
Original file line number Diff line number Diff line change
Expand Up @@ -442,11 +442,16 @@ def setFromSelection(self):
"""Set the guide hierarchy from selection."""
selection = pm.ls(selection=True)
if not selection:
mgear.log(
"Select one or more guide root or a guide model",
mgear.sev_error)
self.valid = False
return False
selection = pm.ls("guide")
if not selection:
mgear.log(
"Not guide found or selected.\n"
+ "Select one or more guide root or a guide model",
mgear.sev_error,
)
return
self.valid = False
return False

for node in selection:
self.setFromHierarchy(node, node.hasAttr("ismodel"))
Expand Down

0 comments on commit 87a0f14

Please sign in to comment.