Skip to content
This repository has been archived by the owner on Oct 7, 2021. It is now read-only.

replaceShape fails if an existing shape doesn't exist #43

Open
chris-lesage opened this issue Nov 22, 2019 · 1 comment
Open

replaceShape fails if an existing shape doesn't exist #43

chris-lesage opened this issue Nov 22, 2019 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@chris-lesage
Copy link
Contributor

chris-lesage commented Nov 22, 2019

scripts/mgear/rigbits/init.py

In the function replaceShape() line 410. If a pre-existing shape doesn't exist on the target node, it fails with an error and then leaves remaining duplicate nodes from the function leftover in the scene. This is because the variable cnx is only declared if a shape is found. But cnx gets called outside the scope of "if shape:"

Suggested fix.
Declare "cnx = None" or "cnx = []" at the beginning of the function.
Then, if a shape doesn't already exist, it will just add it to the transform.

(I'll do a PR in December if no one else gets to it.)

@miquelcampos miquelcampos self-assigned this Nov 23, 2019
@miquelcampos
Copy link
Member

Thanks @chris-lesage I will do the suggested fix on Monday :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants