object_find, didnt get images from an objects material textures
authorCampbell Barton <ideasman42@gmail.com>
Sat, 6 Sep 2008 17:04:54 +0000 (17:04 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Sat, 6 Sep 2008 17:04:54 +0000 (17:04 +0000)
KX_PythonInit.cpp - own error in recent commit.

release/scripts/object_find.py
source/gameengine/Ketsji/KX_PythonInit.cpp

index 8332eab84fb4b3a571f6e04cf668ed636d550e49..f12af07e3e435bcca5eb72a8e6948a60d3c7a496 100644 (file)
@@ -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):
index fe6294e76262080b64e40319c988419801dc7663..eb0052d71ff6f0998eefb7d1d936b3ef210acaaa 100644 (file)
@@ -696,7 +696,7 @@ static PyObject* gPySetGLSLMaterialSetting(PyObject*,
        char *setting;
        int enable, flag;
 
-       if (PyArg_ParseTuple(args,"si",&setting,&enable))
+       if (!PyArg_ParseTuple(args,"si",&setting,&enable))
                return NULL;
        
        flag = getGLSLSettingFlag(setting);