[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [19248] branches/blender2.5/blender/source /blender/editors/transform: Switch to non-array parameters.
Martin Poirier
theeth at yahoo.com
Tue Mar 10 19:10:24 CET 2009
Revision: 19248
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=19248
Author: theeth
Date: 2009-03-10 19:10:24 +0100 (Tue, 10 Mar 2009)
Log Message:
-----------
Switch to non-array parameters.
Add mising property find checks and remove uneeded param.
Modified Paths:
--------------
branches/blender2.5/blender/source/blender/editors/transform/transform.c
branches/blender2.5/blender/source/blender/editors/transform/transform_generics.c
branches/blender2.5/blender/source/blender/editors/transform/transform_ops.c
Modified: branches/blender2.5/blender/source/blender/editors/transform/transform.c
===================================================================
--- branches/blender2.5/blender/source/blender/editors/transform/transform.c 2009-03-10 16:57:13 UTC (rev 19247)
+++ branches/blender2.5/blender/source/blender/editors/transform/transform.c 2009-03-10 18:10:24 UTC (rev 19248)
@@ -946,9 +946,6 @@
int constraint_axis[3] = {0, 0, 0};
int proportional = 0;
- RNA_int_set(op->ptr, "mode", t->mode);
- RNA_int_set(op->ptr, "options", t->options);
-
if (t->flag & T_AUTOVALUES)
{
RNA_float_set_array(op->ptr, "value", t->auto_values);
@@ -1021,7 +1018,7 @@
void initTransform(bContext *C, TransInfo *t, wmOperator *op, wmEvent *event, int mode)
{
- int options = RNA_int_get(op->ptr, "options");
+ int options = 0;
/* added initialize, for external calls to set stuff in TransInfo, like undo string */
@@ -1170,7 +1167,7 @@
}
/* Constraint init from operator */
- if (RNA_property_is_set(op->ptr, "constraint_axis"))
+ if (RNA_struct_find_property(op->ptr, "constraint_axis") && RNA_property_is_set(op->ptr, "constraint_axis"))
{
int constraint_axis[3];
Modified: branches/blender2.5/blender/source/blender/editors/transform/transform_generics.c
===================================================================
--- branches/blender2.5/blender/source/blender/editors/transform/transform_generics.c 2009-03-10 16:57:13 UTC (rev 19247)
+++ branches/blender2.5/blender/source/blender/editors/transform/transform_generics.c 2009-03-10 18:10:24 UTC (rev 19248)
@@ -735,7 +735,7 @@
if(v3d->flag & V3D_ALIGN) t->flag |= T_V3D_ALIGN;
t->around = v3d->around;
- if (op && RNA_property_is_set(op->ptr, "constraint_orientation"))
+ if (op && RNA_struct_find_property(op->ptr, "constraint_axis") && RNA_property_is_set(op->ptr, "constraint_orientation"))
{
t->current_orientation = RNA_int_get(op->ptr, "constraint_orientation");
Modified: branches/blender2.5/blender/source/blender/editors/transform/transform_ops.c
===================================================================
--- branches/blender2.5/blender/source/blender/editors/transform/transform_ops.c 2009-03-10 16:57:13 UTC (rev 19247)
+++ branches/blender2.5/blender/source/blender/editors/transform/transform_ops.c 2009-03-10 18:10:24 UTC (rev 19248)
@@ -322,7 +322,7 @@
ot->cancel = transform_cancel;
ot->poll = ED_operator_areaactive;
- RNA_def_float_vector(ot->srna, "value", 1, NULL, -FLT_MAX, FLT_MAX, "Angle", "", -M_PI*2, M_PI*2);
+ RNA_def_float_rotation(ot->srna, "value", 1, NULL, -FLT_MAX, FLT_MAX, "Angle", "", -M_PI*2, M_PI*2);
Properties_Proportional(ot);
@@ -345,7 +345,7 @@
ot->cancel = transform_cancel;
ot->poll = ED_operator_editcurve;
- RNA_def_float_vector(ot->srna, "value", 1, NULL, -FLT_MAX, FLT_MAX, "Angle", "", -M_PI*2, M_PI*2);
+ RNA_def_float_rotation(ot->srna, "value", 1, NULL, -FLT_MAX, FLT_MAX, "Angle", "", -M_PI*2, M_PI*2);
Properties_Proportional(ot);
@@ -368,7 +368,7 @@
ot->cancel = transform_cancel;
ot->poll = ED_operator_areaactive;
- RNA_def_float_vector(ot->srna, "value", 1, NULL, -FLT_MAX, FLT_MAX, "Angle", "", 0, 1);
+ RNA_def_float_rotation(ot->srna, "value", 1, NULL, -FLT_MAX, FLT_MAX, "Angle", "", 0, 1);
Properties_Proportional(ot);
@@ -392,7 +392,7 @@
ot->cancel = transform_cancel;
ot->poll = ED_operator_areaactive;
- RNA_def_float_vector(ot->srna, "value", 1, NULL, -FLT_MAX, FLT_MAX, "Offset", "", -FLT_MAX, FLT_MAX);
+ RNA_def_float(ot->srna, "value", 0, -FLT_MAX, FLT_MAX, "Offset", "", -FLT_MAX, FLT_MAX);
Properties_Proportional(ot);
@@ -416,7 +416,7 @@
ot->cancel = transform_cancel;
ot->poll = ED_operator_editmesh;
- RNA_def_float_vector(ot->srna, "value", 1, NULL, -FLT_MAX, FLT_MAX, "Offset", "", -FLT_MAX, FLT_MAX);
+ RNA_def_float(ot->srna, "value", 0, -FLT_MAX, FLT_MAX, "Offset", "", -FLT_MAX, FLT_MAX);
Properties_Proportional(ot);
@@ -437,9 +437,7 @@
ot->cancel = transform_cancel;
ot->poll = ED_operator_areaactive;
- //RNA_def_float_percentage(ot->srna, "value", 0, 0, 1, "Percentage", "", 0, 1);
- // Switch to the previous line when get set to array works correctly
- RNA_def_float_vector(ot->srna, "value", 1, NULL, 0, 1, "Percentage", "", 0, 1);
+ RNA_def_float_percentage(ot->srna, "value", 0, 0, 1, "Percentage", "", 0, 1);
Properties_Proportional(ot);
More information about the Bf-blender-cvs
mailing list