[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [42559] branches/bmesh/blender/source/ blender/editors/transform/transform_conversions.c: minor cleanup and sync with trunk
Campbell Barton
ideasman42 at gmail.com
Sat Dec 10 19:41:57 CET 2011
Revision: 42559
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=42559
Author: campbellbarton
Date: 2011-12-10 18:41:53 +0000 (Sat, 10 Dec 2011)
Log Message:
-----------
minor cleanup and sync with trunk
Modified Paths:
--------------
branches/bmesh/blender/source/blender/editors/transform/transform_conversions.c
Modified: branches/bmesh/blender/source/blender/editors/transform/transform_conversions.c
===================================================================
--- branches/bmesh/blender/source/blender/editors/transform/transform_conversions.c 2011-12-10 18:25:56 UTC (rev 42558)
+++ branches/bmesh/blender/source/blender/editors/transform/transform_conversions.c 2011-12-10 18:41:53 UTC (rev 42559)
@@ -308,11 +308,10 @@
int propmode = t->flag & T_PROP_EDIT;
BM_ITER(eed, &iter, em->bm, BM_EDGES_OF_MESH, NULL) {
- if (BM_TestHFlag(eed, BM_HIDDEN))
- continue;
-
- if (BM_TestHFlag(eed, BM_SELECT)) countsel++;
- if (propmode) count++;
+ if (!BM_TestHFlag(eed, BM_HIDDEN))
+ if (BM_TestHFlag(eed, BM_SELECT)) countsel++;
+ if (propmode) count++;
+ }
}
if (countsel == 0)
@@ -1931,8 +1930,8 @@
{
td->flag = 0;
//if(key)
- // td->loc = key->co;
- //else
+ // td->loc = key->co;
+ //else
td->loc = eve->co;
copy_v3_v3(td->center, td->loc);
@@ -1943,11 +1942,11 @@
// Setting normals
copy_v3_v3(td->axismtx[2], eve->no);
td->axismtx[0][0] =
- td->axismtx[0][1] =
- td->axismtx[0][2] =
- td->axismtx[1][0] =
- td->axismtx[1][1] =
- td->axismtx[1][2] = 0.0f;
+ td->axismtx[0][1] =
+ td->axismtx[0][2] =
+ td->axismtx[1][0] =
+ td->axismtx[1][1] =
+ td->axismtx[1][2] = 0.0f;
td->ext = NULL;
td->val = NULL;
@@ -1956,78 +1955,8 @@
td->val = bweight;
td->ival = bweight ? *(bweight) : 1.0f;
}
- }
-
-/* *********************** CrazySpace correction. Now without doing subsurf optimal ****************** */
-
-static void make_vertexcos__mapFunc(void *userData, int index, float *co, float *UNUSED(no_f), short *UNUSED(no_s))
-{
- float *vec = userData;
-
- vec+= 3*index;
- VECCOPY(vec, co);
}
-static int modifiers_disable_subsurf_temporary(Object *ob)
-{
- ModifierData *md;
- int disabled = 0;
-
- for(md=ob->modifiers.first; md; md=md->next)
- if(md->type==eModifierType_Subsurf)
- if(md->mode & eModifierMode_OnCage) {
- md->mode ^= eModifierMode_DisableTemporary;
- disabled= 1;
- }
-
- return disabled;
-}
-
-/* disable subsurf temporal, get mapped cos, and enable it */
-static float *get_crazy_mapped_editverts(TransInfo *t)
-{
- Mesh *me= t->obedit->data;
- DerivedMesh *dm;
- float *vertexcos;
-
- /* disable subsurf temporal, get mapped cos, and enable it */
- if(modifiers_disable_subsurf_temporary(t->obedit)) {
- /* need to make new derivemesh */
- makeDerivedMesh(t->scene, t->obedit, me->edit_btmesh, CD_MASK_BAREMESH, 0);
- }
-
- /* now get the cage */
- dm= editbmesh_get_derived_cage(t->scene, t->obedit, me->edit_btmesh, CD_MASK_BAREMESH);
-
- vertexcos= MEM_mallocN(3*sizeof(float)*me->edit_btmesh->bm->totvert, "vertexcos map");
- dm->foreachMappedVert(dm, make_vertexcos__mapFunc, vertexcos);
-
- dm->release(dm);
-
- /* set back the flag, no new cage needs to be built, transform does it */
- modifiers_disable_subsurf_temporary(t->obedit);
-
- return vertexcos;
-}
-
-#define TAN_MAKE_VEC(a, b, c) a[0]= b[0] + 0.2f*(b[0]-c[0]); a[1]= b[1] + 0.2f*(b[1]-c[1]); a[2]= b[2] + 0.2f*(b[2]-c[2])
-static void set_crazy_vertex_quat(float *quat, float *v1, float *v2, float *v3, float *def1, float *def2, float *def3)
-{
- float vecu[3], vecv[3];
- float q1[4], q2[4];
-
- TAN_MAKE_VEC(vecu, v1, v2);
- TAN_MAKE_VEC(vecv, v1, v3);
- tri_to_quat( q1,v1, vecu, vecv);
-
- TAN_MAKE_VEC(vecu, def1, def2);
- TAN_MAKE_VEC(vecv, def1, def3);
- tri_to_quat( q2,def1, vecu, vecv);
-
- sub_qt_qtqt(quat, q2, q1);
-}
-#undef TAN_MAKE_VEC
-
static void createTransEditVerts(bContext *C, TransInfo *t)
{
ToolSettings *ts = CTX_data_tool_settings(C);
@@ -2146,8 +2075,9 @@
copy_m3_m4(mtx, t->obedit->obmat);
invert_m3_m3(smtx, mtx);
- if(propmode & T_PROP_CONNECTED)
+ if(propmode & T_PROP_CONNECTED) {
editmesh_set_connectivity_distance(em, mtx, dists);
+ }
/* detect CrazySpace [tm] */
if(modifiers_getCageIndex(t->scene, t->obedit, NULL, 1)>=0) {
@@ -2272,8 +2202,7 @@
BLI_array_free(selstate);
- if (t->flag & T_MIRROR)
- {
+ if (t->flag & T_MIRROR) {
EDBM_EndMirrorCache(em);
mirror = 1;
}
@@ -2525,8 +2454,6 @@
/* flush to 2d vector from internally used 3d vector */
for(a=0, td= t->data2d; a<t->total; a++, td++) {
- if (!td->loc2d) continue;
-
td->loc2d[0]= td->loc[0]*invx;
td->loc2d[1]= td->loc[1]*invy;
More information about the Bf-blender-cvs
mailing list