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:
authorJoshua Leung <aligorith@gmail.com>2014-06-26 06:39:44 +0400
committerJoshua Leung <aligorith@gmail.com>2014-06-26 06:39:44 +0400
commit11e0dddf91f76065a6dd782163eb3b75745a6b2e (patch)
treeb3f20555cc1fbb0fbfb04c006a158f5afbc184f6 /source/blender/editors/object/object_select.c
parent7d99a4ded9d3d24c24ea2d5bcc488469cf60fa4a (diff)
Bugfix T40801: Select grouped objects by Keying Set not working with builtin Keying Sets
Most of the default builtin Keying Sets (e.g. Loc, Rot, Available, etc.) depend on the currently selected objects, making them unsuitable for use with this feature. As a result, this feature would silently fail. This commit adds some error messages which at least let users know what's going on so that they can make other plans
Diffstat (limited to 'source/blender/editors/object/object_select.c')
-rw-r--r--source/blender/editors/object/object_select.c21
1 files changed, 18 insertions, 3 deletions
diff --git a/source/blender/editors/object/object_select.c b/source/blender/editors/object/object_select.c
index a5a96c694f1..8a98f38664f 100644
--- a/source/blender/editors/object/object_select.c
+++ b/source/blender/editors/object/object_select.c
@@ -776,14 +776,29 @@ static bool select_grouped_gameprops(bContext *C, Object *ob)
return changed;
}
-static bool select_grouped_keyingset(bContext *C, Object *UNUSED(ob))
+static bool select_grouped_keyingset(bContext *C, ReportList *reports, Object *UNUSED(ob))
{
KeyingSet *ks = ANIM_scene_get_active_keyingset(CTX_data_scene(C));
bool changed = false;
/* firstly, validate KeyingSet */
- if ((ks == NULL) || (ANIM_validate_keyingset(C, NULL, ks) != 0))
+ if (ks == NULL) {
+ BKE_report(reports, RPT_ERROR, "No active Keying Set to use");
+ return false;
+ }
+ else if (ANIM_validate_keyingset(C, NULL, ks) != 0) {
+ if (ks->paths.first == NULL) {
+ if ((ks->flag & KEYINGSET_ABSOLUTE) == 0) {
+ BKE_report(reports, RPT_ERROR,
+ "Use another Keying Set, as the active one depends on the currently "
+ "selected objects or cannot find any targets due to unsuitable context");
+ }
+ else {
+ BKE_report(reports, RPT_ERROR, "Keying Set does not contain any paths");
+ }
+ }
return 0;
+ }
/* select each object that Keying Set refers to */
/* TODO: perhaps to be more in line with the rest of these, we should only take objects
@@ -852,7 +867,7 @@ static int object_select_grouped_exec(bContext *C, wmOperator *op)
else if (nr == 9) changed |= select_grouped_index_object(C, ob);
else if (nr == 10) changed |= select_grouped_color(C, ob);
else if (nr == 11) changed |= select_grouped_gameprops(C, ob);
- else if (nr == 12) changed |= select_grouped_keyingset(C, ob);
+ else if (nr == 12) changed |= select_grouped_keyingset(C, op->reports, ob);
else if (nr == 13) changed |= select_similar_lamps(C, ob);
else if (nr == 14) changed |= select_similar_pass_index(C, ob);