[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [18689] branches/blender2.5/blender/source /blender: Graph Editor - Selection Tools
Joshua Leung
aligorith at gmail.com
Tue Jan 27 06:04:34 CET 2009
Revision: 18689
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=18689
Author: aligorith
Date: 2009-01-27 06:04:23 +0100 (Tue, 27 Jan 2009)
Log Message:
-----------
Graph Editor - Selection Tools
* Mouse-Select and DeSelect All work again
* Added access to constraint 'influence' value
Modified Paths:
--------------
branches/blender2.5/blender/source/blender/blenkernel/intern/anim_sys.c
branches/blender2.5/blender/source/blender/blenkernel/intern/ipo.c
branches/blender2.5/blender/source/blender/editors/space_action/action_select.c
branches/blender2.5/blender/source/blender/editors/space_ipo/ipo_draw.c
branches/blender2.5/blender/source/blender/editors/space_ipo/ipo_edit.c
branches/blender2.5/blender/source/blender/editors/space_ipo/ipo_intern.h
branches/blender2.5/blender/source/blender/editors/space_ipo/ipo_ops.c
branches/blender2.5/blender/source/blender/editors/space_ipo/ipo_select.c
branches/blender2.5/blender/source/blender/makesrna/intern/rna_constraint.c
Modified: branches/blender2.5/blender/source/blender/blenkernel/intern/anim_sys.c
===================================================================
--- branches/blender2.5/blender/source/blender/blenkernel/intern/anim_sys.c 2009-01-27 04:37:12 UTC (rev 18688)
+++ branches/blender2.5/blender/source/blender/blenkernel/intern/anim_sys.c 2009-01-27 05:04:23 UTC (rev 18689)
@@ -183,8 +183,8 @@
}
-/* Write the given value to a setting using RNA */
-static void animsys_write_rna_setting (PointerRNA *ptr, char *path, int array_index, float value)
+/* Write the given value to a setting using RNA, and return success */
+static short animsys_write_rna_setting (PointerRNA *ptr, char *path, int array_index, float value)
{
PropertyRNA *prop;
PointerRNA new_ptr;
@@ -222,7 +222,16 @@
break;
}
}
+
+ /* successful */
+ // XXX should the unhandled case also be successful?
+ return 1;
}
+ else {
+ /* failed to get path */
+ printf("Animato: Invalid path '%s[%d]' \n", path, array_index);
+ return 0;
+ }
}
/* Simple replacement based data-setting of the FCurve using RNA */
Modified: branches/blender2.5/blender/source/blender/blenkernel/intern/ipo.c
===================================================================
--- branches/blender2.5/blender/source/blender/blenkernel/intern/ipo.c 2009-01-27 04:37:12 UTC (rev 18688)
+++ branches/blender2.5/blender/source/blender/blenkernel/intern/ipo.c 2009-01-27 05:04:23 UTC (rev 18689)
@@ -250,6 +250,21 @@
return NULL;
}
+/* Constraint types */
+static char *constraint_adrcodes_to_paths (int adrcode, int *array_index)
+{
+ /* set array index like this in-case nothing sets it correctly */
+ *array_index= 0;
+
+ /* result depends on adrcode */
+ switch (adrcode) {
+ case CO_ENFORCE:
+ return "influence";
+ case CO_HEADTAIL: // XXX this needs to be wrapped in RNA.. probably then this path will be invalid
+ return "data.head_tail";
+ }
+}
+
/* ShapeKey types
* NOTE: as we don't have access to the keyblock where the data comes from (for now),
* we'll just use numerical indicies for now...
Modified: branches/blender2.5/blender/source/blender/editors/space_action/action_select.c
===================================================================
--- branches/blender2.5/blender/source/blender/editors/space_action/action_select.c 2009-01-27 04:37:12 UTC (rev 18688)
+++ branches/blender2.5/blender/source/blender/editors/space_action/action_select.c 2009-01-27 05:04:23 UTC (rev 18689)
@@ -521,7 +521,7 @@
*/
/* defines for column-select mode */
-EnumPropertyItem prop_column_select_types[] = {
+static EnumPropertyItem prop_column_select_types[] = {
{ACTKEYS_COLUMNSEL_KEYS, "KEYS", "On Selected Keyframes", ""},
{ACTKEYS_COLUMNSEL_CFRA, "CFRA", "On Current Frame", ""},
{ACTKEYS_COLUMNSEL_MARKERS_COLUMN, "MARKERS_COLUMN", "On Selected Markers", ""},
@@ -750,7 +750,7 @@
*/
/* defines for left-right select tool */
-EnumPropertyItem prop_leftright_select_types[] = {
+static EnumPropertyItem prop_leftright_select_types[] = {
{ACTKEYS_LRSEL_TEST, "CHECK", "Check if Select Left or Right", ""},
{ACTKEYS_LRSEL_NONE, "OFF", "Don't select", ""},
{ACTKEYS_LRSEL_LEFT, "LEFT", "Before current frame", ""},
@@ -978,12 +978,13 @@
Object *nob= ANIM_nla_mapping_get(ac, ale);
/* set frame for validation callback to refer to */
+ // XXX have a more sensitive range?
if (nob)
bed.f1= get_action_frame(nob, selx);
else
bed.f1= selx;
- /* select elements with frame number matching cfraelem */
+ /* select elements with frame number matching cfra */
ANIM_fcurve_keys_bezier_loop(&bed, ale->key_data, ok_cb, select_cb, NULL);
#if 0 // XXX reenable when Grease Pencil stuff is back
Modified: branches/blender2.5/blender/source/blender/editors/space_ipo/ipo_draw.c
===================================================================
--- branches/blender2.5/blender/source/blender/editors/space_ipo/ipo_draw.c 2009-01-27 04:37:12 UTC (rev 18688)
+++ branches/blender2.5/blender/source/blender/editors/space_ipo/ipo_draw.c 2009-01-27 05:04:23 UTC (rev 18689)
@@ -125,16 +125,15 @@
static GLuint displist=0;
/* initialise round circle shape */
- // FIXME: sometimes, this will draw incorrectly (i.e. a scaled copy shows up at the origin)
if (displist == 0) {
GLUquadricObj *qobj;
displist= glGenLists(1);
- glNewList(displist, GL_COMPILE_AND_EXECUTE);
+ glNewList(displist, GL_COMPILE);
qobj = gluNewQuadric();
gluQuadricDrawStyle(qobj, GLU_SILHOUETTE);
- gluDisk(qobj, 0.07, 0.6, 8, 1);
+ gluDisk(qobj, 0, 0.7, 8, 1);
gluDeleteQuadric(qobj);
glEndList();
Modified: branches/blender2.5/blender/source/blender/editors/space_ipo/ipo_edit.c
===================================================================
--- branches/blender2.5/blender/source/blender/editors/space_ipo/ipo_edit.c 2009-01-27 04:37:12 UTC (rev 18688)
+++ branches/blender2.5/blender/source/blender/editors/space_ipo/ipo_edit.c 2009-01-27 05:04:23 UTC (rev 18689)
@@ -507,15 +507,10 @@
return OPERATOR_CANCELLED;
/* copy keyframes */
- if (ac.datatype == ANIMCONT_GPENCIL) {
- // FIXME...
+ if (copy_graph_keys(&ac)) {
+ // XXX errors - need a way to inform the user
+ printf("Action Copy: No keyframes copied to copy-paste buffer\n");
}
- else {
- if (copy_graph_keys(&ac)) {
- // XXX errors - need a way to inform the user
- printf("Action Copy: No keyframes copied to copy-paste buffer\n");
- }
- }
/* set notifier tha things have changed */
ANIM_animdata_send_notifiers(C, &ac, ANIM_CHANGED_KEYFRAMES_VALUES);
@@ -548,15 +543,10 @@
return OPERATOR_CANCELLED;
/* paste keyframes */
- if (ac.datatype == ANIMCONT_GPENCIL) {
- // FIXME...
+ if (paste_graph_keys(&ac)) {
+ // XXX errors - need a way to inform the user
+ printf("Action Paste: Nothing to paste, as Copy-Paste buffer was empty.\n");
}
- else {
- if (paste_graph_keys(&ac)) {
- // XXX errors - need a way to inform the user
- printf("Action Paste: Nothing to paste, as Copy-Paste buffer was empty.\n");
- }
- }
/* validate keyframes after editing */
ANIM_editkeyframes_refresh(&ac);
@@ -590,18 +580,12 @@
int filter;
/* filter data */
- if (ac->datatype == ANIMCONT_GPENCIL)
- filter= (ANIMFILTER_VISIBLE | ANIMFILTER_CURVEVISIBLE| ANIMFILTER_FOREDIT);
- else
- filter= (ANIMFILTER_VISIBLE | ANIMFILTER_CURVEVISIBLE| ANIMFILTER_FOREDIT | ANIMFILTER_CURVESONLY);
+ filter= (ANIMFILTER_VISIBLE | ANIMFILTER_CURVEVISIBLE| ANIMFILTER_FOREDIT | ANIMFILTER_CURVESONLY);
ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype);
/* loop through filtered data and delete selected keys */
for (ale= anim_data.first; ale; ale= ale->next) {
- //if (ale->type == ANIMTYPE_GPLAYER)
- // delete_gplayer_frames((bGPDlayer *)ale->data);
- //else
- delete_fcurve_keys((FCurve *)ale->key_data); // XXX... this doesn't delete empty curves anymore
+ delete_fcurve_keys((FCurve *)ale->key_data); // XXX... this doesn't delete empty curves anymore
}
/* free filtered list */
@@ -674,8 +658,6 @@
/* get editor data */
if (ANIM_animdata_get_context(C, &ac) == 0)
return OPERATOR_CANCELLED;
- if (ac.datatype == ANIMCONT_GPENCIL)
- return OPERATOR_PASS_THROUGH;
/* get cleaning threshold */
thresh= RNA_float_get(op->ptr, "threshold");
@@ -801,8 +783,6 @@
/* get editor data */
if (ANIM_animdata_get_context(C, &ac) == 0)
return OPERATOR_CANCELLED;
- if (ac.datatype == ANIMCONT_GPENCIL)
- return OPERATOR_PASS_THROUGH;
/* sample keyframes */
sample_graph_keys(&ac);
@@ -875,8 +855,6 @@
/* get editor data */
if (ANIM_animdata_get_context(C, &ac) == 0)
return OPERATOR_CANCELLED;
- if (ac.datatype == ANIMCONT_GPENCIL)
- return OPERATOR_PASS_THROUGH;
/* get handle setting mode */
mode= RNA_enum_get(op->ptr, "type");
@@ -953,8 +931,6 @@
/* get editor data */
if (ANIM_animdata_get_context(C, &ac) == 0)
return OPERATOR_CANCELLED;
- if (ac.datatype == ANIMCONT_GPENCIL)
- return OPERATOR_PASS_THROUGH;
/* get handle setting mode */
mode= RNA_enum_get(op->ptr, "type");
@@ -1051,8 +1027,6 @@
/* get editor data */
if (ANIM_animdata_get_context(C, &ac) == 0)
return OPERATOR_CANCELLED;
- if (ac.datatype == ANIMCONT_GPENCIL)
- return OPERATOR_PASS_THROUGH;
/* get handle setting mode */
mode= RNA_enum_get(op->ptr, "type");
@@ -1181,10 +1155,7 @@
BeztEditFunc edit_cb;
/* filter data */
- if (ac->datatype == ANIMCONT_GPENCIL)
- filter= (ANIMFILTER_VISIBLE | ANIMFILTER_CURVEVISIBLE| ANIMFILTER_FOREDIT);
- else
- filter= (ANIMFILTER_VISIBLE | ANIMFILTER_CURVEVISIBLE| ANIMFILTER_FOREDIT | ANIMFILTER_CURVESONLY);
+ filter= (ANIMFILTER_VISIBLE | ANIMFILTER_CURVEVISIBLE| ANIMFILTER_FOREDIT | ANIMFILTER_CURVESONLY);
ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype);
/* get beztriple editing callbacks */
@@ -1202,8 +1173,6 @@
ANIM_fcurve_keys_bezier_loop(&bed, ale->key_data, NULL, edit_cb, calchandles_fcurve);
ANIM_nla_mapping_apply_fcurve(nob, ale->key_data, 1, 1);
}
- //else if (ale->type == ACTTYPE_GPLAYER)
- // snap_gplayer_frames(ale->data, mode);
else
ANIM_fcurve_keys_bezier_loop(&bed, ale->key_data, NULL, edit_cb, calchandles_fcurve);
}
@@ -1302,10 +1271,7 @@
}
/* filter data */
- if (ac->datatype == ANIMCONT_GPENCIL)
- filter= (ANIMFILTER_VISIBLE | ANIMFILTER_CURVEVISIBLE| ANIMFILTER_FOREDIT);
- else
- filter= (ANIMFILTER_VISIBLE | ANIMFILTER_CURVEVISIBLE| ANIMFILTER_FOREDIT | ANIMFILTER_CURVESONLY);
+ filter= (ANIMFILTER_VISIBLE | ANIMFILTER_CURVEVISIBLE| ANIMFILTER_FOREDIT | ANIMFILTER_CURVESONLY);
ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype);
/* mirror keyframes */
@@ -1317,8 +1283,6 @@
ANIM_fcurve_keys_bezier_loop(&bed, ale->key_data, NULL, edit_cb, calchandles_fcurve);
ANIM_nla_mapping_apply_fcurve(nob, ale->key_data, 1, 1);
}
- //else if (ale->type == ACTTYPE_GPLAYER)
- // snap_gplayer_frames(ale->data, mode);
else
ANIM_fcurve_keys_bezier_loop(&bed, ale->key_data, NULL, edit_cb, calchandles_fcurve);
}
Modified: branches/blender2.5/blender/source/blender/editors/space_ipo/ipo_intern.h
===================================================================
--- branches/blender2.5/blender/source/blender/editors/space_ipo/ipo_intern.h 2009-01-27 04:37:12 UTC (rev 18688)
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list