Bug #1133

Unassigned variable scales in proxy.py

Added by Aranuvir # almost 2 years ago.

Status:NewStart date:02/22/2017
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:Code correctness
Target version:MakeHuman 1.1.2

Description

From MakeHuman log:

Problem loading binary proxy: free variable 'scales' referenced before assignment in enclosing scope
Traceback (most recent call last):
  File "./shared/proxy.py", line 311, in loadProxy
    proxy = loadBinaryProxy(npzpath, human, type)
  File "./shared/proxy.py", line 632, in loadBinaryProxy
    proxy.tmatrix.fromNumpyStruct(npzfile)
  File "./shared/proxy.py", line 823, in fromNumpyStruct
    self.lShearData = _unpack_shears(shears, vidxs)
  File "./shared/proxy.py", line 802, in _unpack_shears
    if i >= min(len(scales)/2, len(vidxs)/2):
NameError: free variable 'scales' referenced before assignment in enclosing scope

The code

[...]
            for i in range(3):
                if i >= min(len(scales)/2, len(vidxs)/2):
                    break
[...]

should probably be

[...]
            for i in range(3):
                if i >= min(len(shears)/2, len(vidxs)/2):
                    break
[...]

Also available in: Atom