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:
authorCampbell Barton <ideasman42@gmail.com>2013-06-20 17:24:07 +0400
committerCampbell Barton <ideasman42@gmail.com>2013-06-20 17:24:07 +0400
commit70212510438fdb1494892b8f75b59cd018b47d5b (patch)
tree03bcd1a63db2a66001c619c3eb293f3c57ef69b1 /source/blender/editors/transform/transform_generics.c
parent8d6e5e2feeecdcff4d4b0d3651043ca561af2cb4 (diff)
transform: 2d option for proportional editmode,
Uses for view orientation for distance calculation, can give nicer results when you dont want twisting caused by changes in depth.
Diffstat (limited to 'source/blender/editors/transform/transform_generics.c')
-rw-r--r--source/blender/editors/transform/transform_generics.c30
1 files changed, 17 insertions, 13 deletions
diff --git a/source/blender/editors/transform/transform_generics.c b/source/blender/editors/transform/transform_generics.c
index 369b5a82a84..3e4316b1277 100644
--- a/source/blender/editors/transform/transform_generics.c
+++ b/source/blender/editors/transform/transform_generics.c
@@ -1023,6 +1023,20 @@ void resetTransRestrictions(TransInfo *t)
t->flag &= ~T_ALL_RESTRICTIONS;
}
+static int initTransInfo_edit_pet_to_flag(const int proportional)
+{
+ switch (proportional) {
+ case PROP_EDIT_ON:
+ return T_PROP_EDIT;
+ case PROP_EDIT_CONNECTED:
+ return T_PROP_EDIT | T_PROP_CONNECTED;
+ case PROP_EDIT_PROJECTED:
+ return T_PROP_EDIT | T_PROP_PROJECTED;
+ default:
+ return 0;
+ }
+}
+
/* the *op can be NULL */
int initTransInfo(bContext *C, TransInfo *t, wmOperator *op, const wmEvent *event)
{
@@ -1245,24 +1259,14 @@ int initTransInfo(bContext *C, TransInfo *t, wmOperator *op, const wmEvent *even
/* setting PET flag only if property exist in operator. Otherwise, assume it's not supported */
if (op && (prop = RNA_struct_find_property(op->ptr, "proportional"))) {
if (RNA_property_is_set(op->ptr, prop)) {
- switch (RNA_property_enum_get(op->ptr, prop)) {
- case PROP_EDIT_CONNECTED:
- t->flag |= T_PROP_CONNECTED;
- case PROP_EDIT_ON:
- t->flag |= T_PROP_EDIT;
- break;
- }
+ t->flag |= initTransInfo_edit_pet_to_flag(RNA_property_enum_get(op->ptr, prop));
}
else {
/* use settings from scene only if modal */
if (t->flag & T_MODAL) {
if ((t->options & CTX_NO_PET) == 0) {
- if (t->obedit && ts->proportional != PROP_EDIT_OFF) {
- t->flag |= T_PROP_EDIT;
-
- if (ts->proportional == PROP_EDIT_CONNECTED) {
- t->flag |= T_PROP_CONNECTED;
- }
+ if (t->obedit) {
+ t->flag |= initTransInfo_edit_pet_to_flag(ts->proportional);
}
else if (t->options & CTX_MASK) {
if (ts->proportional_mask) {