diff options
author | Campbell Barton <ideasman42@gmail.com> | 2008-09-06 21:04:54 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2008-09-06 21:04:54 +0400 |
commit | c7fe2199a736eff39fba5e5400a150511815525d (patch) | |
tree | f0c1720be5adf99ccd53803580aff9d68036d4d9 /release/scripts | |
parent | 601979fc15ccbc69b96f62563638c8b755152942 (diff) |
object_find, didnt get images from an objects material textures
KX_PythonInit.cpp - own error in recent commit.
Diffstat (limited to 'release/scripts')
-rw-r--r-- | release/scripts/object_find.py | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/release/scripts/object_find.py b/release/scripts/object_find.py index 8332eab84fb..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): |