UI:
[blender-staging.git] / source / blender / editors / space_buttons / buttons_context.c
index 255bee1bf5a7089e0daeb8d13a226998a766792d..42180e7902f409a2dff8ad01e9dab155c498bd78 100644 (file)
@@ -574,8 +574,14 @@ int buttons_context(const bContext *C, const char *member, bContextDataResult *r
                return 1;
        }
        else if(CTX_data_equals(member, "cloth")) {
-               set_pointer_type(path, result, &RNA_ClothModifier);
-               return 1;
+               PointerRNA *ptr= get_pointer_type(path, &RNA_Object);
+
+               if(ptr && ptr->data) {
+                       Object *ob= ptr->data;
+                       ModifierData *md= modifiers_findByType(ob, eModifierType_Cloth);
+                       CTX_data_pointer_set(result, &ob->id, &RNA_ClothModifier, md);
+                       return 1;
+               }
        }
        else if(CTX_data_equals(member, "soft_body")) {
                PointerRNA *ptr= get_pointer_type(path, &RNA_Object);