Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2012-09-18 02:19:50 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-09-18 02:19:50 +0400
commit7f32f412ad404b0bfa1d04681f9d88fefee9c2ad (patch)
tree8242d451cece001d1c0eab070af0301bb3760667 /source/blender/editors/interface
parentd9a95f967aa239a6c0609a3f838a8a93721bdc26 (diff)
fix for bug setting single user obdata while in editmode, it didnt work (made many copies but didn't assign them), so disable it.
Diffstat (limited to 'source/blender/editors/interface')
-rw-r--r--source/blender/editors/interface/interface_templates.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c
index b7cc4dda8f6..669da9f24c2 100644
--- a/source/blender/editors/interface/interface_templates.c
+++ b/source/blender/editors/interface/interface_templates.c
@@ -35,6 +35,7 @@
#include "DNA_dynamicpaint_types.h"
#include "DNA_key_types.h"
#include "DNA_scene_types.h"
+#include "DNA_object_types.h"
#include "DNA_userdef_types.h"
#include "BLI_utildefines.h"
@@ -427,8 +428,15 @@ static void template_ID(bContext *C, uiLayout *layout, TemplateID *template, Str
TIP_("Display number of users of this data (click to make a single-user copy)"));
uiButSetNFunc(but, template_id_cb, MEM_dupallocN(template), SET_INT_IN_POINTER(UI_ID_ALONE));
- if (!id_copy(id, NULL, 1 /* test only */) || (idfrom && idfrom->lib) || !editable)
+ if (/* test only */
+ (id_copy(id, NULL, 1) == FALSE) ||
+ (idfrom && idfrom->lib) ||
+ (editable == FALSE) ||
+ /* object in editmode - don't change data */
+ (idfrom && GS(idfrom->name) == ID_OB && (((Object *)idfrom)->mode & OB_MODE_EDIT)))
+ {
uiButSetFlag(but, UI_BUT_DISABLED);
+ }
}
if (user_alert) uiButSetFlag(but, UI_BUT_REDALERT);