Merge with trunk r39928
[blender-staging.git] / source / blender / editors / space_buttons / buttons_context.c
index 3f23b81ca3bea15d63b2ee93b243c24ae1ab01c1..ae61dfe86a002787ac490d823eb503699d056484 100644 (file)
@@ -44,6 +44,7 @@
 #include "DNA_node_types.h"
 #include "DNA_scene_types.h"
 #include "DNA_world_types.h"
+#include "DNA_speaker_types.h"
 #include "DNA_brush_types.h"
 
 #include "BKE_context.h"
@@ -188,6 +189,7 @@ static int buttons_context_path_data(ButsContextPath *path, int type)
        else if(RNA_struct_is_a(ptr->type, &RNA_Lattice) && (type == -1 || type == OB_LATTICE)) return 1;
        else if(RNA_struct_is_a(ptr->type, &RNA_Camera) && (type == -1 || type == OB_CAMERA)) return 1;
        else if(RNA_struct_is_a(ptr->type, &RNA_Lamp) && (type == -1 || type == OB_LAMP)) return 1;
+       else if(RNA_struct_is_a(ptr->type, &RNA_Speaker) && (type == -1 || type == OB_SPEAKER)) return 1;
        /* try to get an object in the path, no pinning supported here */
        else if(buttons_context_path_object(path)) {
                ob= path->ptr[path->len-1].data;
@@ -648,7 +650,7 @@ void buttons_context_compute(const bContext *C, SpaceButs *sbuts)
 
 const char *buttons_context_dir[] = {
        "world", "object", "mesh", "armature", "lattice", "curve",
-       "meta_ball", "lamp", "camera", "material", "material_slot",
+       "meta_ball", "lamp", "speaker", "camera", "material", "material_slot",
        "texture", "texture_slot", "bone", "edit_bone", "pose_bone", "particle_system", "particle_system_editable",
        "cloth", "soft_body", "fluid", "smoke", "collision", "brush", "dynamic_paint", NULL};
 
@@ -701,6 +703,10 @@ int buttons_context(const bContext *C, const char *member, bContextDataResult *r
                set_pointer_type(path, result, &RNA_Camera);
                return 1;
        }
+       else if(CTX_data_equals(member, "speaker")) {
+               set_pointer_type(path, result, &RNA_Speaker);
+               return 1;
+       }
        else if(CTX_data_equals(member, "material")) {
                set_pointer_type(path, result, &RNA_Material);
                return 1;