diff options
author | Campbell Barton <ideasman42@gmail.com> | 2007-05-26 16:58:46 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2007-05-26 16:58:46 +0400 |
commit | deffce3c19ced621f3432a145b5b21b323ef9d6a (patch) | |
tree | 6b62be8dad8db2462dd6e99de2cf2255e6dda943 /release | |
parent | 30dd4fafd13e84ed7363c0c0f6ab17a384098450 (diff) |
Key.c/h - Removed unneeded functions. and ipo in struct wasnt being used.
Lattice.c - removed warning
Mesh.c - (own error) when running me.update(key="...") didnt update the right keyframe.
mesh_cleanup.py - Bugfix from a report by plumiferos that started uncovering all the memory leaks.
Removing NAN verts didnt work with mesh keyframes.
Diffstat (limited to 'release')
-rw-r--r-- | release/scripts/mesh_cleanup.py | 40 |
1 files changed, 39 insertions, 1 deletions
diff --git a/release/scripts/mesh_cleanup.py b/release/scripts/mesh_cleanup.py index 80446b9cc79..1eb3e3968b2 100644 --- a/release/scripts/mesh_cleanup.py +++ b/release/scripts/mesh_cleanup.py @@ -196,7 +196,7 @@ def isnan(f): return False -def fix_nan_verts(me): +def fix_nan_verts__internal(me): rem_nan = 0 for v in me.verts: co = v.co @@ -206,9 +206,46 @@ def fix_nan_verts(me): rem_nan += 1 return rem_nan +def fix_nan_verts(me): + rem_nan = 0 + key = me.key + if key: + # Find the object, and get a mesh thats thinked to the oblink. + # this is a bit crap but needed to set the active key. + me_oblink = None + for ob in bpy.data.objects: + me_oblink = ob.getData(mesh=1) + if me_oblink == me: + me = me_oblink + break + if not me_oblink: + ob = None + + if key and ob: + blocks = key.blocks + # print blocks + orig_pin = ob.pinShape + orig_shape = ob.activeShape + orig_relative = key.relative + ob.pinShape = True + for i, block in enumerate(blocks): + ob.activeShape = i+1 + ob.makeDisplayList() + rem_nan += fix_nan_verts__internal(me) + me.update(block.name) # get the new verts + ob.pinShape = orig_pin + ob.activeShape = orig_shape + key.relative = orig_relative + + else: # No keys, simple operation + rem_nan = fix_nan_verts__internal(me) + + return rem_nan + def fix_nan_uvs(me): rem_nan = 0 if me.faceUV: + orig_uvlayer = me.activeUVLayer for uvlayer in me.getUVLayerNames(): me.activeUVLayer = uvlayer for f in me.faces: @@ -217,6 +254,7 @@ def fix_nan_uvs(me): if isnan(uv[i]): uv[i] = 0.0 rem_nan += 1 + me.activeUVLayer = orig_uvlayer return rem_nan |