Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Sharybin <sergey.vfx@gmail.com>2011-11-07 16:49:52 +0400
committerSergey Sharybin <sergey.vfx@gmail.com>2011-11-07 16:49:52 +0400
commitca24008a772d279e8c2a3c82af7a149a5691ef18 (patch)
tree1233b90be05d76175e50082f074f731c80ddc7a1
parenta35a31880eb5aace7f9ab0e79f08d4b419960244 (diff)
parente122dc0748f6a4d77b236e26beba93e2a9a36bf0 (diff)
Merging r41597 through r41607 from trunk into soc-2011-tomato
-rw-r--r--source/blender/blenkernel/BKE_library.h2
-rw-r--r--source/blender/blenkernel/intern/action.c2
-rw-r--r--source/blender/blenkernel/intern/armature.c2
-rw-r--r--source/blender/blenkernel/intern/brush.c2
-rw-r--r--source/blender/blenkernel/intern/camera.c2
-rw-r--r--source/blender/blenkernel/intern/cdderivedmesh.c58
-rw-r--r--source/blender/blenkernel/intern/curve.c2
-rw-r--r--source/blender/blenkernel/intern/key.c2
-rw-r--r--source/blender/blenkernel/intern/lamp.c4
-rw-r--r--source/blender/blenkernel/intern/lattice.c2
-rw-r--r--source/blender/blenkernel/intern/library.c12
-rw-r--r--source/blender/blenkernel/intern/material.c4
-rw-r--r--source/blender/blenkernel/intern/mball.c2
-rw-r--r--source/blender/blenkernel/intern/mesh.c2
-rw-r--r--source/blender/blenkernel/intern/node.c2
-rw-r--r--source/blender/blenkernel/intern/object.c2
-rw-r--r--source/blender/blenkernel/intern/particle.c2
-rw-r--r--source/blender/blenkernel/intern/pointcache.c20
-rw-r--r--source/blender/blenkernel/intern/scene.c2
-rw-r--r--source/blender/blenkernel/intern/shrinkwrap.c32
-rw-r--r--source/blender/blenkernel/intern/speaker.c2
-rw-r--r--source/blender/blenkernel/intern/text.c2
-rw-r--r--source/blender/blenkernel/intern/texture.c4
-rw-r--r--source/blender/blenkernel/intern/world.c4
-rw-r--r--source/blender/blenlib/BLI_math_vector.h9
-rw-r--r--source/blender/blenlib/intern/math_vector_inline.c44
-rw-r--r--source/blender/editors/animation/anim_channels_defines.c6
-rw-r--r--source/blender/editors/armature/editarmature_retarget.c54
-rw-r--r--source/blender/editors/armature/editarmature_sketch.c36
-rw-r--r--source/blender/editors/gpencil/gpencil_edit.c19
-rw-r--r--source/blender/editors/gpencil/gpencil_paint.c2
-rw-r--r--source/blender/editors/interface/interface.c4
-rw-r--r--source/blender/editors/interface/interface_widgets.c30
-rw-r--r--source/blender/editors/mesh/editmesh_tools.c2
-rw-r--r--source/blender/editors/object/object_add.c87
-rw-r--r--source/blender/editors/object/object_lattice.c3
-rw-r--r--source/blender/editors/object/object_modifier.c4
-rw-r--r--source/blender/editors/sculpt_paint/paint_image.c30
-rw-r--r--source/blender/editors/space_info/textview.c5
-rw-r--r--source/blender/editors/space_view3d/drawarmature.c18
-rw-r--r--source/blender/editors/space_view3d/drawobject.c8
-rw-r--r--source/blender/editors/space_view3d/view3d_edit.c4
-rw-r--r--source/blender/editors/space_view3d/view3d_fly.c4
-rw-r--r--source/blender/editors/transform/transform.c2
-rw-r--r--source/blender/editors/transform/transform_generics.c2
-rw-r--r--source/blender/editors/transform/transform_input.c2
-rw-r--r--source/blender/editors/util/crazyspace.c2
-rw-r--r--source/blender/gpu/intern/gpu_material.c10
-rw-r--r--source/blender/ikplugin/intern/iksolver_plugin.c12
-rw-r--r--source/blender/ikplugin/intern/itasc_plugin.cpp10
-rw-r--r--source/blender/makesrna/intern/rna_armature.c12
-rw-r--r--source/blender/nodes/composite/nodes/node_composite_normalize.c1
-rw-r--r--source/blender/render/intern/include/rendercore.h1
-rw-r--r--source/blender/render/intern/source/envmap.c2
-rw-r--r--source/blender/render/intern/source/imagetexture.c2
-rw-r--r--source/blender/render/intern/source/pixelshading.c10
-rw-r--r--source/blender/render/intern/source/pointdensity.c12
-rw-r--r--source/blender/render/intern/source/rendercore.c51
-rw-r--r--source/blender/render/intern/source/shadbuf.c8
-rw-r--r--source/blender/render/intern/source/shadeinput.c4
-rw-r--r--source/blender/render/intern/source/strand.c9
-rw-r--r--source/blender/render/intern/source/volume_precache.c2
-rw-r--r--source/blender/render/intern/source/voxeldata.c6
-rw-r--r--source/blender/windowmanager/intern/wm_operators.c19
64 files changed, 421 insertions, 297 deletions
diff --git a/source/blender/blenkernel/BKE_library.h b/source/blender/blenkernel/BKE_library.h
index 9130cac6cd6..308d7ff22c2 100644
--- a/source/blender/blenkernel/BKE_library.h
+++ b/source/blender/blenkernel/BKE_library.h
@@ -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);
diff --git a/source/blender/blenkernel/intern/action.c b/source/blender/blenkernel/intern/action.c
index 944f7c6a0b6..5fb03b7bbd0 100644
--- a/source/blender/blenkernel/intern/action.c
+++ b/source/blender/blenkernel/intern/action.c
@@ -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);
diff --git a/source/blender/blenkernel/intern/armature.c b/source/blender/blenkernel/intern/armature.c
index f19ed859064..50f305e4400 100644
--- a/source/blender/blenkernel/intern/armature.c
+++ b/source/blender/blenkernel/intern/armature.c
@@ -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*/
diff --git a/source/blender/blenkernel/intern/brush.c b/source/blender/blenkernel/intern/brush.c
index e78b89441c9..09021e71025 100644
--- a/source/blender/blenkernel/intern/brush.c
+++ b/source/blender/blenkernel/intern/brush.c
@@ -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);
diff --git a/source/blender/blenkernel/intern/camera.c b/source/blender/blenkernel/intern/camera.c
index eeec82c3beb..145eb9363e9 100644
--- a/source/blender/blenkernel/intern/camera.c
+++ b/source/blender/blenkernel/intern/camera.c
@@ -68,7 +68,7 @@ Camera *copy_camera(Camera *cam)
{
Camera *camn;
- camn= copy_libblock(cam);
+ camn= copy_libblock(&cam->id);
return camn;
}
diff --git a/source/blender/blenkernel/intern/cdderivedmesh.c b/source/blender/blenkernel/intern/cdderivedmesh.c
index 25f9f17f201..d2c86a14572 100644
--- a/source/blender/blenkernel/intern/cdderivedmesh.c
+++ b/source/blender/blenkernel/intern/cdderivedmesh.c
@@ -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])
diff --git a/source/blender/blenkernel/intern/curve.c b/source/blender/blenkernel/intern/curve.c
index adc08f5cd9f..160f5703a01 100644
--- a/source/blender/blenkernel/intern/curve.c
+++ b/source/blender/blenkernel/intern/curve.c
@@ -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));
diff --git a/source/blender/blenkernel/intern/key.c b/source/blender/blenkernel/intern/key.c
index c389800b0d1..eb7d07a6f7d 100644
--- a/source/blender/blenkernel/intern/key.c
+++ b/source/blender/blenkernel/intern/key.c
@@ -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);
diff --git a/source/blender/blenkernel/intern/lamp.c b/source/blender/blenkernel/intern/lamp.c
index 974aa660e9f..4edd032dc04 100644
--- a/source/blender/blenkernel/intern/lamp.c
+++ b/source/blender/blenkernel/intern/lamp.c
@@ -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++) {
diff --git a/source/blender/blenkernel/intern/lattice.c b/source/blender/blenkernel/intern/lattice.c
index cef23ac3824..7c9e2be4493 100644
--- a/source/blender/blenkernel/intern/lattice.c
+++ b/source/blender/blenkernel/intern/lattice.c
@@ -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);
diff --git a/source/blender/blenkernel/intern/library.c b/source/blender/blenkernel/intern/library.c
index 119e2e0da1b..650f85da5b3 100644
--- a/source/blender/blenkernel/intern/library.c
+++ b/source/blender/blenkernel/intern/library.c
@@ -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));
}
diff --git a/source/blender/blenkernel/intern/material.c b/source/blender/blenkernel/intern/material.c
index 7be3514e0f2..48c6d6b2a19 100644
--- a/source/blender/blenkernel/intern/material.c
+++ b/source/blender/blenkernel/intern/material.c
@@ -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 */
diff --git a/source/blender/blenkernel/intern/mball.c b/source/blender/blenkernel/intern/mball.c
index 327306b32ee..5c82acde99b 100644
--- a/source/blender/blenkernel/intern/mball.c
+++ b/source/blender/blenkernel/intern/mball.c
@@ -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);
diff --git a/source/blender/blenkernel/intern/mesh.c b/source/blender/blenkernel/intern/mesh.c
index 4a8bc34cdf7..ec9d4873057 100644
--- a/source/blender/blenkernel/intern/mesh.c
+++ b/source/blender/blenkernel/intern/mesh.c
@@ -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++) {
diff --git a/source/blender/blenkernel/intern/node.c b/source/blender/blenkernel/intern/node.c
index e2ef39b7563..115591863cc 100644
--- a/source/blender/blenkernel/intern/node.c
+++ b/source/blender/blenkernel/intern/node.c
@@ -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 */
diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c
index 07e199c1535..45bd8f095a4 100644
--- a/source/blender/blenkernel/intern/object.c
+++ b/source/blender/blenkernel/intern/object.c
@@ -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);
diff --git a/source/blender/blenkernel/intern/particle.c b/source/blender/blenkernel/intern/particle.c
index 56e4c91ba5e..1064a5af160 100644
--- a/source/blender/blenkernel/intern/particle.c
+++ b/source/blender/blenkernel/intern/particle.c
@@ -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);
diff --git a/source/blender/blenkernel/intern/pointcache.c b/source/blender/blenkernel/intern/pointcache.c
index ba5b98ee3cd..9deaa19429f 100644
--- a/source/blender/blenkernel/intern/pointcache.c
+++ b/source/blender/blenkernel/intern/pointcache.c
@@ -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) {
diff --git a/source/blender/blenkernel/intern/scene.c b/source/blender/blenkernel/intern/scene.c
index 66d29b02263..14dfe015894 100644
--- a/source/blender/blenkernel/intern/scene.c
+++ b/source/blender/blenkernel/intern/scene.c
@@ -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();
diff --git a/source/blender/blenkernel/intern/shrinkwrap.c b/source/blender/blenkernel/intern/shrinkwrap.c
index 3d788b40a17..aed246690bd 100644
--- a/source/blender/blenkernel/intern/shrinkwrap.c
+++ b/source/blender/blenkernel/intern/shrinkwrap.c
@@ -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
diff --git a/source/blender/blenkernel/intern/speaker.c b/source/blender/blenkernel/intern/speaker.c
index 018c7a197ff..a14233e9179 100644
--- a/source/blender/blenkernel/intern/speaker.c
+++ b/source/blender/blenkernel/intern/speaker.c
@@ -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++;
diff --git a/source/blender/blenkernel/intern/text.c b/source/blender/blenkernel/intern/text.c
index 955127a8000..e8be0bb2608 100644
--- a/source/blender/blenkernel/intern/text.c
+++ b/source/blender/blenkernel/intern/text.c
@@ -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) {
diff --git a/source/blender/blenkernel/intern/texture.c b/source/blender/blenkernel/intern/texture.c
index 3aa289d0ef8..377eeef117e 100644
--- a/source/blender/blenkernel/intern/texture.c
+++ b/source/blender/blenkernel/intern/texture.c
@@ -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 */
diff --git a/source/blender/blenkernel/intern/world.c b/source/blender/blenkernel/intern/world.c
index c7d2763774d..1d6972b9d61 100644
--- a/source/blender/blenkernel/intern/world.c
+++ b/source/blender/blenkernel/intern/world.c
@@ -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++) {
diff --git a/source/blender/blenlib/BLI_math_vector.h b/source/blender/blenlib/BLI_math_vector.h
index e259071a27a..2b9d6d2d6d6 100644
--- a/source/blender/blenlib/BLI_math_vector.h
+++ b/source/blender/blenlib/BLI_math_vector.h
@@ -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 ********************************/
diff --git a/source/blender/blenlib/intern/math_vector_inline.c b/source/blender/blenlib/intern/math_vector_inline.c
index c460b69679b..1c7d131c750 100644
--- a/source/blender/blenlib/intern/math_vector_inline.c
+++ b/source/blender/blenlib/intern/math_vector_inline.c
@@ -78,6 +78,28 @@ MINLINE void copy_v4_v4(float r[4], const float a[4])
}
/* 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])
{
r[0]= a[0];
@@ -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]);
diff --git a/source/blender/editors/animation/anim_channels_defines.c b/source/blender/editors/animation/anim_channels_defines.c
index e8af5a8f290..f0f3b8f4123 100644
--- a/source/blender/editors/animation/anim_channels_defines.c
+++ b/source/blender/editors/animation/anim_channels_defines.c
@@ -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 */
diff --git a/source/blender/editors/armature/editarmature_retarget.c b/source/blender/editors/armature/editarmature_retarget.c
index 6f1da5757c6..b1651886620 100644
--- a/source/blender/editors/armature/editarmature_retarget.c
+++ b/source/blender/editors/armature/editarmature_retarget.c
@@ -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))
{
diff --git a/source/blender/editors/armature/editarmature_sketch.c b/source/blender/editors/armature/editarmature_sketch.c
index d228d4d3772..b97e843529a 100644
--- a/source/blender/editors/armature/editarmature_sketch.c
+++ b/source/blender/editors/armature/editarmature_sketch.c
@@ -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);
diff --git a/source/blender/editors/gpencil/gpencil_edit.c b/source/blender/editors/gpencil/gpencil_edit.c
index 1b661cc05a9..65db5e27ed7 100644
--- a/source/blender/editors/gpencil/gpencil_edit.c
+++ b/source/blender/editors/gpencil/gpencil_edit.c
@@ -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);
diff --git a/source/blender/editors/gpencil/gpencil_paint.c b/source/blender/editors/gpencil/gpencil_paint.c
index 9b232d886d2..b89b0cda451 100644
--- a/source/blender/editors/gpencil/gpencil_paint.c
+++ b/source/blender/editors/gpencil/gpencil_paint.c
@@ -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) {
diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c
index dd75f506be8..e5092c82304 100644
--- a/source/blender/editors/interface/interface.c
+++ b/source/blender/editors/interface/interface.c
@@ -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) {
diff --git a/source/blender/editors/interface/interface_widgets.c b/source/blender/editors/interface/interface_widgets.c
index 7a138e72891..8ab48ac8ffa 100644
--- a/source/blender/editors/interface/interface_widgets.c
+++ b/source/blender/editors/interface/interface_widgets.c
@@ -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)
diff --git a/source/blender/editors/mesh/editmesh_tools.c b/source/blender/editors/mesh/editmesh_tools.c
index 99af17c161e..1852d90eed0 100644
--- a/source/blender/editors/mesh/editmesh_tools.c
+++ b/source/blender/editors/mesh/editmesh_tools.c
@@ -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
}
diff --git a/source/blender/editors/object/object_add.c b/source/blender/editors/object/object_add.c
index a929144ed2e..8d4d29dbe50 100644
--- a/source/blender/editors/object/object_add.c
+++ b/source/blender/editors/object/object_add.c
@@ -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 **************************/
diff --git a/source/blender/editors/object/object_lattice.c b/source/blender/editors/object/object_lattice.c
index 25c1e32f4ae..cac167ad84f 100644
--- a/source/blender/editors/object/object_lattice.c
+++ b/source/blender/editors/object/object_lattice.c
@@ -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++;
}
diff --git a/source/blender/editors/object/object_modifier.c b/source/blender/editors/object/object_modifier.c
index 129d9df86a5..ad2280baba2 100644
--- a/source/blender/editors/object/object_modifier.c
+++ b/source/blender/editors/object/object_modifier.c
@@ -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;
diff --git a/source/blender/editors/sculpt_paint/paint_image.c b/source/blender/editors/sculpt_paint/paint_image.c
index 3c9edb2fcfe..ce603ce80b6 100644
--- a/source/blender/editors/sculpt_paint/paint_image.c
+++ b/source/blender/editors/sculpt_paint/paint_image.c
@@ -105,12 +105,30 @@
#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)
diff --git a/source/blender/editors/space_info/textview.c b/source/blender/editors/space_info/textview.c
index 70c4ebd445a..177b72567e5 100644
--- a/source/blender/editors/space_info/textview.c
+++ b/source/blender/editors/space_info/textview.c
@@ -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 */
diff --git a/source/blender/editors/space_view3d/drawarmature.c b/source/blender/editors/space_view3d/drawarmature.c
index a7bb1fb3ee6..c0046b089af 100644
--- a/source/blender/editors/space_view3d/drawarmature.c
+++ b/source/blender/editors/space_view3d/drawarmature.c
@@ -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);
}
diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c
index 67986f1a577..4809e463d75 100644
--- a/source/blender/editors/space_view3d/drawobject.c
+++ b/source/blender/editors/space_view3d/drawobject.c
@@ -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);
diff --git a/source/blender/editors/space_view3d/view3d_edit.c b/source/blender/editors/space_view3d/view3d_edit.c
index f98e5a7b42b..7331959ef51 100644
--- a/source/blender/editors/space_view3d/view3d_edit.c
+++ b/source/blender/editors/space_view3d/view3d_edit.c
@@ -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);
diff --git a/source/blender/editors/space_view3d/view3d_fly.c b/source/blender/editors/space_view3d/view3d_fly.c
index e9db9fe1d7e..0cdb7a19995 100644
--- a/source/blender/editors/space_view3d/view3d_fly.c
+++ b/source/blender/editors/space_view3d/view3d_fly.c
@@ -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.
diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c
index a8fcdbfcfd5..13d686508de 100644
--- a/source/blender/editors/transform/transform.c
+++ b/source/blender/editors/transform/transform.c
@@ -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;
diff --git a/source/blender/editors/transform/transform_generics.c b/source/blender/editors/transform/transform_generics.c
index b3d769ab253..53e379a2d27 100644
--- a/source/blender/editors/transform/transform_generics.c
+++ b/source/blender/editors/transform/transform_generics.c
@@ -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
diff --git a/source/blender/editors/transform/transform_input.c b/source/blender/editors/transform/transform_input.c
index cc3ffe086f1..3de68a6e312 100644
--- a/source/blender/editors/transform/transform_input.c
+++ b/source/blender/editors/transform/transform_input.c
@@ -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
diff --git a/source/blender/editors/util/crazyspace.c b/source/blender/editors/util/crazyspace.c
index 9ca990c4193..9ee4a875e24 100644
--- a/source/blender/editors/util/crazyspace.c
+++ b/source/blender/editors/util/crazyspace.c
@@ -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;
}
}
diff --git a/source/blender/gpu/intern/gpu_material.c b/source/blender/gpu/intern/gpu_material.c
index a438d5c86e9..9344b4e680a 100644
--- a/source/blender/gpu/intern/gpu_material.c
+++ b/source/blender/gpu/intern/gpu_material.c
@@ -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);
}
diff --git a/source/blender/ikplugin/intern/iksolver_plugin.c b/source/blender/ikplugin/intern/iksolver_plugin.c
index cfaafe9bf5c..787766f0fa6 100644
--- a/source/blender/ikplugin/intern/iksolver_plugin.c
+++ b/source/blender/ikplugin/intern/iksolver_plugin.c
@@ -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 */
diff --git a/source/blender/ikplugin/intern/itasc_plugin.cpp b/source/blender/ikplugin/intern/itasc_plugin.cpp
index 400e720f138..2cb3a32ae3e 100644
--- a/source/blender/ikplugin/intern/itasc_plugin.cpp
+++ b/source/blender/ikplugin/intern/itasc_plugin.cpp
@@ -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);
diff --git a/source/blender/makesrna/intern/rna_armature.c b/source/blender/makesrna/intern/rna_armature.c
index e67ab012dc9..1ea1a4e3e7b 100644
--- a/source/blender/makesrna/intern/rna_armature.c
+++ b/source/blender/makesrna/intern/rna_armature.c
@@ -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);
}
}
diff --git a/source/blender/nodes/composite/nodes/node_composite_normalize.c b/source/blender/nodes/composite/nodes/node_composite_normalize.c
index a6220fbd20d..d14f589f3f2 100644
--- a/source/blender/nodes/composite/nodes/node_composite_normalize.c
+++ b/source/blender/nodes/composite/nodes/node_composite_normalize.c
@@ -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);
}
diff --git a/source/blender/render/intern/include/rendercore.h b/source/blender/render/intern/include/rendercore.h
index 5a544c46255..08f73ccbe0d 100644
--- a/source/blender/render/intern/include/rendercore.h
+++ b/source/blender/render/intern/include/rendercore.h
@@ -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;
diff --git a/source/blender/render/intern/source/envmap.c b/source/blender/render/intern/source/envmap.c
index 2f20c328405..6ea62828601 100644
--- a/source/blender/render/intern/source/envmap.c
+++ b/source/blender/render/intern/source/envmap.c
@@ -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);
diff --git a/source/blender/render/intern/source/imagetexture.c b/source/blender/render/intern/source/imagetexture.c
index 1887f22198d..d1f7059416d 100644
--- a/source/blender/render/intern/source/imagetexture.c
+++ b/source/blender/render/intern/source/imagetexture.c
@@ -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 {
diff --git a/source/blender/render/intern/source/pixelshading.c b/source/blender/render/intern/source/pixelshading.c
index dfd10687a33..36709408496 100644
--- a/source/blender/render/intern/source/pixelshading.c
+++ b/source/blender/render/intern/source/pixelshading.c
@@ -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;
}
diff --git a/source/blender/render/intern/source/pointdensity.c b/source/blender/render/intern/source/pointdensity.c
index 36ded5c10d2..c3a4ca9bf7d 100644
--- a/source/blender/render/intern/source/pointdensity.c
+++ b/source/blender/render/intern/source/pointdensity.c
@@ -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:
diff --git a/source/blender/render/intern/source/rendercore.c b/source/blender/render/intern/source/rendercore.c
index 48134c46c61..456702e0827 100644
--- a/source/blender/render/intern/source/rendercore.c
+++ b/source/blender/render/intern/source/rendercore.c
@@ -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;
diff --git a/source/blender/render/intern/source/shadbuf.c b/source/blender/render/intern/source/shadbuf.c
index 274fa4469e0..f3eb2234778 100644
--- a/source/blender/render/intern/source/shadbuf.c
+++ b/source/blender/render/intern/source/shadbuf.c
@@ -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);
}
}
diff --git a/source/blender/render/intern/source/shadeinput.c b/source/blender/render/intern/source/shadeinput.c
index 55d3703d351..1852dfaebab 100644
--- a/source/blender/render/intern/source/shadeinput.c
+++ b/source/blender/render/intern/source/shadeinput.c
@@ -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 */
diff --git a/source/blender/render/intern/source/strand.c b/source/blender/render/intern/source/strand.c
index ddcffcc303b..633c7ca1847 100644
--- a/source/blender/render/intern/source/strand.c
+++ b/source/blender/render/intern/source/strand.c
@@ -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);
diff --git a/source/blender/render/intern/source/volume_precache.c b/source/blender/render/intern/source/volume_precache.c
index 11d7d9342f7..29eea081672 100644
--- a/source/blender/render/intern/source/volume_precache.c
+++ b/source/blender/render/intern/source/volume_precache.c
@@ -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;
diff --git a/source/blender/render/intern/source/voxeldata.c b/source/blender/render/intern/source/voxeldata.c
index d624751f613..57ff5f4237a 100644
--- a/source/blender/render/intern/source/voxeldata.c
+++ b/source/blender/render/intern/source/voxeldata.c
@@ -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);
}
diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c
index 43687fc21fb..f12dec6459a 100644
--- a/source/blender/windowmanager/intern/wm_operators.c
+++ b/source/blender/windowmanager/intern/wm_operators.c
@@ -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");
}
{