Merging r41597 through r41607 from trunk into soc-2011-tomato
authorSergey Sharybin <sergey.vfx@gmail.com>
Mon, 7 Nov 2011 12:49:52 +0000 (12:49 +0000)
committerSergey Sharybin <sergey.vfx@gmail.com>
Mon, 7 Nov 2011 12:49:52 +0000 (12:49 +0000)
64 files changed:
source/blender/blenkernel/BKE_library.h
source/blender/blenkernel/intern/action.c
source/blender/blenkernel/intern/armature.c
source/blender/blenkernel/intern/brush.c
source/blender/blenkernel/intern/camera.c
source/blender/blenkernel/intern/cdderivedmesh.c
source/blender/blenkernel/intern/curve.c
source/blender/blenkernel/intern/key.c
source/blender/blenkernel/intern/lamp.c
source/blender/blenkernel/intern/lattice.c
source/blender/blenkernel/intern/library.c
source/blender/blenkernel/intern/material.c
source/blender/blenkernel/intern/mball.c
source/blender/blenkernel/intern/mesh.c
source/blender/blenkernel/intern/node.c
source/blender/blenkernel/intern/object.c
source/blender/blenkernel/intern/particle.c
source/blender/blenkernel/intern/pointcache.c
source/blender/blenkernel/intern/scene.c
source/blender/blenkernel/intern/shrinkwrap.c
source/blender/blenkernel/intern/speaker.c
source/blender/blenkernel/intern/text.c
source/blender/blenkernel/intern/texture.c
source/blender/blenkernel/intern/world.c
source/blender/blenlib/BLI_math_vector.h
source/blender/blenlib/intern/math_vector_inline.c
source/blender/editors/animation/anim_channels_defines.c
source/blender/editors/armature/editarmature_retarget.c
source/blender/editors/armature/editarmature_sketch.c
source/blender/editors/gpencil/gpencil_edit.c
source/blender/editors/gpencil/gpencil_paint.c
source/blender/editors/interface/interface.c
source/blender/editors/interface/interface_widgets.c
source/blender/editors/mesh/editmesh_tools.c
source/blender/editors/object/object_add.c
source/blender/editors/object/object_lattice.c
source/blender/editors/object/object_modifier.c
source/blender/editors/sculpt_paint/paint_image.c
source/blender/editors/space_info/textview.c
source/blender/editors/space_view3d/drawarmature.c
source/blender/editors/space_view3d/drawobject.c
source/blender/editors/space_view3d/view3d_edit.c
source/blender/editors/space_view3d/view3d_fly.c
source/blender/editors/transform/transform.c
source/blender/editors/transform/transform_generics.c
source/blender/editors/transform/transform_input.c
source/blender/editors/util/crazyspace.c
source/blender/gpu/intern/gpu_material.c
source/blender/ikplugin/intern/iksolver_plugin.c
source/blender/ikplugin/intern/itasc_plugin.cpp
source/blender/makesrna/intern/rna_armature.c
source/blender/nodes/composite/nodes/node_composite_normalize.c
source/blender/render/intern/include/rendercore.h
source/blender/render/intern/source/envmap.c
source/blender/render/intern/source/imagetexture.c
source/blender/render/intern/source/pixelshading.c
source/blender/render/intern/source/pointdensity.c
source/blender/render/intern/source/rendercore.c
source/blender/render/intern/source/shadbuf.c
source/blender/render/intern/source/shadeinput.c
source/blender/render/intern/source/strand.c
source/blender/render/intern/source/volume_precache.c
source/blender/render/intern/source/voxeldata.c
source/blender/windowmanager/intern/wm_operators.c

index 9130cac6cd60f2feaa86769ef8e094db148627b9..308d7ff22c2633043ee0d7ed90812b7fd3b99355 100644 (file)
@@ -46,7 +46,7 @@ struct PointerRNA;
 struct PropertyRNA;
 
 void *alloc_libblock(struct ListBase *lb, short type, const char *name);
-void *copy_libblock(void *rt);
+void *copy_libblock(struct ID *id);
 void copy_libblock_data(struct ID *id, const struct ID *id_from, const short do_action);
 
 void BKE_id_lib_local_paths(struct Main *bmain, struct ID *id);
index 944f7c6a0b627a3bda5ee895088d3d8c4bbee338..5fb03b7bbd00dd5199269a88ce1fc9b36ab3375a 100644 (file)
@@ -185,7 +185,7 @@ bAction *copy_action (bAction *src)
        
        if (src == NULL) 
                return NULL;
-       dst= copy_libblock(src);
+       dst= copy_libblock(&src->id);
        
        /* duplicate the lists of groups and markers */
        BLI_duplicatelist(&dst->groups, &src->groups);
index f19ed859064e313106cee8780e79a8d9a0ce4519..50f305e440012eab2c8e153a5a294d504eead48c 100644 (file)
@@ -204,7 +204,7 @@ bArmature *copy_armature(bArmature *arm)
        Bone            *oldBone, *newBone;
        Bone            *newActBone= NULL;
        
-       newArm= copy_libblock (arm);
+       newArm= copy_libblock(&arm->id);
        BLI_duplicatelist(&newArm->bonebase, &arm->bonebase);
        
        /*      Duplicate the childrens' lists*/
index e78b89441c908037af9a451f66c64d3bcb92c0ef..09021e71025f8ab0a2ab9a54b7c8bba5335b93e6 100644 (file)
@@ -144,7 +144,7 @@ Brush *copy_brush(Brush *brush)
 {
        Brush *brushn;
        
-       brushn= copy_libblock(brush);
+       brushn= copy_libblock(&brush->id);
 
        if (brush->mtex.tex)
                id_us_plus((ID*)brush->mtex.tex);
index eeec82c3beb79d321d1b60ef6fc9adb47f79b4cc..145eb9363e9b8e7a463e08030e47c68a975214aa 100644 (file)
@@ -68,7 +68,7 @@ Camera *copy_camera(Camera *cam)
 {
        Camera *camn;
        
-       camn= copy_libblock(cam);
+       camn= copy_libblock(&cam->id);
        
        return camn;
 }
index 25f9f17f2019066ea7d0802100f176db91724aaa..d2c86a14572f0d25ca0c51f5437ae50f90d6e2d6 100644 (file)
@@ -152,7 +152,7 @@ static void cdDM_getVertCo(DerivedMesh *dm, int index, float co_r[3])
 {
        CDDerivedMesh *cddm = (CDDerivedMesh*) dm;
 
-       VECCOPY(co_r, cddm->mvert[index].co);
+       copy_v3_v3(co_r, cddm->mvert[index].co);
 }
 
 static void cdDM_getVertCos(DerivedMesh *dm, float (*cos_r)[3])
@@ -161,7 +161,7 @@ static void cdDM_getVertCos(DerivedMesh *dm, float (*cos_r)[3])
        int i;
 
        for(i = 0; i < dm->numVertData; i++, mv++)
-               VECCOPY(cos_r[i], mv->co);
+               copy_v3_v3(cos_r[i], mv->co);
 }
 
 static void cdDM_getVertNo(DerivedMesh *dm, int index, float no_r[3])
