find objects by texture name raised a python error
authorCampbell Barton <ideasman42@gmail.com>
Sat, 6 Sep 2008 12:50:22 +0000 (12:50 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Sat, 6 Sep 2008 12:50:22 +0000 (12:50 +0000)
release/scripts/object_find.py

index 0cfd6ad1d92b91f2b8ca72fa59cd0fa6a8581bdc..8332eab84fb4b3a571f6e04cf668ed636d550e49 100644 (file)
@@ -195,11 +195,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')