Skip to content

Commit

Permalink
Game Tools Export: Set index is incorrect, re-connect fails fixes #231
Browse files Browse the repository at this point in the history
  • Loading branch information
miquelcampos committed Sep 1, 2023
1 parent 1e7e342 commit 3e6e994
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions release/scripts/mgear/shifter/game_tools_disconnect.py
Original file line number Diff line number Diff line change
Expand Up @@ -488,12 +488,27 @@ def exportAssetAssembly(name, rigTopNode, meshTopNode, path, postScript=None):
# check the folder and script
# if the target name exist abort and request another name

deformer_jnts = rigTopNode.rigGroups[3].connections()[0].members()
deformer_jnts_node = None

for i in range(0, 100):
try:
potential_node = rigTopNode.rigGroups[i].connections()[0]
except IndexError:
break

if potential_node.name().endswith("_deformers_grp"):
deformer_jnts_node = potential_node
break

if deformer_jnts_node:
deformer_jnts = deformer_jnts_node.members()
else:
deformer_jnts = None

if not deformer_jnts:
pm.displayError(
"{} is empty. The tool can't find any joint".format(meshTopNode)
)

# export connections and cut joint connections
file_path = os.path.join(path, name + ".jmm")
dm_nodes = exportConnections(
Expand Down

0 comments on commit 3e6e994

Please sign in to comment.