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:
authorArystanbek Dyussenov <arystan.d@gmail.com>2009-09-15 22:01:18 +0400
committerArystanbek Dyussenov <arystan.d@gmail.com>2009-09-15 22:01:18 +0400
commit816377cc02fe5dd4be945c0f3d415861114b4980 (patch)
tree306e9d1363aa66bc919e43b80b3380fab9f60ea9 /source/blender/editors/animation/drivers.c
parentc8af263e5d8d9d41a757e8438cdcf3b64d57e0c0 (diff)
parentee768ada680ce0a8aa184c882005c0ef1c0140fb (diff)
Undo revision 23130 which was a merge with 2.5, a messy one because I did something wrong (`svn status` output: http://www.pasteall.org/7887).soc-2009-kazanbas
The command: svn merge -r 23130:23129 https://svn.blender.org/svnroot/bf-blender/branches/soc-2009-kazanbas
Diffstat (limited to 'source/blender/editors/animation/drivers.c')
-rw-r--r--source/blender/editors/animation/drivers.c38
1 files changed, 19 insertions, 19 deletions
diff --git a/source/blender/editors/animation/drivers.c b/source/blender/editors/animation/drivers.c
index 8b9224511ba..849e2d2eede 100644
--- a/source/blender/editors/animation/drivers.c
+++ b/source/blender/editors/animation/drivers.c
@@ -151,33 +151,33 @@ short ANIM_add_driver (ID *id, const char rna_path[], int array_index, short fla
/* create F-Curve with Driver */
fcu= verify_driver_fcurve(id, rna_path, array_index, 1);
- if (fcu && fcu->driver) {
+ if(fcu && fcu->driver) {
fcu->driver->type= type;
-
+
/* fill in current value for python */
- if (type == DRIVER_TYPE_PYTHON) {
+ if(type == DRIVER_TYPE_PYTHON) {
PropertyType proptype= RNA_property_type(prop);
- int array= RNA_property_array_length(&ptr, prop);
+ int array= RNA_property_array_length(prop);
char *expression= fcu->driver->expression;
int val, maxlen= sizeof(fcu->driver->expression);
float fval;
-
- if (proptype == PROP_BOOLEAN) {
+
+ if(proptype == PROP_BOOLEAN) {
if(!array) val= RNA_property_boolean_get(&ptr, prop);
else val= RNA_property_boolean_get_index(&ptr, prop, array_index);
-
+
BLI_strncpy(expression, (val)? "True": "False", maxlen);
}
- else if (proptype == PROP_INT) {
- if (!array) val= RNA_property_int_get(&ptr, prop);
+ else if(proptype == PROP_INT) {
+ if(!array) val= RNA_property_int_get(&ptr, prop);
else val= RNA_property_int_get_index(&ptr, prop, array_index);
-
+
BLI_snprintf(expression, maxlen, "%d", val);
}
- else if (proptype == PROP_FLOAT) {
- if (!array) fval= RNA_property_float_get(&ptr, prop);
+ else if(proptype == PROP_FLOAT) {
+ if(!array) fval= RNA_property_float_get(&ptr, prop);
else fval= RNA_property_float_get_index(&ptr, prop, array_index);
-
+
BLI_snprintf(expression, maxlen, "%.3f", fval);
}
@@ -232,7 +232,7 @@ static int add_driver_button_exec (bContext *C, wmOperator *op)
short success= 0;
int a, index, length, all= RNA_boolean_get(op->ptr, "all");
- /* try to create driver using property retrieved from UI */
+ /* try to insert keyframe using property retrieved from UI */
memset(&ptr, 0, sizeof(PointerRNA));
uiAnimContextProperty(C, &ptr, &prop, &index);
@@ -241,7 +241,7 @@ static int add_driver_button_exec (bContext *C, wmOperator *op)
if (path) {
if (all) {
- length= RNA_property_array_length(&ptr, prop);
+ length= RNA_property_array_length(prop);
if (length) index= 0;
else length= 1;
@@ -281,7 +281,7 @@ void ANIM_OT_add_driver_button (wmOperatorType *ot)
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
/* properties */
- RNA_def_boolean(ot->srna, "all", 1, "All", "Create drivers for all elements of the array.");
+ RNA_def_boolean(ot->srna, "all", 1, "All", "Insert a keyframe for all element of the array.");
}
/* Remove Driver Button Operator ------------------------ */
@@ -294,7 +294,7 @@ static int remove_driver_button_exec (bContext *C, wmOperator *op)
short success= 0;
int a, index, length, all= RNA_boolean_get(op->ptr, "all");
- /* try to find driver using property retrieved from UI */
+ /* try to insert keyframe using property retrieved from UI */
memset(&ptr, 0, sizeof(PointerRNA));
uiAnimContextProperty(C, &ptr, &prop, &index);
@@ -303,7 +303,7 @@ static int remove_driver_button_exec (bContext *C, wmOperator *op)
if (path) {
if (all) {
- length= RNA_property_array_length(&ptr, prop);
+ length= RNA_property_array_length(prop);
if(length) index= 0;
else length= 1;
@@ -344,7 +344,7 @@ void ANIM_OT_remove_driver_button (wmOperatorType *ot)
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
/* properties */
- RNA_def_boolean(ot->srna, "all", 1, "All", "Delete drivers for all elements of the array.");
+ RNA_def_boolean(ot->srna, "all", 1, "All", "Delete keyfames from all elements of the array.");
}
/* ************************************************** */