Merge with trunk r39928
[blender-staging.git] / source / blender / editors / space_buttons / buttons_context.c
index 9d2ac3fd8e2aeadb61a02effa4c14279ca5ad7b7..ae61dfe86a002787ac490d823eb503699d056484 100644 (file)
@@ -652,7 +652,7 @@ const char *buttons_context_dir[] = {
        "world", "object", "mesh", "armature", "lattice", "curve",
        "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", NULL};
+       "cloth", "soft_body", "fluid", "smoke", "collision", "brush", "dynamic_paint", NULL};
 
 int buttons_context(const bContext *C, const char *member, bContextDataResult *result)
 {
@@ -868,6 +868,16 @@ int buttons_context(const bContext *C, const char *member, bContextDataResult *r
                set_pointer_type(path, result, &RNA_Brush);
                return 1;
        }
+       else if(CTX_data_equals(member, "dynamic_paint")) {
+               PointerRNA *ptr= get_pointer_type(path, &RNA_Object);
+
+               if(ptr && ptr->data) {
+                       Object *ob= ptr->data;
+                       ModifierData *md= modifiers_findByType(ob, eModifierType_DynamicPaint);
+                       CTX_data_pointer_set(result, &ob->id, &RNA_DynamicPaintModifier, md);
+                       return 1;
+               }
+       }
        else {
                return 0; /* not found */
        }