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:
authorTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>2010-08-02 03:37:52 +0400
committerTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>2010-08-02 03:37:52 +0400
commita5692fd67bedf71f849d330c83239a47ad93e3e7 (patch)
tree8e0ee63a3c9075dee1d50c14795658896c69adf4 /source/blender/editors/transform
parent4cfdedbe6167d8c3a596bde24dde23ce578b1764 (diff)
parentc92e3225f3aa5fadb9ad0920dffbdc0c0209a98a (diff)
Merged changes in the trunk up to revision 30952.
Diffstat (limited to 'source/blender/editors/transform')
-rw-r--r--source/blender/editors/transform/transform.c25
-rw-r--r--source/blender/editors/transform/transform_conversions.c15
-rw-r--r--source/blender/editors/transform/transform_generics.c21
3 files changed, 37 insertions, 24 deletions
diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c
index ce9dcd9b740..beeacfdc8d0 100644
--- a/source/blender/editors/transform/transform.c
+++ b/source/blender/editors/transform/transform.c
@@ -1364,17 +1364,17 @@ void saveTransform(bContext *C, TransInfo *t, wmOperator *op)
}
}
- /* XXX convert stupid flag to enum */
+ /* convert flag to enum */
switch(t->flag & (T_PROP_EDIT|T_PROP_CONNECTED))
{
case (T_PROP_EDIT|T_PROP_CONNECTED):
- proportional = 2;
+ proportional = PROP_EDIT_CONNECTED;
break;
case T_PROP_EDIT:
- proportional = 1;
+ proportional = PROP_EDIT_ON;
break;
default:
- proportional = 0;
+ proportional = PROP_EDIT_OFF;
}
// If modal, save settings back in scene if not set as operator argument
@@ -1382,7 +1382,10 @@ void saveTransform(bContext *C, TransInfo *t, wmOperator *op)
/* save settings if not set in operator */
if (RNA_struct_find_property(op->ptr, "proportional") && !RNA_property_is_set(op->ptr, "proportional")) {
- ts->proportional = proportional;
+ if (t->obedit)
+ ts->proportional = proportional;
+ else
+ ts->proportional_objects = (proportional != PROP_EDIT_OFF);
}
if (RNA_struct_find_property(op->ptr, "proportional_size") && !RNA_property_is_set(op->ptr, "proportional_size")) {
@@ -2171,21 +2174,19 @@ void initWarp(TransInfo *t)
/* we need min/max in view space */
for(i = 0; i < t->total; i++) {
float center[3];
- VECCOPY(center, t->data[i].center);
+ copy_v3_v3(center, t->data[i].center);
mul_m3_v3(t->data[i].mtx, center);
mul_m4_v3(t->viewmat, center);
sub_v3_v3(center, t->viewmat[3]);
if (i)
minmax_v3_v3v3(min, max, center);
else {
- VECCOPY(max, center);
- VECCOPY(min, center);
+ copy_v3_v3(max, center);
+ copy_v3_v3(min, center);
}
}
-
- t->center[0]= (min[0]+max[0])/2.0f;
- t->center[1]= (min[1]+max[1])/2.0f;
- t->center[2]= (min[2]+max[2])/2.0f;
+
+ mid_v3_v3v3(t->center, min, max);
if (max[0] == min[0]) max[0] += 0.1; /* not optimal, but flipping is better than invalid garbage (i.e. division by zero!) */
t->val= (max[0]-min[0])/2.0f; /* t->val is X dimension projected boundbox */
diff --git a/source/blender/editors/transform/transform_conversions.c b/source/blender/editors/transform/transform_conversions.c
index 0edf6f6d10c..e71b9bd66e0 100644
--- a/source/blender/editors/transform/transform_conversions.c
+++ b/source/blender/editors/transform/transform_conversions.c
@@ -1775,14 +1775,17 @@ static int connectivity_edge(float mtx[][3], EditVert *v1, EditVert *v2)
float edge_len;
int done = 0;
+ /* note: hidden verts are not being checked for, this assumes
+ * flushing of hidden faces & edges is working right */
+
+ if (v1->f2 + v2->f2 == 4)
+ return 0;
+
sub_v3_v3v3(edge_vec, v1->co, v2->co);
mul_m3_v3(mtx, edge_vec);
edge_len = len_v3(edge_vec);
- if (v1->f2 + v2->f2 == 4)
- return 0;
-
if (v1->f2) {
if (v2->f2) {
if (v2->tmp.fp + edge_len + THRESHOLD < v1->tmp.fp) {
@@ -1848,7 +1851,7 @@ static void editmesh_set_connectivity_distance(EditMesh *em, float mtx[][3])
/* do internal edges for quads */
for(efa= em->faces.first; efa; efa= efa->next) {
- if (efa->v4) {
+ if (efa->v4 && efa->h==0) {
done |= connectivity_edge(mtx, efa->v1, efa->v3);
done |= connectivity_edge(mtx, efa->v2, efa->v4);
}
@@ -4400,7 +4403,7 @@ static void set_trans_object_base_flags(bContext *C, TransInfo *t)
}
/* all recalc flags get flushed to all layers, so a layer flip later on works fine */
- DAG_scene_flush_update(t->scene, -1, 0);
+ DAG_scene_flush_update(G.main, t->scene, -1, 0);
/* and we store them temporal in base (only used for transform code) */
/* this because after doing updates, the object->recalc is cleared */
@@ -4478,7 +4481,7 @@ static int count_proportional_objects(TransInfo *t)
/* all recalc flags get flushed to all layers, so a layer flip later on works fine */
- DAG_scene_flush_update(t->scene, -1, 0);
+ DAG_scene_flush_update(G.main, t->scene, -1, 0);
/* and we store them temporal in base (only used for transform code) */
/* this because after doing updates, the object->recalc is cleared */
diff --git a/source/blender/editors/transform/transform_generics.c b/source/blender/editors/transform/transform_generics.c
index 8d98255d3d9..920c5c12ea1 100644
--- a/source/blender/editors/transform/transform_generics.c
+++ b/source/blender/editors/transform/transform_generics.c
@@ -38,6 +38,7 @@
#include "DNA_armature_types.h"
#include "DNA_lattice_types.h"
#include "DNA_screen_types.h"
+#include "DNA_scene_types.h"
#include "DNA_space_types.h"
#include "DNA_view3d_types.h"
@@ -1033,9 +1034,9 @@ int initTransInfo (bContext *C, TransInfo *t, wmOperator *op, wmEvent *event)
{
switch(RNA_enum_get(op->ptr, "proportional"))
{
- case 2: /* XXX connected constant */
+ case PROP_EDIT_CONNECTED:
t->flag |= T_PROP_CONNECTED;
- case 1: /* XXX prop on constant */
+ case PROP_EDIT_ON:
t->flag |= T_PROP_EDIT;
break;
}
@@ -1045,11 +1046,19 @@ int initTransInfo (bContext *C, TransInfo *t, wmOperator *op, wmEvent *event)
/* use settings from scene only if modal */
if (t->flag & T_MODAL)
{
- if ((t->options & CTX_NO_PET) == 0 && (ts->proportional != PROP_EDIT_OFF)) {
- t->flag |= T_PROP_EDIT;
+ 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(ts->proportional == PROP_EDIT_CONNECTED)
+ t->flag |= T_PROP_CONNECTED;
+ }
+ else if (t->obedit == NULL && ts->proportional_objects)
+ {
+ t->flag |= T_PROP_EDIT;
+ }
}
}
}