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:
authorMartin Poirier <theeth@yahoo.com>2009-03-10 21:10:24 +0300
committerMartin Poirier <theeth@yahoo.com>2009-03-10 21:10:24 +0300
commita1082a6d32b980556b099f5c9f53c35c2654c42b (patch)
tree87a693a8c6e86f7c5f920da6573cf9fbef3fb9c1
parentd42e3c7be9d1b8849e3812b00a1572e754399397 (diff)
Switch to non-array parameters.
Add mising property find checks and remove uneeded param.
-rw-r--r--source/blender/editors/transform/transform.c7
-rw-r--r--source/blender/editors/transform/transform_generics.c2
-rw-r--r--source/blender/editors/transform/transform_ops.c14
3 files changed, 9 insertions, 14 deletions
diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c
index c721c30d974..3e7188676d1 100644
--- a/source/blender/editors/transform/transform.c
+++ b/source/blender/editors/transform/transform.c
@@ -946,9 +946,6 @@ void saveTransform(bContext *C, TransInfo *t, wmOperator *op)
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 saveTransform(bContext *C, TransInfo *t, wmOperator *op)
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 @@ void initTransform(bContext *C, TransInfo *t, wmOperator *op, wmEvent *event, in
}
/* 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];
diff --git a/source/blender/editors/transform/transform_generics.c b/source/blender/editors/transform/transform_generics.c
index 501afd6381d..2bc177c4330 100644
--- a/source/blender/editors/transform/transform_generics.c
+++ b/source/blender/editors/transform/transform_generics.c
@@ -735,7 +735,7 @@ void initTransInfo (bContext *C, TransInfo *t, wmOperator *op, wmEvent *event)
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");
diff --git a/source/blender/editors/transform/transform_ops.c b/source/blender/editors/transform/transform_ops.c
index 1228ba1a6dd..719ae144913 100644
--- a/source/blender/editors/transform/transform_ops.c
+++ b/source/blender/editors/transform/transform_ops.c
@@ -322,7 +322,7 @@ void TFM_OT_rotation(struct wmOperatorType *ot)
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 @@ void TFM_OT_tilt(struct wmOperatorType *ot)
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 @@ void TFM_OT_warp(struct wmOperatorType *ot)
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 @@ void TFM_OT_shear(struct wmOperatorType *ot)
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 @@ void TFM_OT_shrink_fatten(struct wmOperatorType *ot)
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 @@ void TFM_OT_tosphere(struct wmOperatorType *ot)
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);