Merged changes in the trunk up to revision 52815.
[blender.git] / source / blender / editors / space_buttons / buttons_context.c
index a7f18c9de5322a59100c1f2ffadac94724ac1577..91f069d16de16ccd02d728f78142e2972e944302 100644 (file)
@@ -823,12 +823,12 @@ int buttons_context(const bContext *C, const char *member, bContextDataResult *r
                ButsContextTexture *ct = sbuts->texuser;
                PointerRNA *ptr;
 
-               if (ct)
-                       return 0;  /* new shading system */
-
                if ((ptr = get_pointer_type(path, &RNA_Material))) {
                        Material *ma = ptr->data;
 
+                       if (ct)
+                               return 0;  /* new shading system */
+
                        /* if we have a node material, get slot from material in material node */
                        if (ma && ma->use_nodes && ma->nodetree) {
                                /* if there's an active texture node in the node tree,
@@ -849,12 +849,18 @@ int buttons_context(const bContext *C, const char *member, bContextDataResult *r
                else if ((ptr = get_pointer_type(path, &RNA_Lamp))) {
                        Lamp *la = ptr->data;
 
+                       if (ct)
+                               return 0;  /* new shading system */
+
                        if (la)
                                CTX_data_pointer_set(result, &la->id, &RNA_LampTextureSlot, la->mtex[(int)la->texact]);
                }
                else if ((ptr = get_pointer_type(path, &RNA_World))) {
                        World *wo = ptr->data;
 
+                       if (ct)
+                               return 0;  /* new shading system */
+
                        if (wo)
                                CTX_data_pointer_set(result, &wo->id, &RNA_WorldTextureSlot, wo->mtex[(int)wo->texact]);
                }