@@ -1246,39 +1246,39 @@ static void cdDM_drawMappedFacesGLSL(DerivedMesh *dm, int (*setMaterial)(int, vo
                                if( numdata != 0 ) {
                                        offset = 0;
                                        if(attribs.totorco) {
-                                               VECCOPY((float *)&varray[elementsize*curface*3],(float *)attribs.orco.array[mface->v1]);
-                                               VECCOPY((float *)&varray[elementsize*curface*3+elementsize],(float *)attribs.orco.array[mface->v2]);
-                                               VECCOPY((float *)&varray[elementsize*curface*3+elementsize*2],(float *)attribs.orco.array[mface->v3]);
+                                               copy_v3_v3((float *)&varray[elementsize*curface*3],(float *)attribs.orco.array[mface->v1]);
+                                               copy_v3_v3((float *)&varray[elementsize*curface*3+elementsize],(float *)attribs.orco.array[mface->v2]);
+                                               copy_v3_v3((float *)&varray[elementsize*curface*3+elementsize*2],(float *)attribs.orco.array[mface->v3]);
                                                offset += sizeof(float)*3;
                                        }
                                        for(b = 0; b < attribs.tottface; b++) {
                                                MTFace *tf = &attribs.tface[b].array[a];
-                                               VECCOPY2D((float *)&varray[elementsize*curface*3+offset],tf->uv[0]);
-                                               VECCOPY2D((float *)&varray[elementsize*curface*3+offset+elementsize],tf->uv[1]);
+                                               copy_v2_v2((float *)&varray[elementsize*curface*3+offset],tf->uv[0]);
+                                               copy_v2_v2((float *)&varray[elementsize*curface*3+offset+elementsize],tf->uv[1]);
 
-                                               VECCOPY2D((float *)&varray[elementsize*curface*3+offset+elementsize*2],tf->uv[2]);
+                                               copy_v2_v2((float *)&varray[elementsize*curface*3+offset+elementsize*2],tf->uv[2]);
                                                offset += sizeof(float)*2;
                                        }
                                        for(b = 0; b < attribs.totmcol; b++) {
                                                MCol *cp = &attribs.mcol[b].array[a*4 + 0];
                                                GLubyte col[4];
                                                col[0]= cp->b; col[1]= cp->g; col[2]= cp->r; col[3]= cp->a;
-                                               QUATCOPY((unsigned char *)&varray[elementsize*curface*3+offset], col);
+                                               copy_v4_v4_char((char *)&varray[elementsize*curface*3+offset], (char *)col);
                                                cp = &attribs.mcol[b].array[a*4 + 1];
                                                col[0]= cp->b; col[1]= cp->g; col[2]= cp->r; col[3]= cp->a;
-                                               QUATCOPY((unsigned char *)&varray[elementsize*curface*3+offset+elementsize], col);
+                                               copy_v4_v4_char((char *)&varray[elementsize*curface*3+offset+elementsize], (char *)col);
                                                cp = &attribs.mcol[b].array[a*4 + 2];
                                                col[0]= cp->b; col[1]= cp->g; col[2]= cp->r; col[3]= cp->a;
-                                               QUATCOPY((unsigned char *)&varray[elementsize*curface*3+offset+elementsize*2], col);
+                                               copy_v4_v4_char((char *)&varray[elementsize*curface*3+offset+elementsize*2], (char *)col);
                                                offset += sizeof(unsigned char)*4;
                                        }       
                                        if(attribs.tottang) {
                                                float *tang = attribs.tang.array[a*4 + 0];
-                                               QUATCOPY((float *)&varray[elementsize*curface*3+offset], tang);
+                                               copy_v4_v4((float *)&varray[elementsize*curface*3+offset], tang);
                                                tang = attribs.tang.array[a*4 + 1];
-                                               QUATCOPY((float *)&varray[elementsize*curface*3+offset+elementsize], tang);
+                                               copy_v4_v4((float *)&varray[elementsize*curface*3+offset+elementsize], tang);
                                                tang = attribs.tang.array[a*4 + 2];
-                                               QUATCOPY((float *)&varray[elementsize*curface*3+offset+elementsize*2], tang);
+                                               copy_v4_v4((float *)&varray[elementsize*curface*3+offset+elementsize*2], tang);
                                                offset += sizeof(float)*4;
                                        }
                                        (void)offset;
@@ -1288,38 +1288,38 @@ static void cdDM_drawMappedFacesGLSL(DerivedMesh *dm, int (*setMaterial)(int, vo
                                        if( numdata != 0 ) {
                                                offset = 0;
                                                if(attribs.totorco) {
-                                                       VECCOPY((float *)&varray[elementsize*curface*3],(float *)attribs.orco.array[mface->v3]);
-                                                       VECCOPY((float *)&varray[elementsize*curface*3+elementsize],(float *)attribs.orco.array[mface->v4]);
-                                                       VECCOPY((float *)&varray[elementsize*curface*3+elementsize*2],(float *)attribs.orco.array[mface->v1]);
+                                                       copy_v3_v3((float *)&varray[elementsize*curface*3],(float *)attribs.orco.array[mface->v3]);
+                                                       copy_v3_v3((float *)&varray[elementsize*curface*3+elementsize],(float *)attribs.orco.array[mface->v4]);
+                                                       copy_v3_v3((float *)&varray[elementsize*curface*3+elementsize*2],(float *)attribs.orco.array[mface->v1]);
                                                        offset += sizeof(float)*3;
                                                }
                                                for(b = 0; b < attribs.tottface; b++) {
                                                        MTFace *tf = &attribs.tface[b].array[a];
-                                                       VECCOPY2D((float *)&varray[elementsize*curface*3+offset],tf->uv[2]);
-                                                       VECCOPY2D((float *)&varray[elementsize*curface*3+offset+elementsize],tf->uv[3]);
-                                                       VECCOPY2D((float *)&varray[elementsize*curface*3+offset+elementsize*2],tf->uv[0]);
+                                                       copy_v2_v2((float *)&varray[elementsize*curface*3+offset],tf->uv[2]);
+                                                       copy_v2_v2((float *)&varray[elementsize*curface*3+offset+elementsize],tf->uv[3]);
+                                                       copy_v2_v2((float *)&varray[elementsize*curface*3+offset+elementsize*2],tf->uv[0]);
                                                        offset += sizeof(float)*2;
                                                }
                                                for(b = 0; b < attribs.totmcol; b++) {
                                                        MCol *cp = &attribs.mcol[b].array[a*4 + 2];
                                                        GLubyte col[4];
                                                        col[0]= cp->b; col[1]= cp->g; col[2]= cp->r; col[3]= cp->a;
-                                                       QUATCOPY((unsigned char *)&varray[elementsize*curface*3+offset], col);
+                                                       copy_v4_v4_char((char *)&varray[elementsize*curface*3+offset], (char *)col);
                                                        cp = &attribs.mcol[b].array[a*4 + 3];
                                                        col[0]= cp->b; col[1]= cp->g; col[2]= cp->r; col[3]= cp->a;
-                                                       QUATCOPY((unsigned char *)&varray[elementsize*curface*3+offset+elementsize], col);
+                                                       copy_v4_v4_char((char *)&varray[elementsize*curface*3+offset+elementsize], (char *)col);
                                                        cp = &attribs.mcol[b].array[a*4 + 0];
                                                        col[0]= cp->b; col[1]= cp->g; col[2]= cp->r; col[3]= cp->a;
-                                                       QUATCOPY((unsigned char *)&varray[elementsize*curface*3+offset+elementsize*2], col);
+                                                       copy_v4_v4_char((char *)&varray[elementsize*curface*3+offset+elementsize*2], (char *)col);
                                                        offset += sizeof(unsigned char)*4;
                                                }       
                                                if(attribs.tottang) {
                                                        float *tang = attribs.tang.array[a*4 + 2];
-                                                       QUATCOPY((float *)&varray[elementsize*curface*3+offset], tang);
+                                                       copy_v4_v4((float *)&varray[elementsize*curface*3+offset], tang);
                                                        tang = attribs.tang.array[a*4 + 3];
-                                                       QUATCOPY((float *)&varray[elementsize*curface*3+offset+elementsize], tang);
+                                                       copy_v4_v4((float *)&varray[elementsize*curface*3+offset+elementsize], tang);
                                                        tang = attribs.tang.array[a*4 + 0];
-                                                       QUATCOPY((float *)&varray[elementsize*curface*3+offset+elementsize*2], tang);
+                                                       copy_v4_v4((float *)&varray[elementsize*curface*3+offset+elementsize*2], tang);
                                                        offset += sizeof(float)*4;
                                                }
                                                (void)offset;
@@ -1439,7 +1439,7 @@ static void cdDM_foreachMappedFaceCenter(
                else
                        orig = i;
 
-               VECCOPY(cent, mv[mf->v1].co);
+               copy_v3_v3(cent, mv[mf->v1].co);
                add_v3_v3(cent, mv[mf->v2].co);
                add_v3_v3(cent, mv[mf->v3].co);
 
@@ -1625,7 +1625,7 @@ DerivedMesh *CDDM_from_editmesh(EditMesh *em, Mesh *UNUSED(me))
                i++, eve = eve->next, index++) {
                MVert *mv = &mvert[i];
 
-               VECCOPY(mv->co, eve->co);
+               copy_v3_v3(mv->co, eve->co);
 
                normal_float_to_short_v3(mv->no, eve->no);
                mv->bweight = (unsigned char) (eve->bweight * 255.0f);
@@ -1793,7 +1793,7 @@ void CDDM_apply_vert_coords(DerivedMesh *dm, float (*vertCoords)[3])
        cddm->mvert = vert;
 
        for(i = 0; i < dm->numVertData; ++i, ++vert)
-               VECCOPY(vert->co, vertCoords[i]);
+               copy_v3_v3(vert->co, vertCoords[i]);
 }
 
 void CDDM_apply_vert_normals(DerivedMesh *dm, short (*vertNormals)[3])
index adc08f5cd9f76553ce1c6475862c9ce85f436c6c..160f5703a01b85e2f5580c2027c26c94e379cb9a 100644 (file)
@@ -192,7 +192,7 @@ Curve *copy_curve(Curve *cu)
        Curve *cun;
        int a;
        
-       cun= copy_libblock(cu);
+       cun= copy_libblock(&cu->id);
        cun->nurb.first= cun->nurb.last= NULL;
        duplicateNurblist( &(cun->nurb), &(cu->nurb));
 
index c389800b0d1385279da9c72be2e0b692a0efac53..eb7d07a6f7de1f26f6af7b4851f2cd4b7a8d0a5a 100644 (file)
@@ -154,7 +154,7 @@ Key *copy_key(Key *key)
        
        if(key==NULL) return NULL;
        
-       keyn= copy_libblock(key);
+       keyn= copy_libblock(&key->id);
        
        BLI_duplicatelist(&keyn->block, &key->block);
        
index 974aa660e9fe7a04cabc31de89885660217aa32f..4edd032dc0445815cad306dd633a239f5b137166 100644 (file)
@@ -106,7 +106,7 @@ Lamp *copy_lamp(Lamp *la)
        Lamp *lan;
        int a;
        
-       lan= copy_libblock(la);
+       lan= copy_libblock(&la->id);
 
        for(a=0; a<MAX_MTEX; a++) {
                if(lan->mtex[a]) {
@@ -132,7 +132,7 @@ Lamp *localize_lamp(Lamp *la)
        Lamp *lan;
        int a;
        
-       lan= copy_libblock(la);
+       lan= copy_libblock(&la->id);
        BLI_remlink(&G.main->lamp, lan);
 
        for(a=0; a<MAX_MTEX; a++) {
index cef23ac38242fbebdddb02b89ef8fb7e8cd8ba01..7c9e2be4493befd2d73f3a32d4c2866f41bd0441 100644 (file)
@@ -204,7 +204,7 @@ Lattice *copy_lattice(Lattice *lt)
 {
        Lattice *ltn;
 
-       ltn= copy_libblock(lt);
+       ltn= copy_libblock(&lt->id);
        ltn->def= MEM_dupallocN(lt->def);
 
        ltn->key= copy_key(ltn->key);
index 119e2e0da1bc2579286b76e45c4ec86d465c9670..650f85da5b3ef64aa39c61a63134d6a913564022 100644 (file)
@@ -725,14 +725,11 @@ void copy_libblock_data(ID *id, const ID *id_from, const short do_action)
 }
 
 /* used everywhere in blenkernel */
-void *copy_libblock(void *rt)
+void *copy_libblock(ID *id)
 {
-       ID *idn, *id;
+       ID *idn;
        ListBase *lb;
-       char *cp, *cpn;
        size_t idn_len;
-       
-       id= rt;
 
        lb= which_libbase(G.main, GS(id->name));
        idn= alloc_libblock(lb, GS(id->name), id->name+2);
@@ -741,8 +738,9 @@ void *copy_libblock(void *rt)
 
        idn_len= MEM_allocN_len(idn);
        if((int)idn_len - (int)sizeof(ID) > 0) { /* signed to allow neg result */
-               cp= (char *)id;
-               cpn= (char *)idn;
+               const char *cp= (const char *)id;
+               char *cpn= (char *)idn;
+
                memcpy(cpn+sizeof(ID), cp+sizeof(ID), idn_len - sizeof(ID));
        }
        
index 7be3514e0f2733792168907530cc092512452e58..48c6d6b2a19313efa95a663d77382fe6ffe40866 100644 (file)
@@ -215,7 +215,7 @@ Material *copy_material(Material *ma)
        Material *man;
        int a;
        
-       man= copy_libblock(ma);
+       man= copy_libblock(&ma->id);
        
        id_lib_extern((ID *)man->group);
        
@@ -247,7 +247,7 @@ Material *localize_material(Material *ma)
        Material *man;
        int a;
        
-       man= copy_libblock(ma);
+       man= copy_libblock(&ma->id);
        BLI_remlink(&G.main->mat, man);
 
        /* no increment for texture ID users, in previewrender.c it prevents decrement */
index 327306b32eed899a465ea75c5cb3bb13fc8a5b38..5c82acde99b1bef4d37a3e512acf0ff80d599abd 100644 (file)
@@ -120,7 +120,7 @@ MetaBall *copy_mball(MetaBall *mb)
        MetaBall *mbn;
        int a;
        
-       mbn= copy_libblock(mb);
+       mbn= copy_libblock(&mb->id);
 
        BLI_duplicatelist(&mbn->elems, &mb->elems);
        
index 4a8bc34cdf762002ec760a0c8072725d4532f6f0..ec9d4873057664e02f525b319b59db542d410359 100644 (file)
@@ -206,7 +206,7 @@ Mesh *copy_mesh(Mesh *me)
        MTFace *tface;
        int a, i;
        
-       men= copy_libblock(me);
+       men= copy_libblock(&me->id);
        
        men->mat= MEM_dupallocN(me->mat);
        for(a=0; a<men->totcol; a++) {
index e2ef39b7563d764f0a2ee7e576402c41635ad163..115591863cca656832833ac599978e7c290a6ab4 100644 (file)
@@ -629,7 +629,7 @@ bNodeTree *ntreeCopyTree(bNodeTree *ntree)
        for(newtree=G.main->nodetree.first; newtree; newtree= newtree->id.next)
                if(newtree==ntree) break;
        if(newtree) {
-               newtree= copy_libblock(ntree);
+               newtree= copy_libblock(&ntree->id);
        } else {
                newtree= MEM_dupallocN(ntree);
                copy_libblock_data(&newtree->id, &ntree->id, TRUE); /* copy animdata and ID props */
index 07e199c1535a38edc703a9cae4b6f44ad4063103..45bd8f095a43c46dc2185e83fcd6ed6308f409dd 100644 (file)
@@ -1085,7 +1085,7 @@ Object *copy_object(Object *ob)
        ModifierData *md;
        int a;
 
-       obn= copy_libblock(ob);
+       obn= copy_libblock(&ob->id);
        
        if(ob->totcol) {
                obn->mat= MEM_dupallocN(ob->mat);
index 56e4c91ba5e56b6429f450d89896aa0f07a2ae42..1064a5af1609d39458a8b1d9e186f4ccdbffb83a 100644 (file)
@@ -3569,7 +3569,7 @@ ParticleSettings *psys_copy_settings(ParticleSettings *part)
        ParticleSettings *partn;
        int a;
 
-       partn= copy_libblock(part);
+       partn= copy_libblock(&part->id);
        partn->pd= MEM_dupallocN(part->pd);
        partn->pd2= MEM_dupallocN(part->pd2);
        partn->effector_weights= MEM_dupallocN(part->effector_weights);
index ba5b98ee3cd906732ea6aed8dcdfbcf950c10b70..9deaa19429fbcfb543edced0be6597b8a1af9cd1 100644 (file)
@@ -183,8 +183,8 @@ static void ptcache_softbody_interpolate(int index, void *soft_v, void **data, f
        if(cfra1 == cfra2)
                return;
 
-       VECCOPY(keys[1].co, bp->pos);
-       VECCOPY(keys[1].vel, bp->vec);
+       copy_v3_v3(keys[1].co, bp->pos);
+       copy_v3_v3(keys[1].vel, bp->vec);
 
        if(old_data) {
                memcpy(keys[2].co, old_data, 3 * sizeof(float));
@@ -202,8 +202,8 @@ static void ptcache_softbody_interpolate(int index, void *soft_v, void **data, f
 
        mul_v3_fl(keys->vel, 1.0f / dfra);
 
-       VECCOPY(bp->pos, keys->co);
-       VECCOPY(bp->vec, keys->vel);
+       copy_v3_v3(bp->pos, keys->co);
+       copy_v3_v3(bp->vec, keys->vel);
 }
 static int  ptcache_softbody_totpoint(void *soft_v, int UNUSED(cfra))
 {
@@ -483,8 +483,8 @@ static void ptcache_cloth_interpolate(int index, void *cloth_v, void **data, flo
        if(cfra1 == cfra2)
                return;
 
-       VECCOPY(keys[1].co, vert->x);
-       VECCOPY(keys[1].vel, vert->v);
+       copy_v3_v3(keys[1].co, vert->x);
+       copy_v3_v3(keys[1].vel, vert->v);
 
        if(old_data) {
                memcpy(keys[2].co, old_data, 3 * sizeof(float));
@@ -502,8 +502,8 @@ static void ptcache_cloth_interpolate(int index, void *cloth_v, void **data, flo
 
        mul_v3_fl(keys->vel, 1.0f / dfra);
 
-       VECCOPY(vert->x, keys->co);
-       VECCOPY(vert->v, keys->vel);
+       copy_v3_v3(vert->x, keys->co);
+       copy_v3_v3(vert->v, keys->vel);
 
        /* should vert->xconst be interpolated somehow too? - jahka */
 }
@@ -2126,7 +2126,7 @@ int  BKE_ptcache_id_exist(PTCacheID *pid, int cfra)
 }
 void BKE_ptcache_id_time(PTCacheID *pid, Scene *scene, float cfra, int *startframe, int *endframe, float *timescale)
 {
-       Object *ob;
+       /* Object *ob; */ /* UNUSED */
        PointCache *cache;
        /* float offset; unused for now */
        float time, nexttime;
@@ -2143,7 +2143,7 @@ void BKE_ptcache_id_time(PTCacheID *pid, Scene *scene, float cfra, int *startfra
         *   is probably to interpolate results from two frames for that ..
         */
 
-       ob= pid->ob;
+       /* ob= pid->ob; */ /* UNUSED */
        cache= pid->cache;
 
        if(timescale) {
index 66d29b02263e4e9372f24c5c54f37814bb4a64b8..14dfe015894c5d5f8b18b3cc58347e989d1cc926 100644 (file)
@@ -126,7 +126,7 @@ Scene *copy_scene(Scene *sce, int type)
                scen->r.layers= lb;
        }
        else {
-               scen= copy_libblock(sce);
+               scen= copy_libblock(&sce->id);
                BLI_duplicatelist(&(scen->base), &(sce->base));
                
                clear_id_newpoins();
index 3d788b40a17ccc4d843ff6f379d639ec48621ba2..aed246690bd8bce682e0ecaa2fc5781eacf6e93f 100644 (file)
@@ -167,13 +167,11 @@ static void shrinkwrap_calc_nearest_vertex(ShrinkwrapCalcData *calc)
 
 
                //Convert the vertex to tree coordinates
-               if(calc->vert)
-               {
-                       VECCOPY(tmp_co, calc->vert[i].co);
+               if(calc->vert) {
+                       copy_v3_v3(tmp_co, calc->vert[i].co);
                }
-               else
-               {
-                       VECCOPY(tmp_co, co);
+               else {
+                       copy_v3_v3(tmp_co, co);
                }
                space_transform_apply(&calc->local2target, tmp_co);
 
@@ -198,7 +196,7 @@ static void shrinkwrap_calc_nearest_vertex(ShrinkwrapCalcData *calc)
                        if(dist > FLT_EPSILON) weight *= (dist - calc->keepDist)/dist;
 
                        //Convert the coordinates back to mesh coordinates
-                       VECCOPY(tmp_co, nearest.co);
+                       copy_v3_v3(tmp_co, nearest.co);
                        space_transform_invert(&calc->local2target, tmp_co);
 
                        interp_v3_v3v3(co, co, tmp_co, weight); //linear interpolation
@@ -228,11 +226,11 @@ int normal_projection_project_vertex(char options, const float *vert, const floa
        //Apply space transform (TODO readjust dist)
        if(transf)
        {
-               VECCOPY( tmp_co, vert );
+               copy_v3_v3( tmp_co, vert );
                space_transform_apply( transf, tmp_co );
                co = tmp_co;
 
-               VECCOPY( tmp_no, dir );
+               copy_v3_v3( tmp_no, dir );
                space_transform_apply_normal( transf, tmp_no );
                no = tmp_no;
 
@@ -350,17 +348,17 @@ static void shrinkwrap_calc_normal_projection(ShrinkwrapCalcData *calc)
                                /* this coordinated are deformed by vertexCos only for normal projection (to get correct normals) */
                                /* for other cases calc->varts contains undeformed coordinates and vertexCos should be used */
                                if(calc->smd->projAxis == MOD_SHRINKWRAP_PROJECT_OVER_NORMAL) {
-                                       VECCOPY(tmp_co, calc->vert[i].co);
+                                       copy_v3_v3(tmp_co, calc->vert[i].co);
                                        normal_short_to_float_v3(tmp_no, calc->vert[i].no);
                                } else {
-                                       VECCOPY(tmp_co, co);
-                                       VECCOPY(tmp_no, proj_axis);
+                                       copy_v3_v3(tmp_co, co);
+                                       copy_v3_v3(tmp_no, proj_axis);
                                }
                        }
                        else
                        {
-                               VECCOPY(tmp_co, co);
-                               VECCOPY(tmp_no, proj_axis);
+                               copy_v3_v3(tmp_co, co);
+                               copy_v3_v3(tmp_no, proj_axis);
                        }
 
 
@@ -443,11 +441,11 @@ static void shrinkwrap_calc_nearest_surface_point(ShrinkwrapCalcData *calc)
                //Convert the vertex to tree coordinates
                if(calc->vert)
                {
-                       VECCOPY(tmp_co, calc->vert[i].co);
+                       copy_v3_v3(tmp_co, calc->vert[i].co);
                }
                else
                {
-                       VECCOPY(tmp_co, co);
+                       copy_v3_v3(tmp_co, co);
                }
                space_transform_apply(&calc->local2target, tmp_co);
 
@@ -478,7 +476,7 @@ static void shrinkwrap_calc_nearest_surface_point(ShrinkwrapCalcData *calc)
                                if(dist > FLT_EPSILON)
                                        interp_v3_v3v3(tmp_co, tmp_co, nearest.co, (dist - calc->keepDist)/dist);       //linear interpolation
                                else
-                                       VECCOPY( tmp_co, nearest.co );
+                                       copy_v3_v3( tmp_co, nearest.co );
                        }
 
                        //Convert the coordinates back to mesh coordinates
index 018c7a197ffdb701c8d3b174ae0a6b49dac5f7ee..a14233e9179ff7b6410b7fb6f80af97421cb3ca9 100644 (file)
@@ -69,7 +69,7 @@ Speaker *copy_speaker(Speaker *spk)
 {
        Speaker *spkn;
 
-       spkn= copy_libblock(spk);
+       spkn= copy_libblock(&spk->id);
        if(spkn->sound)
                spkn->sound->id.us++;
 
index 955127a8000667e9497a84c9251030295c3ef9a7..e8be0bb2608f069527960c43f3a1d7cf09edfe92 100644 (file)
@@ -431,7 +431,7 @@ Text *copy_text(Text *ta)
        Text *tan;
        TextLine *line, *tmp;
        
-       tan= copy_libblock(ta);
+       tan= copy_libblock(&ta->id);
        
        /* file name can be NULL */
        if(ta->name) {
index 3aa289d0ef8bd72add873931dfc47d20f15d6710..377eeef117e6114cb1fcb15629de4651b0275a16 100644 (file)
@@ -751,7 +751,7 @@ Tex *copy_texture(Tex *tex)
 {
        Tex *texn;
        
-       texn= copy_libblock(tex);
+       texn= copy_libblock(&tex->id);
        if(texn->type==TEX_IMAGE) id_us_plus((ID *)texn->ima);
        else texn->ima= NULL;
        
@@ -781,7 +781,7 @@ Tex *localize_texture(Tex *tex)
 {
        Tex *texn;
        
-       texn= copy_libblock(tex);
+       texn= copy_libblock(&tex->id);
        BLI_remlink(&G.main->tex, texn);
        
        /* image texture: free_texture also doesn't decrease */
index c7d2763774d83fc65467dace6da0e235f515eca3..1d6972b9d611cafe8771a1378fdd2c6bb4666cfa 100644 (file)
@@ -118,7 +118,7 @@ World *copy_world(World *wrld)
        World *wrldn;
        int a;
        
-       wrldn= copy_libblock(wrld);
+       wrldn= copy_libblock(&wrld->id);
        
        for(a=0; a<MAX_MTEX; a++) {
                if(wrld->mtex[a]) {
@@ -142,7 +142,7 @@ World *localize_world(World *wrld)
        World *wrldn;
        int a;
        
-       wrldn= copy_libblock(wrld);
+       wrldn= copy_libblock(&wrld->id);
        BLI_remlink(&G.main->world, wrldn);
        
        for(a=0; a<MAX_MTEX; a++) {
index e259071a27ac4943b0ebbf5b92cacc7f19786be0..2b9d6d2d6d63cd640cfa2807e4981abee39d7881 100644 (file)
@@ -54,11 +54,18 @@ MINLINE void swap_v2_v2(float a[2], float b[2]);
 MINLINE void swap_v3_v3(float a[3], float b[3]);
 MINLINE void swap_v4_v4(float a[4], float b[4]);
 
+/* char */
+MINLINE void copy_v2_v2_char(char r[2], const char a[2]);
+MINLINE void copy_v3_v3_char(char r[3], const char a[3]);
+MINLINE void copy_v4_v4_char(char r[4], const char a[4]);
 /* short */
 MINLINE void copy_v2_v2_short(short r[2], const short a[2]);
 MINLINE void copy_v3_v3_short(short r[3], const short a[3]);
 MINLINE void copy_v4_v4_short(short r[4], const short a[4]);
-
+/* int */
+MINLINE void copy_v2_v2_int(int r[2], const int a[2]);
+MINLINE void copy_v3_v3_int(int r[3], const int a[3]);
+MINLINE void copy_v4_v4_int(int r[4], const int a[4]);
 
 /********************************* Arithmetic ********************************/
 
index c460b69679b4a0c43a1d22d1f15f0bbf0210ee43..1c7d131c750ba904ffef8587257b7c18ec328621 100644 (file)
@@ -77,6 +77,28 @@ MINLINE void copy_v4_v4(float r[4], const float a[4])
        r[3]= a[3];
 }
 
+/* short */
+MINLINE void copy_v2_v2_char(char r[2], const char a[2])
+{
+       r[0]= a[0];
+       r[1]= a[1];
+}
+
+MINLINE void copy_v3_v3_char(char r[3], const char a[3])
+{
+       r[0]= a[0];
+       r[1]= a[1];
+       r[2]= a[2];
+}
+
+MINLINE void copy_v4_v4_char(char r[4], const char a[4])
+{
+       r[0]= a[0];
+       r[1]= a[1];
+       r[2]= a[2];
+       r[3]= a[3];
+}
+
 /* short */
 MINLINE void copy_v2_v2_short(short r[2], const short a[2])
 {
@@ -99,6 +121,28 @@ MINLINE void copy_v4_v4_short(short r[4], const short a[4])
        r[3]= a[3];
 }
 
+/* int */
+MINLINE void copy_v2_v2_int(int r[2], const int a[2])
+{
+       r[0]= a[0];
+       r[1]= a[1];
+}
+
+MINLINE void copy_v3_v3_int(int r[3], const int a[3])
+{
+       r[0]= a[0];
+       r[1]= a[1];
+       r[2]= a[2];
+}
+
+MINLINE void copy_v4_v4_int(int r[4], const int a[4])
+{
+       r[0]= a[0];
+       r[1]= a[1];
+       r[2]= a[2];
+       r[3]= a[3];
+}
+
 MINLINE void swap_v2_v2(float a[2], float b[2])
 {
        SWAP(float, a[0], b[0]);
index e8af5a8f290ae3ef00462755c72289be291116b3..f0f3b8f4123e0db1cffce43df35a3b98711873f0 100644 (file)
@@ -176,13 +176,13 @@ static void acf_generic_channel_color(bAnimContext *ac, bAnimListElem *ale, floa
                unsigned char cp[3];
                
                if (indent == 2) {
-                       VECCOPY(cp, grp->cs.solid);
+                       copy_v3_v3_char((char *)cp, grp->cs.solid);
                }
                else if (indent == 1) {
-                       VECCOPY(cp, grp->cs.select);
+                       copy_v3_v3_char((char *)cp, grp->cs.select);
                }
                else {
-                       VECCOPY(cp, grp->cs.active);
+                       copy_v3_v3_char((char *)cp, grp->cs.active);
                }
                
                /* copy the colors over, transforming from bytes to floats */
index 6f1da5757c699136db1ce74aa78ec1a5617d31bb..b1651886620bdb035297704857db061cc337aa33 100644 (file)
@@ -157,14 +157,14 @@ static void getEditBoneRollUpAxis(EditBone *bone, float roll, float up_axis[3])
        sub_v3_v3v3(nor, bone->tail, bone->head);
        
        vec_roll_to_mat3(nor, roll, mat);
-       VECCOPY(up_axis, mat[2]);
+       copy_v3_v3(up_axis, mat[2]);
 }
 
 static float rollBoneByQuatAligned(EditBone *bone, float old_up_axis[3], float qrot[4], float qroll[4], float aligned_axis[3])
 {
        float nor[3], new_up_axis[3], x_axis[3], z_axis[3];
        
-       VECCOPY(new_up_axis, old_up_axis);
+       copy_v3_v3(new_up_axis, old_up_axis);
        mul_qt_v3(qrot, new_up_axis);
        
        sub_v3_v3v3(nor, bone->tail, bone->head);
@@ -236,7 +236,7 @@ static float rollBoneByQuatJoint(RigEdge *edge, RigEdge *previous, float qrot[4]
                
                mul_qt_v3(qroll, normal);
                        
-               VECCOPY(new_up_axis, edge->up_axis);
+               copy_v3_v3(new_up_axis, edge->up_axis);
                mul_qt_v3(qrot, new_up_axis);
                
                normalize_v3(new_up_axis);
@@ -252,7 +252,7 @@ float rollBoneByQuat(EditBone *bone, float old_up_axis[3], float qrot[4])
 {
        float new_up_axis[3];
        
-       VECCOPY(new_up_axis, old_up_axis);
+       copy_v3_v3(new_up_axis, old_up_axis);
        mul_qt_v3(qrot, new_up_axis);
        
        return ED_rollBoneToVector(bone, new_up_axis, FALSE);
@@ -367,7 +367,7 @@ static RigNode *newRigNodeHead(RigGraph *rg, RigArc *arc, float p[3])
        node = MEM_callocN(sizeof(RigNode), "rig node");
        BLI_addtail(&rg->nodes, node);
 
-       VECCOPY(node->p, p);
+       copy_v3_v3(node->p, p);
        node->degree = 1;
        node->arcs = NULL;
        
@@ -389,7 +389,7 @@ static RigNode *newRigNode(RigGraph *rg, float p[3])
        node = MEM_callocN(sizeof(RigNode), "rig node");
        BLI_addtail(&rg->nodes, node);
 
-       VECCOPY(node->p, p);
+       copy_v3_v3(node->p, p);
        node->degree = 0;
        node->arcs = NULL;
        
@@ -412,12 +412,12 @@ static void RIG_appendEdgeToArc(RigArc *arc, RigEdge *edge)
 
        if (edge->prev == NULL)
        {
-               VECCOPY(edge->head, arc->head->p);
+               copy_v3_v3(edge->head, arc->head->p);
        }
        else
        {
                RigEdge *last_edge = edge->prev;
-               VECCOPY(edge->head, last_edge->tail);
+               copy_v3_v3(edge->head, last_edge->tail);
                RIG_calculateEdgeAngles(last_edge, edge);
        }
        
@@ -434,7 +434,7 @@ static void RIG_addEdgeToArc(RigArc *arc, float tail[3], EditBone *bone)
 
        edge = MEM_callocN(sizeof(RigEdge), "rig edge");
 
-       VECCOPY(edge->tail, tail);
+       copy_v3_v3(edge->tail, tail);
        edge->bone = bone;
        
        if (bone)
@@ -489,10 +489,10 @@ static RigControl *cloneControl(RigGraph *rg, RigGraph *src_rg, RigControl *src_
        
        ctrl = newRigControl(rg);
        
-       VECCOPY(ctrl->head, src_ctrl->head);
-       VECCOPY(ctrl->tail, src_ctrl->tail);
-       VECCOPY(ctrl->up_axis, src_ctrl->up_axis);
-       VECCOPY(ctrl->offset, src_ctrl->offset);
+       copy_v3_v3(ctrl->head, src_ctrl->head);
+       copy_v3_v3(ctrl->tail, src_ctrl->tail);
+       copy_v3_v3(ctrl->up_axis, src_ctrl->up_axis);
+       copy_v3_v3(ctrl->offset, src_ctrl->offset);
        
        ctrl->tail_mode = src_ctrl->tail_mode;
        ctrl->flag = src_ctrl->flag;
@@ -531,9 +531,9 @@ static RigArc *cloneArc(RigGraph *rg, RigGraph *src_rg, RigArc *src_arc, GHash *
        
                edge = MEM_callocN(sizeof(RigEdge), "rig edge");
 
-               VECCOPY(edge->head, src_edge->head);
-               VECCOPY(edge->tail, src_edge->tail);
-               VECCOPY(edge->up_axis, src_edge->up_axis);
+               copy_v3_v3(edge->head, src_edge->head);
+               copy_v3_v3(edge->tail, src_edge->tail);
+               copy_v3_v3(edge->up_axis, src_edge->up_axis);
                
                edge->length = src_edge->length;
                edge->angle = src_edge->angle;
@@ -690,8 +690,8 @@ static void RIG_addControlBone(RigGraph *rg, EditBone *bone)
 {
        RigControl *ctrl = newRigControl(rg);
        ctrl->bone = bone;
-       VECCOPY(ctrl->head, bone->head);
-       VECCOPY(ctrl->tail, bone->tail);
+       copy_v3_v3(ctrl->head, bone->head);
+       copy_v3_v3(ctrl->tail, bone->tail);
        getEditBoneRollUpAxis(bone, bone->roll, ctrl->up_axis);
        ctrl->tail_mode = TL_NONE;
        
@@ -765,7 +765,7 @@ static int RIG_parentControl(RigControl *ctrl, EditBone *link)
                ctrl->link = link;
                ctrl->flag = flag;
                
-               VECCOPY(ctrl->offset, offset);
+               copy_v3_v3(ctrl->offset, offset);
                
                return 1;
        }
@@ -1146,7 +1146,7 @@ static void RIG_removeUneededOffsets(RigGraph *rg)
                                                BLI_remlink(&arc->edges, first_edge);
                                                MEM_freeN(first_edge);
                                                
-                                               VECCOPY(arc->head->p, next_edge->head);
+                                               copy_v3_v3(arc->head->p, next_edge->head);
                                        }
                                }
                        }
@@ -1222,7 +1222,7 @@ static void RIG_removeUneededOffsets(RigGraph *rg)
                                                        BLI_remlink(&arc->edges, first_edge);
                                                        MEM_freeN(first_edge);
                                                        
-                                                       VECCOPY(arc->head->p, next_edge->head);
+                                                       copy_v3_v3(arc->head->p, next_edge->head);
                                                        
                                                        /* remove null edge in other arcs too */
                                                        for (other_arc = rg->arcs.first; other_arc; other_arc = other_arc->next)
@@ -1284,7 +1284,7 @@ static void RIG_removeUneededOffsets(RigGraph *rg)
                                                BLI_remlink(&arc->edges, last_edge);
                                                MEM_freeN(last_edge);
                                                
-                                               VECCOPY(arc->tail->p, previous_edge->tail);
+                                               copy_v3_v3(arc->tail->p, previous_edge->tail);
                                                previous_edge->angle = 0;
                                        }
                                }
@@ -1755,7 +1755,7 @@ static void finalizeControl(RigGraph *rigg, RigControl *ctrl, float resize)
                        sub_v3_v3v3(v1, ctrl->bone->tail, ctrl->bone->head);
                        sub_v3_v3v3(v2, tail_vec, ctrl->bone->head);
                        
-                       VECCOPY(ctrl->bone->tail, tail_vec);
+                       copy_v3_v3(ctrl->bone->tail, tail_vec);
                        
                        rotation_between_vecs_to_quat(qtail, v1, v2);
                        mul_qt_qtqt(ctrl->qrot, qtail, ctrl->qrot);
@@ -1791,7 +1791,7 @@ static void repositionControl(RigGraph *rigg, RigControl *ctrl, float head[3], f
 {
        float parent_offset[3], tail_offset[3];
        
-       VECCOPY(parent_offset, ctrl->offset);
+       copy_v3_v3(parent_offset, ctrl->offset);
        mul_v3_fl(parent_offset, resize);
        mul_qt_v3(qrot, parent_offset);
        
@@ -1799,7 +1799,7 @@ static void repositionControl(RigGraph *rigg, RigControl *ctrl, float head[3], f
 
        ctrl->flag |= RIG_CTRL_HEAD_DONE;
 
-       QUATCOPY(ctrl->qrot, qrot); 
+       copy_qt_qt(ctrl->qrot, qrot);
 
        if (ctrl->tail_mode == TL_NONE)
        {
@@ -1836,8 +1836,8 @@ static void repositionBone(bContext *C, RigGraph *rigg, RigEdge *edge, float vec
        
        rotation_between_vecs_to_quat(qrot, v1, v2);
        
-       VECCOPY(bone->head, vec0);
-       VECCOPY(bone->tail, vec1);
+       copy_v3_v3(bone->head, vec0);
+       copy_v3_v3(bone->tail, vec1);
        
        if (!is_zero_v3(up_axis))
        {
index d228d4d3772a437b505a912d088e2522249cc96f..b97e843529a595b2d885df6cf641fe59c42b0aae 100644 (file)
@@ -624,7 +624,7 @@ static void drawSubdividedStrokeBy(ToolSettings *toolsettings, BArcIterator *ite
        gluQuadricNormals(quad, GLU_SMOOTH);
 
        iter->head(iter);
-       VECCOPY(head, iter->p);
+       copy_v3_v3(head, iter->p);
 
        index = next_subdividion(toolsettings, iter, bone_start, end, head, tail);
        while (index != -1)
@@ -640,7 +640,7 @@ static void drawSubdividedStrokeBy(ToolSettings *toolsettings, BArcIterator *ite
 
                glPopMatrix();
 
-               VECCOPY(head, tail);
+               copy_v3_v3(head, tail);
                bone_start = index; // start next bone from current index
 
                index = next_subdividion(toolsettings, iter, bone_start, end, head, tail);
@@ -748,7 +748,7 @@ static SK_Point *sk_snapPointArmature(bContext *C, Object *ob, ListBase *ebones,
 
                if ((bone->flag & BONE_CONNECTED) == 0)
                {
-                       VECCOPY(vec, bone->head);
+                       copy_v3_v3(vec, bone->head);
                        mul_m4_v3(ob->obmat, vec);
                        project_short_noclip(ar, vec, pval);
 
@@ -758,13 +758,13 @@ static SK_Point *sk_snapPointArmature(bContext *C, Object *ob, ListBase *ebones,
                        {
                                *dist = pdist;
                                pt = &boneSnap;
-                               VECCOPY(pt->p, vec);
+                               copy_v3_v3(pt->p, vec);
                                pt->type = PT_EXACT;
                        }
                }
 
 
-               VECCOPY(vec, bone->tail);
+               copy_v3_v3(vec, bone->tail);
                mul_m4_v3(ob->obmat, vec);
                project_short_noclip(ar, vec, pval);
 
@@ -774,7 +774,7 @@ static SK_Point *sk_snapPointArmature(bContext *C, Object *ob, ListBase *ebones,
                {
                        *dist = pdist;
                        pt = &boneSnap;
-                       VECCOPY(pt->p, vec);
+                       copy_v3_v3(pt->p, vec);
                        pt->type = PT_EXACT;
                }
        }
@@ -1024,7 +1024,7 @@ static void sk_projectDrawPoint(bContext *C, float vec[3], SK_Stroke *stk, SK_Dr
 
        if (last != NULL)
        {
-               VECCOPY(fp, last->p);
+               copy_v3_v3(fp, last->p);
        }
 
        initgrabz(ar->regiondata, fp[0], fp[1], fp[2]);
@@ -1134,12 +1134,12 @@ static int sk_getStrokeSnapPoint(bContext *C, SK_Point *pt, SK_Sketch *sketch, S
                                }
                                else
                                {
-                                       VECCOPY(vec, p1->p);
+                                       copy_v3_v3(vec, p1->p);
                                }
 
                                if (last_p == NULL)
                                {
-                                       VECCOPY(p, vec);
+                                       copy_v3_v3(p, vec);
                                        size = new_size;
                                        dist = 0;
                                        break;
@@ -1149,7 +1149,7 @@ static int sk_getStrokeSnapPoint(bContext *C, SK_Point *pt, SK_Sketch *sketch, S
 
                                if (new_dist < dist)
                                {
-                                       VECCOPY(p, vec);
+                                       copy_v3_v3(p, vec);
                                        dist = new_dist;
                                        size = new_size;
                                }
@@ -1161,7 +1161,7 @@ static int sk_getStrokeSnapPoint(bContext *C, SK_Point *pt, SK_Sketch *sketch, S
                        pt->type = dd->type;
                        pt->mode = PT_SNAP;
                        pt->size = size / 2;
-                       VECCOPY(pt->p, p);
+                       copy_v3_v3(pt->p, p);
 
                        point_added = 1;
                }
@@ -1193,7 +1193,7 @@ static int sk_getStrokeSnapPoint(bContext *C, SK_Point *pt, SK_Sketch *sketch, S
 
                        if (spt != NULL)
                        {
-                               VECCOPY(pt->p, spt->p);
+                               copy_v3_v3(pt->p, spt->p);
                                point_added = 1;
                        }
                }
@@ -1207,7 +1207,7 @@ static int sk_getStrokeSnapPoint(bContext *C, SK_Point *pt, SK_Sketch *sketch, S
                {
                        pt->type = dd->type;
                        pt->mode = PT_SNAP;
-                       VECCOPY(pt->p, vec);
+                       copy_v3_v3(pt->p, vec);
 
                        point_added = 1;
                }
@@ -1234,7 +1234,7 @@ static int sk_addStrokeSnapPoint(bContext *C, SK_Sketch *sketch, SK_Stroke *stk,
                int total;
                int i;
 
-               VECCOPY(final_p, pt.p);
+               copy_v3_v3(final_p, pt.p);
 
                sk_projectDrawPoint(C, pt.p, stk, dd);
                sk_appendStrokePoint(stk, &pt);
@@ -1259,7 +1259,7 @@ static int sk_addStrokeSnapPoint(bContext *C, SK_Sketch *sketch, SK_Stroke *stk,
                        sk_interpolateDepth(C, stk, i + 1, stk->nb_points - 2, length, distance);
                }
 
-               VECCOPY(stk->points[stk->nb_points - 1].p, final_p);
+               copy_v3_v3(stk->points[stk->nb_points - 1].p, final_p);
 
                point_added = 1;
        }
@@ -1296,7 +1296,7 @@ static void sk_getStrokePoint(bContext *C, SK_Point *pt, SK_Sketch *sketch, SK_S
        {
                point_added = sk_getStrokeSnapPoint(C, pt, sketch, stk, dd);
                LAST_SNAP_POINT_VALID = 1;
-               VECCOPY(LAST_SNAP_POINT, pt->p);
+               copy_v3_v3(LAST_SNAP_POINT, pt->p);
        }
        else
        {
@@ -1536,8 +1536,8 @@ static void sk_convertStroke(bContext *C, SK_Stroke *stk)
                                {
                                        bone = ED_armature_edit_bone_add(arm, "Bone");
 
-                                       VECCOPY(bone->head, head->p);
-                                       VECCOPY(bone->tail, pt->p);
+                                       copy_v3_v3(bone->head, head->p);
+                                       copy_v3_v3(bone->tail, pt->p);
 
                                        mul_m4_v3(invmat, bone->head);
                                        mul_m4_v3(invmat, bone->tail);
index 1b661cc05a9c8d6a955b0190355f4aa857ac03cf..65db5e27ed7b7b9b9e4b49d0ebc95add5ecae99f 100644 (file)
@@ -569,8 +569,8 @@ static void gp_layer_to_curve (bContext *C, bGPdata *gpd, bGPDlayer *gpl, short
         *      - must clear transforms set on object, as those skew our results
         */
        ob= add_object(scene, OB_CURVE);
-       ob->loc[0]= ob->loc[1]= ob->loc[2]= 0;
-       ob->rot[0]= ob->rot[1]= ob->rot[2]= 0;
+       zero_v3(ob->loc);
+       zero_v3(ob->rot);
        cu= ob->data;
        cu->flag |= CU_3D;
        
@@ -587,6 +587,9 @@ static void gp_layer_to_curve (bContext *C, bGPdata *gpd, bGPDlayer *gpl, short
                        case GP_STROKECONVERT_CURVE:
                                gp_stroke_to_bezier(C, gpl, gps, cu, subrect_ptr);
                                break;
+                       default:
+                               BLI_assert(!"invalid mode");
+                               break;
                }
        }
 }
@@ -616,17 +619,7 @@ static int gp_convert_layer_exec (bContext *C, wmOperator *op)
                return OPERATOR_CANCELLED;
        }
 
-       /* handle conversion modes */
-       switch (mode) {
-               case GP_STROKECONVERT_PATH:
-               case GP_STROKECONVERT_CURVE:
-                       gp_layer_to_curve(C, gpd, gpl, mode);
-                       break;
-                       
-               default: /* unsupoorted */
-                       BKE_report(op->reports, RPT_ERROR, "Unknown conversion option");
-                       return OPERATOR_CANCELLED;
-       }
+       gp_layer_to_curve(C, gpd, gpl, mode);
 
        /* notifiers */
        WM_event_add_notifier(C, NC_OBJECT|NA_ADDED, NULL);
index 9b232d886d2f6a8391b639d392a810cb8a6d77ad..b89b0cda451da2be7d1aa258d68a7ea2f20b74de 100644 (file)
@@ -664,7 +664,7 @@ static void gp_stroke_newfrombuffer (tGPsdata *p)
                                        found_depth= TRUE;
                                }
 
-                               VECCOPY2D(mval_prev, mval);
+                               copy_v2_v2_int(mval_prev, mval);
                        }
                        
                        if (found_depth == FALSE) {
index dd75f506be858f9509c22b2c7662fa8a576b5532..e5092c82304d6553840d057d89051e0c97313bdb 100644 (file)
@@ -1224,7 +1224,7 @@ void ui_get_but_vectorf(uiBut *but, float vec[3])
        int a, tot;
 
        if(but->editvec) {
-               VECCOPY(vec, but->editvec);
+               copy_v3_v3(vec, but->editvec);
        }
 
        if(but->rnaprop) {
@@ -1248,7 +1248,7 @@ void ui_get_but_vectorf(uiBut *but, float vec[3])
        }
        else if(but->pointype == FLO) {
                float *fp= (float *)but->poin;
-               VECCOPY(vec, fp);
+               copy_v3_v3(vec, fp);
        }
        else {
                if (but->editvec==NULL) {
index 7a138e72891af4c4056370404b14000fc4206fe0..8ab48ac8ffa1e6c16ef8a6f6988a154f0ba99970 100644 (file)
@@ -1510,7 +1510,7 @@ static void widget_state(uiWidgetType *wt, int state)
        wt->wcol= *(wt->wcol_theme);
        
        if(state & UI_SELECT) {
-               QUATCOPY(wt->wcol.inner, wt->wcol.inner_sel)
+               copy_v4_v4_char(wt->wcol.inner, wt->wcol.inner_sel);
 
                if(state & UI_BUT_ANIMATED_KEY)
                        widget_state_blend(wt->wcol.inner, wcol_state->inner_key_sel, wcol_state->blend);
@@ -1519,7 +1519,7 @@ static void widget_state(uiWidgetType *wt, int state)
                else if(state & UI_BUT_DRIVEN)
                        widget_state_blend(wt->wcol.inner, wcol_state->inner_driven_sel, wcol_state->blend);
 
-               VECCOPY(wt->wcol.text, wt->wcol.text_sel);
+               copy_v3_v3_char(wt->wcol.text, wt->wcol.text_sel);
                
                if(state & UI_SELECT)
                        SWAP(short, wt->wcol.shadetop, wt->wcol.shadedown);
@@ -1604,7 +1604,7 @@ static void widget_state_option_menu(uiWidgetType *wt, int state)
        else {
                bTheme *btheme= U.themes.first; /* XXX */
 
-               VECCOPY(wt->wcol.text, btheme->tui.wcol_menu_back.text);
+               copy_v3_v3_char(wt->wcol.text, btheme->tui.wcol_menu_back.text);
        }
 }
 
@@ -1619,11 +1619,11 @@ static void widget_state_pulldown(uiWidgetType *wt, int state)
 {
        wt->wcol= *(wt->wcol_theme);
        
-       QUATCOPY(wt->wcol.inner, wt->wcol.inner_sel);
-       VECCOPY(wt->wcol.outline, wt->wcol.inner);
+       copy_v4_v4_char(wt->wcol.inner, wt->wcol.inner_sel);
+       copy_v3_v3_char(wt->wcol.outline, wt->wcol.inner);
 
        if(state & UI_ACTIVE)
-               VECCOPY(wt->wcol.text, wt->wcol.text_sel);
+               copy_v3_v3_char(wt->wcol.text, wt->wcol.text_sel);
 }
 
 /* special case, menu items */
@@ -1637,8 +1637,8 @@ static void widget_state_menu_item(uiWidgetType *wt, int state)
                wt->wcol.text[2]= 0.5f*(wt->wcol.text[2]+wt->wcol.text_sel[2]);
        }
        else if(state & UI_ACTIVE) {
-               QUATCOPY(wt->wcol.inner, wt->wcol.inner_sel);
-               VECCOPY(wt->wcol.text, wt->wcol.text_sel);
+               copy_v4_v4_char(wt->wcol.inner, wt->wcol.inner_sel);
+               copy_v3_v3_char(wt->wcol.text, wt->wcol.text_sel);
        }
 }
 
@@ -2197,7 +2197,7 @@ void uiWidgetScrollDraw(uiWidgetColors *wcol, rcti *rect, rcti *slider, int stat
                
                SWAP(short, wcol->shadetop, wcol->shadedown);
                
-               QUATCOPY(wcol->inner, wcol->item);
+               copy_v4_v4_char(wcol->inner, wcol->item);
                
                if(wcol->shadetop>wcol->shadedown)
                        wcol->shadetop+= 20;    /* XXX violates themes... */
@@ -2369,9 +2369,9 @@ static void widget_numslider(uiBut *but, uiWidgetColors *wcol, rcti *rect, int s
        if(!(state & UI_TEXTINPUT)) {
                
                        /* slider part */
-               VECCOPY(outline, wcol->outline);
-               VECCOPY(wcol->outline, wcol->item);
-               VECCOPY(wcol->inner, wcol->item);
+               copy_v3_v3_char(outline, wcol->outline);
+               copy_v3_v3_char(wcol->outline, wcol->item);
+               copy_v3_v3_char(wcol->inner, wcol->item);
 
                if(!(state & UI_SELECT))
                        SWAP(short, wcol->shadetop, wcol->shadedown);
@@ -2397,7 +2397,7 @@ static void widget_numslider(uiBut *but, uiWidgetColors *wcol, rcti *rect, int s
                round_box_edges(&wtb1, roundboxalign & ~(UI_CNR_TOP_LEFT | UI_CNR_BOTTOM_LEFT), &rect1, offs);
                
                widgetbase_draw(&wtb1, wcol);
-               VECCOPY(wcol->outline, outline);
+               copy_v3_v3_char(wcol->outline, outline);
                
                if(!(state & UI_SELECT))
                        SWAP(short, wcol->shadetop, wcol->shadedown);
@@ -2624,7 +2624,7 @@ static void widget_box(uiBut *but, uiWidgetColors *wcol, rcti *rect, int UNUSED(
        
        widget_init(&wtb);
        
-       VECCOPY(old_col, wcol->inner);
+       copy_v3_v3_char(old_col, wcol->inner);
        
        /* abuse but->hsv - if it's non-zero, use this color as the box's background */
        if (but->col[3]) {
@@ -2643,7 +2643,7 @@ static void widget_box(uiBut *but, uiWidgetColors *wcol, rcti *rect, int UNUSED(
        /* XXX, this doesnt work right since the color applies to buttons outside the box too. */
        glClearColor(wcol->inner[0]/255.0, wcol->inner[1]/255.0, wcol->inner[2]/255.0, 1.0);
        
-       VECCOPY(wcol->inner, old_col);
+       copy_v3_v3_char(wcol->inner, old_col);
 }
 
 static void widget_but(uiWidgetColors *wcol, rcti *rect, int UNUSED(state), int roundboxalign)
index 99af17c161e5db16d56a47c870770a2ba4d2b088..1852d90eed0ec866587e19ff44ca7c0222340380 100644 (file)
@@ -1387,6 +1387,8 @@ static void delete_mesh(EditMesh *em, wmOperator *op, int event)
                }
        }
 
+       recalc_editnormals(em);
+
        EM_fgon_flags(em);      // redo flags and indices for fgons
 }
 
index a929144ed2ee19ce12f97a1979b13c40860ed126..8d4d29dbe50a1ebfc1c8315a1383af5e80bb61fe 100644 (file)
@@ -48,6 +48,7 @@
 #include "DNA_vfont_types.h"
 
 #include "BLI_math.h"
+#include "BLI_string.h"
 #include "BLI_listbase.h"
 #include "BLI_utildefines.h"
 
@@ -1008,23 +1009,21 @@ static void copy_object_set_idnew(bContext *C, int dupflag)
 
 /********************* Make Duplicates Real ************************/
 
-static void make_object_duplilist_real(bContext *C, Scene *scene, Base *base)
+static void make_object_duplilist_real(bContext *C, Scene *scene, Base *base,
+                                       const short use_base_parent,
+                                       const short use_hierarchy)
 {
-       Base *basen;
-       Object *ob;
        ListBase *lb;
        DupliObject *dob;
-       
-       if(!base && !(base = BASACT))
-               return;
-       
+
        if(!(base->object->transflag & OB_DUPLI))
                return;
        
        lb= object_duplilist(scene, base->object);
        
        for(dob= lb->first; dob; dob= dob->next) {
-               ob= copy_object(dob->ob);
+               Base *basen;
+               Object *ob= copy_object(dob->ob);
                /* font duplis can have a totcol without material, we get them from parent
                * should be implemented better...
                */
@@ -1051,22 +1050,85 @@ static void make_object_duplilist_real(bContext *C, Scene *scene, Base *base)
                object_apply_mat4(ob, ob->obmat, FALSE, FALSE);
        }
        
+       if (use_hierarchy) {
+               for(dob= lb->first; dob; dob= dob->next) {
+                       /* original parents */
+                       Object *ob_src=     dob->ob;
+                       Object *ob_src_par= ob_src->parent;
+
+                       Object *ob_dst=     (Object *)ob_src->id.newid;
+
+                       if (ob_src_par && ob_src_par->id.newid) {
+                               /* the parent was also made real, parent newly real duplis */
+                               Object *ob_dst_par= (Object *)ob_src_par->id.newid;
+
+                               /* allow for all possible parent types */
+                               ob_dst->partype= ob_src->partype;
+                               BLI_strncpy(ob_dst->parsubstr, ob_src->parsubstr, sizeof(ob_dst->parsubstr));
+                               ob_dst->par1= ob_src->par1;
+                               ob_dst->par2= ob_src->par2;
+                               ob_dst->par3= ob_src->par3;
+
+                               copy_m4_m4(ob_dst->parentinv, ob_src->parentinv);
+
+                               ob_dst->parent= ob_dst_par;
+                       }
+                       else if (use_base_parent) {
+                               ob_dst->parent= base->object;
+                               ob_dst->partype= PAROBJECT;
+                       }
+
+                       if (ob_dst->parent) {
+                               invert_m4_m4(ob_dst->parentinv, dob->mat);
+
+                               /* note, this may be the parent of other objects, but it should
+                                * still work out ok */
+                               object_apply_mat4(ob_dst, dob->mat, FALSE, TRUE);
+
+                               /* to set ob_dst->orig and incase theres any other discrepicies */
+                               DAG_id_tag_update(&ob_dst->id, OB_RECALC_OB);
+                       }
+               }
+       }
+       else if (use_base_parent) {
+               /* since we are ignoring the internal hierarchy - parent all to the
+                * base object */
+               for(dob= lb->first; dob; dob= dob->next) {
+                       /* original parents */
+                       Object *ob_src=     dob->ob;
+                       Object *ob_dst=     (Object *)ob_src->id.newid;
+
+                       ob_dst->parent= base->object;
+                       ob_dst->partype= PAROBJECT;
+
+                       /* similer to the code above, see comments */
+                       invert_m4_m4(ob_dst->parentinv, dob->mat);
+                       object_apply_mat4(ob_dst, dob->mat, FALSE, TRUE);
+                       DAG_id_tag_update(&ob_dst->id, OB_RECALC_OB);
+
+
+               }
+       }
+
        copy_object_set_idnew(C, 0);
        
        free_object_duplilist(lb);
        
-       base->object->transflag &= ~OB_DUPLI;   
+       base->object->transflag &= ~OB_DUPLI;
 }
 
-static int object_duplicates_make_real_exec(bContext *C, wmOperator *UNUSED(op))
+static int object_duplicates_make_real_exec(bContext *C, wmOperator *op)
 {
        Main *bmain= CTX_data_main(C);
        Scene *scene= CTX_data_scene(C);
+
+       const short use_base_parent= RNA_boolean_get(op->ptr, "use_base_parent");
+       const short use_hierarchy= RNA_boolean_get(op->ptr, "use_hierarchy");
        
        clear_id_newpoins();
                
        CTX_DATA_BEGIN(C, Base*, base, selected_editable_bases) {
-               make_object_duplilist_real(C, scene, base);
+               make_object_duplilist_real(C, scene, base, use_base_parent, use_hierarchy);
 
                /* dependencies were changed */
                WM_event_add_notifier(C, NC_OBJECT|ND_PARENT, base->object);
@@ -1096,6 +1158,9 @@ void OBJECT_OT_duplicates_make_real(wmOperatorType *ot)
        
        /* flags */
        ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+
+       RNA_def_boolean(ot->srna, "use_base_parent", 0, "Parent", "Parent newly created objects to the original duplicator");
+       RNA_def_boolean(ot->srna, "use_hierarchy", 0, "Keep Hierarchy", "Maintain parent child relationships");
 }
 
 /**************************** Convert **************************/
index 25c1e32f4aeb353a416dc3ce6f2b6de9d3af5665..cac167ad84f3f78a5674f25528f98f4c2650ea8e 100644 (file)
@@ -35,6 +35,7 @@
 #include "MEM_guardedalloc.h"
 
 #include "BLI_listbase.h"
+#include "BLI_math.h"
 #include "BLI_utildefines.h"
 
 #include "DNA_curve_types.h"
@@ -132,7 +133,7 @@ void load_editLatt(Object *obedit)
 
                bp= editlt->def;
                while(tot--) {
-                       VECCOPY(fp, bp->vec);
+                       copy_v3_v3(fp, bp->vec);
                        fp+= 3;
                        bp++;
                }
index 129d9df86a51c0d90fb164d3e16ae42e2516c293..ad2280baba2578db107fa5bb320121767ff8dfe1 100644 (file)
@@ -357,7 +357,7 @@ int ED_object_modifier_convert(ReportList *UNUSED(reports), Main *bmain, Scene *
                key= cache[a];
                kmax= key->steps;
                for(k=0; k<=kmax; k++,key++,cvert++,mvert++) {
-                       VECCOPY(mvert->co,key->co);
+                       copy_v3_v3(mvert->co,key->co);
                        if(k) {
                                medge->v1= cvert-1;
                                medge->v2= cvert;
@@ -376,7 +376,7 @@ int ED_object_modifier_convert(ReportList *UNUSED(reports), Main *bmain, Scene *
                key=cache[a];
                kmax=key->steps;
                for(k=0; k<=kmax; k++,key++,cvert++,mvert++) {
-                       VECCOPY(mvert->co,key->co);
+                       copy_v3_v3(mvert->co,key->co);
                        if(k) {
                                medge->v1=cvert-1;
                                medge->v2=cvert;
index 3c9edb2fcfeec200607304e27f9b97252dc82487..ce603ce80b65ba62d3973c4f43f2244f1a42925a 100644 (file)
 
 #define IMAPAINT_CHAR_TO_FLOAT(c) ((c)/255.0f)
 
-#define IMAPAINT_FLOAT_RGB_TO_CHAR(c, f) { (c)[0]=FTOCHAR((f)[0]); (c)[1]=FTOCHAR((f)[1]); (c)[2]=FTOCHAR((f)[2]); }
-#define IMAPAINT_FLOAT_RGBA_TO_CHAR(c, f) { (c)[0]=FTOCHAR((f)[0]); (c)[1]=FTOCHAR((f)[1]); (c)[2]=FTOCHAR((f)[2]); (c)[3]=FTOCHAR((f)[3]); }
-
-#define IMAPAINT_CHAR_RGB_TO_FLOAT(f, c) { (f)[0]=IMAPAINT_CHAR_TO_FLOAT((c)[0]); (f)[1]=IMAPAINT_CHAR_TO_FLOAT((c)[1]); (f)[2]=IMAPAINT_CHAR_TO_FLOAT((c)[2]); }
-#define IMAPAINT_CHAR_RGBA_TO_FLOAT(f, c) { (f)[0]=IMAPAINT_CHAR_TO_FLOAT((c)[0]); (f)[1]=IMAPAINT_CHAR_TO_FLOAT((c)[1]); (f)[2]=IMAPAINT_CHAR_TO_FLOAT((c)[2]); (f)[3]=IMAPAINT_CHAR_TO_FLOAT((c)[3]); }
-#define IMAPAINT_FLOAT_RGB_COPY(a, b) VECCOPY(a, b)
+#define IMAPAINT_FLOAT_RGB_TO_CHAR(c, f)  {                                   \
+       (c)[0]= FTOCHAR((f)[0]);                                                  \
+       (c)[1]= FTOCHAR((f)[1]);                                                  \
+       (c)[2]= FTOCHAR((f)[2]);                                                  \
+}
+#define IMAPAINT_FLOAT_RGBA_TO_CHAR(c, f)  {                                  \
+       (c)[0]= FTOCHAR((f)[0]);                                                  \
+       (c)[1]= FTOCHAR((f)[1]);                                                  \
+       (c)[2]= FTOCHAR((f)[2]);                                                  \
+       (c)[3]= FTOCHAR((f)[3]);                                                  \
+}
+#define IMAPAINT_CHAR_RGB_TO_FLOAT(f, c)  {                                   \
+       (f)[0]= IMAPAINT_CHAR_TO_FLOAT((c)[0]);                                   \
+       (f)[1]= IMAPAINT_CHAR_TO_FLOAT((c)[1]);                                   \
+       (f)[2]= IMAPAINT_CHAR_TO_FLOAT((c)[2]);                                   \
+}
+#define IMAPAINT_CHAR_RGBA_TO_FLOAT(f, c)  {                                  \
+       (f)[0]= IMAPAINT_CHAR_TO_FLOAT((c)[0]);                                   \
+       (f)[1]= IMAPAINT_CHAR_TO_FLOAT((c)[1]);                                   \
+       (f)[2]= IMAPAINT_CHAR_TO_FLOAT((c)[2]);                                   \
+       (f)[3]= IMAPAINT_CHAR_TO_FLOAT((c)[3]);                                   \
+}
+
+#define IMAPAINT_FLOAT_RGB_COPY(a, b) copy_v3_v3(a, b)
 
 #define IMAPAINT_TILE_BITS                     6
 #define IMAPAINT_TILE_SIZE                     (1 << IMAPAINT_TILE_BITS)
index 70c4ebd445a5d8c2a282f6adf3d2b20acaff91ff..177b72567e5c8a696c25c979dc0572f0889e3e3e 100644 (file)
@@ -33,6 +33,7 @@
 
 #include "BLF_api.h"
 
+#include "BLI_math.h"
 #include "BLI_utildefines.h"
 
 
@@ -131,7 +132,7 @@ static int console_draw_string(ConsoleDrawContext *cdc, const char *str, int str
                const char *line_stride= str + initial_offset;  /* advance to the last line and draw it first */
                
                int sel_orig[2];
-               VECCOPY2D(sel_orig, cdc->sel);
+               copy_v2_v2_int(sel_orig, cdc->sel);
 
                /* invert and swap for wrapping */
                cdc->sel[0] = str_len - sel_orig[1];
@@ -178,7 +179,7 @@ static int console_draw_string(ConsoleDrawContext *cdc, const char *str, int str
                                return 0;
                }
 
-               VECCOPY2D(cdc->sel, sel_orig);
+               copy_v2_v2_int(cdc->sel, sel_orig);
                STEP_SEL(-(str_len + 1));
        }
        else { /* simple, no wrap */
index a7bb1fb3ee6ab77d7a76303ae1b5cb533afc27a7..c0046b089af4f3e7517b6b22103c8d4f6e1fa69a 100644 (file)
@@ -153,17 +153,17 @@ static short set_pchan_glColor (short colCode, int boneflag, short constflag)
                        unsigned char cp[3];
                        
                        if (boneflag & BONE_DRAW_ACTIVE) {
-                               VECCOPY(cp, bcolor->active);
+                               copy_v3_v3_char((char *)cp, bcolor->active);
                                if(!(boneflag & BONE_SELECTED)) {
                                        cp_shade_color3ub(cp, -80);
                                }
                        }
                        else if (boneflag & BONE_SELECTED) {
-                               VECCOPY(cp, bcolor->select);
+                               copy_v3_v3_char((char *)cp, bcolor->select);
                        }
                        else {
                                /* a bit darker than solid */
-                               VECCOPY(cp, bcolor->solid);
+                               copy_v3_v3_char((char *)cp, bcolor->solid);
                                cp_shade_color3ub(cp, -50);
                        }
                        
@@ -213,13 +213,13 @@ static short set_pchan_glColor (short colCode, int boneflag, short constflag)
                        unsigned char cp[3];
                        
                        if (boneflag & BONE_DRAW_ACTIVE) {
-                               VECCOPY(cp, bcolor->active);
+                               copy_v3_v3_char((char *)cp, bcolor->active);
                        }
                        else if (boneflag & BONE_SELECTED) {
-                               VECCOPY(cp, bcolor->select);
+                               copy_v3_v3_char((char *)cp, bcolor->select);
                        }
                        else {
-                               VECCOPY(cp, bcolor->solid);
+                               copy_v3_v3_char((char *)cp, bcolor->solid);
                        }
                        
                        glColor3ubv(cp);
@@ -239,15 +239,15 @@ static short set_pchan_glColor (short colCode, int boneflag, short constflag)
                        unsigned char cp[3];
                        
                        if (boneflag & BONE_DRAW_ACTIVE) {
-                               VECCOPY(cp, bcolor->active);
+                               copy_v3_v3_char((char *)cp, bcolor->active);
                                cp_shade_color3ub(cp, 10);
                        }
                        else if (boneflag & BONE_SELECTED) {
-                               VECCOPY(cp, bcolor->select);
+                               copy_v3_v3_char((char *)cp, bcolor->select);
                                cp_shade_color3ub(cp, -30);
                        }
                        else {
-                               VECCOPY(cp, bcolor->solid);
+                               copy_v3_v3_char((char *)cp, bcolor->solid);
                                cp_shade_color3ub(cp, -30);
                        }
                        
index 67986f1a5774e91f8bec383788240f22b670d693..4809e463d7520fb83589dddceb1c237eba453873 100644 (file)
@@ -5150,7 +5150,7 @@ static void drawnurb(Scene *scene, View3D *v3d, RegionView3D *rv3d, Base *base,
                        int skip= nu->resolu/16;
                        
                        while (nr-->0) { /* accounts for empty bevel lists */
-                               float fac= bevp->radius * ts->normalsize;
+                               const float fac= bevp->radius * ts->normalsize;
                                float vec_a[3]; // Offset perpendicular to the curve
                                float vec_b[3]; // Delta along the curve
 
@@ -5166,9 +5166,9 @@ static void drawnurb(Scene *scene, View3D *v3d, RegionView3D *rv3d, Base *base,
                                mul_qt_v3(bevp->quat, vec_b);
                                add_v3_v3(vec_a, bevp->vec);
                                add_v3_v3(vec_b, bevp->vec);
-                               
-                               VECSUBFAC(vec_a, vec_a, bevp->dir, fac);
-                               VECSUBFAC(vec_b, vec_b, bevp->dir, fac);
+
+                               madd_v3_v3fl(vec_a, bevp->dir, -fac);
+                               madd_v3_v3fl(vec_b, bevp->dir, -fac);
 
                                glBegin(GL_LINE_STRIP);
                                glVertex3fv(vec_a);
index f98e5a7b42bce4ab804438c2e3d741ec5243f6ec..7331959ef51d5bc154793e42695930b7fedb570a 100644 (file)
@@ -3453,8 +3453,8 @@ int ED_view3d_autodist_depth_seg(struct ARegion *ar, const int mval_sta[2], cons
        data.margin= margin;
        data.depth= FLT_MAX;
 
-       VECCOPY2D(p1, mval_sta);
-       VECCOPY2D(p2, mval_end);
+       copy_v2_v2_int(p1, mval_sta);
+       copy_v2_v2_int(p2, mval_end);
 
        plot_line_v2v2i(p1, p2, depth_segment_cb, &data);
 
index e9db9fe1d7eccc1f4302eb0871cf8d17365bef67..0cdb7a19995225645989c8b6e53f83663ca379ed 100644 (file)
@@ -314,7 +314,7 @@ static int initFlyInfo (bContext *C, FlyInfo *fly, wmOperator *op, wmEvent *even
 
        fly->timer= WM_event_add_timer(CTX_wm_manager(C), CTX_wm_window(C), TIMER, 0.01f);
 
-       VECCOPY2D(fly->mval, event->mval)
+       copy_v2_v2_int(fly->mval, event->mval);
        fly->ndof = NULL;
 
        fly->time_lastdraw= fly->time_lastwheel= PIL_check_seconds_timer();
@@ -475,7 +475,7 @@ static void flyEvent(FlyInfo *fly, wmEvent *event)
                fly->redraw = 1;
        }
        else if (event->type == MOUSEMOVE) {
-               VECCOPY2D(fly->mval, event->mval);
+               copy_v2_v2_int(fly->mval, event->mval);
        }
        else if (event->type == NDOF_MOTION) {
                // do these automagically get delivered? yes.
index a8fcdbfcfd50dc50b8225f67f8e31eff1400bb26..13d686508de269656360d7fe43fe53bb4a283621 100644 (file)
@@ -573,7 +573,7 @@ int transformEvent(TransInfo *t, wmEvent *event)
                if (t->modifiers & MOD_CONSTRAINT_SELECT)
                        t->con.mode |= CON_SELECT;
 
-               VECCOPY2D(t->mval, event->mval);
+               copy_v2_v2_int(t->mval, event->mval);
 
                // t->redraw |= TREDRAW_SOFT; /* Use this for soft redraw. Might cause flicker in object mode */
                t->redraw |= TREDRAW_HARD;
index b3d769ab2539f9e7c34f114a2cc9708017190878..53e379a2d270a345d34718dded9d67b86a27f4bf 100644 (file)
@@ -986,7 +986,7 @@ int initTransInfo (bContext *C, TransInfo *t, wmOperator *op, wmEvent *event)
        
        if (event)
        {
-               VECCOPY2D(t->imval, event->mval);
+               copy_v2_v2_int(t->imval, event->mval);
                t->event_type = event->type;
        }
        else
index cc3ffe086f1a386b1a12b9d3b2719f63b16c6fdb..3de68a6e3126494e13f12640407533f9824012f0 100644 (file)
@@ -409,7 +409,7 @@ int handleMouseInput(TransInfo *t, MouseInput *mi, wmEvent *event)
                        t->modifiers |= MOD_PRECISION;
                        /* shift is modifier for higher precision transform
                         * store the mouse position where the normal movement ended */
-                       VECCOPY2D(mi->precision_mval, event->mval);
+                       copy_v2_v2_int(mi->precision_mval, event->mval);
                        mi->precision = 1;
                }
                else
index 9ca990c419301e07521b2632e3b2165d03c2256d..9ee4a875e24f69d3e75f12c18edd9aac15e0a3ec 100644 (file)
@@ -80,7 +80,7 @@ static void make_vertexcos__mapFunc(void *userData, int index, float *co, float
        if(!mappedData->flags[index]) {
                /* we need coord from prototype vertex, not it clones or images,
                   suppose they stored in the beginning of vertex array stored in DM */
-               VECCOPY(vec, co);
+               copy_v3_v3(vec, co);
                mappedData->flags[index]= 1;
        }
 }
index a438d5c86e9a4129ddb2439b3c6be603e473b5e0..9344b4e680ac0e5c27a0d51d86395a1b57bdd5d4 100644 (file)
@@ -260,7 +260,7 @@ void GPU_material_bind(GPUMaterial *material, int oblay, int viewlay, double tim
 
                        if(!lamp->hide && (lamp->lay & viewlay) && (!(lamp->mode & LA_LAYER) || (lamp->lay & oblay))) {
                                lamp->dynenergy = lamp->energy;
-                               VECCOPY(lamp->dyncol, lamp->col);
+                               copy_v3_v3(lamp->dyncol, lamp->col);
                        }
                        else {
                                lamp->dynenergy = 0.0f;
@@ -306,14 +306,14 @@ void GPU_material_bind_uniforms(GPUMaterial *material, float obmat[][4], float v
                        lamp= nlink->data;
 
                        if(material->dynproperty & DYN_LAMP_VEC) {
-                               VECCOPY(lamp->dynvec, lamp->vec);
+                               copy_v3_v3(lamp->dynvec, lamp->vec);
                                normalize_v3(lamp->dynvec);
                                negate_v3(lamp->dynvec);
                                mul_mat3_m4_v3(viewmat, lamp->dynvec);
                        }
 
                        if(material->dynproperty & DYN_LAMP_CO) {
-                               VECCOPY(lamp->dynco, lamp->co);
+                               copy_v3_v3(lamp->dynco, lamp->co);
                                mul_m4_v3(viewmat, lamp->dynco);
                        }
 
@@ -1472,8 +1472,8 @@ void GPU_lamp_update(GPULamp *lamp, int lay, int hide, float obmat[][4])
        copy_m4_m4(mat, obmat);
        normalize_m4(mat);
 
-       VECCOPY(lamp->vec, mat[2]);
-       VECCOPY(lamp->co, mat[3]);
+       copy_v3_v3(lamp->vec, mat[2]);
+       copy_v3_v3(lamp->co, mat[3]);
        copy_m4_m4(lamp->obmat, mat);
        invert_m4_m4(lamp->imat, mat);
 }
index cfaafe9bf5c1b5f9720a093bc2b30db2cbf245d3..787766f0fa6de8dc5e014b67f2e2f22e812a1ae3 100644 (file)
@@ -205,9 +205,9 @@ static void where_is_ik_bone(bPoseChannel *pchan, float ik_mat[][3])   // nr = t
                mul_m4_m4m4(pchan->pose_mat, ikmat, pchan->chan_mat);
 
        /* calculate head */
-       VECCOPY(pchan->pose_head, pchan->pose_mat[3]);
+       copy_v3_v3(pchan->pose_head, pchan->pose_mat[3]);
        /* calculate tail */
-       VECCOPY(vec, pchan->pose_mat[1]);
+       copy_v3_v3(vec, pchan->pose_mat[1]);
        mul_v3_fl(vec, pchan->bone->length);
        add_v3_v3v3(pchan->pose_tail, pchan->pose_head, vec);
 
@@ -340,7 +340,7 @@ static void execute_posetree(struct Scene *scene, Object *ob, PoseTree *tree)
                copy_m4_m4(rootmat, pchan->parent->pose_mat);
        else
                unit_m4(rootmat);
-       VECCOPY(rootmat[3], pchan->pose_head);
+       copy_v3_v3(rootmat[3], pchan->pose_head);
        
        mul_m4_m4m4(imat, rootmat, ob->obmat);
        invert_m4_m4(goalinv, imat);
@@ -359,7 +359,7 @@ static void execute_posetree(struct Scene *scene, Object *ob, PoseTree *tree)
                /* and set and transform goal */
                mul_m4_m4m4(goal, rootmat, goalinv);
                
-               VECCOPY(goalpos, goal[3]);
+               copy_v3_v3(goalpos, goal[3]);
                copy_m3_m4(goalrot, goal);
                
                /* same for pole vector target */
@@ -372,7 +372,7 @@ static void execute_posetree(struct Scene *scene, Object *ob, PoseTree *tree)
                        }
                        else {
                                mul_m4_m4m4(goal, rootmat, goalinv);
-                               VECCOPY(polepos, goal[3]);
+                               copy_v3_v3(polepos, goal[3]);
                                poleconstrain= 1;
 
                                /* for pole targets, we blend the result of the ik solver
@@ -398,7 +398,7 @@ static void execute_posetree(struct Scene *scene, Object *ob, PoseTree *tree)
                        
                        /* end effector in world space */
                        copy_m4_m4(end_pose, pchan->pose_mat);
-                       VECCOPY(end_pose[3], pchan->pose_tail);
+                       copy_v3_v3(end_pose[3], pchan->pose_tail);
                        mul_serie_m4(world_pose, goalinv, ob->obmat, end_pose, NULL, NULL, NULL, NULL, NULL);
                        
                        /* blend position */
index 400e720f1382e076bc66c5dddb6af207ea949b5a..2cb3a32ae3edb391a301e20f2a594a6c91a23b64 100644 (file)
@@ -558,7 +558,7 @@ static bool target_callback(const iTaSC::Timestamp& timestamp, const iTaSC::Fram
                        pchan = pchan->parent;
                        float chanmat[4][4];
                        copy_m4_m4(chanmat, pchan->pose_mat);
-                       VECCOPY(chanmat[3], pchan->pose_tail);
+                       copy_v3_v3(chanmat[3], pchan->pose_tail);
                        mul_serie_m4(restmat, target->owner->obmat, chanmat, target->eeRest, NULL, NULL, NULL, NULL, NULL);
                } 
                else {
@@ -585,7 +585,7 @@ static bool base_callback(const iTaSC::Timestamp& timestamp, const iTaSC::Frame&
                pchan = pchan->parent;
                float chanmat[4][4];
                copy_m4_m4(chanmat, pchan->pose_mat);
-               VECCOPY(chanmat[3], pchan->pose_tail);
+               copy_v3_v3(chanmat[3], pchan->pose_tail);
                // save the base as a frame too so that we can compute deformation
                // after simulation
                ikscene->baseFrame.setValue(&chanmat[0][0]);
@@ -1662,12 +1662,12 @@ static void execute_scene(Scene* blscene, IK_Scene* ikscene, bItasc* ikparam, fl
                pchan = ikchan->pchan;
                // tail mat
                ikchan->frame.getValue(&pchan->pose_mat[0][0]);
-               VECCOPY(pchan->pose_tail, pchan->pose_mat[3]);
+               copy_v3_v3(pchan->pose_tail, pchan->pose_mat[3]);
                // shift to head
-               VECCOPY(yaxis, pchan->pose_mat[1]);
+               copy_v3_v3(yaxis, pchan->pose_mat[1]);
                mul_v3_fl(yaxis, length);
                sub_v3_v3v3(pchan->pose_mat[3], pchan->pose_mat[3], yaxis);
-               VECCOPY(pchan->pose_head, pchan->pose_mat[3]);
+               copy_v3_v3(pchan->pose_head, pchan->pose_mat[3]);
                // add scale
                mul_v3_fl(pchan->pose_mat[0], scale);
                mul_v3_fl(pchan->pose_mat[1], scale);
index e67ab012dc9ef5d934b63028798ee2234a13538e..1ea1a4e3e7b53c8b251b34158ee924499fc62988 100644 (file)
@@ -283,7 +283,7 @@ static void rna_EditBone_connected_check(EditBone *ebone)
        if(ebone->parent) {
                if(ebone->flag & BONE_CONNECTED) {
                        /* Attach this bone to its parent */
-                       VECCOPY(ebone->head, ebone->parent->tail);
+                       copy_v3_v3(ebone->head, ebone->parent->tail);
 
                        if(ebone->flag & BONE_ROOTSEL)
                                ebone->parent->flag |= BONE_TIPSEL;
@@ -350,7 +350,7 @@ static void rna_EditBone_matrix_get(PointerRNA *ptr, float *values)
        sub_v3_v3v3(delta, ebone->tail, ebone->head);
        vec_roll_to_mat3(delta, ebone->roll, tmat);
        copy_m4_m3(mat, tmat);
-       VECCOPY(mat[3], ebone->head);
+       copy_v3_v3(mat[3], ebone->head);
 
        memcpy(values, mat, 16 * sizeof(float));
 }
@@ -363,12 +363,12 @@ static void rna_Armature_editbone_transform_update(Main *bmain, Scene *scene, Po
        
        /* update our parent */
        if(ebone->parent && ebone->flag & BONE_CONNECTED)
-               VECCOPY(ebone->parent->tail, ebone->head)
+               copy_v3_v3(ebone->parent->tail, ebone->head);
 
        /* update our children if necessary */
        for(child = arm->edbo->first; child; child=child->next)
                if(child->parent == ebone && (child->flag & BONE_CONNECTED))
-                       VECCOPY(child->head, ebone->tail);
+                       copy_v3_v3(child->head, ebone->tail);
 
        if(arm->flag & ARM_MIRROR_EDIT) {
                eboflip= ED_armature_bone_get_mirrored(arm->edbo, ebone);
@@ -381,12 +381,12 @@ static void rna_Armature_editbone_transform_update(Main *bmain, Scene *scene, Po
                        
                        /* update our parent */
                        if(eboflip->parent && eboflip->flag & BONE_CONNECTED)
-                               VECCOPY(eboflip->parent->tail, eboflip->head);
+                               copy_v3_v3(eboflip->parent->tail, eboflip->head);
                        
                        /* update our children if necessary */
                        for(child = arm->edbo->first; child; child=child->next)
                                if(child->parent == eboflip && (child->flag & BONE_CONNECTED))
-                                       VECCOPY (child->head, eboflip->tail);
+                                       copy_v3_v3 (child->head, eboflip->tail);
                }
        }
 
index a6220fbd20d811ec1151a8df80e8b44377da1222..d14f589f3f2e7712fc4744a9909875dcc2657466 100644 (file)
@@ -109,7 +109,6 @@ void register_node_type_cmp_normalize(ListBase *lb)
        node_type_socket_templates(&ntype, cmp_node_normalize_in, cmp_node_normalize_out);
        node_type_size(&ntype, 100, 60, 150);
        node_type_exec(&ntype, node_composit_exec_normalize);
-       node_type_storage(&ntype, "TexMapping", NULL, NULL);
        
        nodeRegisterType(lb, &ntype);
 }
index 5a544c46255dd96840cc6116b43ce3d8486658ff..08f73ccbe0dc60ad5f702fddd657243d1dbabd96 100644 (file)
@@ -42,7 +42,6 @@
 /* vector defines */
 
 #define CROSS(dest, a, b)              { dest[0]= a[1] * b[2] - a[2] * b[1]; dest[1]= a[2] * b[0] - a[0] * b[2]; dest[2]= a[0] * b[1] - a[1] * b[0]; }
-#define VECMUL(dest, f)                        { dest[0]*= f; dest[1]*= f; dest[2]*= f; }
 
 struct HaloRen;
 struct ShadeInput;
index 2f20c3284057b40eee692507ad5d688cdcfe71d5..6ea62828601da49b79a8aade685ac6892962f8b7 100644 (file)
@@ -704,7 +704,7 @@ int envmaptex(Tex *tex, float *texvec, float *dxt, float *dyt, int osatex, TexRe
        }
        
        /* rotate to envmap space, if object is set */
-       VECCOPY(vec, texvec);
+       copy_v3_v3(vec, texvec);
        if(env->object) mul_m3_v3(env->obimat, vec);
        else mul_mat3_m4_v3(R.viewinv, vec);
        
index 1887f22198d8e698feec155b0f632b8bde486b1c..d1f7059416d33e1c070f7bdea403ffffc01d380f 100644 (file)
@@ -92,7 +92,7 @@ static void ibuf_get_color(float *col, struct ImBuf *ibuf, int x, int y)
                }
                else if(ibuf->channels==3) {
                        float *fp= ibuf->rect_float + 3*ofs;
-                       VECCOPY(col, fp);
+                       copy_v3_v3(col, fp);
                        col[3]= 1.0f;
                }
                else {
index dfd10687a336b5eed7fcd5e1c14973bf76a8adda..3670940849619679494dc58382597752aeb2cbd1 100644 (file)
@@ -84,7 +84,7 @@ static void render_lighting_halo(HaloRen *har, float col_r[3])
        
        ir= ig= ib= 0.0;
        
-       VECCOPY(rco, har->co);  
+       copy_v3_v3(rco, har->co);
        dco[0]=dco[1]=dco[2]= 1.0f/har->rad;
        
        vn= har->no;
@@ -97,7 +97,7 @@ static void render_lighting_halo(HaloRen *har, float col_r[3])
                
                /* lampdist cacluation */
                if(lar->type==LA_SUN || lar->type==LA_HEMI) {
-                       VECCOPY(lv, lar->vec);
+                       copy_v3_v3(lv, lar->vec);
                        lampdist= 1.0;
                }
                else {
@@ -146,7 +146,7 @@ static void render_lighting_halo(HaloRen *har, float col_r[3])
                        memset(&shi, 0, sizeof(ShadeInput)); 
                        /* end warning! - Campbell */
                        
-                       VECCOPY(shi.co, rco);
+                       copy_v3_v3(shi.co, rco);
                        shi.osatex= 0;
                        do_lamp_tex(lar, lv, &shi, lacol, LA_TEXTURE);
                }
@@ -158,7 +158,7 @@ static void render_lighting_halo(HaloRen *har, float col_r[3])
                                        float x, lvrot[3];
                                        
                                        /* rotate view to lampspace */
-                                       VECCOPY(lvrot, lv);
+                                       copy_v3_v3(lvrot, lv);
                                        mul_m3_v3(lar->imat, lvrot);
                                        
                                        x= MAX2(fabs(lvrot[0]/lvrot[2]) , fabs(lvrot[1]/lvrot[2]));
@@ -610,7 +610,7 @@ void shadeSkyPixel(float collector[4], float fx, float fy, short thread)
 
        if((R.wrld.skytype & (WO_SKYBLEND+WO_SKYTEX))==0) {
                /* 1. solid color */
-               VECCOPY(collector, &R.wrld.horr);
+               copy_v3_v3(collector, &R.wrld.horr);
 
                collector[3] = 0.0f;
        } 
index 36ded5c10d2c79af3592d043fc53d34a4f7728f7..c3a4ca9bf7d2c01c6db9edb296c9e1d043e57137 100644 (file)
@@ -153,7 +153,7 @@ static void pointdensity_cache_psys(Render *re, PointDensity *pd, Object *ob, Pa
                state.time = cfra;
                if(psys_get_particle_state(&sim, i, &state, 0)) {
                        
-                       VECCOPY(partco, state.co);
+                       copy_v3_v3(partco, state.co);
                        
                        if (pd->psys_cache_space == TEX_PD_OBJECTSPACE)
                                mul_m4_v3(ob->imat, partco);
@@ -217,7 +217,7 @@ static void pointdensity_cache_object(Render *re, PointDensity *pd, Object *ob)
        for(i=0; i < pd->totpoints; i++, mvert++) {
                float co[3];
                
-               VECCOPY(co, mvert->co);
+               copy_v3_v3(co, mvert->co);
 
                switch(pd->ob_cache_space) {
                        case TEX_PD_OBJECTSPACE:
@@ -423,7 +423,7 @@ int pointdensitytex(Tex *tex, float *texvec, TexResult *texres)
                (pd->flag&TEX_PD_FALLOFF_CURVE ? pd->falloff_curve : NULL), pd->falloff_speed_scale*0.001f);
        noise_fac = pd->noise_fac * 0.5f;       /* better default */
        
-       VECCOPY(co, texvec);
+       copy_v3_v3(co, texvec);
        
        if (point_data_used(pd)) {
                /* does a BVH lookup to find accumulated density and additional point data *
@@ -480,7 +480,7 @@ int pointdensitytex(Tex *tex, float *texvec, TexResult *texres)
                        if (pd->coba) {
                                if (do_colorband(pd->coba, age, col)) {
                                        texres->talpha= 1;
-                                       VECCOPY(&texres->tr, col);
+                                       copy_v3_v3(&texres->tr, col);
                                        texres->tin *= col[3];
                                        texres->ta = texres->tin;
                                }
@@ -493,7 +493,7 @@ int pointdensitytex(Tex *tex, float *texvec, TexResult *texres)
                        if (pd->coba) {
                                if (do_colorband(pd->coba, speed, col)) {
                                        texres->talpha= 1;      
-                                       VECCOPY(&texres->tr, col);
+                                       copy_v3_v3(&texres->tr, col);
                                        texres->tin *= col[3];
                                        texres->ta = texres->tin;
                                }
@@ -503,7 +503,7 @@ int pointdensitytex(Tex *tex, float *texvec, TexResult *texres)
                case TEX_PD_COLOR_PARTVEL:
                        texres->talpha= 1;
                        mul_v3_fl(vec, pd->speed_scale);
-                       VECCOPY(&texres->tr, vec);
+                       copy_v3_v3(&texres->tr, vec);
                        texres->ta = texres->tin;
                        break;
                case TEX_PD_COLOR_CONSTANT:
index 48134c46c617ade61bab0d6a62b5a720dda7d587..456702e082716d52bd65fd52160f3dc2ff2ddff8 100644 (file)
@@ -768,18 +768,17 @@ static void atm_tile(RenderPart *pa, RenderLayer *rl)
                                                                continue;
                                                        }
                                                        
-                                                       VECCOPY(tmp_rgb, rgbrect);
+                                                       copy_v3_v3(tmp_rgb, rgbrect);
                                                        if(rgbrect[3]!=1.0f) {  /* de-premul */
-                                                               float div= 1.0f/rgbrect[3];
-                                                               VECMUL(tmp_rgb, div);
+                                                               mul_v3_fl(tmp_rgb, 1.0f/rgbrect[3]);
                                                        }
                                                        shadeAtmPixel(lar->sunsky, tmp_rgb, x, y, *zrect);
                                                        if(rgbrect[3]!=1.0f) {  /* premul */
-                                                               VECMUL(tmp_rgb, rgbrect[3]);
+                                                               mul_v3_fl(tmp_rgb, rgbrect[3]);
                                                        }
                                                        
                                                        if(done==0) {
-                                                               VECCOPY(rgb, tmp_rgb);
+                                                               copy_v3_v3(rgb, tmp_rgb);
                                                                done = 1;                                               
                                                        }
                                                        else{
@@ -793,7 +792,7 @@ static void atm_tile(RenderPart *pa, RenderLayer *rl)
 
                                /* if at least for one sun lamp aerial perspective was applied*/
                                if(done) {
-                                       VECCOPY(rgbrect, rgb);
+                                       copy_v3_v3(rgbrect, rgb);
                                }
                        }
                }
@@ -1533,13 +1532,13 @@ static void shade_sample_sss(ShadeSample *ssamp, Material *mat, ObjectInstanceRe
           then clamp to avoid a too large contribution from a single pixel */
        shi->osatex= 1;
 
-       VECCOPY(nor, shi->facenor);
+       copy_v3_v3(nor, shi->facenor);
        calc_view_vector(shi->facenor, sx, sy);
        normalize_v3(shi->facenor);
        shade_input_set_viewco(shi, x, y, sx, sy, z);
        orthoarea= len_v3(shi->dxco)*len_v3(shi->dyco);
 
-       VECCOPY(shi->facenor, nor);
+       copy_v3_v3(shi->facenor, nor);
        shade_input_set_viewco(shi, x, y, sx, sy, z);
        *area= len_v3(shi->dxco)*len_v3(shi->dyco);
        *area= MIN2(*area, 2.0f*orthoarea);
@@ -1572,8 +1571,8 @@ static void shade_sample_sss(ShadeSample *ssamp, Material *mat, ObjectInstanceRe
        shade_samples_do_AO(ssamp);
        shade_material_loop(shi, &shr);
        
-       VECCOPY(co, shi->co);
-       VECCOPY(color, shr.combined);
+       copy_v3_v3(co, shi->co);
+       copy_v3_v3(color, shr.combined);
 
        /* texture blending */
        /* texfac= shi->mat->sss_texfac; */ /* UNUSED */
@@ -1711,7 +1710,7 @@ void zbufshade_sss_tile(RenderPart *pa)
 
                                        totpoint++;
 
-                                       VECADD(fcol, fcol, color);
+                                       add_v3_v3(fcol, color);
                                        fcol[3]= 1.0f;
                                }
 
@@ -1730,7 +1729,7 @@ void zbufshade_sss_tile(RenderPart *pa)
                                        shade_sample_sss(&ssamp, mat, obi, vlr, quad, x, y, *rz,
                                                co[totpoint], color[totpoint], &area[totpoint]);
                                        
-                                       VECADD(fcol, fcol, color[totpoint]);
+                                       add_v3_v3(fcol, color[totpoint]);
                                        fcol[3]= 1.0f;
                                        totpoint++;
                                }
@@ -1753,7 +1752,7 @@ void zbufshade_sss_tile(RenderPart *pa)
                                        /* to indicate this is a back sample */
                                        area[totpoint]= -area[totpoint];
 
-                                       VECADD(fcol, fcol, color[totpoint]);
+                                       add_v3_v3(fcol, color[totpoint]);
                                        fcol[3]= 1.0f;
                                        totpoint++;
                                }
@@ -2068,7 +2067,7 @@ static void bake_shade(void *handle, Object *ob, ShadeInput *shi, int UNUSED(qua
                if(bs->type==RE_BAKE_NORMALS) {
                        float nor[3];
 
-                       VECCOPY(nor, shi->vn);
+                       copy_v3_v3(nor, shi->vn);
 
                        if(R.r.bake_normal_space == R_BAKE_SPACE_CAMERA);
                        else if(R.r.bake_normal_space == R_BAKE_SPACE_TANGENT) {
@@ -2076,16 +2075,16 @@ static void bake_shade(void *handle, Object *ob, ShadeInput *shi, int UNUSED(qua
 
                                /* bitangent */
                                if(tvn && ttang) {
-                                       VECCOPY(mat[0], ttang);
+                                       copy_v3_v3(mat[0], ttang);
                                        cross_v3_v3v3(mat[1], tvn, ttang);
                                        mul_v3_fl(mat[1], ttang[3]);
-                                       VECCOPY(mat[2], tvn);
+                                       copy_v3_v3(mat[2], tvn);
                                }
                                else {
-                                       VECCOPY(mat[0], shi->nmaptang);
+                                       copy_v3_v3(mat[0], shi->nmaptang);
                                        cross_v3_v3v3(mat[1], shi->nmapnorm, shi->nmaptang);
                                        mul_v3_fl(mat[1], shi->nmaptang[3]);
-                                       VECCOPY(mat[2], shi->nmapnorm);
+                                       copy_v3_v3(mat[2], shi->nmapnorm);
                                }
 
                                invert_m3_m3(imat, mat);
@@ -2115,7 +2114,7 @@ static void bake_shade(void *handle, Object *ob, ShadeInput *shi, int UNUSED(qua
                        shr.alpha = shi->alpha;
                }
                else if(bs->type==RE_BAKE_SHADOW) {
-                       VECCOPY(shr.combined, shr.shad);
+                       copy_v3_v3(shr.combined, shr.shad);
                        shr.alpha = shi->alpha;
                }
                else if(bs->type==RE_BAKE_SPEC_COLOR) {
@@ -2158,7 +2157,7 @@ static void bake_shade(void *handle, Object *ob, ShadeInput *shi, int UNUSED(qua
        
        if(bs->rect_float) {
                float *col= bs->rect_float + 4*(bs->rectx*y + x);
-               VECCOPY(col, shr.combined);
+               copy_v3_v3(col, shr.combined);
                if (bs->type==RE_BAKE_ALL || bs->type==RE_BAKE_TEXTURE) {
                        col[3]= shr.alpha;
                } else {
@@ -2336,15 +2335,15 @@ static void do_bake_shade(void *handle, int x, int y, float u, float v)
        if(obi->flag & R_TRANSFORMED)
                mul_m4_v3(obi->mat, shi->co);
        
-       VECCOPY(shi->dxco, bs->dxco);
-       VECCOPY(shi->dyco, bs->dyco);
+       copy_v3_v3(shi->dxco, bs->dxco);
+       copy_v3_v3(shi->dyco, bs->dyco);
 
        quad= bs->quad;
        bake_set_shade_input(obi, vlr, shi, quad, 0, x, y, u, v);
 
        if(bs->type==RE_BAKE_NORMALS && R.r.bake_normal_space==R_BAKE_SPACE_TANGENT) {
                shade_input_set_shade_texco(shi);
-               VECCOPY(tvn, shi->nmapnorm);
+               copy_v3_v3(tvn, shi->nmapnorm);
                copy_v4_v4(ttang, shi->nmaptang);
        }
 
@@ -2359,7 +2358,7 @@ static void do_bake_shade(void *handle, int x, int y, float u, float v)
                memset(&minisec, 0, sizeof(minisec));
                minco[0]= minco[1]= minco[2]= 0.0f;
                
-               VECCOPY(bs->dir, shi->vn);
+               copy_v3_v3(bs->dir, shi->vn);
                
                for(sign=-1; sign<=1; sign+=2) {
                        memset(&isec, 0, sizeof(isec));
@@ -2375,7 +2374,7 @@ static void do_bake_shade(void *handle, int x, int y, float u, float v)
                                if(!hit || len_v3v3(shi->co, co) < len_v3v3(shi->co, minco)) {
                                        minisec= isec;
                                        mindist= dist;
-                                       VECCOPY(minco, co);
+                                       copy_v3_v3(minco, co);
                                        hit= 1;
                                        dir = sign;
                                }
@@ -2395,7 +2394,7 @@ static void do_bake_shade(void *handle, int x, int y, float u, float v)
                        obi= (ObjectInstanceRen*)minisec.hit.ob;
                        vlr= (VlakRen*)minisec.hit.face;
                        quad= (minisec.isect == 2);
-                       VECCOPY(shi->co, minco);
+                       copy_v3_v3(shi->co, minco);
                        
                        u= -minisec.u;
                        v= -minisec.v;
index 274fa4469e0bf212e2e88711573f588ba58781b7..f3eb22347788fad1c5dfb629497ccb6ad666a15d 100644 (file)
@@ -672,7 +672,7 @@ static void shadowbuf_autoclip(Render *re, LampRen *lar)
                        else ver++;
                        
                        if(clipflag[a]) {
-                               VECCOPY(vec, ver->co);
+                               copy_v3_v3(vec, ver->co);
                                mul_m4_v3(obviewmat, vec);
                                /* Z on visible side of lamp space */
                                if(vec[2] < 0.0f) {
@@ -2063,7 +2063,7 @@ static int viewpixel_to_lampbuf(ShadBuf *shb, ObjectInstanceRen *obi, VlakRen *v
        float dface, fac, siz;
        
        RE_vlakren_get_normal(&R, obi, vlr, nor);
-       VECCOPY(v1, vlr->v1->co);
+       copy_v3_v3(v1, vlr->v1->co);
        if(obi->flag & R_TRANSFORMED)
                mul_m4_v3(obi->mat, v1);
 
@@ -2463,7 +2463,7 @@ static void isb_make_buffer_transp(RenderPart *pa, APixstr *apixbuf, LampRen *la
                                                                                        samp->facenr= apn->p[a] & ~RE_QUAD_OFFS;
                                                                                        samp->shadfac= &apn->shadfac[a];
                                                                                        
-                                                                                       VECCOPY(samp->zco, zco);
+                                                                                       copy_v3_v3(samp->zco, zco);
                                                                                        bound_rectf((rctf *)&root.box, samp->zco);
                                                                                }
                                                                        }
@@ -2479,7 +2479,7 @@ static void isb_make_buffer_transp(RenderPart *pa, APixstr *apixbuf, LampRen *la
                                                                        samp->facenr= apn->p[a] & ~RE_QUAD_OFFS;
                                                                        samp->shadfac= &apn->shadfac[a];
                                                                        
-                                                                       VECCOPY(samp->zco, zco);
+                                                                       copy_v3_v3(samp->zco, zco);
                                                                        bound_rectf((rctf *)&root.box, samp->zco);
                                                                }
                                                        }
index 55d3703d3519a0e86659cd5215ff13703029b8cc..1852dfaebab1dc868ac73b50c8b7a848517302f5 100644 (file)
@@ -127,8 +127,8 @@ void shade_material_loop(ShadeInput *shi, ShadeResult *shr)
                if(shi->passflag & SCE_PASS_SHADOW)
                        VECADDISFAC(shr->shad, shr_t.shad, fac);
 
-               VECMUL(shi->vn, -1.0f);
-               VECMUL(shi->facenor, -1.0f);
+               negate_v3(shi->vn);
+               negate_v3(shi->facenor);
        }
        
        /* depth >= 1 when ray-shading */
index ddcffcc303bdebf4b23cad9ea5f43587afbc086f..633c7ca1847351b8d678bb54df4d0e800619e20c 100644 (file)
@@ -139,12 +139,9 @@ void strand_eval_point(StrandSegment *sseg, StrandPoint *spoint)
        spoint->dtco[1]= data[0]*p[0][1] + data[1]*p[1][1] + data[2]*p[2][1] + data[3]*p[3][1];
        spoint->dtco[2]= data[0]*p[0][2] + data[1]*p[1][2] + data[2]*p[2][2] + data[3]*p[3][2];
 
-       copy_v3_v3(spoint->tan, spoint->dtco);
-       normalize_v3(spoint->tan);
-
-       copy_v3_v3(spoint->nor, spoint->co);
-       VECMUL(spoint->nor, -1.0f);
-       normalize_v3(spoint->nor);
+       normalize_v3_v3(spoint->tan, spoint->dtco);
+       normalize_v3_v3(spoint->nor, spoint->co);
+       negate_v3(spoint->nor);
 
        spoint->width= strand_eval_width(ma, spoint->strandco);
        
index 11d7d9342f715b0a7c7035165002cc289bcb50ac..29eea081672eb1494e204b3a7388941214f5d83e 100644 (file)
@@ -623,7 +623,7 @@ static void precache_init_parts(Render *re, RayObject *tree, ShadeInput *shi, Ob
                                
                                copy_v3_v3(pa->bbmin, bbmin);
                                copy_v3_v3(pa->voxel, voxel);
-                               VECCOPY(pa->res, res); /* int's */
+                               copy_v3_v3_int(pa->res, res);
                                
                                pa->minx = minx; pa->maxx = maxx;
                                pa->miny = miny; pa->maxy = maxy;
index d624751f6134ca21ac1822f95b201a83e0340ea9..57ff5f4237a77f98417ceecdbd3d14dc42f8df79 100644 (file)
@@ -241,7 +241,7 @@ static void init_frame_smoke(VoxelData *vd, float cfra)
                                size_t i;
                                float *heat;
 
-                               VECCOPY(vd->resol, smd->domain->res);
+                               copy_v3_v3_int(vd->resol, smd->domain->res);
                                totRes= vd_resol_size(vd);
 
                                // scaling heat values from -2.0-2.0 to 0.0-1.0
@@ -262,7 +262,7 @@ static void init_frame_smoke(VoxelData *vd, float cfra)
                                size_t i;
                                float *xvel, *yvel, *zvel;
 
-                               VECCOPY(vd->resol, smd->domain->res);
+                               copy_v3_v3_int(vd->resol, smd->domain->res);
                                totRes= vd_resol_size(vd);
 
                                // scaling heat values from -2.0-2.0 to 0.0-1.0
@@ -286,7 +286,7 @@ static void init_frame_smoke(VoxelData *vd, float cfra)
                                        smoke_turbulence_get_res(smd->domain->wt, vd->resol);
                                        density = smoke_turbulence_get_density(smd->domain->wt);
                                } else {
-                                       VECCOPY(vd->resol, smd->domain->res);
+                                       copy_v3_v3_int(vd->resol, smd->domain->res);
                                        density = smoke_get_density(smd->domain->fluid);
                                }
 
index 43687fc21fb5a1aa242905b7a0b104f158230e12..f12dec6459afae4304eb9f60b857084e87b9e4c3 100644 (file)
@@ -270,7 +270,7 @@ static int wm_macro_modal(bContext *C, wmOperator *op, wmEvent *event)
        int retval= OPERATOR_FINISHED;
        
        if(opm==NULL)
-               printf("macro error, calling NULL modal()\n");
+               printf("%s: macro error, calling NULL modal()\n", __func__);
        else {
                retval = opm->type->modal(C, opm, event);
                OPERATOR_RETVAL_CHECK(retval);
@@ -341,7 +341,7 @@ wmOperatorType *WM_operatortype_append_macro(const char *idname, const char *nam
        wmOperatorType *ot;
        
        if(WM_operatortype_find(idname, TRUE)) {
-               printf("Macro error: operator %s exists\n", idname);
+               printf("%s: macro error: operator %s exists\n", __func__, idname);
                return NULL;
        }
        
@@ -658,10 +658,11 @@ int WM_menu_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event))
        uiLayout *layout;
 
        if(prop==NULL) {
-               printf("WM_menu_invoke: %s has no enum property set\n", op->type->idname);
+               printf("%s: %s has no enum property set\n", __func__, op->type->idname);
        }
        else if (RNA_property_type(prop) != PROP_ENUM) {
-               printf("WM_menu_invoke: %s \"%s\" is not an enum property\n", op->type->idname, RNA_property_identifier(prop));
+               printf("%s: %s \"%s\" is not an enum property\n",
+                      __func__, op->type->idname, RNA_property_identifier(prop));
        }
        else if (RNA_property_is_set(op->ptr, RNA_property_identifier(prop))) {
                const int retval= op->type->exec(C, op);
@@ -686,10 +687,12 @@ static void operator_enum_search_cb(const struct bContext *C, void *arg_ot, cons
        PropertyRNA *prop= ot->prop;
 
        if(prop==NULL) {
-               printf("WM_enum_search_invoke: %s has no enum property set\n", ot->idname);
+               printf("%s: %s has no enum property set\n",
+                      __func__, ot->idname);
        }
        else if (RNA_property_type(prop) != PROP_ENUM) {
-               printf("WM_enum_search_invoke: %s \"%s\" is not an enum property\n", ot->idname, RNA_property_identifier(prop));
+               printf("%s: %s \"%s\" is not an enum property\n",
+                      __func__, ot->idname, RNA_property_identifier(prop));
        }
        else {
                PointerRNA ptr;
@@ -725,7 +728,7 @@ static void operator_enum_call_cb(struct bContext *C, void *arg1, void *arg2)
                        WM_operator_properties_free(&props_ptr);
                }
                else {
-                       printf("operator_enum_call_cb: op->prop for '%s' is NULL\n", ot->idname);
+                       printf("%s: op->prop for '%s' is NULL\n", __func__, ot->idname);
                }
        }
 }
@@ -2619,7 +2622,7 @@ int WM_gesture_lasso_modal(bContext *C, wmOperator *op, wmEvent *event)
                                memcpy(gesture->customdata, old_lasso, 2*sizeof(short)*gesture->size);
                                gesture->size = gesture->size + WM_LASSO_MIN_POINTS;
                                MEM_freeN(old_lasso);
-                               printf("realloc\n");
+                               // printf("realloc\n");
                        }
 
                        {