Wednesday sync orange with bf-blender
authorTon Roosendaal <ton@blender.org>
Wed, 4 Jan 2006 15:47:16 +0000 (15:47 +0000)
committerTon Roosendaal <ton@blender.org>
Wed, 4 Jan 2006 15:47:16 +0000 (15:47 +0000)
Note: has the crazyspace fix!

1  2 
source/blender/python/api2_2x/Armature.c
source/blender/src/transform_conversions.c

index a2a3db05bc8ae3feb76b3debdd6e1a23a8939a1d,13e2f230100070d2c2909bc17cc28474a13c9028..743956a1f61c9438f79282207b663d0727d8a60d
@@@ -465,9 -465,9 +465,10 @@@ static PyObject *Armature_update(BPy_Ar
                if (!BonesDict_InitBones(self->Bones))
                        return NULL;
                self->Bones->editmode_flag = 0;
+               BLI_freelistN(&self->Bones->editbones);
        }else{
                goto AttributeError;
 +
        }
        return EXPP_incr_ret(Py_None);
  
index b47cd8e458593690f2f7b9d74b9f49cc4a7c07a1,65bf0a597baf29fc6d38db50d06647a11d0f8863..8708981063abf2e1999db6fb974e74cd2548ff29
@@@ -1395,9 -1409,10 +1395,11 @@@ static void VertsToTransData(TransData 
        td->ext = NULL;
        td->tdi = NULL;
        td->val = NULL;
 +      td->tdmir= NULL;
  }
  
+ /* *********************** CrazySpace correction. Now without doing subsurf optimal ****************** */
  static void make_vertexcos__mapFunc(void *userData, int index, float *co, float *no_f, short *no_s)
  {
        float *vec = userData;
@@@ -1440,39 -1498,59 +1485,59 @@@ static void set_crazyspace_quats(float 
        EditMesh *em = G.editMesh;
        EditVert *eve, *prev;
        EditFace *efa;
-       float q1[4], q2[4];
-       float *v1, *v2, *v3, *quatp;
+       float *v1, *v2, *v3, *v4;
        int index= 0;
        
-       /* 2 abused locations in vertices */
+       /* two abused locations in vertices */
        for(eve= em->verts.first; eve; eve= eve->next, index++) {
 -              eve->vn= NULL;
 +              eve->tmp.fp = NULL;
                eve->prev= (EditVert *)index;
        }
        
-       quatp= quats;
+       /* first store two sets of tangent vectors in vertices, we derive it just from the face-edges */
        for(efa= em->faces.first; efa; efa= efa->next) {
-               /* vertex f1 flags were set for transform */
                
-               if( (efa->v1->f1 && efa->v1->tmp.fp==NULL) || 
-                       (efa->v2->f1 && efa->v2->tmp.fp==NULL) ||
-                       (efa->v3->f1 && efa->v3->tmp.fp==NULL) || 
-                        (efa->v4 && efa->v4->f1 && efa->v4->tmp.fp==NULL) ) {
+               /* retrieve mapped coordinates */
+               v1= mappedcos + 3*( (int)(efa->v1->prev) );
+               v2= mappedcos + 3*( (int)(efa->v2->prev) );
+               v3= mappedcos + 3*( (int)(efa->v3->prev) );
                
-                       triatoquat(efa->v1->co, efa->v2->co, efa->v3->co, q1);
-                       
-                       /* retrieve mapped coordinates */
-                       v1= mappedcos + 3*( (int)(efa->v1->prev) );
-                       v2= mappedcos + 3*( (int)(efa->v2->prev) );
-                       v3= mappedcos + 3*( (int)(efa->v3->prev) );
-                       triatoquat(v1, v2, v3, q2);
-                       
-                       QuatSub(quatp, q2, q1);
 -              if(efa->v2->vn==NULL && efa->v2->f1) {
++              if(efa->v2->tmp.fp==NULL && efa->v2->f1) {
+                       set_crazy_vertex_quat(quats, efa->v2->co, efa->v3->co, efa->v1->co, v2, v3, v1);
 -                      efa->v2->vn= (EditVert *)(quats);
++                      efa->v2->tmp.fp= quats;
+                       quats+= 4;
+               }
+               
+               if(efa->v4) {
+                       v4= mappedcos + 3*( (int)(efa->v4->prev) );
                        
-                       if(efa->v1->f1) quatp= crazy_quat_blend(efa->v1, quatp);
-                       if(efa->v2->f1) quatp= crazy_quat_blend(efa->v2, quatp);
-                       if(efa->v3->f1) quatp= crazy_quat_blend(efa->v3, quatp);
-                       if(efa->v4 && efa->v4->f1) quatp= crazy_quat_blend(efa->v4, quatp);
 -                      if(efa->v1->vn==NULL && efa->v1->f1) {
++                      if(efa->v1->tmp.fp==NULL && efa->v1->f1) {
+                               set_crazy_vertex_quat(quats, efa->v1->co, efa->v2->co, efa->v4->co, v1, v2, v4);
 -                              efa->v1->vn= (EditVert *)(quats);
++                              efa->v1->tmp.fp= quats;
+                               quats+= 4;
+                       }
 -                      if(efa->v3->vn==NULL && efa->v3->f1) {
++                      if(efa->v3->tmp.fp==NULL && efa->v3->f1) {
+                               set_crazy_vertex_quat(quats, efa->v3->co, efa->v4->co, efa->v2->co, v3, v4, v2);
 -                              efa->v3->vn= (EditVert *)(quats);
++                              efa->v3->tmp.fp= quats;
+                               quats+= 4;
+                       }
 -                      if(efa->v4->vn==NULL && efa->v4->f1) {
++                      if(efa->v4->tmp.fp==NULL && efa->v4->f1) {
+                               set_crazy_vertex_quat(quats, efa->v4->co, efa->v1->co, efa->v3->co, v4, v1, v3);
 -                              efa->v4->vn= (EditVert *)(quats);
++                              efa->v4->tmp.fp= quats;
+                               quats+= 4;
+                       }
+               }
+               else {
 -                      if(efa->v1->vn==NULL && efa->v1->f1) {
++                      if(efa->v1->tmp.fp==NULL && efa->v1->f1) {
+                               set_crazy_vertex_quat(quats, efa->v1->co, efa->v2->co, efa->v3->co, v1, v2, v3);
 -                              efa->v1->vn= (EditVert *)(quats);
++                              efa->v1->tmp.fp= quats;
+                               quats+= 4;
+                       }
 -                      if(efa->v3->vn==NULL && efa->v3->f1) {
++                      if(efa->v3->tmp.fp==NULL && efa->v3->f1) {
+                               set_crazy_vertex_quat(quats, efa->v3->co, efa->v1->co, efa->v2->co, v3, v1, v2);
 -                              efa->v3->vn= (EditVert *)(quats);
++                              efa->v3->tmp.fp= quats;
+                               quats+= 4;
+                       }
                }
        }