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
path: root/source
diff options
context:
space:
mode:
authorTon Roosendaal <ton@blender.org>2011-01-08 19:54:38 +0300
committerTon Roosendaal <ton@blender.org>2011-01-08 19:54:38 +0300
commit6594b591de9fbbacb1c148f891cdfc963ba61a72 (patch)
treec0b2daa94e65da1c052ddf9d389d0f090bdc9675 /source
parent17dd29cb850927bf47e86db48e2d33c544cfc786 (diff)
Proportional editing:
- Proportional circle size is printed in header Allows you to find out if you make it smaller when it's large - Proportional size is clipped with view3d clip-end now - Added the size to rna, so you can inspect values via UI and py.
Diffstat (limited to 'source')
-rw-r--r--source/blender/editors/transform/transform.c13
-rw-r--r--source/blender/makesrna/intern/rna_scene.c5
2 files changed, 18 insertions, 0 deletions
diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c
index a0b80567361..981899083ce 100644
--- a/source/blender/editors/transform/transform.c
+++ b/source/blender/editors/transform/transform.c
@@ -741,6 +741,8 @@ int transformEvent(TransInfo *t, wmEvent *event)
case TFM_MODAL_PROPSIZE_UP:
if(t->flag & T_PROP_EDIT) {
t->prop_size*= 1.1f;
+ if(t->spacetype==SPACE_VIEW3D)
+ t->prop_size= MIN2(t->prop_size, ((View3D *)t->view)->far);
calculatePropRatio(t);
}
t->redraw |= TREDRAW_HARD;
@@ -977,6 +979,8 @@ int transformEvent(TransInfo *t, wmEvent *event)
case PADPLUSKEY:
if(event->alt && t->flag & T_PROP_EDIT) {
t->prop_size *= 1.1f;
+ if(t->spacetype==SPACE_VIEW3D)
+ t->prop_size= MIN2(t->prop_size, ((View3D *)t->view)->far);
calculatePropRatio(t);
}
t->redraw= 1;
@@ -2542,6 +2546,9 @@ static void headerResize(TransInfo *t, float vec[3], char *str) {
else
sprintf(str, "Scale X: %s Y: %s Z: %s%s %s", &tvec[0], &tvec[20], &tvec[40], t->con.text, t->proptext);
}
+
+ if (t->flag & (T_PROP_EDIT|T_PROP_CONNECTED))
+ sprintf(str, "%s Proportional size: %.2f", str, t->prop_size);
}
#define SIGN(a) (a<-FLT_EPSILON?1:a>FLT_EPSILON?2:3)
@@ -3165,6 +3172,9 @@ int Rotation(TransInfo *t, short UNUSED(mval[2]))
sprintf(str, "Rot: %.2f%s %s", 180.0*final/M_PI, t->con.text, t->proptext);
}
+ if (t->flag & (T_PROP_EDIT|T_PROP_CONNECTED))
+ sprintf(str, "%s Proportional size: %.2f", str, t->prop_size);
+
t->values[0] = final;
applyRotation(t, final, t->axis);
@@ -3386,6 +3396,9 @@ static void headerTranslation(TransInfo *t, float vec[3], char *str) {
else
sprintf(str, "Dx: %s Dy: %s Dz: %s (%s)%s %s %s", &tvec[0], &tvec[20], &tvec[40], distvec, t->con.text, t->proptext, &autoik[0]);
}
+
+ if (t->flag & (T_PROP_EDIT|T_PROP_CONNECTED))
+ sprintf(str, "%s Proportional size: %.2f", str, t->prop_size);
}
static void applyTranslation(TransInfo *t, float vec[3]) {
diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c
index 23c045ba4f9..13a46e08814 100644
--- a/source/blender/makesrna/intern/rna_scene.c
+++ b/source/blender/makesrna/intern/rna_scene.c
@@ -1087,6 +1087,11 @@ static void rna_def_tool_settings(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Proportional Editing Falloff", "Falloff type for proportional editing mode");
RNA_def_property_update(prop, NC_SCENE|ND_TOOLSETTINGS, NULL); /* header redraw */
+ prop= RNA_def_property(srna, "proportional_size", PROP_FLOAT, PROP_DISTANCE);
+ RNA_def_property_float_sdna(prop, NULL, "proportional_size");
+ RNA_def_property_ui_text(prop, "Proportional Size", "Display size for proportional editing circle");
+ RNA_def_property_range(prop, 0.00001, 5000.0);
+
prop= RNA_def_property(srna, "normal_size", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "normalsize");
RNA_def_property_ui_text(prop, "Normal Size", "Display size for normals in the 3D view");