diff options
author | Andre Susano Pinto <andresusanopinto@gmail.com> | 2008-09-15 18:20:31 +0400 |
---|---|---|
committer | Andre Susano Pinto <andresusanopinto@gmail.com> | 2008-09-15 18:20:31 +0400 |
commit | a1d611e9bd3379dd2c002cd5a895c788962a19a5 (patch) | |
tree | 3c4bedb765464e1f2deadf2b1124c1228cd3d7e7 /release | |
parent | 039ed9cb7f3edd2cae640065979aed4a7eb31103 (diff) |
svn merge -r 16231:16536 https://svn.blender.org/svnroot/bf-blender/trunk/blender
Diffstat (limited to 'release')
-rw-r--r-- | release/datafiles/blenderbuttons | bin | 69599 -> 68242 bytes | |||
-rw-r--r-- | release/scripts/mesh_cleanup.py | 32 | ||||
-rw-r--r-- | release/scripts/object_find.py | 26 | ||||
-rw-r--r-- | release/scripts/sysinfo.py | 2 |
4 files changed, 40 insertions, 20 deletions
diff --git a/release/datafiles/blenderbuttons b/release/datafiles/blenderbuttons Binary files differindex a4834091692..6993840e51f 100644 --- a/release/datafiles/blenderbuttons +++ b/release/datafiles/blenderbuttons diff --git a/release/scripts/mesh_cleanup.py b/release/scripts/mesh_cleanup.py index 608201acb98..27adca335cb 100644 --- a/release/scripts/mesh_cleanup.py +++ b/release/scripts/mesh_cleanup.py @@ -121,25 +121,29 @@ def rem_unused_materials(me): material_users= dict( [(i,0) for i in xrange(len_materials)] ) for f in me.faces: + f_mat = f.mat # Make sure the face index isnt too big. this happens sometimes. - if f.mat >= len_materials: - f.mat=0 - material_users[f.mat] += 1 + if f_mat >= len_materials: + f_mat = f.mat = 0 + material_users[f_mat] += 1 - mat_idx_subtract= 0 - reindex_mapping= dict( [(i,0) for i in xrange(len_materials)] ) - i= len_materials - while i: - i-=1 - + # mat_idx_subtract= 0 + # reindex_mapping= dict( [(i,0) for i in xrange(len_materials)] ) + + reindex_mapping_ls = range(len_materials) + for i in range(len_materials-1, -1, -1): if material_users[i] == 0: - mat_idx_subtract+=1 - reindex_mapping[i]= mat_idx_subtract - materials.pop(i) + del reindex_mapping_ls[i] + del materials[i] rem_materials+=1 + reindex_mapping= {} + + for i, mat in enumerate(reindex_mapping_ls): + reindex_mapping[mat] = i + for f in me.faces: - f.mat= f.mat - reindex_mapping[f.mat] + f.mat= reindex_mapping[f.mat] me.materials= materials return rem_materials @@ -449,4 +453,4 @@ def main(): if __name__ == '__main__': - main() + main()
\ No newline at end of file diff --git a/release/scripts/object_find.py b/release/scripts/object_find.py index 0cfd6ad1d92..f12af07e3e4 100644 --- a/release/scripts/object_find.py +++ b/release/scripts/object_find.py @@ -61,8 +61,20 @@ def get_object_images(ob): me.activeUVLayer = orig_uvlayer + + # Now get material images + for mat in me.materials: + if mat: + for mtex in mat.getTextures(): + if mtex: + tex = mtex.tex + i = tex.getImage() + if i: unique_images[i.name] = i + return unique_images.values() + + # Todo, support other object types, materials return [] @@ -118,7 +130,7 @@ def main(): def activate(ob, scn): bpy.data.scenes.active = scn scn.objects.selected = [] - scn.Layers = ob.Layers + scn.Layers = ob.Layers & (1<<20)-1 ob.sel = 1 def name_cmp(name_search, name_found): @@ -195,11 +207,13 @@ def main(): activate(ob, scn) return if NAME_TEXTURE: - for tex in mat.getTextures(): - if tex: - if name_cmp(NAME_MATERIAL, tex.name): - activate(ob, scn) - return + for mtex in mat.getTextures(): + if mtex: + tex = mtex.tex + if tex: + if name_cmp(NAME_TEXTURE, tex.name): + activate(ob, scn) + return Draw.PupMenu('No Objects Found') diff --git a/release/scripts/sysinfo.py b/release/scripts/sysinfo.py index 9f24885829c..3a671e7221e 100644 --- a/release/scripts/sysinfo.py +++ b/release/scripts/sysinfo.py @@ -94,6 +94,8 @@ output = Blender.Text.New(output_filename) output.write(header + "\n\n") +output.write("%s\n\n" % Blender.Get('buildinfo')) + output.write("Platform: %s\n========\n\n" % sys.platform) output.write("Python:\n======\n\n") |