diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2009-06-18 18:20:25 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2009-06-18 18:20:25 +0400 |
commit | 5ea992df98d152f83072e886a0b1f9464a4883d6 (patch) | |
tree | 3d3ff82225033a8307ae9fbc7de9892808db948e /source/blender/editors | |
parent | 7e57823c47761383a458665e923bb189e489c1f4 (diff) |
UI:
* Fix context.cloth, was not being set correct.
* Fix errors with context pinning, scripts should
not assume context.object to be there.
* Always show preview even if e.g. the material is not
set, to keep ID buttons from jumping while you're
using them.
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/space_buttons/buttons_context.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/source/blender/editors/space_buttons/buttons_context.c b/source/blender/editors/space_buttons/buttons_context.c index 255bee1bf5a..42180e7902f 100644 --- a/source/blender/editors/space_buttons/buttons_context.c +++ b/source/blender/editors/space_buttons/buttons_context.c @@ -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); |