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>2010-02-27 05:03:33 +0300
committerJoshua Leung <aligorith@gmail.com>2010-02-27 05:03:33 +0300
commitbe44ac74907b3b38d8b3a3f7626f25fced02744c (patch)
tree59b7f982532965ab287f3484dbe00760396b02b4 /source/blender
parent15db857628198195936b80115329b8356645ea68 (diff)
* Renaming some Keying Sets API functions to make the terminology more consistent in the UI
* Fixed bug with hotkeys for adding properties to Keying Sets using the KKEY over the relevant buttons. Was calling the remove callback instead.
Diffstat (limited to 'source/blender')
-rw-r--r--source/blender/blenkernel/BKE_animsys.h6
-rw-r--r--source/blender/blenkernel/intern/anim_sys.c6
-rw-r--r--source/blender/blenkernel/intern/fcurve.c4
-rw-r--r--source/blender/editors/animation/keyingsets.c32
-rw-r--r--source/blender/editors/interface/interface_handlers.c2
-rw-r--r--source/blender/editors/space_outliner/outliner.c4
-rw-r--r--source/blender/editors/transform/transform_conversions.c2
-rw-r--r--source/blender/makesrna/intern/rna_animation.c1
-rw-r--r--source/blender/makesrna/intern/rna_animation_api.c8
9 files changed, 24 insertions, 41 deletions
diff --git a/source/blender/blenkernel/BKE_animsys.h b/source/blender/blenkernel/BKE_animsys.h
index 2f2fcfcc531..f6950ba07b8 100644
--- a/source/blender/blenkernel/BKE_animsys.h
+++ b/source/blender/blenkernel/BKE_animsys.h
@@ -70,11 +70,11 @@ void BKE_animdata_make_local(struct AnimData *adt);
/* Used to create a new 'custom' KeyingSet for the user, that will be automatically added to the stack */
struct KeyingSet *BKE_keyingset_add(struct ListBase *list, const char name[], short flag, short keyingflag);
-/* Add a destination to a KeyingSet */
-void BKE_keyingset_add_destination(struct KeyingSet *ks, struct ID *id, const char group_name[], const char rna_path[], int array_index, short flag, short groupmode);
+/* Add a path to a KeyingSet */
+void BKE_keyingset_add_path(struct KeyingSet *ks, struct ID *id, const char group_name[], const char rna_path[], int array_index, short flag, short groupmode);
/* Find the destination matching the criteria given */
-struct KS_Path *BKE_keyingset_find_destination(struct KeyingSet *ks, struct ID *id, const char group_name[], const char rna_path[], int array_index, int group_mode);
+struct KS_Path *BKE_keyingset_find_path(struct KeyingSet *ks, struct ID *id, const char group_name[], const char rna_path[], int array_index, int group_mode);
/* Copy all KeyingSets in the given list */
void BKE_keyingsets_copy(struct ListBase *newlist, struct ListBase *list);
diff --git a/source/blender/blenkernel/intern/anim_sys.c b/source/blender/blenkernel/intern/anim_sys.c
index 7b2eea141f2..a880417a111 100644
--- a/source/blender/blenkernel/intern/anim_sys.c
+++ b/source/blender/blenkernel/intern/anim_sys.c
@@ -547,7 +547,7 @@ void BKE_all_animdata_fix_paths_rename (char *prefix, char *oldName, char *newNa
/* Find the first path that matches the given criteria */
// TODO: do we want some method to perform partial matches too?
-KS_Path *BKE_keyingset_find_destination (KeyingSet *ks, ID *id, const char group_name[], const char rna_path[], int array_index, int group_mode)
+KS_Path *BKE_keyingset_find_path (KeyingSet *ks, ID *id, const char group_name[], const char rna_path[], int array_index, int group_mode)
{
KS_Path *ksp;
@@ -624,7 +624,7 @@ KeyingSet *BKE_keyingset_add (ListBase *list, const char name[], short flag, sho
/* Add a destination to a KeyingSet. Nothing is returned for now...
* Checks are performed to ensure that destination is appropriate for the KeyingSet in question
*/
-void BKE_keyingset_add_destination (KeyingSet *ks, ID *id, const char group_name[], const char rna_path[], int array_index, short flag, short groupmode)
+void BKE_keyingset_add_path (KeyingSet *ks, ID *id, const char group_name[], const char rna_path[], int array_index, short flag, short groupmode)
{
KS_Path *ksp;
@@ -643,7 +643,7 @@ void BKE_keyingset_add_destination (KeyingSet *ks, ID *id, const char group_name
}
/* don't add if there is already a matching KS_Path in the KeyingSet */
- if (BKE_keyingset_find_destination(ks, id, group_name, rna_path, array_index, groupmode)) {
+ if (BKE_keyingset_find_path(ks, id, group_name, rna_path, array_index, groupmode)) {
if (G.f & G_DEBUG)
printf("ERROR: destination already exists in Keying Set \n");
return;
diff --git a/source/blender/blenkernel/intern/fcurve.c b/source/blender/blenkernel/intern/fcurve.c
index bc6f9eb5881..bd29bd55428 100644
--- a/source/blender/blenkernel/intern/fcurve.c
+++ b/source/blender/blenkernel/intern/fcurve.c
@@ -831,7 +831,7 @@ static float dtar_get_prop_val (ChannelDriver *driver, DriverTarget *dtar)
driver->flag |= DRIVER_FLAG_INVALID;
return 0.0f;
}
-
+
/* get RNA-pointer for the ID-block given in target */
RNA_id_pointer_create(id, &id_ptr);
@@ -887,7 +887,7 @@ static bPoseChannel *dtar_get_pchan_ptr (ChannelDriver *driver, DriverTarget *dt
/* check if the ID here is a valid object */
if (id && GS(id->name)) {
Object *ob= (Object *)id;
-
+
/* get pose, and subsequently, posechannel */
return get_pose_channel(ob->pose, dtar->pchan_name);
}
diff --git a/source/blender/editors/animation/keyingsets.c b/source/blender/editors/animation/keyingsets.c
index f1d84fb1066..63323a8519d 100644
--- a/source/blender/editors/animation/keyingsets.c
+++ b/source/blender/editors/animation/keyingsets.c
@@ -355,7 +355,7 @@ static int add_keyingset_button_exec (bContext *C, wmOperator *op)
}
/* add path to this setting */
- BKE_keyingset_add_destination(ks, ptr.id.data, NULL, path, index, pflag, KSP_GROUP_KSNAME);
+ BKE_keyingset_add_path(ks, ptr.id.data, NULL, path, index, pflag, KSP_GROUP_KSNAME);
ks->active_path= BLI_countlist(&ks->paths);
success= 1;
@@ -426,7 +426,7 @@ static int remove_keyingset_button_exec (bContext *C, wmOperator *op)
KS_Path *ksp;
/* try to find a path matching this description */
- ksp= BKE_keyingset_find_destination(ks, ptr.id.data, ks->name, path, index, KSP_GROUP_KSNAME);
+ ksp= BKE_keyingset_find_path(ks, ptr.id.data, ks->name, path, index, KSP_GROUP_KSNAME);
if (ksp) {
/* just free it... */
@@ -1162,31 +1162,13 @@ static int keyingset_relative_get_templates (KeyingSet *ks)
return templates;
}
-/* Check if context data is suitable for the given absolute Keying Set */
+/* Check if context data is suitable for the given Keying Set */
short keyingset_context_ok_poll (bContext *C, KeyingSet *ks)
{
- ScrArea *sa= CTX_wm_area(C);
-
- /* data retrieved from context depends on active editor */
- if (sa == NULL) return 0;
-
- switch (sa->spacetype) {
- case SPACE_VIEW3D:
- {
- Object *obact= CTX_data_active_object(C);
-
- /* if in posemode, check if 'pose-channels' requested for in KeyingSet */
- if ((obact && obact->pose) && (obact->mode & OB_MODE_POSE)) {
- /* check for posechannels */
-
- }
- else {
- /* check for selected object */
-
- }
- }
- break;
- }
+ // TODO:
+ // For 'relative' keyingsets (i.e. py-keyingsets), add a call here
+ // which basically gets a listing of all the paths to be used for this
+ // set.
return 1;
diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c
index 9624adf4879..0dd8e3d412d 100644
--- a/source/blender/editors/interface/interface_handlers.c
+++ b/source/blender/editors/interface/interface_handlers.c
@@ -4015,7 +4015,7 @@ static int ui_do_button(bContext *C, uiBlock *block, uiBut *but, wmEvent *event)
if(event->alt)
ui_but_anim_remove_keyingset(C);
else
- ui_but_anim_remove_keyingset(C);
+ ui_but_anim_add_keyingset(C);
ED_region_tag_redraw(CTX_wm_region(C));
diff --git a/source/blender/editors/space_outliner/outliner.c b/source/blender/editors/space_outliner/outliner.c
index 795546fdda7..8a07e99e280 100644
--- a/source/blender/editors/space_outliner/outliner.c
+++ b/source/blender/editors/space_outliner/outliner.c
@@ -3977,14 +3977,14 @@ static void do_outliner_keyingset_editop(SpaceOops *soops, KeyingSet *ks, ListBa
{
/* add a new path with the information obtained (only if valid) */
// TODO: what do we do with group name? for now, we don't supply one, and just let this use the KeyingSet name
- BKE_keyingset_add_destination(ks, id, NULL, path, array_index, flag, groupmode);
+ BKE_keyingset_add_path(ks, id, NULL, path, array_index, flag, groupmode);
ks->active_path= BLI_countlist(&ks->paths);
}
break;
case KEYINGSET_EDITMODE_REMOVE:
{
/* find the relevant path, then remove it from the KeyingSet */
- KS_Path *ksp= BKE_keyingset_find_destination(ks, id, NULL, path, array_index, groupmode);
+ KS_Path *ksp= BKE_keyingset_find_path(ks, id, NULL, path, array_index, groupmode);
if (ksp) {
/* free path's data */
diff --git a/source/blender/editors/transform/transform_conversions.c b/source/blender/editors/transform/transform_conversions.c
index 3aef2711370..9d236bd47db 100644
--- a/source/blender/editors/transform/transform_conversions.c
+++ b/source/blender/editors/transform/transform_conversions.c
@@ -4718,7 +4718,7 @@ void special_aftertrans_update(bContext *C, TransInfo *t)
Object *ob;
// short redrawipo=0, resetslowpar=1;
int cancelled= (t->state == TRANS_CANCEL);
- short duplicate= (t->undostr && strstr(t->undostr, "Duplicate")) ? 1 : 0;
+ short duplicate= (t->undostr && strstr(t->undostr, "Duplicate")) ? 1 : 0; /* see bugreport #21229 for reasons for this data */
/* early out when nothing happened */
if (t->total == 0 || t->mode == TFM_DUMMY)
diff --git a/source/blender/makesrna/intern/rna_animation.c b/source/blender/makesrna/intern/rna_animation.c
index 208f91a452f..453d9b9a844 100644
--- a/source/blender/makesrna/intern/rna_animation.c
+++ b/source/blender/makesrna/intern/rna_animation.c
@@ -249,6 +249,7 @@ static void rna_def_keyingset(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Active Path Index", "Current Keying Set index");
/* Flags */
+ // XXX: depreceated
prop= RNA_def_property(srna, "builtin", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", KEYINGSET_BUILTIN);
diff --git a/source/blender/makesrna/intern/rna_animation_api.c b/source/blender/makesrna/intern/rna_animation_api.c
index 7ce93658789..208e3b9ca4c 100644
--- a/source/blender/makesrna/intern/rna_animation_api.c
+++ b/source/blender/makesrna/intern/rna_animation_api.c
@@ -41,7 +41,7 @@
#include "BKE_animsys.h"
-static void rna_KeyingSet_add_destination(KeyingSet *keyingset, ReportList *reports,
+static void rna_KeyingSet_add_path(KeyingSet *keyingset, ReportList *reports,
ID *id, char rna_path[], int array_index, int entire_array,
int grouping_method, char group_name[])
{
@@ -53,11 +53,11 @@ static void rna_KeyingSet_add_destination(KeyingSet *keyingset, ReportList *repo
/* if data is valid, call the API function for this */
if (keyingset) {
- BKE_keyingset_add_destination(keyingset, id, group_name, rna_path, array_index, flag, grouping_method);
+ BKE_keyingset_add_path(keyingset, id, group_name, rna_path, array_index, flag, grouping_method);
keyingset->active_path= BLI_countlist(&keyingset->paths);
}
else {
- BKE_report(reports, RPT_ERROR, "Keying Set Destination could not be added.");
+ BKE_report(reports, RPT_ERROR, "Keying Set Path could not be added.");
}
}
@@ -69,7 +69,7 @@ void RNA_api_keyingset(StructRNA *srna)
PropertyRNA *parm;
/* Add Destination */
- func= RNA_def_function(srna, "add_destination", "rna_KeyingSet_add_destination");
+ func= RNA_def_function(srna, "add_destination", "rna_KeyingSet_add_path");
RNA_def_function_ui_description(func, "Add a new destination for the Keying Set.");
RNA_def_function_flag(func, FUNC_USE_REPORTS);
/* ID-block for target */