[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [51931] trunk/blender/source/blender/ editors/animation/keyingsets.c: Display warning/ info notification after adding properties to a Keying Set using
Joshua Leung
aligorith at gmail.com
Tue Nov 6 06:26:02 CET 2012
Revision: 51931
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=51931
Author: aligorith
Date: 2012-11-06 05:25:55 +0000 (Tue, 06 Nov 2012)
Log Message:
-----------
Display warning/info notification after adding properties to a Keying Set using
KKEY
Previously this would happen silently, so users may not have noticed that these
had been added. Let's see how this goes before seeing if a hotkey change is
needed to prevent even more errors.
Modified Paths:
--------------
trunk/blender/source/blender/editors/animation/keyingsets.c
Modified: trunk/blender/source/blender/editors/animation/keyingsets.c
===================================================================
--- trunk/blender/source/blender/editors/animation/keyingsets.c 2012-11-06 05:04:54 UTC (rev 51930)
+++ trunk/blender/source/blender/editors/animation/keyingsets.c 2012-11-06 05:25:55 UTC (rev 51931)
@@ -325,8 +325,9 @@
BKE_report(op->reports, RPT_ERROR, "Cannot add property to built in keying set");
return OPERATOR_CANCELLED;
}
- else
+ else {
ks = BLI_findlink(&scene->keyingsets, scene->active_keyingset - 1);
+ }
/* try to add to keyingset using property retrieved from UI */
uiContextActiveProperty(C, &ptr, &prop, &index);
@@ -360,9 +361,10 @@
if (success) {
/* send updates */
DAG_ids_flush_update(bmain, 0);
+ WM_event_add_notifier(C, NC_SCENE | ND_KEYINGSET, NULL);
- /* for now, only send ND_KEYS for KeyingSets */
- WM_event_add_notifier(C, NC_SCENE | ND_KEYINGSET, NULL);
+ /* show notification/report header, so that users notice that something changed */
+ BKE_reportf(op->reports, RPT_INFO, "Property added to Keying Set: '%s'", ks->name);
}
return (success) ? OPERATOR_FINISHED : OPERATOR_CANCELLED;
@@ -411,8 +413,9 @@
BKE_report(op->reports, RPT_ERROR, "Cannot remove property from built in keying set");
return OPERATOR_CANCELLED;
}
- else
+ else {
ks = BLI_findlink(&scene->keyingsets, scene->active_keyingset - 1);
+ }
/* try to add to keyingset using property retrieved from UI */
uiContextActiveProperty(C, &ptr, &prop, &index);
@@ -425,7 +428,7 @@
/* try to find a path matching this description */
ksp = BKE_keyingset_find_path(ks, ptr.id.data, ks->name, path, index, KSP_GROUP_KSNAME);
-
+
if (ksp) {
BKE_keyingset_free_path(ks, ksp);
success = 1;
@@ -440,9 +443,10 @@
if (success) {
/* send updates */
DAG_ids_flush_update(bmain, 0);
+ WM_event_add_notifier(C, NC_SCENE | ND_KEYINGSET, NULL);
- /* for now, only send ND_KEYS for KeyingSets */
- WM_event_add_notifier(C, NC_SCENE | ND_KEYINGSET, NULL);
+ /* show warning */
+ BKE_report(op->reports, RPT_INFO, "Property removed from Keying Set");
}
return (success) ? OPERATOR_FINISHED : OPERATOR_CANCELLED;
@@ -891,11 +895,13 @@
ksi->iter(ksi, C, ks);
/* if we don't have any paths now, then this still qualifies as invalid context */
+ // FIXME: we need some error conditions (to be retrieved from the iterator why this failed!)
if (ks->paths.first == NULL)
return MODIFYKEY_INVALID_CONTEXT;
}
else {
/* poll callback tells us that KeyingSet is useless in current context */
+ // FIXME: the poll callback needs to give us more info why
return MODIFYKEY_INVALID_CONTEXT;
}
}
More information about the Bf-blender-cvs
mailing list