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:
authorCampbell Barton <ideasman42@gmail.com>2011-09-12 08:14:12 +0400
committerCampbell Barton <ideasman42@gmail.com>2011-09-12 08:14:12 +0400
commit4bd0a2ba2dadee66d52f9a1101ee918f1327eec4 (patch)
treeb567b077039e78467e21548c5e03fa8b94fc2b6c /source/blender/nodes
parent471a86bf9ccae23b63cb1a05c9525ef99987581d (diff)
replace VECCOPY -> copy_v3_v3, added copy_v*_v*_short too for typesafe copying, some parts of the code are copying float -> short normals without scaling. fix coming next.
Diffstat (limited to 'source/blender/nodes')
-rw-r--r--source/blender/nodes/shader/nodes/node_shader_geom.c12
-rw-r--r--source/blender/nodes/shader/nodes/node_shader_material.c6
2 files changed, 8 insertions, 10 deletions
diff --git a/source/blender/nodes/shader/nodes/node_shader_geom.c b/source/blender/nodes/shader/nodes/node_shader_geom.c
index 585d1e59d15..ddb8c42a730 100644
--- a/source/blender/nodes/shader/nodes/node_shader_geom.c
+++ b/source/blender/nodes/shader/nodes/node_shader_geom.c
@@ -72,12 +72,12 @@ static void node_shader_exec_geom(void *data, bNode *node, bNodeStack **UNUSED(i
}
/* out: global, local, view, orco, uv, normal, vertex color */
- VECCOPY(out[GEOM_OUT_GLOB]->vec, shi->gl);
- VECCOPY(out[GEOM_OUT_LOCAL]->vec, shi->co);
- VECCOPY(out[GEOM_OUT_VIEW]->vec, shi->view);
- VECCOPY(out[GEOM_OUT_ORCO]->vec, shi->lo);
- VECCOPY(out[GEOM_OUT_UV]->vec, suv->uv);
- VECCOPY(out[GEOM_OUT_NORMAL]->vec, shi->vno);
+ copy_v3_v3(out[GEOM_OUT_GLOB]->vec, shi->gl);
+ copy_v3_v3(out[GEOM_OUT_LOCAL]->vec, shi->co);
+ copy_v3_v3(out[GEOM_OUT_VIEW]->vec, shi->view);
+ copy_v3_v3(out[GEOM_OUT_ORCO]->vec, shi->lo);
+ copy_v3_v3(out[GEOM_OUT_UV]->vec, suv->uv);
+ copy_v3_v3(out[GEOM_OUT_NORMAL]->vec, shi->vno);
if (shi->totcol) {
/* find vertex color layer by name */
diff --git a/source/blender/nodes/shader/nodes/node_shader_material.c b/source/blender/nodes/shader/nodes/node_shader_material.c
index 984bfed3ff9..21fb4db115b 100644
--- a/source/blender/nodes/shader/nodes/node_shader_material.c
+++ b/source/blender/nodes/shader/nodes/node_shader_material.c
@@ -120,13 +120,11 @@ static void node_shader_exec_material(void *data, bNode *node, bNodeStack **in,
normalize_v3(shi->vn);
}
else
- VECCOPY(shi->vn, shi->vno);
+ copy_v3_v3(shi->vn, shi->vno);
/* custom option to flip normal */
if(node->custom1 & SH_NODE_MAT_NEG) {
- shi->vn[0]= -shi->vn[0];
- shi->vn[1]= -shi->vn[1];
- shi->vn[2]= -shi->vn[2];
+ negate_v3(shi->vn);
}
if (node->type == SH_NODE_MATERIAL_EXT) {