style cleanup
This commit is contained in:
parent
30fd258a0b
commit
ddc2dbc2a4
|
@ -29,13 +29,6 @@
|
|||
* \ingroup ctr
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
|
||||
* Copyright (C) 2001 NaN Technologies B.V.
|
||||
* Simple tagged index class.
|
||||
*/
|
||||
|
||||
#ifndef __CTR_TAGGEDINDEX_H__
|
||||
#define __CTR_TAGGEDINDEX_H__
|
||||
|
||||
|
@ -53,7 +46,6 @@
|
|||
#include "MEM_sys_types.h"
|
||||
|
||||
enum {
|
||||
|
||||
empty_tag = 0x0,
|
||||
empty_index = 0xffffffff
|
||||
};
|
||||
|
@ -191,7 +183,7 @@ public:
|
|||
return (Tag() == Empty().Tag());
|
||||
}
|
||||
|
||||
// functionals
|
||||
/* functionals */
|
||||
|
||||
struct greater : std::binary_function<CTR_TaggedIndex, CTR_TaggedIndex, bool>
|
||||
{
|
||||
|
@ -213,7 +205,6 @@ private :
|
|||
unsigned int m_val;
|
||||
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
};
|
||||
|
||||
#endif /* __CTR_TAGGEDINDEX_H__ */
|
||||
|
|
|
@ -50,16 +50,16 @@
|
|||
* type ObjectType must have the following public methods to be used by
|
||||
* this template class:
|
||||
*
|
||||
* int
|
||||
* int
|
||||
* OpenTag(void) --- return a persistent tag value for the primitive
|
||||
*
|
||||
* void
|
||||
* void
|
||||
* SetOpenTag(int bla) --- set the persistent tag value for this primitive to bla.
|
||||
*
|
||||
* bool
|
||||
* bool
|
||||
* SelectTag() --- return a persistent boolean tag for this primitive
|
||||
*
|
||||
* void
|
||||
* void
|
||||
* SetSelectTag(bool bla) --- set the persistent boolean tag for this primitive to bla.
|
||||
*
|
||||
* Here persistent means that the tag should be associated with the object for the
|
||||
|
@ -86,16 +86,16 @@ public :
|
|||
unsigned int shift
|
||||
) {
|
||||
|
||||
// iterate through vectors in index_list
|
||||
// iterate through individual members of each vector
|
||||
// mark each obejct that the index points to
|
||||
/* iterate through vectors in index_list
|
||||
* iterate through individual members of each vector
|
||||
* mark each obejct that the index points to */
|
||||
|
||||
typename std::vector< std::vector<IndexType> >::const_iterator
|
||||
last_vector = index_list.end();
|
||||
typename std::vector< std::vector<IndexType> >::const_iterator
|
||||
start_vector = index_list.begin();
|
||||
|
||||
// FIXME some temporary space
|
||||
/* FIXME some temporary space */
|
||||
|
||||
std::vector<IndexType> temp_union;
|
||||
temp_union.reserve(64);
|
||||
|
@ -114,7 +114,7 @@ public :
|
|||
ObjectType & prim = primitives[*start_index];
|
||||
|
||||
if (!prim.OpenTag()) {
|
||||
// compute the union
|
||||
/* compute the union */
|
||||
temp_union.push_back(*start_index);
|
||||
}
|
||||
int tag = prim.OpenTag();
|
||||
|
@ -126,7 +126,7 @@ public :
|
|||
++tag_num;
|
||||
}
|
||||
|
||||
// now iterate through the union and pull out all those with the right tag
|
||||
/* now iterate through the union and pull out all those with the right tag */
|
||||
|
||||
typename std::vector<IndexType>::const_iterator last_index =
|
||||
temp_union.end();
|
||||
|
@ -138,20 +138,20 @@ public :
|
|||
ObjectType & prim = primitives[*start_index];
|
||||
|
||||
if (prim.OpenTag() == tag_num) {
|
||||
//it's part of the intersection!
|
||||
/* it's part of the intersection! */
|
||||
|
||||
output.push_back(*start_index);
|
||||
// because we're iterating through the union
|
||||
// it's safe to remove the tag at this point
|
||||
/* because we're iterating through the union
|
||||
* it's safe to remove the tag at this point */
|
||||
|
||||
prim.SetOpenTag(prim.OpenTag() & ~mask);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// note not a strict set intersection!
|
||||
// if x appears twice in b and is part of the intersection
|
||||
// it will appear twice in the intersection
|
||||
/* note not a strict set intersection!
|
||||
* if x appears twice in b and is part of the intersection
|
||||
* it will appear twice in the intersection */
|
||||
|
||||
static
|
||||
void
|
||||
|
@ -180,7 +180,7 @@ public :
|
|||
output.push_back(*start_index);
|
||||
}
|
||||
}
|
||||
// deselect
|
||||
/* deselect */
|
||||
last_index = a.end();
|
||||
start_index = a.begin();
|
||||
|
||||
|
@ -199,9 +199,9 @@ public :
|
|||
std::vector<IndexType> &output
|
||||
) {
|
||||
|
||||
// iterate through vectors in index_list
|
||||
// iterate through individual members of each vector
|
||||
// mark each obejct that the index points to
|
||||
/* iterate through vectors in index_list
|
||||
* iterate through individual members of each vector
|
||||
* mark each obejct that the index points to */
|
||||
|
||||
typename std::vector< std::vector<IndexType> >::const_iterator
|
||||
last_vector = index_list.end();
|
||||
|
@ -220,15 +220,15 @@ public :
|
|||
ObjectType & prim = primitives[*start_index];
|
||||
|
||||
if (!prim.SelectTag()) {
|
||||
// compute the union
|
||||
/* compute the union */
|
||||
output.push_back(*start_index);
|
||||
prim.SetSelectTag(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// now iterate through the union and reset the tags
|
||||
|
||||
/* now iterate through the union and reset the tags */
|
||||
|
||||
typename std::vector<IndexType>::const_iterator last_index =
|
||||
output.end();
|
||||
typename std::vector<IndexType>::iterator start_index =
|
||||
|
@ -238,7 +238,7 @@ public :
|
|||
|
||||
ObjectType & prim = primitives[*start_index];
|
||||
prim.SetSelectTag(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -251,8 +251,8 @@ public :
|
|||
std::vector< IndexType> &output
|
||||
) {
|
||||
|
||||
// iterate through b mark all
|
||||
// iterate through a and add to output all unmarked
|
||||
/* iterate through b mark all
|
||||
* iterate through a and add to output all unmarked */
|
||||
|
||||
typename std::vector<IndexType>::const_iterator last_index =
|
||||
b.end();
|
||||
|
@ -276,7 +276,7 @@ public :
|
|||
}
|
||||
}
|
||||
|
||||
// clean up the tags
|
||||
/* clean up the tags */
|
||||
|
||||
last_index = b.end();
|
||||
start_index = b.begin();
|
||||
|
@ -290,12 +290,11 @@ public :
|
|||
|
||||
private :
|
||||
|
||||
// private constructor - this class is not meant for
|
||||
// instantiation
|
||||
/* private constructor - this class is not meant for
|
||||
* instantiation */
|
||||
|
||||
CTR_TaggedSetOps();
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
#endif /* __CTR_TAGGEDSETOPS_H__ */
|
||||
|
|
|
@ -956,7 +956,8 @@ void boid_brain(BoidBrainData *bbd, int p, ParticleData *pa)
|
|||
// }
|
||||
//}
|
||||
|
||||
bbd->wanted_co[0]=bbd->wanted_co[1]=bbd->wanted_co[2]=bbd->wanted_speed=0.0f;
|
||||
zero_v3(bbd->wanted_co);
|
||||
bbd->wanted_speed = 0.0f;
|
||||
|
||||
/* create random seed for every particle & frame */
|
||||
rand = (int)(PSYS_FRAND(psys->seed + p) * 1000);
|
||||
|
@ -990,7 +991,8 @@ void boid_brain(BoidBrainData *bbd, int p, ParticleData *pa)
|
|||
add_v3_v3(wanted_co, bbd->wanted_co);
|
||||
wanted_speed += bbd->wanted_speed;
|
||||
n++;
|
||||
bbd->wanted_co[0]=bbd->wanted_co[1]=bbd->wanted_co[2]=bbd->wanted_speed=0.0f;
|
||||
zero_v3(bbd->wanted_co);
|
||||
bbd->wanted_speed = 0.0f;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1266,9 +1268,9 @@ void boid_body(BoidBrainData *bbd, ParticleData *pa)
|
|||
{
|
||||
float grav[3];
|
||||
|
||||
grav[0]= 0.0f;
|
||||
grav[1]= 0.0f;
|
||||
grav[2]= bbd->sim->scene->physics_settings.gravity[2] < 0.0f ? -1.0f : 0.0f;
|
||||
grav[0] = 0.0f;
|
||||
grav[1] = 0.0f;
|
||||
grav[2] = bbd->sim->scene->physics_settings.gravity[2] < 0.0f ? -1.0f : 0.0f;
|
||||
|
||||
/* don't take forward acceleration into account (better banking) */
|
||||
if (dot_v3v3(bpa->data.acc, pa->state.vel) > 0.0f) {
|
||||
|
@ -1309,9 +1311,9 @@ void boid_body(BoidBrainData *bbd, ParticleData *pa)
|
|||
{
|
||||
float grav[3];
|
||||
|
||||
grav[0]= 0.0f;
|
||||
grav[1]= 0.0f;
|
||||
grav[2]= bbd->sim->scene->physics_settings.gravity[2] < 0.0f ? -1.0f : 0.0f;
|
||||
grav[0] = 0.0f;
|
||||
grav[1] = 0.0f;
|
||||
grav[2] = bbd->sim->scene->physics_settings.gravity[2] < 0.0f ? -1.0f : 0.0f;
|
||||
|
||||
|
||||
/* gather apparent gravity */
|
||||
|
|
|
@ -824,7 +824,7 @@ static int cloth_from_object(Object *ob, ClothModifierData *clmd, DerivedMesh *d
|
|||
int i = 0;
|
||||
MVert *mvert = NULL;
|
||||
ClothVertex *verts = NULL;
|
||||
float (*shapekey_rest)[3]= NULL;
|
||||
float (*shapekey_rest)[3] = NULL;
|
||||
float tnull[3] = {0, 0, 0};
|
||||
Cloth *cloth = NULL;
|
||||
float maxdist = 0;
|
||||
|
|
|
@ -828,7 +828,7 @@ static void do_physical_effector(EffectorCache *eff, EffectorData *efd, Effected
|
|||
{
|
||||
PartDeflect *pd = eff->pd;
|
||||
RNG *rng = pd->rng;
|
||||
float force[3]={0, 0, 0};
|
||||
float force[3] = {0, 0, 0};
|
||||
float temp[3];
|
||||
float fac;
|
||||
float strength = pd->f_strength;
|
||||
|
@ -1020,7 +1020,7 @@ void pdDoEffectors(ListBase *effectors, ListBase *colliders, EffectorWeights *we
|
|||
do_texture_effector(eff, &efd, point, force);
|
||||
}
|
||||
else {
|
||||
float temp1[3]={0, 0, 0}, temp2[3];
|
||||
float temp1[3] = {0, 0, 0}, temp2[3];
|
||||
copy_v3_v3(temp1, force);
|
||||
|
||||
do_physical_effector(eff, &efd, point, force);
|
||||
|
|
|
@ -1218,7 +1218,7 @@ DO_INLINE void cloth_calc_spring_force(ClothModifierData *clmd, ClothSpring *s,
|
|||
float stretch_force[3] = {0, 0, 0};
|
||||
float bending_force[3] = {0, 0, 0};
|
||||
float damping_force[3] = {0, 0, 0};
|
||||
float nulldfdx[3][3]={ {0, 0, 0}, {0, 0, 0}, {0, 0, 0}};
|
||||
float nulldfdx[3][3] = {{0, 0, 0}, {0, 0, 0}, {0, 0, 0}};
|
||||
|
||||
float scaling = 0.0;
|
||||
|
||||
|
@ -1356,15 +1356,15 @@ static void CalcFloat( float *v1, float *v2, float *v3, float *n)
|
|||
{
|
||||
float n1[3], n2[3];
|
||||
|
||||
n1[0]= v1[0]-v2[0];
|
||||
n2[0]= v2[0]-v3[0];
|
||||
n1[1]= v1[1]-v2[1];
|
||||
n2[1]= v2[1]-v3[1];
|
||||
n1[2]= v1[2]-v2[2];
|
||||
n2[2]= v2[2]-v3[2];
|
||||
n[0]= n1[1]*n2[2]-n1[2]*n2[1];
|
||||
n[1]= n1[2]*n2[0]-n1[0]*n2[2];
|
||||
n[2]= n1[0]*n2[1]-n1[1]*n2[0];
|
||||
n1[0] = v1[0]-v2[0];
|
||||
n2[0] = v2[0]-v3[0];
|
||||
n1[1] = v1[1]-v2[1];
|
||||
n2[1] = v2[1]-v3[1];
|
||||
n1[2] = v1[2]-v2[2];
|
||||
n2[2] = v2[2]-v3[2];
|
||||
n[0] = n1[1]*n2[2]-n1[2]*n2[1];
|
||||
n[1] = n1[2]*n2[0]-n1[0]*n2[2];
|
||||
n[2] = n1[0]*n2[1]-n1[1]*n2[0];
|
||||
}
|
||||
|
||||
static void CalcFloat4( float *v1, float *v2, float *v3, float *v4, float *n)
|
||||
|
@ -1372,17 +1372,17 @@ static void CalcFloat4( float *v1, float *v2, float *v3, float *v4, float *n)
|
|||
/* real cross! */
|
||||
float n1[3], n2[3];
|
||||
|
||||
n1[0]= v1[0]-v3[0];
|
||||
n1[1]= v1[1]-v3[1];
|
||||
n1[2]= v1[2]-v3[2];
|
||||
n1[0] = v1[0]-v3[0];
|
||||
n1[1] = v1[1]-v3[1];
|
||||
n1[2] = v1[2]-v3[2];
|
||||
|
||||
n2[0]= v2[0]-v4[0];
|
||||
n2[1]= v2[1]-v4[1];
|
||||
n2[2]= v2[2]-v4[2];
|
||||
n2[0] = v2[0]-v4[0];
|
||||
n2[1] = v2[1]-v4[1];
|
||||
n2[2] = v2[2]-v4[2];
|
||||
|
||||
n[0]= n1[1]*n2[2]-n1[2]*n2[1];
|
||||
n[1]= n1[2]*n2[0]-n1[0]*n2[2];
|
||||
n[2]= n1[0]*n2[1]-n1[1]*n2[0];
|
||||
n[0] = n1[1]*n2[2]-n1[2]*n2[1];
|
||||
n[1] = n1[2]*n2[0]-n1[0]*n2[2];
|
||||
n[2] = n1[0]*n2[1]-n1[1]*n2[0];
|
||||
}
|
||||
|
||||
static float calculateVertexWindForce(float wind[3], float vertexnormal[3])
|
||||
|
@ -1544,7 +1544,7 @@ static void cloth_calc_force(ClothModifierData *clmd, float UNUSED(frame), lfVec
|
|||
lfVector *winvec;
|
||||
EffectedPoint epoint;
|
||||
|
||||
tm2[0][0]= tm2[1][1]= tm2[2][2]= -spring_air;
|
||||
tm2[0][0] = tm2[1][1] = tm2[2][2] = -spring_air;
|
||||
|
||||
/* global acceleration (gravitation) */
|
||||
if (clmd->scene->physics_settings.flag & PHYS_GLOBAL_GRAVITY) {
|
||||
|
@ -1588,9 +1588,9 @@ static void cloth_calc_force(ClothModifierData *clmd, float UNUSED(frame), lfVec
|
|||
}
|
||||
|
||||
for (i = 0; i < cloth->numfaces; i++) {
|
||||
float trinormal[3]={0, 0, 0}; // normalized triangle normal
|
||||
float triunnormal[3]={0, 0, 0}; // not-normalized-triangle normal
|
||||
float tmp[3]={0, 0, 0};
|
||||
float trinormal[3] = {0, 0, 0}; // normalized triangle normal
|
||||
float triunnormal[3] = {0, 0, 0}; // not-normalized-triangle normal
|
||||
float tmp[3] = {0, 0, 0};
|
||||
float factor = (mfaces[i].v4) ? 0.25 : 1.0 / 3.0;
|
||||
factor *= 0.02;
|
||||
|
||||
|
@ -1628,9 +1628,9 @@ static void cloth_calc_force(ClothModifierData *clmd, float UNUSED(frame), lfVec
|
|||
/* Hair has only edges */
|
||||
if (cloth->numfaces == 0) {
|
||||
ClothSpring *spring;
|
||||
float edgevec[3]={0, 0, 0}; //edge vector
|
||||
float edgeunnormal[3]={0, 0, 0}; // not-normalized-edge normal
|
||||
float tmp[3]={0, 0, 0};
|
||||
float edgevec[3] = {0, 0, 0}; //edge vector
|
||||
float edgeunnormal[3] = {0, 0, 0}; // not-normalized-edge normal
|
||||
float tmp[3] = {0, 0, 0};
|
||||
float factor = 0.01;
|
||||
|
||||
search = cloth->springs;
|
||||
|
|
|
@ -1200,7 +1200,7 @@ static int check_for_dupid(ListBase *lb, ID *id, char *name)
|
|||
char left[MAX_ID_NAME + 8], leftest[MAX_ID_NAME + 8];
|
||||
|
||||
/* make sure input name is terminated properly */
|
||||
/* if ( strlen(name) > MAX_ID_NAME-3 ) name[MAX_ID_NAME-3]= 0; */
|
||||
/* if ( strlen(name) > MAX_ID_NAME-3 ) name[MAX_ID_NAME-3] = 0; */
|
||||
/* removed since this is only ever called from one place - campbell */
|
||||
|
||||
while (1) {
|
||||
|
|
|
@ -1159,7 +1159,7 @@ void material_drivers_update(Scene *scene, Material *ma, float ctime)
|
|||
|
||||
/* ****************** */
|
||||
#if 0 /* UNUSED */
|
||||
static char colname_array[125][20]= {
|
||||
static char colname_array[125][20] = {
|
||||
"Black", "DarkRed", "HalfRed", "Red", "Red",
|
||||
"DarkGreen", "DarkOlive", "Brown", "Chocolate", "OrangeRed",
|
||||
"HalfGreen", "GreenOlive", "DryOlive", "Goldenrod", "DarkOrange",
|
||||
|
|
|
@ -369,10 +369,10 @@ void psys_calc_dmcache(Object *ob, DerivedMesh *dm, ParticleSystem *psys)
|
|||
if (nodearray[*origindex]) {
|
||||
/* prepend */
|
||||
node->next = nodearray[*origindex];
|
||||
nodearray[*origindex]= node;
|
||||
nodearray[*origindex] = node;
|
||||
}
|
||||
else
|
||||
nodearray[*origindex]= node;
|
||||
nodearray[*origindex] = node;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -633,8 +633,8 @@ static void hammersley_create(float *out, int n, int seed, float amount)
|
|||
int k, kk;
|
||||
|
||||
rng = rng_new(31415926 + n + seed);
|
||||
offs[0]= rng_getDouble(rng) + (double)amount;
|
||||
offs[1]= rng_getDouble(rng) + (double)amount;
|
||||
offs[0] = rng_getDouble(rng) + (double)amount;
|
||||
offs[1] = rng_getDouble(rng) + (double)amount;
|
||||
rng_free(rng);
|
||||
|
||||
for (k = 0; k < n; k++) {
|
||||
|
@ -643,8 +643,8 @@ static void hammersley_create(float *out, int n, int seed, float amount)
|
|||
if (kk & 1) /* kk mod 2 = 1 */
|
||||
t += p;
|
||||
|
||||
out[2*k + 0]= fmod((double)k/(double)n + offs[0], 1.0);
|
||||
out[2*k + 1]= fmod(t + offs[1], 1.0);
|
||||
out[2*k + 0] = fmod((double)k/(double)n + offs[0], 1.0);
|
||||
out[2*k + 1] = fmod(t + offs[1], 1.0);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -666,8 +666,8 @@ static void init_mv_jit(float *jit, int num, int seed2, float amount)
|
|||
num2 = 2 * num;
|
||||
for (i=0; i<num2; i+=2) {
|
||||
|
||||
jit[i]= x + amount*rad1*(0.5f - rng_getFloat(rng));
|
||||
jit[i+1]= i/(2.0f*num) + amount*rad1*(0.5f - rng_getFloat(rng));
|
||||
jit[i] = x + amount*rad1*(0.5f - rng_getFloat(rng));
|
||||
jit[i+1] = i/(2.0f*num) + amount*rad1*(0.5f - rng_getFloat(rng));
|
||||
|
||||
jit[i]-= (float)floor(jit[i]);
|
||||
jit[i+1]-= (float)floor(jit[i+1]);
|
||||
|
@ -698,21 +698,21 @@ static void psys_uv_to_w(float u, float v, int quad, float *w)
|
|||
u= 1.0f-u;
|
||||
}
|
||||
|
||||
vert[0][0]= 0.0f; vert[0][1]= 0.0f; vert[0][2]= 0.0f;
|
||||
vert[1][0]= 1.0f; vert[1][1]= 0.0f; vert[1][2]= 0.0f;
|
||||
vert[2][0]= 1.0f; vert[2][1]= 1.0f; vert[2][2]= 0.0f;
|
||||
vert[0][0] = 0.0f; vert[0][1] = 0.0f; vert[0][2] = 0.0f;
|
||||
vert[1][0] = 1.0f; vert[1][1] = 0.0f; vert[1][2] = 0.0f;
|
||||
vert[2][0] = 1.0f; vert[2][1] = 1.0f; vert[2][2] = 0.0f;
|
||||
|
||||
co[0]= u;
|
||||
co[1]= v;
|
||||
co[2]= 0.0f;
|
||||
co[0] = u;
|
||||
co[1] = v;
|
||||
co[2] = 0.0f;
|
||||
|
||||
if (quad) {
|
||||
vert[3][0]= 0.0f; vert[3][1]= 1.0f; vert[3][2]= 0.0f;
|
||||
vert[3][0] = 0.0f; vert[3][1] = 1.0f; vert[3][2] = 0.0f;
|
||||
interp_weights_poly_v3( w,vert, 4, co);
|
||||
}
|
||||
else {
|
||||
interp_weights_poly_v3( w,vert, 3, co);
|
||||
w[3]= 0.0f;
|
||||
w[3] = 0.0f;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1000,7 +1000,7 @@ static void distribute_invalid(Scene *scene, ParticleSystem *psys, int from)
|
|||
|
||||
if (psys->child && totchild) {
|
||||
for (p=0,cpa=psys->child; p<totchild; p++,cpa++) {
|
||||
cpa->fuv[0]=cpa->fuv[1]=cpa->fuv[2]=cpa->fuv[3]= 0.0;
|
||||
cpa->fuv[0]=cpa->fuv[1]=cpa->fuv[2]=cpa->fuv[3] = 0.0;
|
||||
cpa->foffset= 0.0f;
|
||||
cpa->parent=0;
|
||||
cpa->pa[0]=cpa->pa[1]=cpa->pa[2]=cpa->pa[3]=0;
|
||||
|
@ -1011,7 +1011,7 @@ static void distribute_invalid(Scene *scene, ParticleSystem *psys, int from)
|
|||
else {
|
||||
PARTICLE_P;
|
||||
LOOP_PARTICLES {
|
||||
pa->fuv[0]=pa->fuv[1]=pa->fuv[2]= pa->fuv[3]= 0.0;
|
||||
pa->fuv[0] = pa->fuv[1] = pa->fuv[2] = pa->fuv[3] = 0.0;
|
||||
pa->foffset= 0.0f;
|
||||
pa->num= -1;
|
||||
}
|
||||
|
@ -1113,7 +1113,7 @@ static int distribute_threads_init_data(ParticleThread *threads, Scene *scene, D
|
|||
|
||||
if (from == PART_FROM_VERT) {
|
||||
MVert *mv= dm->getVertDataArray(dm, CD_MVERT);
|
||||
float (*orcodata)[3]= dm->getVertDataArray(dm, CD_ORCO);
|
||||
float (*orcodata)[3] = dm->getVertDataArray(dm, CD_ORCO);
|
||||
int totvert = dm->getNumVerts(dm);
|
||||
|
||||
tree=BLI_kdtree_new(totvert);
|
||||
|
@ -1245,9 +1245,9 @@ static int distribute_threads_init_data(ParticleThread *threads, Scene *scene, D
|
|||
inv_totweight = (totweight > 0.f ? 1.f/totweight : 0.f);
|
||||
|
||||
/* Calculate cumulative weights */
|
||||
element_sum[0]= 0.0f;
|
||||
element_sum[0] = 0.0f;
|
||||
for (i=0; i<totelem; i++)
|
||||
element_sum[i+1]= element_sum[i] + element_weight[i] * inv_totweight;
|
||||
element_sum[i+1] = element_sum[i] + element_weight[i] * inv_totweight;
|
||||
|
||||
/* Finally assign elements to particles */
|
||||
if ((part->flag&PART_TRAND) || (part->simplify_flag&PART_SIMPLIFY_ENABLE)) {
|
||||
|
@ -1256,9 +1256,9 @@ static int distribute_threads_init_data(ParticleThread *threads, Scene *scene, D
|
|||
for (p=0; p<totpart; p++) {
|
||||
/* In theory element_sum[totelem] should be 1.0, but due to float errors this is not necessarily always true, so scale pos accordingly. */
|
||||
pos= BLI_frand() * element_sum[totelem];
|
||||
particle_element[p]= distribute_binary_search(element_sum, totelem, pos);
|
||||
particle_element[p]= MIN2(totelem-1, particle_element[p]);
|
||||
jitter_offset[particle_element[p]]= pos;
|
||||
particle_element[p] = distribute_binary_search(element_sum, totelem, pos);
|
||||
particle_element[p] = MIN2(totelem-1, particle_element[p]);
|
||||
jitter_offset[particle_element[p]] = pos;
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
@ -1272,13 +1272,13 @@ static int distribute_threads_init_data(ParticleThread *threads, Scene *scene, D
|
|||
while ((i < totelem) && (pos > element_sum[i+1]))
|
||||
i++;
|
||||
|
||||
particle_element[p]= MIN2(totelem-1, i);
|
||||
particle_element[p] = MIN2(totelem-1, i);
|
||||
|
||||
/* avoid zero weight face */
|
||||
if (p == totpart-1 && element_weight[particle_element[p]] == 0.0f)
|
||||
particle_element[p]= particle_element[p-1];
|
||||
particle_element[p] = particle_element[p-1];
|
||||
|
||||
jitter_offset[particle_element[p]]= pos;
|
||||
jitter_offset[particle_element[p]] = pos;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1622,9 +1622,9 @@ void psys_get_birth_coordinates(ParticleSimulationData *sim, ParticleData *pa, P
|
|||
ParticleSystem *psys = sim->psys;
|
||||
ParticleSettings *part;
|
||||
ParticleTexture ptex;
|
||||
float fac, phasefac, nor[3]={0,0,0},loc[3],vel[3]={0.0,0.0,0.0},rot[4],q2[4];
|
||||
float r_vel[3],r_ave[3],r_rot[4],vec[3],p_vel[3]={0.0,0.0,0.0};
|
||||
float x_vec[3]={1.0,0.0,0.0}, utan[3]={0.0,1.0,0.0}, vtan[3]={0.0,0.0,1.0}, rot_vec[3]={0.0,0.0,0.0};
|
||||
float fac, phasefac, nor[3] = {0,0,0},loc[3],vel[3] = {0.0,0.0,0.0},rot[4],q2[4];
|
||||
float r_vel[3],r_ave[3],r_rot[4],vec[3],p_vel[3] = {0.0,0.0,0.0};
|
||||
float x_vec[3] = {1.0,0.0,0.0}, utan[3] = {0.0,1.0,0.0}, vtan[3] = {0.0,0.0,1.0}, rot_vec[3] = {0.0,0.0,0.0};
|
||||
float q_phase[4];
|
||||
int p = pa - psys->particles;
|
||||
part=psys->part;
|
||||
|
@ -2736,7 +2736,7 @@ static void basic_integrate(ParticleSimulationData *sim, int p, float dfra, floa
|
|||
}
|
||||
static void basic_rotate(ParticleSettings *part, ParticleData *pa, float dfra, float timestep)
|
||||
{
|
||||
float rotfac, rot1[4], rot2[4]={1.0,0.0,0.0,0.0}, dtime=dfra*timestep, extrotfac;
|
||||
float rotfac, rot1[4], rot2[4] = {1.0,0.0,0.0,0.0}, dtime=dfra*timestep, extrotfac;
|
||||
|
||||
if ((part->flag & PART_ROTATIONS) == 0) {
|
||||
unit_qt(pa->state.rot);
|
||||
|
|
|
@ -249,9 +249,9 @@ static int ptcache_particle_write(int index, void *psys_v, void **data, int cfr
|
|||
if (data[BPHYS_DATA_INDEX] && (cfra < pa->time - step || cfra > pa->dietime + step))
|
||||
return 0;
|
||||
|
||||
times[0]= pa->time;
|
||||
times[1]= pa->dietime;
|
||||
times[2]= pa->lifetime;
|
||||
times[0] = pa->time;
|
||||
times[1] = pa->dietime;
|
||||
times[2] = pa->lifetime;
|
||||
|
||||
PTCACHE_DATA_FROM(data, BPHYS_DATA_INDEX, &index);
|
||||
PTCACHE_DATA_FROM(data, BPHYS_DATA_LOCATION, pa->state.co);
|
||||
|
|
|
@ -552,7 +552,7 @@ void set_sca_new_poins_ob(Object *ob)
|
|||
if (sens->flag & SENS_NEW) {
|
||||
for (a=0; a<sens->totlinks; a++) {
|
||||
if (sens->links[a] && sens->links[a]->mynew)
|
||||
sens->links[a]= sens->links[a]->mynew;
|
||||
sens->links[a] = sens->links[a]->mynew;
|
||||
}
|
||||
}
|
||||
sens= sens->next;
|
||||
|
@ -563,7 +563,7 @@ void set_sca_new_poins_ob(Object *ob)
|
|||
if (cont->flag & CONT_NEW) {
|
||||
for (a=0; a<cont->totlinks; a++) {
|
||||
if ( cont->links[a] && cont->links[a]->mynew)
|
||||
cont->links[a]= cont->links[a]->mynew;
|
||||
cont->links[a] = cont->links[a]->mynew;
|
||||
}
|
||||
}
|
||||
cont= cont->next;
|
||||
|
|
|
@ -1598,7 +1598,7 @@ static void _scan_for_ext_spring_forces(Scene *scene, Object *ob, float timenow,
|
|||
/*see if we have wind*/
|
||||
if (do_effector) {
|
||||
EffectedPoint epoint;
|
||||
float speed[3]={0.0f, 0.0f, 0.0f};
|
||||
float speed[3] = {0.0f, 0.0f, 0.0f};
|
||||
float pos[3];
|
||||
mid_v3_v3v3(pos, sb->bpoint[bs->v1].pos, sb->bpoint[bs->v2].pos);
|
||||
mid_v3_v3v3(vel, sb->bpoint[bs->v1].vec, sb->bpoint[bs->v2].vec);
|
||||
|
@ -1749,8 +1749,8 @@ static int sb_detect_vertex_collisionCached(float opco[3], float facenormal[3],
|
|||
Object *ob= NULL;
|
||||
GHash *hash;
|
||||
GHashIterator *ihash;
|
||||
float nv1[3], nv2[3], nv3[3], nv4[3], edge1[3], edge2[3], d_nvect[3], dv1[3], ve[3], avel[3]={0.0, 0.0, 0.0},
|
||||
vv1[3], vv2[3], vv3[3], vv4[3], coledge[3]={0.0f, 0.0f, 0.0f}, mindistedge = 1000.0f,
|
||||
float nv1[3], nv2[3], nv3[3], nv4[3], edge1[3], edge2[3], d_nvect[3], dv1[3], ve[3], avel[3] = {0.0, 0.0, 0.0},
|
||||
vv1[3], vv2[3], vv3[3], vv4[3], coledge[3] = {0.0f, 0.0f, 0.0f}, mindistedge = 1000.0f,
|
||||
outerforceaccu[3], innerforceaccu[3],
|
||||
facedist, /* n_mag, */ /* UNUSED */ force_mag_norm, minx, miny, minz, maxx, maxy, maxz,
|
||||
innerfacethickness = -0.5f, outerfacethickness = 0.2f,
|
||||
|
@ -2209,7 +2209,7 @@ static int _softbody_calc_forces_slice_in_a_thread(Scene *scene, Object *ob, flo
|
|||
bp = &sb->bpoint[ifirst];
|
||||
for (bb=number_of_points_here; bb>0; bb--, bp++) {
|
||||
/* clear forces accumulator */
|
||||
bp->force[0]= bp->force[1]= bp->force[2]= 0.0;
|
||||
bp->force[0] = bp->force[1] = bp->force[2] = 0.0;
|
||||
/* naive ball self collision */
|
||||
/* needs to be done if goal snaps or not */
|
||||
if (do_selfcollision) {
|
||||
|
@ -2304,8 +2304,8 @@ static int _softbody_calc_forces_slice_in_a_thread(Scene *scene, Object *ob, flo
|
|||
if (do_effector) {
|
||||
EffectedPoint epoint;
|
||||
float kd;
|
||||
float force[3]= {0.0f, 0.0f, 0.0f};
|
||||
float speed[3]= {0.0f, 0.0f, 0.0f};
|
||||
float force[3] = {0.0f, 0.0f, 0.0f};
|
||||
float speed[3] = {0.0f, 0.0f, 0.0f};
|
||||
float eval_sb_fric_force_scale = sb_fric_force_scale(ob); /* just for calling function once */
|
||||
pd_point_from_soft(scene, bp->pos, bp->vec, sb->bpoint-bp, &epoint);
|
||||
pdDoEffectors(do_effector, NULL, sb->effector_weights, &epoint, force, speed);
|
||||
|
@ -2557,7 +2557,7 @@ static void softbody_calc_forces(Scene *scene, Object *ob, float forcetime, floa
|
|||
|
||||
for (a=sb->totpoint, bp= sb->bpoint; a>0; a--, bp++) {
|
||||
/* clear forces accumulator */
|
||||
bp->force[0]= bp->force[1]= bp->force[2]= 0.0;
|
||||
bp->force[0] = bp->force[1] = bp->force[2] = 0.0;
|
||||
if (nl_flags & NLF_BUILD) {
|
||||
//int ia =3*(sb->totpoint-a);
|
||||
//int op =3*sb->totpoint;
|
||||
|
@ -2712,8 +2712,8 @@ static void softbody_calc_forces(Scene *scene, Object *ob, float forcetime, floa
|
|||
/* particle field & vortex */
|
||||
if (do_effector) {
|
||||
EffectedPoint epoint;
|
||||
float force[3]= {0.0f, 0.0f, 0.0f};
|
||||
float speed[3]= {0.0f, 0.0f, 0.0f};
|
||||
float force[3] = {0.0f, 0.0f, 0.0f};
|
||||
float speed[3] = {0.0f, 0.0f, 0.0f};
|
||||
float eval_sb_fric_force_scale = sb_fric_force_scale(ob); /* just for calling function once */
|
||||
pd_point_from_soft(scene, bp->pos, bp->vec, sb->bpoint-bp, &epoint);
|
||||
pdDoEffectors(do_effector, NULL, sb->effector_weights, &epoint, force, speed);
|
||||
|
@ -2905,7 +2905,7 @@ static void softbody_apply_forces(Object *ob, float forcetime, int mode, float *
|
|||
/* or heun ~ 2nd order runge-kutta steps, mode 1, 2 */
|
||||
SoftBody *sb= ob->soft; /* is supposed to be there */
|
||||
BodyPoint *bp;
|
||||
float dx[3]={0}, dv[3], aabbmin[3], aabbmax[3], cm[3]={0.0f, 0.0f, 0.0f};
|
||||
float dx[3] = {0}, dv[3], aabbmin[3], aabbmax[3], cm[3] = {0.0f, 0.0f, 0.0f};
|
||||
float timeovermass/*, freezeloc=0.00001f, freezeforce=0.00000000001f*/;
|
||||
float maxerrpos= 0.0f, maxerrvel = 0.0f;
|
||||
int a, fuzzy=0;
|
||||
|
@ -3865,7 +3865,7 @@ static void softbody_reset(Object *ob, SoftBody *sb, float (*vertexCos)[3], int
|
|||
copy_v3_v3(bp->origS, bp->pos);
|
||||
copy_v3_v3(bp->origE, bp->pos);
|
||||
copy_v3_v3(bp->origT, bp->pos);
|
||||
bp->vec[0]= bp->vec[1]= bp->vec[2]= 0.0f;
|
||||
bp->vec[0] = bp->vec[1] = bp->vec[2] = 0.0f;
|
||||
|
||||
/* the bp->prev*'s are for rolling back from a canceled try to propagate in time
|
||||
* adaptive step size algo in a nutshell:
|
||||
|
|
|
@ -122,6 +122,7 @@ static void heap_up(Heap *heap, unsigned int i)
|
|||
Heap *BLI_heap_new_ex(unsigned int tot_reserve)
|
||||
{
|
||||
Heap *heap = (Heap *)MEM_callocN(sizeof(Heap), __func__);
|
||||
/* ensure we have at least one so we can keep doubling it */
|
||||
heap->bufsize = MAX2(1, tot_reserve);
|
||||
heap->tree = (HeapNode **)MEM_mallocN(heap->bufsize * sizeof(HeapNode *), "BLIHeapTree");
|
||||
heap->arena = BLI_memarena_new(1 << 16, "heap arena");
|
||||
|
@ -151,8 +152,8 @@ HeapNode *BLI_heap_insert(Heap *heap, float value, void *ptr)
|
|||
{
|
||||
HeapNode *node;
|
||||
|
||||
if ((heap->size + 1) > heap->bufsize) {
|
||||
heap->bufsize = heap->bufsize * 2;
|
||||
if (UNLIKELY((heap->size + 1) > heap->bufsize)) {
|
||||
heap->bufsize *= 2;
|
||||
heap->tree = MEM_reallocN(heap->tree, heap->bufsize * sizeof(*heap->tree));
|
||||
}
|
||||
|
||||
|
@ -199,8 +200,9 @@ void *BLI_heap_popmin(Heap *heap)
|
|||
heap->tree[0]->ptr = heap->freenodes;
|
||||
heap->freenodes = heap->tree[0];
|
||||
|
||||
if (heap->size == 1)
|
||||
if (UNLIKELY(heap->size == 1)) {
|
||||
heap->size--;
|
||||
}
|
||||
else {
|
||||
heap_swap(heap, 0, heap->size - 1);
|
||||
heap->size--;
|
||||
|
|
|
@ -1679,34 +1679,34 @@ void vec_apply_track(float vec[3], short axis)
|
|||
|
||||
switch (axis) {
|
||||
case 0: /* pos-x */
|
||||
/* vec[0]= 0.0; */
|
||||
/* vec[0] = 0.0; */
|
||||
vec[1] = tvec[2];
|
||||
vec[2] = -tvec[1];
|
||||
break;
|
||||
case 1: /* pos-y */
|
||||
/* vec[0]= tvec[0]; */
|
||||
/* vec[1]= 0.0; */
|
||||
/* vec[2]= tvec[2]; */
|
||||
/* vec[0] = tvec[0]; */
|
||||
/* vec[1] = 0.0; */
|
||||
/* vec[2] = tvec[2]; */
|
||||
break;
|
||||
case 2: /* pos-z */
|
||||
/* vec[0]= tvec[0]; */
|
||||
/* vec[1]= tvec[1]; */
|
||||
/* vec[2]= 0.0; */
|
||||
/* vec[0] = tvec[0]; */
|
||||
/* vec[1] = tvec[1]; */
|
||||
/* vec[2] = 0.0; */
|
||||
break;
|
||||
case 3: /* neg-x */
|
||||
/* vec[0]= 0.0; */
|
||||
/* vec[0] = 0.0; */
|
||||
vec[1] = tvec[2];
|
||||
vec[2] = -tvec[1];
|
||||
break;
|
||||
case 4: /* neg-y */
|
||||
vec[0] = -tvec[2];
|
||||
/* vec[1]= 0.0; */
|
||||
/* vec[1] = 0.0; */
|
||||
vec[2] = tvec[0];
|
||||
break;
|
||||
case 5: /* neg-z */
|
||||
vec[0] = -tvec[0];
|
||||
vec[1] = -tvec[1];
|
||||
/* vec[2]= 0.0; */
|
||||
/* vec[2] = 0.0; */
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -214,7 +214,7 @@ size_t BLI_strncpy_wchar_as_utf8(char *dst, const wchar_t *src, const size_t max
|
|||
len += BLI_str_utf8_from_unicode(*src++, dst + len);
|
||||
}
|
||||
|
||||
dst[len]= '\0';
|
||||
dst[len] = '\0';
|
||||
|
||||
return len;
|
||||
}
|
||||
|
|
|
@ -2811,7 +2811,7 @@ static void lib_link_mball(FileData *fd, Main *main)
|
|||
if (mb->adt) lib_link_animdata(fd, &mb->id, mb->adt);
|
||||
|
||||
for (a = 0; a < mb->totcol; a++)
|
||||
mb->mat[a]= newlibadr_us(fd, mb->id.lib, mb->mat[a]);
|
||||
mb->mat[a] = newlibadr_us(fd, mb->id.lib, mb->mat[a]);
|
||||
|
||||
mb->ipo = newlibadr_us(fd, mb->id.lib, mb->ipo); // XXX deprecated - old animation system
|
||||
|
||||
|
@ -7271,10 +7271,10 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
|
|||
if ( (ob->dsize[i] == 0.0f) || /* simple case, user never touched dsize */
|
||||
(ob->size[i] == 0.0f)) /* cant scale the dsize to give a non zero result, so fallback to 1.0f */
|
||||
{
|
||||
ob->dscale[i]= 1.0f;
|
||||
ob->dscale[i] = 1.0f;
|
||||
}
|
||||
else {
|
||||
ob->dscale[i]= (ob->size[i] + ob->dsize[i]) / ob->size[i];
|
||||
ob->dscale[i] = (ob->size[i] + ob->dsize[i]) / ob->size[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -197,7 +197,7 @@ static WriteData *writedata_new(int file)
|
|||
|
||||
if (wd == NULL) return NULL;
|
||||
|
||||
wd->sdna= DNA_sdna_from_data(DNAstr, DNAlen, 0);
|
||||
wd->sdna = DNA_sdna_from_data(DNAstr, DNAlen, 0);
|
||||
|
||||
wd->file= file;
|
||||
|
||||
|
@ -2540,7 +2540,7 @@ static void write_bone(WriteData *wd, Bone *bone)
|
|||
Bone* cbone;
|
||||
|
||||
// PATCH for upward compatibility after 2.37+ armature recode
|
||||
bone->size[0]= bone->size[1]= bone->size[2]= 1.0f;
|
||||
bone->size[0] = bone->size[1] = bone->size[2] = 1.0f;
|
||||
|
||||
// Write this bone
|
||||
writestruct(wd, DATA, "Bone", 1, bone);
|
||||
|
|
|
@ -876,6 +876,7 @@ void BM_mesh_decimate(BMesh *bm, const float factor)
|
|||
|
||||
/* alloc vars */
|
||||
vquadrics = MEM_callocN(sizeof(Quadric) * bm->totvert, __func__);
|
||||
/* since some edges may be degenerate, we might be over allocing a little here */
|
||||
eheap = BLI_heap_new_ex(bm->totedge);
|
||||
eheap_table = MEM_callocN(sizeof(HeapNode *) * bm->totedge, __func__);
|
||||
tot_edge_orig = bm->totedge;
|
||||
|
|
|
@ -628,8 +628,8 @@ static int ui_but_update_from_old_block(const bContext *C, uiBlock *block, uiBut
|
|||
// but->selend= oldbut->selend;
|
||||
// but->softmin= oldbut->softmin;
|
||||
// but->softmax= oldbut->softmax;
|
||||
// but->linkto[0]= oldbut->linkto[0];
|
||||
// but->linkto[1]= oldbut->linkto[1];
|
||||
// but->linkto[0] = oldbut->linkto[0];
|
||||
// but->linkto[1] = oldbut->linkto[1];
|
||||
found = 1;
|
||||
// oldbut->active= NULL;
|
||||
|
||||
|
|
|
@ -603,7 +603,7 @@ static void foreach_mouse_hit_key(PEData *data, ForKeyMatFunc func, int selected
|
|||
ParticleSystemModifierData *psmd = NULL;
|
||||
ParticleEditSettings *pset= PE_settings(data->scene);
|
||||
POINT_P; KEY_K;
|
||||
float mat[4][4]= MAT4_UNITY, imat[4][4]= MAT4_UNITY;
|
||||
float mat[4][4] = MAT4_UNITY, imat[4][4] = MAT4_UNITY;
|
||||
|
||||
if (edit->psys)
|
||||
psmd= psys_get_modifier(data->ob, edit->psys);
|
||||
|
@ -744,15 +744,15 @@ static void PE_update_mirror_cache(Object *ob, ParticleSystem *psys)
|
|||
psys_mat_hair_to_orco(ob, psmd->dm, psys->part->from, pa, mat);
|
||||
copy_v3_v3(co, key->co);
|
||||
mul_m4_v3(mat, co);
|
||||
co[0]= -co[0];
|
||||
co[0] = -co[0];
|
||||
|
||||
index= BLI_kdtree_find_nearest(tree, co, NULL, &nearest);
|
||||
|
||||
/* this needs a custom threshold still, duplicated for editmode mirror */
|
||||
if (index != -1 && index != p && (nearest.dist <= 0.0002f))
|
||||
edit->mirror_cache[p]= index;
|
||||
edit->mirror_cache[p] = index;
|
||||
else
|
||||
edit->mirror_cache[p]= -1;
|
||||
edit->mirror_cache[p] = -1;
|
||||
}
|
||||
|
||||
/* make sure mirrors are in two directions */
|
||||
|
@ -760,7 +760,7 @@ static void PE_update_mirror_cache(Object *ob, ParticleSystem *psys)
|
|||
if (edit->mirror_cache[p]) {
|
||||
index= edit->mirror_cache[p];
|
||||
if (edit->mirror_cache[index] != p)
|
||||
edit->mirror_cache[p]= -1;
|
||||
edit->mirror_cache[p] = -1;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -829,7 +829,7 @@ static void PE_mirror_particle(Object *ob, DerivedMesh *dm, ParticleSystem *psys
|
|||
for (k=0; k<pa->totkey; k++, hkey++, mhkey++, key++, mkey++) {
|
||||
copy_v3_v3(mhkey->co, hkey->co);
|
||||
mul_m4_v3(mat, mhkey->co);
|
||||
mhkey->co[0]= -mhkey->co[0];
|
||||
mhkey->co[0] = -mhkey->co[0];
|
||||
mul_m4_v3(immat, mhkey->co);
|
||||
|
||||
if (key->flag & PEK_TAG)
|
||||
|
@ -986,9 +986,9 @@ static void pe_iterate_lengths(Scene *scene, PTCacheEdit *edit)
|
|||
PTCacheEditKey *key;
|
||||
int j, k;
|
||||
float tlen;
|
||||
float dv0[3]= {0.0f, 0.0f, 0.0f};
|
||||
float dv1[3]= {0.0f, 0.0f, 0.0f};
|
||||
float dv2[3]= {0.0f, 0.0f, 0.0f};
|
||||
float dv0[3] = {0.0f, 0.0f, 0.0f};
|
||||
float dv1[3] = {0.0f, 0.0f, 0.0f};
|
||||
float dv2[3] = {0.0f, 0.0f, 0.0f};
|
||||
|
||||
if (edit==0 || (pset->flag & PE_KEEP_LENGTHS)==0)
|
||||
return;
|
||||
|
@ -1003,12 +1003,12 @@ static void pe_iterate_lengths(Scene *scene, PTCacheEdit *edit)
|
|||
if (pset->flag & PE_LOCK_FIRST) {
|
||||
key= point->keys + 1;
|
||||
k= 1;
|
||||
dv1[0]= dv1[1]= dv1[2]= 0.0;
|
||||
dv1[0] = dv1[1] = dv1[2] = 0.0;
|
||||
}
|
||||
else {
|
||||
key= point->keys;
|
||||
k= 0;
|
||||
dv0[0]= dv0[1]= dv0[2]= 0.0;
|
||||
dv0[0] = dv0[1] = dv0[2] = 0.0;
|
||||
}
|
||||
|
||||
for (; k<point->totkey; k++, key++) {
|
||||
|
@ -1527,8 +1527,8 @@ static int select_linked_exec(bContext *C, wmOperator *op)
|
|||
int location[2];
|
||||
|
||||
RNA_int_get_array(op->ptr, "location", location);
|
||||
mval[0]= location[0];
|
||||
mval[1]= location[1];
|
||||
mval[0] = location[0];
|
||||
mval[1] = location[1];
|
||||
|
||||
PE_set_view3d_data(C, &data);
|
||||
data.mval= mval;
|
||||
|
@ -1643,7 +1643,7 @@ int PE_lasso_select(bContext *C, const int mcords[][2], const short moves, short
|
|||
ParticleSystem *psys = edit->psys;
|
||||
ParticleSystemModifierData *psmd = psys_get_modifier(ob, psys);
|
||||
POINT_P; KEY_K;
|
||||
float co[3], mat[4][4]= MAT4_UNITY;
|
||||
float co[3], mat[4][4] = MAT4_UNITY;
|
||||
int screen_co[2];
|
||||
|
||||
PEData data;
|
||||
|
@ -2535,7 +2535,7 @@ static void toggle_particle_cursor(bContext *C, int enable)
|
|||
|
||||
enum { DEL_PARTICLE, DEL_KEY };
|
||||
|
||||
static EnumPropertyItem delete_type_items[]= {
|
||||
static EnumPropertyItem delete_type_items[] = {
|
||||
{DEL_PARTICLE, "PARTICLE", 0, "Particle", ""},
|
||||
{DEL_KEY, "KEY", 0, "Key", ""},
|
||||
{0, NULL, 0, NULL, NULL}};
|
||||
|
@ -2691,10 +2691,10 @@ static void PE_mirror_x(Scene *scene, Object *ob, int tagged)
|
|||
|
||||
/* rotate weights according to vertex index rotation */
|
||||
rotation= mirrorfaces[pa->num*2+1];
|
||||
newpa->fuv[0]= pa->fuv[2];
|
||||
newpa->fuv[1]= pa->fuv[1];
|
||||
newpa->fuv[2]= pa->fuv[0];
|
||||
newpa->fuv[3]= pa->fuv[3];
|
||||
newpa->fuv[0] = pa->fuv[2];
|
||||
newpa->fuv[1] = pa->fuv[1];
|
||||
newpa->fuv[2] = pa->fuv[0];
|
||||
newpa->fuv[3] = pa->fuv[3];
|
||||
while (rotation-- > 0)
|
||||
if (me->mface[pa->num].v4) {
|
||||
SHIFT4(float, newpa->fuv[0], newpa->fuv[1], newpa->fuv[2], newpa->fuv[3]);
|
||||
|
@ -3088,9 +3088,9 @@ static void intersect_dm_quad_weights(const float v1[3], const float v2[3], cons
|
|||
copy_v3_v3(vert[2], v3);
|
||||
copy_v3_v3(vert[3], v4);
|
||||
|
||||
co[0]= v1[0]*w[0] + v2[0]*w[1] + v3[0]*w[2] + v4[0]*w[3];
|
||||
co[1]= v1[1]*w[0] + v2[1]*w[1] + v3[1]*w[2] + v4[1]*w[3];
|
||||
co[2]= v1[2]*w[0] + v2[2]*w[1] + v3[2]*w[2] + v4[2]*w[3];
|
||||
co[0] = v1[0]*w[0] + v2[0]*w[1] + v3[0]*w[2] + v4[0]*w[3];
|
||||
co[1] = v1[1]*w[0] + v2[1]*w[1] + v3[1]*w[2] + v4[1]*w[3];
|
||||
co[2] = v1[2]*w[0] + v2[2]*w[1] + v3[2]*w[2] + v4[2]*w[3];
|
||||
|
||||
interp_weights_poly_v3(w, vert, 4, co);
|
||||
}
|
||||
|
@ -3198,10 +3198,10 @@ static int particle_intersect_dm(Scene *scene, Object *ob, DerivedMesh *dm,
|
|||
if (isect_line_tri_v3(co1, co2, v1, v2, v3, &cur_d, cur_uv)) {
|
||||
if (cur_d<*min_d) {
|
||||
*min_d=cur_d;
|
||||
min_w[0]= 1.0f - cur_uv[0] - cur_uv[1];
|
||||
min_w[1]= cur_uv[0];
|
||||
min_w[2]= cur_uv[1];
|
||||
min_w[3]= 0.0f;
|
||||
min_w[0] = 1.0f - cur_uv[0] - cur_uv[1];
|
||||
min_w[1] = cur_uv[0];
|
||||
min_w[2] = cur_uv[1];
|
||||
min_w[3] = 0.0f;
|
||||
if (mface->v4)
|
||||
intersect_dm_quad_weights(v1, v2, v3, v4, min_w);
|
||||
*min_face=i;
|
||||
|
@ -3212,10 +3212,10 @@ static int particle_intersect_dm(Scene *scene, Object *ob, DerivedMesh *dm,
|
|||
if (isect_line_tri_v3(co1, co2, v1, v3, v4, &cur_d, cur_uv)) {
|
||||
if (cur_d<*min_d) {
|
||||
*min_d=cur_d;
|
||||
min_w[0]= 1.0f - cur_uv[0] - cur_uv[1];
|
||||
min_w[1]= 0.0f;
|
||||
min_w[2]= cur_uv[0];
|
||||
min_w[3]= cur_uv[1];
|
||||
min_w[0] = 1.0f - cur_uv[0] - cur_uv[1];
|
||||
min_w[1] = 0.0f;
|
||||
min_w[2] = cur_uv[0];
|
||||
min_w[3] = cur_uv[1];
|
||||
intersect_dm_quad_weights(v1, v2, v3, v4, min_w);
|
||||
*min_face=i;
|
||||
intersect=1;
|
||||
|
@ -3274,8 +3274,8 @@ static int brush_add(PEData *data, short number)
|
|||
}
|
||||
}
|
||||
|
||||
mco[0]= data->mval[0] + dmx;
|
||||
mco[1]= data->mval[1] + dmy;
|
||||
mco[0] = data->mval[0] + dmx;
|
||||
mco[1] = data->mval[1] + dmy;
|
||||
ED_view3d_win_to_segment_clip(data->vc.ar, data->vc.v3d, mco, co1, co2);
|
||||
|
||||
mul_m4_v3(imat, co1);
|
||||
|
@ -3368,11 +3368,11 @@ static int brush_add(PEData *data, short number)
|
|||
maxd= ptn[maxw-1].dist;
|
||||
|
||||
for (w=0; w<maxw; w++) {
|
||||
weight[w]= (float)pow(2.0, (double)(-6.0f * ptn[w].dist / maxd));
|
||||
weight[w] = (float)pow(2.0, (double)(-6.0f * ptn[w].dist / maxd));
|
||||
totw += weight[w];
|
||||
}
|
||||
for (;w<3; w++) {
|
||||
weight[w]= 0.0f;
|
||||
weight[w] = 0.0f;
|
||||
}
|
||||
|
||||
for (w=0; w<maxw; w++)
|
||||
|
@ -3506,15 +3506,15 @@ static void brush_edit_apply(bContext *C, wmOperator *op, PointerRNA *itemptr)
|
|||
flip= RNA_boolean_get(itemptr, "pen_flip");
|
||||
|
||||
if (bedit->first) {
|
||||
bedit->lastmouse[0]= mouse[0];
|
||||
bedit->lastmouse[1]= mouse[1];
|
||||
bedit->lastmouse[0] = mouse[0];
|
||||
bedit->lastmouse[1] = mouse[1];
|
||||
}
|
||||
|
||||
dx= mouse[0] - bedit->lastmouse[0];
|
||||
dy= mouse[1] - bedit->lastmouse[1];
|
||||
|
||||
mval[0]= mouse[0];
|
||||
mval[1]= mouse[1];
|
||||
mval[0] = mouse[0];
|
||||
mval[1] = mouse[1];
|
||||
|
||||
|
||||
/* disable locking temporatily for disconnected hair */
|
||||
|
@ -3639,7 +3639,7 @@ static void brush_edit_apply(bContext *C, wmOperator *op, PointerRNA *itemptr)
|
|||
data.mval= mval;
|
||||
data.rad= (float)brush->size;
|
||||
|
||||
data.vec[0]= data.vec[1]= data.vec[2]= 0.0f;
|
||||
data.vec[0] = data.vec[1] = data.vec[2] = 0.0f;
|
||||
data.tot= 0;
|
||||
|
||||
data.smoothfac= brush->strength;
|
||||
|
@ -3693,8 +3693,8 @@ static void brush_edit_apply(bContext *C, wmOperator *op, PointerRNA *itemptr)
|
|||
WM_event_add_notifier(C, NC_OBJECT|ND_MODIFIER, ob);
|
||||
}
|
||||
|
||||
bedit->lastmouse[0]= mouse[0];
|
||||
bedit->lastmouse[1]= mouse[1];
|
||||
bedit->lastmouse[0] = mouse[0];
|
||||
bedit->lastmouse[1] = mouse[1];
|
||||
bedit->first= 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -113,26 +113,26 @@
|
|||
#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]); \
|
||||
(c)[0] = FTOCHAR((f)[0]); \
|
||||
(c)[1] = FTOCHAR((f)[1]); \
|
||||
(c)[2] = FTOCHAR((f)[2]); \
|
||||
} (void)0
|
||||
#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]); \
|
||||
(c)[0] = FTOCHAR((f)[0]); \
|
||||
(c)[1] = FTOCHAR((f)[1]); \
|
||||
(c)[2] = FTOCHAR((f)[2]); \
|
||||
(c)[3] = FTOCHAR((f)[3]); \
|
||||
} (void)0
|
||||
#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]); \
|
||||
(f)[0] = IMAPAINT_CHAR_TO_FLOAT((c)[0]); \
|
||||
(f)[1] = IMAPAINT_CHAR_TO_FLOAT((c)[1]); \
|
||||
(f)[2] = IMAPAINT_CHAR_TO_FLOAT((c)[2]); \
|
||||
} (void)0
|
||||
#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]); \
|
||||
(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]); \
|
||||
} (void)0
|
||||
|
||||
#define IMAPAINT_FLOAT_RGB_COPY(a, b) copy_v3_v3(a, b)
|
||||
|
|
|
@ -149,22 +149,22 @@ void make_unique_prop_names(bContext *C, char *str)
|
|||
ob= (Object *)idar[a];
|
||||
prop= ob->prop.first;
|
||||
while (prop) {
|
||||
names[nr++]= prop->name;
|
||||
names[nr++] = prop->name;
|
||||
prop= prop->next;
|
||||
}
|
||||
sens= ob->sensors.first;
|
||||
while (sens) {
|
||||
names[nr++]= sens->name;
|
||||
names[nr++] = sens->name;
|
||||
sens= sens->next;
|
||||
}
|
||||
cont= ob->controllers.first;
|
||||
while (cont) {
|
||||
names[nr++]= cont->name;
|
||||
names[nr++] = cont->name;
|
||||
cont= cont->next;
|
||||
}
|
||||
act= ob->actuators.first;
|
||||
while (act) {
|
||||
names[nr++]= act->name;
|
||||
names[nr++] = act->name;
|
||||
act= act->next;
|
||||
}
|
||||
}
|
||||
|
@ -697,13 +697,13 @@ static ID **get_selected_and_linked_obs(bContext *C, short *count, short scavisf
|
|||
|
||||
/* make the active object always the first one of the list */
|
||||
if (obact) {
|
||||
idar[0]= (ID *)obact;
|
||||
idar[0] = (ID *)obact;
|
||||
nr++;
|
||||
}
|
||||
|
||||
while (ob) {
|
||||
if ((ob->scavisflag) && (ob != obact)) {
|
||||
idar[nr]= (ID *)ob;
|
||||
idar[nr] = (ID *)ob;
|
||||
nr++;
|
||||
}
|
||||
if (nr>=24) break;
|
||||
|
|
|
@ -129,18 +129,18 @@ static SpaceLink *logic_new(const bContext *UNUSED(C))
|
|||
ar->v2d.cur.xmax = 1280.0f;
|
||||
ar->v2d.cur.ymax = 240.0f;
|
||||
|
||||
ar->v2d.min[0]= 1.0f;
|
||||
ar->v2d.min[1]= 1.0f;
|
||||
ar->v2d.min[0] = 1.0f;
|
||||
ar->v2d.min[1] = 1.0f;
|
||||
|
||||
ar->v2d.max[0]= 32000.0f;
|
||||
ar->v2d.max[1]= 32000.0f;
|
||||
ar->v2d.max[0] = 32000.0f;
|
||||
ar->v2d.max[1] = 32000.0f;
|
||||
|
||||
ar->v2d.minzoom= 0.5f;
|
||||
ar->v2d.maxzoom= 1.21f;
|
||||
ar->v2d.minzoom = 0.5f;
|
||||
ar->v2d.maxzoom = 1.21f;
|
||||
|
||||
ar->v2d.scroll= (V2D_SCROLL_RIGHT|V2D_SCROLL_BOTTOM);
|
||||
ar->v2d.keepzoom= V2D_LIMITZOOM|V2D_KEEPASPECT;
|
||||
ar->v2d.keeptot= 0;
|
||||
ar->v2d.scroll = (V2D_SCROLL_RIGHT | V2D_SCROLL_BOTTOM);
|
||||
ar->v2d.keepzoom = V2D_LIMITZOOM | V2D_KEEPASPECT;
|
||||
ar->v2d.keeptot = 0;
|
||||
|
||||
|
||||
return (SpaceLink *)slogic;
|
||||
|
|
|
@ -636,7 +636,7 @@ static void draw_mesh_text(Scene *scene, Object *ob, int glsl)
|
|||
int a, totpoly = me->totpoly;
|
||||
|
||||
/* fake values to pass to GPU_render_text() */
|
||||
MCol tmp_mcol[4] = {{0}};
|
||||
MCol tmp_mcol[4] = {{0}};
|
||||
MCol *tmp_mcol_pt = mloopcol ? tmp_mcol : NULL;
|
||||
MTFace tmp_tf = {{{0}}};
|
||||
|
||||
|
|
|
@ -795,8 +795,8 @@ static int flyApply(bContext *C, FlyInfo *fly)
|
|||
ymargin = ar->winy / 20.0f;
|
||||
|
||||
// UNUSED
|
||||
// cent_orig[0]= ar->winrct.xmin + ar->winx/2;
|
||||
// cent_orig[1]= ar->winrct.ymin + ar->winy/2;
|
||||
// cent_orig[0] = ar->winrct.xmin + ar->winx / 2;
|
||||
// cent_orig[1] = ar->winrct.ymin + ar->winy / 2;
|
||||
|
||||
{
|
||||
|
||||
|
|
|
@ -35,8 +35,8 @@
|
|||
|
||||
struct SDNA;
|
||||
|
||||
extern unsigned char DNAstr[]; /* DNA.c */
|
||||
extern int DNAlen;
|
||||
extern const unsigned char DNAstr[]; /* DNA.c */
|
||||
extern const int DNAlen;
|
||||
|
||||
typedef enum eSDNA_Type {
|
||||
SDNA_TYPE_CHAR = 0,
|
||||
|
@ -56,7 +56,7 @@ typedef enum eSDNA_Type {
|
|||
/* define so switch statements don't complain */
|
||||
#define SDNA_TYPE_VOID 9
|
||||
|
||||
struct SDNA *DNA_sdna_from_data(void *data, int datalen, int do_endian_swap);
|
||||
struct SDNA *DNA_sdna_from_data(const void *data, const int datalen, int do_endian_swap);
|
||||
void DNA_sdna_free(struct SDNA *sdna);
|
||||
|
||||
int DNA_struct_find_nr(struct SDNA *sdna, const char *str);
|
||||
|
|
|
@ -506,7 +506,7 @@ static void init_structDNA(SDNA *sdna, int do_endian_swap)
|
|||
}
|
||||
}
|
||||
|
||||
SDNA *DNA_sdna_from_data(void *data, int datalen, int do_endian_swap)
|
||||
SDNA *DNA_sdna_from_data(const void *data, const int datalen, int do_endian_swap)
|
||||
{
|
||||
SDNA *sdna = MEM_mallocN(sizeof(*sdna), "sdna");
|
||||
|
||||
|
|
|
@ -1174,7 +1174,7 @@ int main(int argc, char **argv)
|
|||
strcpy(baseDirectory, BASE_HEADER);
|
||||
}
|
||||
|
||||
fprintf(file, "unsigned char DNAstr[]= {\n");
|
||||
fprintf(file, "const unsigned char DNAstr[] = {\n");
|
||||
if (make_structDNA(baseDirectory, file)) {
|
||||
/* error */
|
||||
fclose(file);
|
||||
|
@ -1183,7 +1183,7 @@ int main(int argc, char **argv)
|
|||
}
|
||||
else {
|
||||
fprintf(file, "};\n");
|
||||
fprintf(file, "int DNAlen = sizeof(DNAstr);\n");
|
||||
fprintf(file, "const int DNAlen = sizeof(DNAstr);\n");
|
||||
|
||||
fclose(file);
|
||||
}
|
||||
|
|
|
@ -475,7 +475,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
|
|||
/*printf("\t\tVERT: %i\n", lt_iter.v);*/
|
||||
if (lt_iter.v_poin->flag) {
|
||||
/*printf("\t\t\tBreaking Found end\n");*/
|
||||
//endpoints[0]= endpoints[1]= -1;
|
||||
//endpoints[0] = endpoints[1] = -1;
|
||||
ed_loop_closed = 1; /* circle */
|
||||
break;
|
||||
}
|
||||
|
@ -490,7 +490,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
|
|||
screwvert_iter_step(<_iter);
|
||||
if (!lt_iter.v_poin) {
|
||||
/*printf("\t\t\tFound End Also Num %i\n", j);*/
|
||||
/*endpoints[j]= lt_iter.v_other;*/ /* other is still valid */
|
||||
/*endpoints[j] = lt_iter.v_other;*/ /* other is still valid */
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -213,53 +213,53 @@ void typecheck_compbuf_color(float *out, float *in, int outtype, int intype)
|
|||
}
|
||||
else if (outtype==CB_VEC2) {
|
||||
if (intype==CB_VAL) {
|
||||
out[0]= in[0];
|
||||
out[1]= in[0];
|
||||
out[0] = in[0];
|
||||
out[1] = in[0];
|
||||
}
|
||||
else if (intype==CB_VEC3) {
|
||||
out[0]= in[0];
|
||||
out[1]= in[1];
|
||||
out[0] = in[0];
|
||||
out[1] = in[1];
|
||||
}
|
||||
else if (intype==CB_RGBA) {
|
||||
out[0]= in[0];
|
||||
out[1]= in[1];
|
||||
out[0] = in[0];
|
||||
out[1] = in[1];
|
||||
}
|
||||
}
|
||||
else if (outtype==CB_VEC3) {
|
||||
if (intype==CB_VAL) {
|
||||
out[0]= in[0];
|
||||
out[1]= in[0];
|
||||
out[2]= in[0];
|
||||
out[0] = in[0];
|
||||
out[1] = in[0];
|
||||
out[2] = in[0];
|
||||
}
|
||||
else if (intype==CB_VEC2) {
|
||||
out[0]= in[0];
|
||||
out[1]= in[1];
|
||||
out[2]= 0.0f;
|
||||
out[0] = in[0];
|
||||
out[1] = in[1];
|
||||
out[2] = 0.0f;
|
||||
}
|
||||
else if (intype==CB_RGBA) {
|
||||
out[0]= in[0];
|
||||
out[1]= in[1];
|
||||
out[2]= in[2];
|
||||
out[0] = in[0];
|
||||
out[1] = in[1];
|
||||
out[2] = in[2];
|
||||
}
|
||||
}
|
||||
else if (outtype==CB_RGBA) {
|
||||
if (intype==CB_VAL) {
|
||||
out[0]= in[0];
|
||||
out[1]= in[0];
|
||||
out[2]= in[0];
|
||||
out[3]= 1.0f;
|
||||
out[0] = in[0];
|
||||
out[1] = in[0];
|
||||
out[2] = in[0];
|
||||
out[3] = 1.0f;
|
||||
}
|
||||
else if (intype==CB_VEC2) {
|
||||
out[0]= in[0];
|
||||
out[1]= in[1];
|
||||
out[2]= 0.0f;
|
||||
out[3]= 1.0f;
|
||||
out[0] = in[0];
|
||||
out[1] = in[1];
|
||||
out[2] = 0.0f;
|
||||
out[3] = 1.0f;
|
||||
}
|
||||
else if (intype==CB_VEC3) {
|
||||
out[0]= in[0];
|
||||
out[1]= in[1];
|
||||
out[2]= in[2];
|
||||
out[3]= 1.0f;
|
||||
out[0] = in[0];
|
||||
out[1] = in[1];
|
||||
out[2] = in[2];
|
||||
out[3] = 1.0f;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -307,69 +307,69 @@ CompBuf *typecheck_compbuf(CompBuf *inbuf, int type)
|
|||
else if (type==CB_VEC2) {
|
||||
if (inbuf->type==CB_VAL) {
|
||||
for (; x>0; x--, outrf+= 2, inrf+= 1) {
|
||||
outrf[0]= inrf[0];
|
||||
outrf[1]= inrf[0];
|
||||
outrf[0] = inrf[0];
|
||||
outrf[1] = inrf[0];
|
||||
}
|
||||
}
|
||||
else if (inbuf->type==CB_VEC3) {
|
||||
for (; x>0; x--, outrf+= 2, inrf+= 3) {
|
||||
outrf[0]= inrf[0];
|
||||
outrf[1]= inrf[1];
|
||||
outrf[0] = inrf[0];
|
||||
outrf[1] = inrf[1];
|
||||
}
|
||||
}
|
||||
else if (inbuf->type==CB_RGBA) {
|
||||
for (; x>0; x--, outrf+= 2, inrf+= 4) {
|
||||
outrf[0]= inrf[0];
|
||||
outrf[1]= inrf[1];
|
||||
outrf[0] = inrf[0];
|
||||
outrf[1] = inrf[1];
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (type==CB_VEC3) {
|
||||
if (inbuf->type==CB_VAL) {
|
||||
for (; x>0; x--, outrf+= 3, inrf+= 1) {
|
||||
outrf[0]= inrf[0];
|
||||
outrf[1]= inrf[0];
|
||||
outrf[2]= inrf[0];
|
||||
outrf[0] = inrf[0];
|
||||
outrf[1] = inrf[0];
|
||||
outrf[2] = inrf[0];
|
||||
}
|
||||
}
|
||||
else if (inbuf->type==CB_VEC2) {
|
||||
for (; x>0; x--, outrf+= 3, inrf+= 2) {
|
||||
outrf[0]= inrf[0];
|
||||
outrf[1]= inrf[1];
|
||||
outrf[2]= 0.0f;
|
||||
outrf[0] = inrf[0];
|
||||
outrf[1] = inrf[1];
|
||||
outrf[2] = 0.0f;
|
||||
}
|
||||
}
|
||||
else if (inbuf->type==CB_RGBA) {
|
||||
for (; x>0; x--, outrf+= 3, inrf+= 4) {
|
||||
outrf[0]= inrf[0];
|
||||
outrf[1]= inrf[1];
|
||||
outrf[2]= inrf[2];
|
||||
outrf[0] = inrf[0];
|
||||
outrf[1] = inrf[1];
|
||||
outrf[2] = inrf[2];
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (type==CB_RGBA) {
|
||||
if (inbuf->type==CB_VAL) {
|
||||
for (; x>0; x--, outrf+= 4, inrf+= 1) {
|
||||
outrf[0]= inrf[0];
|
||||
outrf[1]= inrf[0];
|
||||
outrf[2]= inrf[0];
|
||||
outrf[3]= 1.0f;
|
||||
outrf[0] = inrf[0];
|
||||
outrf[1] = inrf[0];
|
||||
outrf[2] = inrf[0];
|
||||
outrf[3] = 1.0f;
|
||||
}
|
||||
}
|
||||
else if (inbuf->type==CB_VEC2) {
|
||||
for (; x>0; x--, outrf+= 4, inrf+= 2) {
|
||||
outrf[0]= inrf[0];
|
||||
outrf[1]= inrf[1];
|
||||
outrf[2]= 0.0f;
|
||||
outrf[3]= 1.0f;
|
||||
outrf[0] = inrf[0];
|
||||
outrf[1] = inrf[1];
|
||||
outrf[2] = 0.0f;
|
||||
outrf[3] = 1.0f;
|
||||
}
|
||||
}
|
||||
else if (inbuf->type==CB_VEC3) {
|
||||
for (; x>0; x--, outrf+= 4, inrf+= 3) {
|
||||
outrf[0]= inrf[0];
|
||||
outrf[1]= inrf[1];
|
||||
outrf[2]= inrf[2];
|
||||
outrf[3]= 1.0f;
|
||||
outrf[0] = inrf[0];
|
||||
outrf[1] = inrf[1];
|
||||
outrf[2] = inrf[2];
|
||||
outrf[3] = 1.0f;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -387,7 +387,7 @@ float *compbuf_get_pixel(CompBuf *cbuf, float *defcol, float *use, int x, int y,
|
|||
return use;
|
||||
}
|
||||
else {
|
||||
static float col[4]= {0.0f, 0.0f, 0.0f, 0.0f};
|
||||
static float col[4] = {0.0f, 0.0f, 0.0f, 0.0f};
|
||||
|
||||
/* map coords */
|
||||
x-= cbuf->xof;
|
||||
|
@ -707,18 +707,18 @@ void do_copy_rgba(bNode *UNUSED(node), float *out, float *in)
|
|||
void do_copy_rgb(bNode *UNUSED(node), float *out, float *in)
|
||||
{
|
||||
copy_v3_v3(out, in);
|
||||
out[3]= 1.0f;
|
||||
out[3] = 1.0f;
|
||||
}
|
||||
|
||||
void do_copy_value(bNode *UNUSED(node), float *out, float *in)
|
||||
{
|
||||
out[0]= in[0];
|
||||
out[0] = in[0];
|
||||
}
|
||||
|
||||
void do_copy_a_rgba(bNode *UNUSED(node), float *out, float *in, float *fac)
|
||||
{
|
||||
copy_v3_v3(out, in);
|
||||
out[3]= *fac;
|
||||
out[3] = *fac;
|
||||
}
|
||||
|
||||
/* only accepts RGBA buffers */
|
||||
|
@ -732,16 +732,16 @@ void gamma_correct_compbuf(CompBuf *img, int inversed)
|
|||
drect= img->rect;
|
||||
if (inversed) {
|
||||
for (x=img->x*img->y; x>0; x--, drect+=4) {
|
||||
if (drect[0]>0.0f) drect[0]= sqrt(drect[0]); else drect[0]= 0.0f;
|
||||
if (drect[1]>0.0f) drect[1]= sqrt(drect[1]); else drect[1]= 0.0f;
|
||||
if (drect[2]>0.0f) drect[2]= sqrt(drect[2]); else drect[2]= 0.0f;
|
||||
if (drect[0]>0.0f) drect[0] = sqrt(drect[0]); else drect[0] = 0.0f;
|
||||
if (drect[1]>0.0f) drect[1] = sqrt(drect[1]); else drect[1] = 0.0f;
|
||||
if (drect[2]>0.0f) drect[2] = sqrt(drect[2]); else drect[2] = 0.0f;
|
||||
}
|
||||
}
|
||||
else {
|
||||
for (x=img->x*img->y; x>0; x--, drect+=4) {
|
||||
if (drect[0]>0.0f) drect[0]*= drect[0]; else drect[0]= 0.0f;
|
||||
if (drect[1]>0.0f) drect[1]*= drect[1]; else drect[1]= 0.0f;
|
||||
if (drect[2]>0.0f) drect[2]*= drect[2]; else drect[2]= 0.0f;
|
||||
if (drect[0]>0.0f) drect[0]*= drect[0]; else drect[0] = 0.0f;
|
||||
if (drect[1]>0.0f) drect[1]*= drect[1]; else drect[1] = 0.0f;
|
||||
if (drect[2]>0.0f) drect[2]*= drect[2]; else drect[2] = 0.0f;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -757,9 +757,9 @@ void premul_compbuf(CompBuf *img, int inversed)
|
|||
if (inversed) {
|
||||
for (x=img->x*img->y; x>0; x--, drect+=4) {
|
||||
if (fabsf(drect[3]) < 1e-5f) {
|
||||
drect[0]= 0.0f;
|
||||
drect[1]= 0.0f;
|
||||
drect[2]= 0.0f;
|
||||
drect[0] = 0.0f;
|
||||
drect[1] = 0.0f;
|
||||
drect[2] = 0.0f;
|
||||
}
|
||||
else {
|
||||
drect[0] /= drect[3];
|
||||
|
|
|
@ -32,13 +32,13 @@
|
|||
#include "node_composite_util.h"
|
||||
|
||||
/* **************** ALPHAOVER ******************** */
|
||||
static bNodeSocketTemplate cmp_node_alphaover_in[]= {
|
||||
static bNodeSocketTemplate cmp_node_alphaover_in[] = {
|
||||
{ SOCK_FLOAT, 1, N_("Fac"), 1.0f, 0.0f, 1.0f, 1.0f, 0.0f, 1.0f, PROP_FACTOR},
|
||||
{ SOCK_RGBA, 1, N_("Image"), 1.0f, 1.0f, 1.0f, 1.0f},
|
||||
{ SOCK_RGBA, 1, N_("Image"), 1.0f, 1.0f, 1.0f, 1.0f},
|
||||
{ -1, 0, "" }
|
||||
};
|
||||
static bNodeSocketTemplate cmp_node_alphaover_out[]= {
|
||||
static bNodeSocketTemplate cmp_node_alphaover_out[] = {
|
||||
{ SOCK_RGBA, 0, N_("Image")},
|
||||
{ -1, 0, "" }
|
||||
};
|
||||
|
@ -58,10 +58,10 @@ static void do_alphaover_premul(bNode *UNUSED(node), float *out, float *src, flo
|
|||
else {
|
||||
float mul= 1.0f - fac[0]*over[3];
|
||||
|
||||
out[0]= (mul*src[0]) + fac[0]*over[0];
|
||||
out[1]= (mul*src[1]) + fac[0]*over[1];
|
||||
out[2]= (mul*src[2]) + fac[0]*over[2];
|
||||
out[3]= (mul*src[3]) + fac[0]*over[3];
|
||||
out[0] = (mul*src[0]) + fac[0]*over[0];
|
||||
out[1] = (mul*src[1]) + fac[0]*over[1];
|
||||
out[2] = (mul*src[2]) + fac[0]*over[2];
|
||||
out[3] = (mul*src[3]) + fac[0]*over[3];
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -79,10 +79,10 @@ static void do_alphaover_key(bNode *UNUSED(node), float *out, float *src, float
|
|||
float premul= fac[0]*over[3];
|
||||
float mul= 1.0f - premul;
|
||||
|
||||
out[0]= (mul*src[0]) + premul*over[0];
|
||||
out[1]= (mul*src[1]) + premul*over[1];
|
||||
out[2]= (mul*src[2]) + premul*over[2];
|
||||
out[3]= (mul*src[3]) + fac[0]*over[3];
|
||||
out[0] = (mul*src[0]) + premul*over[0];
|
||||
out[1] = (mul*src[1]) + premul*over[1];
|
||||
out[2] = (mul*src[2]) + premul*over[2];
|
||||
out[3] = (mul*src[3]) + fac[0]*over[3];
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -102,10 +102,10 @@ static void do_alphaover_mixed(bNode *node, float *out, float *src, float *over,
|
|||
float premul= fac[0]*addfac;
|
||||
float mul= 1.0f - fac[0]*over[3];
|
||||
|
||||
out[0]= (mul*src[0]) + premul*over[0];
|
||||
out[1]= (mul*src[1]) + premul*over[1];
|
||||
out[2]= (mul*src[2]) + premul*over[2];
|
||||
out[3]= (mul*src[3]) + fac[0]*over[3];
|
||||
out[0] = (mul*src[0]) + premul*over[0];
|
||||
out[1] = (mul*src[1]) + premul*over[1];
|
||||
out[2] = (mul*src[2]) + premul*over[2];
|
||||
out[3] = (mul*src[3]) + fac[0]*over[3];
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -37,7 +37,7 @@
|
|||
|
||||
/* **************** Bokeh image Tools ******************** */
|
||||
|
||||
static bNodeSocketTemplate cmp_node_bokehimage_out[]= {
|
||||
static bNodeSocketTemplate cmp_node_bokehimage_out[] = {
|
||||
{ SOCK_RGBA, 0, N_("Image"), 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f},
|
||||
{ -1, 0, "" }
|
||||
};
|
||||
|
|
|
@ -35,13 +35,13 @@
|
|||
#include "../node_composite_util.h"
|
||||
|
||||
/* **************** SCALAR MATH ******************** */
|
||||
static bNodeSocketTemplate cmp_node_boxmask_in[]= {
|
||||
static bNodeSocketTemplate cmp_node_boxmask_in[] = {
|
||||
{ SOCK_FLOAT, 1, N_("Mask"), 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f},
|
||||
{ SOCK_FLOAT, 1, N_("Value"), 1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f},
|
||||
{ -1, 0, "" }
|
||||
};
|
||||
|
||||
static bNodeSocketTemplate cmp_node_boxmask_out[]= {
|
||||
static bNodeSocketTemplate cmp_node_boxmask_out[] = {
|
||||
{ SOCK_FLOAT, 0, N_("Mask"), 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f},
|
||||
{ -1, 0, "" }
|
||||
};
|
||||
|
|
|
@ -36,13 +36,13 @@
|
|||
|
||||
/* **************** Brigh and contrsast ******************** */
|
||||
|
||||
static bNodeSocketTemplate cmp_node_brightcontrast_in[]= {
|
||||
static bNodeSocketTemplate cmp_node_brightcontrast_in[] = {
|
||||
{ SOCK_RGBA, 1, N_("Image"), 1.0f, 1.0f, 1.0f, 1.0f},
|
||||
{ SOCK_FLOAT, 1, N_("Bright"), 0.0f, 0.0f, 0.0f, 0.0f, -100.0f, 100.0f, PROP_NONE},
|
||||
{ SOCK_FLOAT, 1, N_("Contrast"), 0.0f, 0.0f, 0.0f, 0.0f, -100.0f, 100.0f, PROP_NONE},
|
||||
{ -1, 0, "" }
|
||||
};
|
||||
static bNodeSocketTemplate cmp_node_brightcontrast_out[]= {
|
||||
static bNodeSocketTemplate cmp_node_brightcontrast_out[] = {
|
||||
{ SOCK_RGBA, 0, N_("Image")},
|
||||
{ -1, 0, "" }
|
||||
};
|
||||
|
|
|
@ -34,12 +34,12 @@
|
|||
|
||||
|
||||
/* ******************* Channel Matte Node ********************************* */
|
||||
static bNodeSocketTemplate cmp_node_channel_matte_in[]={
|
||||
static bNodeSocketTemplate cmp_node_channel_matte_in[] ={
|
||||
{SOCK_RGBA, 1, N_("Image"), 1.0f, 1.0f, 1.0f, 1.0f},
|
||||
{-1, 0, ""}
|
||||
};
|
||||
|
||||
static bNodeSocketTemplate cmp_node_channel_matte_out[]={
|
||||
static bNodeSocketTemplate cmp_node_channel_matte_out[] ={
|
||||
{SOCK_RGBA, 0, N_("Image")},
|
||||
{SOCK_FLOAT, 0, N_("Matte")},
|
||||
{-1, 0, ""}
|
||||
|
|
|
@ -33,13 +33,13 @@
|
|||
#include "node_composite_util.h"
|
||||
|
||||
/* ******************* Chroma Key ********************************************************** */
|
||||
static bNodeSocketTemplate cmp_node_chroma_in[]={
|
||||
static bNodeSocketTemplate cmp_node_chroma_in[] = {
|
||||
{SOCK_RGBA, 1, N_("Image"), 1.0f, 1.0f, 1.0f, 1.0f},
|
||||
{SOCK_RGBA, 1, N_("Key Color"), 1.0f, 1.0f, 1.0f, 1.0f},
|
||||
{-1, 0, ""}
|
||||
};
|
||||
|
||||
static bNodeSocketTemplate cmp_node_chroma_out[]={
|
||||
static bNodeSocketTemplate cmp_node_chroma_out[] = {
|
||||
{SOCK_RGBA, 0, N_("Image")},
|
||||
{SOCK_FLOAT, 0, N_("Matte")},
|
||||
{-1, 0, ""}
|
||||
|
|
|
@ -33,13 +33,13 @@
|
|||
#include "node_composite_util.h"
|
||||
|
||||
/* ******************* Color Key ********************************************************** */
|
||||
static bNodeSocketTemplate cmp_node_color_in[]={
|
||||
static bNodeSocketTemplate cmp_node_color_in[] = {
|
||||
{SOCK_RGBA, 1, N_("Image"), 1.0f, 1.0f, 1.0f, 1.0f},
|
||||
{SOCK_RGBA, 1, N_("Key Color"), 1.0f, 1.0f, 1.0f, 1.0f},
|
||||
{-1, 0, ""}
|
||||
};
|
||||
|
||||
static bNodeSocketTemplate cmp_node_color_out[]={
|
||||
static bNodeSocketTemplate cmp_node_color_out[] = {
|
||||
{SOCK_RGBA, 0, N_("Image")},
|
||||
{SOCK_FLOAT, 0, N_("Matte")},
|
||||
{-1, 0, ""}
|
||||
|
|
|
@ -36,13 +36,13 @@
|
|||
#define AVG(a, b) ((a + b) / 2)
|
||||
|
||||
/* ******************* Color Spill Supression ********************************* */
|
||||
static bNodeSocketTemplate cmp_node_color_spill_in[]={
|
||||
static bNodeSocketTemplate cmp_node_color_spill_in[] = {
|
||||
{SOCK_RGBA, 1, N_("Image"), 1.0f, 1.0f, 1.0f, 1.0f},
|
||||
{SOCK_FLOAT, 1, N_("Fac"), 1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f, PROP_FACTOR},
|
||||
{-1, 0, ""}
|
||||
};
|
||||
|
||||
static bNodeSocketTemplate cmp_node_color_spill_out[]={
|
||||
static bNodeSocketTemplate cmp_node_color_spill_out[] = {
|
||||
{SOCK_RGBA, 0, N_("Image")},
|
||||
{-1, 0, ""}
|
||||
};
|
||||
|
|
|
@ -35,13 +35,13 @@
|
|||
|
||||
|
||||
/* ******************* Color Balance ********************************* */
|
||||
static bNodeSocketTemplate cmp_node_colorbalance_in[]={
|
||||
static bNodeSocketTemplate cmp_node_colorbalance_in[] = {
|
||||
{SOCK_FLOAT, 1, N_("Fac"), 1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f, PROP_FACTOR},
|
||||
{SOCK_RGBA, 1, N_("Image"), 1.0f, 1.0f, 1.0f, 1.0f},
|
||||
{-1, 0, ""}
|
||||
};
|
||||
|
||||
static bNodeSocketTemplate cmp_node_colorbalance_out[]={
|
||||
static bNodeSocketTemplate cmp_node_colorbalance_out[] = {
|
||||
{SOCK_RGBA, 0, N_("Image")},
|
||||
{-1, 0, ""}
|
||||
};
|
||||
|
|
|
@ -36,13 +36,13 @@
|
|||
|
||||
|
||||
/* ******************* Color Balance ********************************* */
|
||||
static bNodeSocketTemplate cmp_node_colorcorrection_in[]={
|
||||
static bNodeSocketTemplate cmp_node_colorcorrection_in[] = {
|
||||
{ SOCK_RGBA,1,N_("Image"), 1.0f, 1.0f, 1.0f, 1.0f},
|
||||
{ SOCK_FLOAT, 1, N_("Mask"), 1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f, PROP_FACTOR},
|
||||
{ -1,0,""}
|
||||
};
|
||||
|
||||
static bNodeSocketTemplate cmp_node_colorcorrection_out[]={
|
||||
static bNodeSocketTemplate cmp_node_colorcorrection_out[] = {
|
||||
{ SOCK_RGBA,0,N_("Image")},
|
||||
{ -1,0,""}
|
||||
};
|
||||
|
|
|
@ -32,7 +32,7 @@
|
|||
#include "node_composite_util.h"
|
||||
|
||||
/* **************** COMPOSITE ******************** */
|
||||
static bNodeSocketTemplate cmp_node_composite_in[]= {
|
||||
static bNodeSocketTemplate cmp_node_composite_in[] = {
|
||||
{ SOCK_RGBA, 1, N_("Image"), 0.0f, 0.0f, 0.0f, 1.0f},
|
||||
{ SOCK_FLOAT, 1, N_("Alpha"), 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, PROP_FACTOR},
|
||||
{ SOCK_FLOAT, 1, N_("Z"), 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, PROP_FACTOR},
|
||||
|
|
|
@ -34,11 +34,11 @@
|
|||
|
||||
/* **************** Crop ******************** */
|
||||
|
||||
static bNodeSocketTemplate cmp_node_crop_in[]= {
|
||||
static bNodeSocketTemplate cmp_node_crop_in[] = {
|
||||
{ SOCK_RGBA, 1, N_("Image"), 1.0f, 1.0f, 1.0f, 1.0f},
|
||||
{ -1, 0, "" }
|
||||
};
|
||||
static bNodeSocketTemplate cmp_node_crop_out[]= {
|
||||
static bNodeSocketTemplate cmp_node_crop_out[] = {
|
||||
{ SOCK_RGBA, 0, N_("Image")},
|
||||
{ -1, 0, "" }
|
||||
};
|
||||
|
|
|
@ -36,7 +36,7 @@
|
|||
/* **************** CURVE Time ******************** */
|
||||
|
||||
/* custom1 = sfra, custom2 = efra */
|
||||
static bNodeSocketTemplate cmp_node_time_out[]= {
|
||||
static bNodeSocketTemplate cmp_node_time_out[] = {
|
||||
{ SOCK_FLOAT, 0, N_("Fac")},
|
||||
{ -1, 0, "" }
|
||||
};
|
||||
|
@ -55,7 +55,7 @@ static void node_composit_exec_curves_time(void *data, bNode *node, bNodeStack *
|
|||
curvemapping_initialize(node->storage);
|
||||
fac = curvemapping_evaluateF(node->storage, 0, fac);
|
||||
|
||||
out[0]->vec[0]= CLAMPIS(fac, 0.0f, 1.0f);
|
||||
out[0]->vec[0] = CLAMPIS(fac, 0.0f, 1.0f);
|
||||
}
|
||||
|
||||
#endif /* WITH_COMPOSITOR_LEGACY */
|
||||
|
@ -86,12 +86,12 @@ void register_node_type_cmp_curve_time(bNodeTreeType *ttype)
|
|||
|
||||
|
||||
/* **************** CURVE VEC ******************** */
|
||||
static bNodeSocketTemplate cmp_node_curve_vec_in[]= {
|
||||
static bNodeSocketTemplate cmp_node_curve_vec_in[] = {
|
||||
{ SOCK_VECTOR, 1, N_("Vector"), 0.0f, 0.0f, 0.0f, 1.0f, -1.0f, 1.0f, PROP_NONE},
|
||||
{ -1, 0, "" }
|
||||
};
|
||||
|
||||
static bNodeSocketTemplate cmp_node_curve_vec_out[]= {
|
||||
static bNodeSocketTemplate cmp_node_curve_vec_out[] = {
|
||||
{ SOCK_VECTOR, 0, N_("Vector")},
|
||||
{ -1, 0, "" }
|
||||
};
|
||||
|
@ -132,7 +132,7 @@ void register_node_type_cmp_curve_vec(bNodeTreeType *ttype)
|
|||
|
||||
|
||||
/* **************** CURVE RGB ******************** */
|
||||
static bNodeSocketTemplate cmp_node_curve_rgb_in[]= {
|
||||
static bNodeSocketTemplate cmp_node_curve_rgb_in[] = {
|
||||
{ SOCK_FLOAT, 1, N_("Fac"), 1.0f, 0.0f, 0.0f, 1.0f, -1.0f, 1.0f, PROP_FACTOR},
|
||||
{ SOCK_RGBA, 1, N_("Image"), 1.0f, 1.0f, 1.0f, 1.0f},
|
||||
{ SOCK_RGBA, 1, N_("Black Level"), 0.0f, 0.0f, 0.0f, 1.0f},
|
||||
|
@ -140,7 +140,7 @@ static bNodeSocketTemplate cmp_node_curve_rgb_in[]= {
|
|||
{ -1, 0, "" }
|
||||
};
|
||||
|
||||
static bNodeSocketTemplate cmp_node_curve_rgb_out[]= {
|
||||
static bNodeSocketTemplate cmp_node_curve_rgb_out[] = {
|
||||
{ SOCK_RGBA, 0, N_("Image")},
|
||||
{ -1, 0, "" }
|
||||
};
|
||||
|
@ -151,7 +151,7 @@ static void do_curves(bNode *node, float *out, float *in)
|
|||
{
|
||||
curvemapping_initialize(node->storage);
|
||||
curvemapping_evaluate_premulRGBF(node->storage, out, in);
|
||||
out[3]= in[3];
|
||||
out[3] = in[3];
|
||||
}
|
||||
|
||||
static void do_curves_fac(bNode *node, float *out, float *in, float *fac)
|
||||
|
@ -166,11 +166,11 @@ static void do_curves_fac(bNode *node, float *out, float *in, float *fac)
|
|||
else {
|
||||
float col[4], mfac= 1.0f-*fac;
|
||||
curvemapping_evaluate_premulRGBF(node->storage, col, in);
|
||||
out[0]= mfac*in[0] + *fac*col[0];
|
||||
out[1]= mfac*in[1] + *fac*col[1];
|
||||
out[2]= mfac*in[2] + *fac*col[2];
|
||||
out[0] = mfac*in[0] + *fac*col[0];
|
||||
out[1] = mfac*in[1] + *fac*col[1];
|
||||
out[2] = mfac*in[2] + *fac*col[2];
|
||||
}
|
||||
out[3]= in[3];
|
||||
out[3] = in[3];
|
||||
}
|
||||
|
||||
static void node_composit_exec_curve_rgb(void *UNUSED(data), bNode *node, bNodeStack **in, bNodeStack **out)
|
||||
|
|
|
@ -34,12 +34,12 @@
|
|||
#include <limits.h>
|
||||
|
||||
/* ************ qdn: Defocus node ****************** */
|
||||
static bNodeSocketTemplate cmp_node_defocus_in[]= {
|
||||
static bNodeSocketTemplate cmp_node_defocus_in[] = {
|
||||
{ SOCK_RGBA, 1, N_("Image"), 1.0f, 1.0f, 1.0f, 1.0f},
|
||||
{ SOCK_FLOAT, 1, N_("Z"), 1.0f, 1.0f, 1.0f, 1.0f, 0.0f, 1.0f, PROP_FACTOR},
|
||||
{ -1, 0, "" }
|
||||
};
|
||||
static bNodeSocketTemplate cmp_node_defocus_out[]= {
|
||||
static bNodeSocketTemplate cmp_node_defocus_out[] = {
|
||||
{ SOCK_RGBA, 0, N_("Image")},
|
||||
{ -1, 0, "" }
|
||||
};
|
||||
|
|
|
@ -32,12 +32,12 @@
|
|||
#include "node_composite_util.h"
|
||||
|
||||
/* **************** FILTER ******************** */
|
||||
static bNodeSocketTemplate cmp_node_despeckle_in[]= {
|
||||
static bNodeSocketTemplate cmp_node_despeckle_in[] = {
|
||||
{ SOCK_FLOAT, 1, N_("Fac"), 1.0f, 1.0f, 1.0f, 1.0f, 0.0f, 1.0f, PROP_FACTOR},
|
||||
{ SOCK_RGBA, 1, N_("Image"), 1.0f, 1.0f, 1.0f, 1.0f},
|
||||
{ -1, 0, "" }
|
||||
};
|
||||
static bNodeSocketTemplate cmp_node_despeckle_out[]= {
|
||||
static bNodeSocketTemplate cmp_node_despeckle_out[] = {
|
||||
{ SOCK_RGBA, 0, N_("Image")},
|
||||
{ -1, 0, "" }
|
||||
};
|
||||
|
|
|
@ -33,13 +33,13 @@
|
|||
#include "node_composite_util.h"
|
||||
|
||||
/* ******************* channel Difference Matte ********************************* */
|
||||
static bNodeSocketTemplate cmp_node_diff_matte_in[]={
|
||||
static bNodeSocketTemplate cmp_node_diff_matte_in[] = {
|
||||
{SOCK_RGBA, 1, N_("Image 1"), 1.0f, 1.0f, 1.0f, 1.0f},
|
||||
{SOCK_RGBA, 1, N_("Image 2"), 1.0f, 1.0f, 1.0f, 1.0f},
|
||||
{-1, 0, ""}
|
||||
};
|
||||
|
||||
static bNodeSocketTemplate cmp_node_diff_matte_out[]={
|
||||
static bNodeSocketTemplate cmp_node_diff_matte_out[] = {
|
||||
{SOCK_RGBA, 0, N_("Image")},
|
||||
{SOCK_FLOAT, 0, N_("Matte")},
|
||||
{-1, 0, ""}
|
||||
|
|
|
@ -35,14 +35,14 @@
|
|||
|
||||
/* **************** Displace ******************** */
|
||||
|
||||
static bNodeSocketTemplate cmp_node_displace_in[]= {
|
||||
static bNodeSocketTemplate cmp_node_displace_in[] = {
|
||||
{ SOCK_RGBA, 1, N_("Image"), 1.0f, 1.0f, 1.0f, 1.0f},
|
||||
{ SOCK_VECTOR, 1, N_("Vector"), 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, PROP_TRANSLATION},
|
||||
{ SOCK_FLOAT, 1, N_("X Scale"), 0.0f, 0.0f, 0.0f, 0.0f, -1000.0f, 1000.0f, PROP_FACTOR},
|
||||
{ SOCK_FLOAT, 1, N_("Y Scale"), 0.0f, 0.0f, 0.0f, 0.0f, -1000.0f, 1000.0f, PROP_FACTOR},
|
||||
{ -1, 0, "" }
|
||||
};
|
||||
static bNodeSocketTemplate cmp_node_displace_out[]= {
|
||||
static bNodeSocketTemplate cmp_node_displace_out[] = {
|
||||
{ SOCK_RGBA, 0, N_("Image")},
|
||||
{ -1, 0, "" }
|
||||
};
|
||||
|
|
|
@ -33,13 +33,13 @@
|
|||
#include "node_composite_util.h"
|
||||
|
||||
/* ******************* channel Distance Matte ********************************* */
|
||||
static bNodeSocketTemplate cmp_node_distance_matte_in[]={
|
||||
static bNodeSocketTemplate cmp_node_distance_matte_in[] = {
|
||||
{SOCK_RGBA, 1, N_("Image"), 1.0f, 1.0f, 1.0f, 1.0f},
|
||||
{SOCK_RGBA, 1, N_("Key Color"), 1.0f, 1.0f, 1.0f, 1.0f},
|
||||
{-1, 0, ""}
|
||||
};
|
||||
|
||||
static bNodeSocketTemplate cmp_node_distance_matte_out[]={
|
||||
static bNodeSocketTemplate cmp_node_distance_matte_out[] = {
|
||||
{SOCK_RGBA, 0, N_("Image")},
|
||||
{SOCK_FLOAT, 0, N_("Matte")},
|
||||
{-1, 0, ""}
|
||||
|
@ -159,9 +159,9 @@ static void node_composit_exec_distance_matte(void *data, bNode *node, bNodeStac
|
|||
workbuf=dupalloc_compbuf(inbuf);
|
||||
|
||||
/*use the input color*/
|
||||
c->key[0]= in[1]->vec[0];
|
||||
c->key[1]= in[1]->vec[1];
|
||||
c->key[2]= in[1]->vec[2];
|
||||
c->key[0] = in[1]->vec[0];
|
||||
c->key[1] = in[1]->vec[1];
|
||||
c->key[2] = in[1]->vec[2];
|
||||
|
||||
/* work in RGB color space */
|
||||
if (c->channel == 1) {
|
||||
|
|
|
@ -32,12 +32,12 @@
|
|||
/* **************** Double Edge Mask ******************** */
|
||||
|
||||
|
||||
static bNodeSocketTemplate cmp_node_doubleedgemask_in[]= {
|
||||
static bNodeSocketTemplate cmp_node_doubleedgemask_in[] = {
|
||||
{ SOCK_FLOAT, 1, "Inner Mask", 0.8f, 0.8f, 0.8f, 1.0f, 0.0f, 1.0f, PROP_NONE}, // inner mask socket definition
|
||||
{ SOCK_FLOAT, 1, "Outer Mask", 0.8f, 0.8f, 0.8f, 1.0f, 0.0f, 1.0f, PROP_NONE}, // outer mask socket definition
|
||||
{ -1, 0, "" } // input socket array terminator
|
||||
};
|
||||
static bNodeSocketTemplate cmp_node_doubleedgemask_out[]= {
|
||||
static bNodeSocketTemplate cmp_node_doubleedgemask_out[] = {
|
||||
{ SOCK_FLOAT, 0, "Mask"}, // output socket definition
|
||||
{ -1, 0, "" } // output socket array terminator
|
||||
};
|
||||
|
|
|
@ -35,13 +35,13 @@
|
|||
#include "../node_composite_util.h"
|
||||
|
||||
/* **************** SCALAR MATH ******************** */
|
||||
static bNodeSocketTemplate cmp_node_ellipsemask_in[]= {
|
||||
static bNodeSocketTemplate cmp_node_ellipsemask_in[] = {
|
||||
{ SOCK_FLOAT, 1, N_("Mask"), 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f},
|
||||
{ SOCK_FLOAT, 1, N_("Value"), 1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f},
|
||||
{ -1, 0, "" }
|
||||
};
|
||||
|
||||
static bNodeSocketTemplate cmp_node_ellipsemask_out[]= {
|
||||
static bNodeSocketTemplate cmp_node_ellipsemask_out[] = {
|
||||
{ SOCK_FLOAT, 0, N_("Mask"), 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f},
|
||||
{ -1, 0, "" }
|
||||
};
|
||||
|
|
|
@ -33,12 +33,12 @@
|
|||
#include "node_composite_util.h"
|
||||
|
||||
/* **************** FILTER ******************** */
|
||||
static bNodeSocketTemplate cmp_node_filter_in[]= {
|
||||
static bNodeSocketTemplate cmp_node_filter_in[] = {
|
||||
{ SOCK_FLOAT, 1, N_("Fac"), 1.0f, 1.0f, 1.0f, 1.0f, 0.0f, 1.0f, PROP_FACTOR},
|
||||
{ SOCK_RGBA, 1, N_("Image"), 1.0f, 1.0f, 1.0f, 1.0f},
|
||||
{ -1, 0, "" }
|
||||
};
|
||||
static bNodeSocketTemplate cmp_node_filter_out[]= {
|
||||
static bNodeSocketTemplate cmp_node_filter_out[] = {
|
||||
{ SOCK_RGBA, 0, N_("Image")},
|
||||
{ -1, 0, "" }
|
||||
};
|
||||
|
@ -73,10 +73,10 @@ static void do_filter_edge(CompBuf *out, CompBuf *in, float *filter, float fac)
|
|||
for (c=0; c<3; c++) {
|
||||
f1= filter[0]*row1[0] + filter[1]*row1[4] + filter[2]*row1[8] + filter[3]*row2[0] + filter[4]*row2[4] + filter[5]*row2[8] + filter[6]*row3[0] + filter[7]*row3[4] + filter[8]*row3[8];
|
||||
f2= filter[0]*row1[0] + filter[3]*row1[4] + filter[6]*row1[8] + filter[1]*row2[0] + filter[4]*row2[4] + filter[7]*row2[8] + filter[2]*row3[0] + filter[5]*row3[4] + filter[8]*row3[8];
|
||||
fp[0]= mfac*row2[4] + fac*sqrt(f1*f1 + f2*f2);
|
||||
fp[0] = mfac*row2[4] + fac*sqrt(f1*f1 + f2*f2);
|
||||
fp++; row1++; row2++; row3++;
|
||||
}
|
||||
fp[0]= row2[4];
|
||||
fp[0] = row2[4];
|
||||
/* no alpha... will clear it completely */
|
||||
fp++; row1++; row2++; row3++;
|
||||
}
|
||||
|
@ -87,7 +87,7 @@ static void do_filter_edge(CompBuf *out, CompBuf *in, float *filter, float fac)
|
|||
for (x=2; x<rowlen; x++) {
|
||||
f1= filter[0]*row1[0] + filter[1]*row1[1] + filter[2]*row1[2] + filter[3]*row2[0] + filter[4]*row2[1] + filter[5]*row2[2] + filter[6]*row3[0] + filter[7]*row3[1] + filter[8]*row3[2];
|
||||
f2= filter[0]*row1[0] + filter[3]*row1[1] + filter[6]*row1[2] + filter[1]*row2[0] + filter[4]*row2[1] + filter[7]*row2[2] + filter[2]*row3[0] + filter[5]*row3[1] + filter[8]*row3[2];
|
||||
fp[0]= mfac*row2[1] + fac*sqrt(f1*f1 + f2*f2);
|
||||
fp[0] = mfac*row2[1] + fac*sqrt(f1*f1 + f2*f2);
|
||||
fp++; row1++; row2++; row3++;
|
||||
}
|
||||
}
|
||||
|
@ -116,28 +116,28 @@ static void do_filter3(CompBuf *out, CompBuf *in, float *filter, float fac)
|
|||
fp= out->rect + pixlen*(y)*rowlen;
|
||||
|
||||
if (pixlen==1) {
|
||||
fp[0]= row2[0];
|
||||
fp[0] = row2[0];
|
||||
fp+= 1;
|
||||
|
||||
for (x=2; x<rowlen; x++) {
|
||||
fp[0]= mfac*row2[1] + fac*(filter[0]*row1[0] + filter[1]*row1[1] + filter[2]*row1[2] + filter[3]*row2[0] + filter[4]*row2[1] + filter[5]*row2[2] + filter[6]*row3[0] + filter[7]*row3[1] + filter[8]*row3[2]);
|
||||
fp[0] = mfac*row2[1] + fac*(filter[0]*row1[0] + filter[1]*row1[1] + filter[2]*row1[2] + filter[3]*row2[0] + filter[4]*row2[1] + filter[5]*row2[2] + filter[6]*row3[0] + filter[7]*row3[1] + filter[8]*row3[2]);
|
||||
fp++; row1++; row2++; row3++;
|
||||
}
|
||||
fp[0]= row2[1];
|
||||
fp[0] = row2[1];
|
||||
}
|
||||
else if (pixlen==2) {
|
||||
fp[0]= row2[0];
|
||||
fp[1]= row2[1];
|
||||
fp[0] = row2[0];
|
||||
fp[1] = row2[1];
|
||||
fp+= 2;
|
||||
|
||||
for (x=2; x<rowlen; x++) {
|
||||
for (c=0; c<2; c++) {
|
||||
fp[0]= mfac*row2[2] + fac*(filter[0]*row1[0] + filter[1]*row1[2] + filter[2]*row1[4] + filter[3]*row2[0] + filter[4]*row2[2] + filter[5]*row2[4] + filter[6]*row3[0] + filter[7]*row3[2] + filter[8]*row3[4]);
|
||||
fp[0] = mfac*row2[2] + fac*(filter[0]*row1[0] + filter[1]*row1[2] + filter[2]*row1[4] + filter[3]*row2[0] + filter[4]*row2[2] + filter[5]*row2[4] + filter[6]*row3[0] + filter[7]*row3[2] + filter[8]*row3[4]);
|
||||
fp++; row1++; row2++; row3++;
|
||||
}
|
||||
}
|
||||
fp[0]= row2[2];
|
||||
fp[1]= row2[3];
|
||||
fp[0] = row2[2];
|
||||
fp[1] = row2[3];
|
||||
}
|
||||
else if (pixlen==3) {
|
||||
copy_v3_v3(fp, row2);
|
||||
|
@ -145,7 +145,7 @@ static void do_filter3(CompBuf *out, CompBuf *in, float *filter, float fac)
|
|||
|
||||
for (x=2; x<rowlen; x++) {
|
||||
for (c=0; c<3; c++) {
|
||||
fp[0]= mfac*row2[3] + fac*(filter[0]*row1[0] + filter[1]*row1[3] + filter[2]*row1[6] + filter[3]*row2[0] + filter[4]*row2[3] + filter[5]*row2[6] + filter[6]*row3[0] + filter[7]*row3[3] + filter[8]*row3[6]);
|
||||
fp[0] = mfac*row2[3] + fac*(filter[0]*row1[0] + filter[1]*row1[3] + filter[2]*row1[6] + filter[3]*row2[0] + filter[4]*row2[3] + filter[5]*row2[6] + filter[6]*row3[0] + filter[7]*row3[3] + filter[8]*row3[6]);
|
||||
fp++; row1++; row2++; row3++;
|
||||
}
|
||||
}
|
||||
|
@ -157,7 +157,7 @@ static void do_filter3(CompBuf *out, CompBuf *in, float *filter, float fac)
|
|||
|
||||
for (x=2; x<rowlen; x++) {
|
||||
for (c=0; c<4; c++) {
|
||||
fp[0]= mfac*row2[4] + fac*(filter[0]*row1[0] + filter[1]*row1[4] + filter[2]*row1[8] + filter[3]*row2[0] + filter[4]*row2[4] + filter[5]*row2[8] + filter[6]*row3[0] + filter[7]*row3[4] + filter[8]*row3[8]);
|
||||
fp[0] = mfac*row2[4] + fac*(filter[0]*row1[0] + filter[1]*row1[4] + filter[2]*row1[8] + filter[3]*row2[0] + filter[4]*row2[4] + filter[5]*row2[8] + filter[6]*row3[0] + filter[7]*row3[4] + filter[8]*row3[8]);
|
||||
fp++; row1++; row2++; row3++;
|
||||
}
|
||||
}
|
||||
|
@ -169,13 +169,13 @@ static void do_filter3(CompBuf *out, CompBuf *in, float *filter, float fac)
|
|||
|
||||
static void node_composit_exec_filter(void *data, bNode *node, bNodeStack **in, bNodeStack **out)
|
||||
{
|
||||
static float soft[9]= {1/16.0f, 2/16.0f, 1/16.0f, 2/16.0f, 4/16.0f, 2/16.0f, 1/16.0f, 2/16.0f, 1/16.0f};
|
||||
float sharp[9]= {-1, -1, -1, -1, 9, -1, -1, -1, -1};
|
||||
float laplace[9]= {-1/8.0f, -1/8.0f, -1/8.0f, -1/8.0f, 1.0f, -1/8.0f, -1/8.0f, -1/8.0f, -1/8.0f};
|
||||
float sobel[9]= {1, 2, 1, 0, 0, 0, -1, -2, -1};
|
||||
float prewitt[9]= {1, 1, 1, 0, 0, 0, -1, -1, -1};
|
||||
float kirsch[9]= {5, 5, 5, -3, -3, -3, -2, -2, -2};
|
||||
float shadow[9]= {1, 2, 1, 0, 1, 0, -1, -2, -1};
|
||||
static float soft[9] = {1/16.0f, 2/16.0f, 1/16.0f, 2/16.0f, 4/16.0f, 2/16.0f, 1/16.0f, 2/16.0f, 1/16.0f};
|
||||
float sharp[9] = {-1, -1, -1, -1, 9, -1, -1, -1, -1};
|
||||
float laplace[9] = {-1/8.0f, -1/8.0f, -1/8.0f, -1/8.0f, 1.0f, -1/8.0f, -1/8.0f, -1/8.0f, -1/8.0f};
|
||||
float sobel[9] = {1, 2, 1, 0, 0, 0, -1, -2, -1};
|
||||
float prewitt[9] = {1, 1, 1, 0, 0, 0, -1, -1, -1};
|
||||
float kirsch[9] = {5, 5, 5, -3, -3, -3, -2, -2, -2};
|
||||
float shadow[9] = {1, 2, 1, 0, 1, 0, -1, -2, -1};
|
||||
|
||||
if (out[0]->hasoutput==0) return;
|
||||
|
||||
|
|
|
@ -33,12 +33,12 @@
|
|||
#include "node_composite_util.h"
|
||||
|
||||
/* **************** Flip ******************** */
|
||||
static bNodeSocketTemplate cmp_node_flip_in[]= {
|
||||
static bNodeSocketTemplate cmp_node_flip_in[] = {
|
||||
{ SOCK_RGBA, 1, N_("Image"), 1.0f, 1.0f, 1.0f, 1.0f},
|
||||
{ -1, 0, "" }
|
||||
};
|
||||
|
||||
static bNodeSocketTemplate cmp_node_flip_out[]= {
|
||||
static bNodeSocketTemplate cmp_node_flip_out[] = {
|
||||
{ SOCK_RGBA, 0, N_("Image")},
|
||||
{ -1, 0, "" }
|
||||
};
|
||||
|
@ -75,7 +75,7 @@ static void node_composit_exec_flip(void *UNUSED(data), bNode *node, bNodeStack
|
|||
outfp += (src_width-1)*src_pix;
|
||||
for (x=0; x<src_width; x++) {
|
||||
for (i=0; i<src_pix; i++) {
|
||||
outfp[i]= srcfp[i];
|
||||
outfp[i] = srcfp[i];
|
||||
}
|
||||
outfp -= src_pix;
|
||||
srcfp += src_pix;
|
||||
|
|
|
@ -35,12 +35,12 @@
|
|||
|
||||
/* **************** Gamma Tools ******************** */
|
||||
|
||||
static bNodeSocketTemplate cmp_node_gamma_in[]= {
|
||||
static bNodeSocketTemplate cmp_node_gamma_in[] = {
|
||||
{ SOCK_RGBA, 1, N_("Image"), 1.0f, 1.0f, 1.0f, 1.0f},
|
||||
{ SOCK_FLOAT, 1, N_("Gamma"), 1.0f, 0.0f, 0.0f, 0.0f, 0.001f, 10.0f, PROP_UNSIGNED},
|
||||
{ -1, 0, "" }
|
||||
};
|
||||
static bNodeSocketTemplate cmp_node_gamma_out[]= {
|
||||
static bNodeSocketTemplate cmp_node_gamma_out[] = {
|
||||
{ SOCK_RGBA, 0, N_("Image")},
|
||||
{ -1, 0, "" }
|
||||
};
|
||||
|
|
|
@ -32,11 +32,11 @@
|
|||
|
||||
#include "node_composite_util.h"
|
||||
|
||||
static bNodeSocketTemplate cmp_node_glare_in[]= {
|
||||
static bNodeSocketTemplate cmp_node_glare_in[] = {
|
||||
{ SOCK_RGBA, 1, N_("Image"), 1.0f, 1.0f, 1.0f, 1.0f},
|
||||
{ -1, 0, "" }
|
||||
};
|
||||
static bNodeSocketTemplate cmp_node_glare_out[]= {
|
||||
static bNodeSocketTemplate cmp_node_glare_out[] = {
|
||||
{ SOCK_RGBA, 0, N_("Image")},
|
||||
{ -1, 0, "" }
|
||||
};
|
||||
|
|
|
@ -34,12 +34,12 @@
|
|||
|
||||
|
||||
/* **************** Hue Saturation ******************** */
|
||||
static bNodeSocketTemplate cmp_node_hue_sat_in[]= {
|
||||
static bNodeSocketTemplate cmp_node_hue_sat_in[] = {
|
||||
{ SOCK_FLOAT, 1, N_("Fac"), 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, PROP_FACTOR},
|
||||
{ SOCK_RGBA, 1, N_("Image"), 1.0f, 1.0f, 1.0f, 1.0f},
|
||||
{ -1, 0, "" }
|
||||
};
|
||||
static bNodeSocketTemplate cmp_node_hue_sat_out[]= {
|
||||
static bNodeSocketTemplate cmp_node_hue_sat_out[] = {
|
||||
{ SOCK_RGBA, 0, N_("Image")},
|
||||
{ -1, 0, "" }
|
||||
};
|
||||
|
@ -60,10 +60,10 @@ static void do_hue_sat_fac(bNode *node, float *out, float *in, float *fac)
|
|||
hsv[2]*= nhs->val;
|
||||
hsv_to_rgb(hsv[0], hsv[1], hsv[2], col, col+1, col+2);
|
||||
|
||||
out[0]= mfac*in[0] + *fac*col[0];
|
||||
out[1]= mfac*in[1] + *fac*col[1];
|
||||
out[2]= mfac*in[2] + *fac*col[2];
|
||||
out[3]= in[3];
|
||||
out[0] = mfac*in[0] + *fac*col[0];
|
||||
out[1] = mfac*in[1] + *fac*col[1];
|
||||
out[2] = mfac*in[2] + *fac*col[2];
|
||||
out[3] = in[3];
|
||||
}
|
||||
else {
|
||||
copy_v4_v4(out, in);
|
||||
|
|
|
@ -32,13 +32,13 @@
|
|||
|
||||
#include "node_composite_util.h"
|
||||
|
||||
static bNodeSocketTemplate cmp_node_huecorrect_in[]= {
|
||||
static bNodeSocketTemplate cmp_node_huecorrect_in[] = {
|
||||
{ SOCK_FLOAT, 1, N_("Fac"), 1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f, PROP_FACTOR},
|
||||
{ SOCK_RGBA, 1, N_("Image"), 1.0f, 1.0f, 1.0f, 1.0f},
|
||||
{ -1, 0, "" }
|
||||
};
|
||||
|
||||
static bNodeSocketTemplate cmp_node_huecorrect_out[]= {
|
||||
static bNodeSocketTemplate cmp_node_huecorrect_out[] = {
|
||||
{ SOCK_RGBA, 0, N_("Image")},
|
||||
{ -1, 0, "" }
|
||||
};
|
||||
|
@ -71,7 +71,7 @@ static void do_huecorrect(bNode *node, float *out, float *in)
|
|||
/* convert back to rgb */
|
||||
hsv_to_rgb(hsv[0], hsv[1], hsv[2], out, out+1, out+2);
|
||||
|
||||
out[3]= in[3];
|
||||
out[3] = in[3];
|
||||
}
|
||||
|
||||
static void do_huecorrect_fac(bNode *node, float *out, float *in, float *fac)
|
||||
|
@ -101,10 +101,10 @@ static void do_huecorrect_fac(bNode *node, float *out, float *in, float *fac)
|
|||
/* convert back to rgb */
|
||||
hsv_to_rgb(hsv[0], hsv[1], hsv[2], rgb, rgb+1, rgb+2);
|
||||
|
||||
out[0]= mfac*in[0] + *fac*rgb[0];
|
||||
out[1]= mfac*in[1] + *fac*rgb[1];
|
||||
out[2]= mfac*in[2] + *fac*rgb[2];
|
||||
out[3]= in[3];
|
||||
out[0] = mfac*in[0] + *fac*rgb[0];
|
||||
out[1] = mfac*in[1] + *fac*rgb[1];
|
||||
out[2] = mfac*in[2] + *fac*rgb[2];
|
||||
out[3] = in[3];
|
||||
}
|
||||
|
||||
static void node_composit_exec_huecorrect(void *UNUSED(data), bNode *node, bNodeStack **in, bNodeStack **out)
|
||||
|
|
|
@ -35,11 +35,11 @@
|
|||
|
||||
/* **************** ID Mask ******************** */
|
||||
|
||||
static bNodeSocketTemplate cmp_node_idmask_in[]= {
|
||||
static bNodeSocketTemplate cmp_node_idmask_in[] = {
|
||||
{ SOCK_FLOAT, 1, N_("ID value"), 1.0f, 1.0f, 1.0f, 1.0f, 0.0f, 1.0f, PROP_NONE},
|
||||
{ -1, 0, "" }
|
||||
};
|
||||
static bNodeSocketTemplate cmp_node_idmask_out[]= {
|
||||
static bNodeSocketTemplate cmp_node_idmask_out[] = {
|
||||
{ SOCK_FLOAT, 0, N_("Alpha")},
|
||||
{ -1, 0, "" }
|
||||
};
|
||||
|
@ -56,14 +56,14 @@ static void do_idmask(CompBuf *stackbuf, CompBuf *cbuf, float idnr)
|
|||
rect= cbuf->rect;
|
||||
for (x= cbuf->x*cbuf->y - 1; x>=0; x--)
|
||||
if (rect[x]==idnr)
|
||||
abuf[x]= 255;
|
||||
abuf[x] = 255;
|
||||
|
||||
antialias_tagbuf(cbuf->x, cbuf->y, abuf);
|
||||
|
||||
rect= stackbuf->rect;
|
||||
for (x= cbuf->x*cbuf->y - 1; x>=0; x--)
|
||||
if (abuf[x]>1)
|
||||
rect[x]= (1.0f/255.0f)*(float)abuf[x];
|
||||
rect[x] = (1.0f/255.0f)*(float)abuf[x];
|
||||
|
||||
MEM_freeN(abuf);
|
||||
}
|
||||
|
@ -78,7 +78,7 @@ static void do_idmask_fsa(CompBuf *stackbuf, CompBuf *cbuf, float idnr)
|
|||
rs= stackbuf->rect;
|
||||
for (x= cbuf->x*cbuf->y - 1; x>=0; x--)
|
||||
if (rect[x]==idnr)
|
||||
rs[x]= 1.0f;
|
||||
rs[x] = 1.0f;
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -34,7 +34,7 @@
|
|||
|
||||
/* **************** IMAGE (and RenderResult, multilayer image) ******************** */
|
||||
|
||||
static bNodeSocketTemplate cmp_node_rlayers_out[]= {
|
||||
static bNodeSocketTemplate cmp_node_rlayers_out[] = {
|
||||
{ SOCK_RGBA, 0, N_("Image"), 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f},
|
||||
{ SOCK_FLOAT, 0, N_("Alpha"), 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f},
|
||||
{ SOCK_FLOAT, 0, N_("Z"), 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f},
|
||||
|
|
|
@ -32,13 +32,13 @@
|
|||
#include "node_composite_util.h"
|
||||
|
||||
/* **************** INVERT ******************** */
|
||||
static bNodeSocketTemplate cmp_node_invert_in[]= {
|
||||
static bNodeSocketTemplate cmp_node_invert_in[] = {
|
||||
{ SOCK_FLOAT, 1, N_("Fac"), 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, PROP_FACTOR},
|
||||
{ SOCK_RGBA, 1, N_("Color"), 1.0f, 1.0f, 1.0f, 1.0f},
|
||||
{ -1, 0, "" }
|
||||
};
|
||||
|
||||
static bNodeSocketTemplate cmp_node_invert_out[]= {
|
||||
static bNodeSocketTemplate cmp_node_invert_out[] = {
|
||||
{ SOCK_RGBA, 0, N_("Color")},
|
||||
{ -1, 0, "" }
|
||||
};
|
||||
|
|
|
@ -32,13 +32,13 @@
|
|||
|
||||
#include "node_composite_util.h"
|
||||
|
||||
static bNodeSocketTemplate cmp_node_lensdist_in[]= {
|
||||
static bNodeSocketTemplate cmp_node_lensdist_in[] = {
|
||||
{ SOCK_RGBA, 1, N_("Image"), 1.0f, 1.0f, 1.0f, 1.0f},
|
||||
{ SOCK_FLOAT, 1, N_("Distort"), 0.f, 0.f, 0.f, 0.f, -0.999f, 1.f, PROP_NONE},
|
||||
{ SOCK_FLOAT, 1, N_("Dispersion"), 0.f, 0.f, 0.f, 0.f, 0.f, 1.f, PROP_NONE},
|
||||
{ -1, 0, "" }
|
||||
};
|
||||
static bNodeSocketTemplate cmp_node_lensdist_out[]= {
|
||||
static bNodeSocketTemplate cmp_node_lensdist_out[] = {
|
||||
{ SOCK_RGBA, 0, N_("Image")},
|
||||
{ -1, 0, "" }
|
||||
};
|
||||
|
@ -74,7 +74,7 @@ static void lensDistort(CompBuf *dst, CompBuf *src, float kr, float kg, float kb
|
|||
qd_getPixelLerpChan(tsrc, (u*dst->x - kr) - 0.5f, v*dst->y - 0.5f, 2, colp[x]+2);
|
||||
|
||||
/* set alpha */
|
||||
colp[x][3]= 1.0f;
|
||||
colp[x][3] = 1.0f;
|
||||
}
|
||||
}
|
||||
free_compbuf(tsrc);
|
||||
|
@ -159,7 +159,7 @@ static void lensDistort(CompBuf *dst, CompBuf *src, float kr, float kg, float kb
|
|||
if (db) colp[x][2] = 2.f*tc[2] / (float)db;
|
||||
|
||||
/* set alpha */
|
||||
colp[x][3]= 1.0f;
|
||||
colp[x][3] = 1.0f;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -34,12 +34,12 @@
|
|||
|
||||
|
||||
/* **************** LEVELS ******************** */
|
||||
static bNodeSocketTemplate cmp_node_view_levels_in[]= {
|
||||
static bNodeSocketTemplate cmp_node_view_levels_in[] = {
|
||||
{ SOCK_RGBA, 1, N_("Image"), 0.0f, 0.0f, 0.0f, 1.0f},
|
||||
{ -1, 0, "" }
|
||||
};
|
||||
|
||||
static bNodeSocketTemplate cmp_node_view_levels_out[]={
|
||||
static bNodeSocketTemplate cmp_node_view_levels_out[] = {
|
||||
{SOCK_FLOAT, 0, N_("Mean")},
|
||||
{SOCK_FLOAT, 0, N_("Std Dev")},
|
||||
{-1, 0, ""}
|
||||
|
@ -300,9 +300,9 @@ static void node_composit_exec_view_levels(void *data, bNode *node, bNodeStack *
|
|||
#endif
|
||||
|
||||
if (out[0]->hasoutput)
|
||||
out[0]->vec[0]= mean;
|
||||
out[0]->vec[0] = mean;
|
||||
if (out[1]->hasoutput)
|
||||
out[1]->vec[0]= std_dev;
|
||||
out[1]->vec[0] = std_dev;
|
||||
|
||||
generate_preview(data, node, histogram);
|
||||
|
||||
|
|
|
@ -34,12 +34,12 @@
|
|||
|
||||
|
||||
/* ******************* Luma Matte Node ********************************* */
|
||||
static bNodeSocketTemplate cmp_node_luma_matte_in[]={
|
||||
static bNodeSocketTemplate cmp_node_luma_matte_in[] = {
|
||||
{SOCK_RGBA, 1, N_("Image"), 1.0f, 1.0f, 1.0f, 1.0f},
|
||||
{-1, 0, ""}
|
||||
};
|
||||
|
||||
static bNodeSocketTemplate cmp_node_luma_matte_out[]={
|
||||
static bNodeSocketTemplate cmp_node_luma_matte_out[] = {
|
||||
{SOCK_RGBA, 0, N_("Image")},
|
||||
{SOCK_FLOAT, 0, N_("Matte")},
|
||||
{-1, 0, ""}
|
||||
|
|
|
@ -34,12 +34,12 @@
|
|||
|
||||
/* **************** Map UV ******************** */
|
||||
|
||||
static bNodeSocketTemplate cmp_node_mapuv_in[]= {
|
||||
static bNodeSocketTemplate cmp_node_mapuv_in[] = {
|
||||
{ SOCK_RGBA, 1, N_("Image"), 1.0f, 1.0f, 1.0f, 1.0f},
|
||||
{ SOCK_VECTOR, 1, N_("UV"), 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, PROP_NONE},
|
||||
{ -1, 0, "" }
|
||||
};
|
||||
static bNodeSocketTemplate cmp_node_mapuv_out[]= {
|
||||
static bNodeSocketTemplate cmp_node_mapuv_out[] = {
|
||||
{ SOCK_RGBA, 0, N_("Image")},
|
||||
{ -1, 0, "" }
|
||||
};
|
||||
|
|
|
@ -33,11 +33,11 @@
|
|||
#include "node_composite_util.h"
|
||||
|
||||
/* **************** MAP VALUE ******************** */
|
||||
static bNodeSocketTemplate cmp_node_map_value_in[]= {
|
||||
static bNodeSocketTemplate cmp_node_map_value_in[] = {
|
||||
{ SOCK_FLOAT, 1, N_("Value"), 1.0f, 1.0f, 1.0f, 1.0f, 0.0f, 1.0f, PROP_NONE},
|
||||
{ -1, 0, "" }
|
||||
};
|
||||
static bNodeSocketTemplate cmp_node_map_value_out[]= {
|
||||
static bNodeSocketTemplate cmp_node_map_value_out[] = {
|
||||
{ SOCK_FLOAT, 0, N_("Value")},
|
||||
{ -1, 0, "" }
|
||||
};
|
||||
|
@ -48,13 +48,13 @@ static void do_map_value(bNode *node, float *out, float *src)
|
|||
{
|
||||
TexMapping *texmap= node->storage;
|
||||
|
||||
out[0]= (src[0] + texmap->loc[0])*texmap->size[0];
|
||||
out[0] = (src[0] + texmap->loc[0])*texmap->size[0];
|
||||
if (texmap->flag & TEXMAP_CLIP_MIN)
|
||||
if (out[0]<texmap->min[0])
|
||||
out[0]= texmap->min[0];
|
||||
out[0] = texmap->min[0];
|
||||
if (texmap->flag & TEXMAP_CLIP_MAX)
|
||||
if (out[0]>texmap->max[0])
|
||||
out[0]= texmap->max[0];
|
||||
out[0] = texmap->max[0];
|
||||
}
|
||||
|
||||
static void node_composit_exec_map_value(void *UNUSED(data), bNode *node, bNodeStack **in, bNodeStack **out)
|
||||
|
|
|
@ -33,13 +33,13 @@
|
|||
#include "node_composite_util.h"
|
||||
|
||||
/* **************** SCALAR MATH ******************** */
|
||||
static bNodeSocketTemplate cmp_node_math_in[]= {
|
||||
static bNodeSocketTemplate cmp_node_math_in[] = {
|
||||
{ SOCK_FLOAT, 1, N_("Value"), 0.5f, 0.5f, 0.5f, 1.0f, -10000.0f, 10000.0f, PROP_NONE},
|
||||
{ SOCK_FLOAT, 1, N_("Value"), 0.5f, 0.5f, 0.5f, 1.0f, -10000.0f, 10000.0f, PROP_NONE},
|
||||
{ -1, 0, "" }
|
||||
};
|
||||
|
||||
static bNodeSocketTemplate cmp_node_math_out[]= {
|
||||
static bNodeSocketTemplate cmp_node_math_out[] = {
|
||||
{ SOCK_FLOAT, 0, N_("Value")},
|
||||
{ -1, 0, "" }
|
||||
};
|
||||
|
@ -50,63 +50,63 @@ static void do_math(bNode *node, float *out, float *in, float *in2)
|
|||
{
|
||||
switch (node->custom1) {
|
||||
case 0: /* Add */
|
||||
out[0]= in[0] + in2[0];
|
||||
out[0] = in[0] + in2[0];
|
||||
break;
|
||||
case 1: /* Subtract */
|
||||
out[0]= in[0] - in2[0];
|
||||
out[0] = in[0] - in2[0];
|
||||
break;
|
||||
case 2: /* Multiply */
|
||||
out[0]= in[0] * in2[0];
|
||||
out[0] = in[0] * in2[0];
|
||||
break;
|
||||
case 3: /* Divide */
|
||||
{
|
||||
if (in2[0]==0) /* We don't want to divide by zero. */
|
||||
out[0]= 0.0;
|
||||
out[0] = 0.0;
|
||||
else
|
||||
out[0]= in[0] / in2[0];
|
||||
out[0] = in[0] / in2[0];
|
||||
}
|
||||
break;
|
||||
case 4: /* Sine */
|
||||
out[0]= sin(in[0]);
|
||||
out[0] = sin(in[0]);
|
||||
break;
|
||||
case 5: /* Cosine */
|
||||
out[0]= cos(in[0]);
|
||||
out[0] = cos(in[0]);
|
||||
break;
|
||||
case 6: /* Tangent */
|
||||
out[0]= tan(in[0]);
|
||||
out[0] = tan(in[0]);
|
||||
break;
|
||||
case 7: /* Arc-Sine */
|
||||
{
|
||||
/* Can't do the impossible... */
|
||||
if (in[0] <= 1 && in[0] >= -1 )
|
||||
out[0]= asin(in[0]);
|
||||
out[0] = asin(in[0]);
|
||||
else
|
||||
out[0]= 0.0;
|
||||
out[0] = 0.0;
|
||||
}
|
||||
break;
|
||||
case 8: /* Arc-Cosine */
|
||||
{
|
||||
/* Can't do the impossible... */
|
||||
if ( in[0] <= 1 && in[0] >= -1 )
|
||||
out[0]= acos(in[0]);
|
||||
out[0] = acos(in[0]);
|
||||
else
|
||||
out[0]= 0.0;
|
||||
out[0] = 0.0;
|
||||
}
|
||||
break;
|
||||
case 9: /* Arc-Tangent */
|
||||
out[0]= atan(in[0]);
|
||||
out[0] = atan(in[0]);
|
||||
break;
|
||||
case 10: /* Power */
|
||||
{
|
||||
/* Only raise negative numbers by full integers */
|
||||
if ( in[0] >= 0 ) {
|
||||
out[0]= pow(in[0], in2[0]);
|
||||
out[0] = pow(in[0], in2[0]);
|
||||
}
|
||||
else {
|
||||
float y_mod_1 = fmod(in2[0], 1);
|
||||
/* if input value is not nearly an integer, fall back to zero, nicer than straight rounding */
|
||||
if (y_mod_1 > 0.999f || y_mod_1 < 0.001f) {
|
||||
out[0]= powf(in[0], floorf(in2[0] + 0.5f));
|
||||
out[0] = powf(in[0], floorf(in2[0] + 0.5f));
|
||||
}
|
||||
else {
|
||||
out[0] = 0.0f;
|
||||
|
@ -118,50 +118,50 @@ static void do_math(bNode *node, float *out, float *in, float *in2)
|
|||
{
|
||||
/* Don't want any imaginary numbers... */
|
||||
if ( in[0] > 0 && in2[0] > 0 )
|
||||
out[0]= log(in[0]) / log(in2[0]);
|
||||
out[0] = log(in[0]) / log(in2[0]);
|
||||
else
|
||||
out[0]= 0.0;
|
||||
out[0] = 0.0;
|
||||
}
|
||||
break;
|
||||
case 12: /* Minimum */
|
||||
{
|
||||
if ( in[0] < in2[0] )
|
||||
out[0]= in[0];
|
||||
out[0] = in[0];
|
||||
else
|
||||
out[0]= in2[0];
|
||||
out[0] = in2[0];
|
||||
}
|
||||
break;
|
||||
case 13: /* Maximum */
|
||||
{
|
||||
if ( in[0] > in2[0] )
|
||||
out[0]= in[0];
|
||||
out[0] = in[0];
|
||||
else
|
||||
out[0]= in2[0];
|
||||
out[0] = in2[0];
|
||||
}
|
||||
break;
|
||||
case 14: /* Round */
|
||||
{
|
||||
/* round by the second value */
|
||||
if ( in2[0] != 0.0f )
|
||||
out[0]= floorf(in[0] / in2[0] + 0.5f) * in2[0];
|
||||
out[0] = floorf(in[0] / in2[0] + 0.5f) * in2[0];
|
||||
else
|
||||
out[0]= floorf(in[0] + 0.5f);
|
||||
out[0] = floorf(in[0] + 0.5f);
|
||||
}
|
||||
break;
|
||||
case 15: /* Less Than */
|
||||
{
|
||||
if ( in[0] < in2[0] )
|
||||
out[0]= 1.0f;
|
||||
out[0] = 1.0f;
|
||||
else
|
||||
out[0]= 0.0f;
|
||||
out[0] = 0.0f;
|
||||
}
|
||||
break;
|
||||
case 16: /* Greater Than */
|
||||
{
|
||||
if ( in[0] > in2[0] )
|
||||
out[0]= 1.0f;
|
||||
out[0] = 1.0f;
|
||||
else
|
||||
out[0]= 0.0f;
|
||||
out[0] = 0.0f;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -32,13 +32,13 @@
|
|||
#include "node_composite_util.h"
|
||||
|
||||
/* **************** MIX RGB ******************** */
|
||||
static bNodeSocketTemplate cmp_node_mix_rgb_in[]= {
|
||||
static bNodeSocketTemplate cmp_node_mix_rgb_in[] = {
|
||||
{ SOCK_FLOAT, 1, N_("Fac"), 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 5.0f, PROP_FACTOR},
|
||||
{ SOCK_RGBA, 1, N_("Image"), 1.0f, 1.0f, 1.0f, 1.0f},
|
||||
{ SOCK_RGBA, 1, N_("Image"), 1.0f, 1.0f, 1.0f, 1.0f},
|
||||
{ -1, 0, "" }
|
||||
};
|
||||
static bNodeSocketTemplate cmp_node_mix_rgb_out[]= {
|
||||
static bNodeSocketTemplate cmp_node_mix_rgb_out[] = {
|
||||
{ SOCK_RGBA, 0, N_("Image")},
|
||||
{ -1, 0, "" }
|
||||
};
|
||||
|
@ -55,7 +55,7 @@ static void do_mix_rgb(bNode *node, float *out, float *in1, float *in2, float *f
|
|||
else
|
||||
ramp_blend(node->custom1, col, fac[0], in2);
|
||||
copy_v3_v3(out, col);
|
||||
out[3]= in1[3];
|
||||
out[3] = in1[3];
|
||||
}
|
||||
|
||||
static void node_composit_exec_mix_rgb(void *data, bNode *node, bNodeStack **in, bNodeStack **out)
|
||||
|
|
|
@ -34,12 +34,12 @@
|
|||
|
||||
|
||||
/* **************** NORMAL ******************** */
|
||||
static bNodeSocketTemplate cmp_node_normal_in[]= {
|
||||
static bNodeSocketTemplate cmp_node_normal_in[] = {
|
||||
{ SOCK_VECTOR, 1, N_("Normal"), 0.0f, 0.0f, 0.0f, 1.0f, -1.0f, 1.0f, PROP_DIRECTION},
|
||||
{ -1, 0, "" }
|
||||
};
|
||||
|
||||
static bNodeSocketTemplate cmp_node_normal_out[]= {
|
||||
static bNodeSocketTemplate cmp_node_normal_out[] = {
|
||||
{ SOCK_VECTOR, 0, N_("Normal")},
|
||||
{ SOCK_FLOAT, 0, N_("Dot")},
|
||||
{ -1, 0, "" }
|
||||
|
@ -53,7 +53,7 @@ static void do_normal(bNode *node, float *out, float *in)
|
|||
float *nor= ((bNodeSocketValueVector*)sock->default_value)->value;
|
||||
|
||||
/* render normals point inside... the widget points outside */
|
||||
out[0]= -dot_v3v3(nor, in);
|
||||
out[0] = -dot_v3v3(nor, in);
|
||||
}
|
||||
|
||||
/* generates normal, does dot product */
|
||||
|
@ -68,7 +68,7 @@ static void node_composit_exec_normal(void *UNUSED(data), bNode *node, bNodeStac
|
|||
if (in[0]->data==NULL) {
|
||||
copy_v3_v3(out[0]->vec, nor);
|
||||
/* render normals point inside... the widget points outside */
|
||||
out[1]->vec[0]= -dot_v3v3(out[0]->vec, in[0]->vec);
|
||||
out[1]->vec[0] = -dot_v3v3(out[0]->vec, in[0]->vec);
|
||||
}
|
||||
else if (out[1]->hasoutput) {
|
||||
/* make output size of input image */
|
||||
|
|
|
@ -34,11 +34,11 @@
|
|||
|
||||
|
||||
/* **************** NORMALIZE single channel, useful for Z buffer ******************** */
|
||||
static bNodeSocketTemplate cmp_node_normalize_in[]= {
|
||||
static bNodeSocketTemplate cmp_node_normalize_in[] = {
|
||||
{ SOCK_FLOAT, 1, N_("Value"), 1.0f, 1.0f, 1.0f, 1.0f, 0.0f, 1.0f, PROP_NONE},
|
||||
{ -1, 0, "" }
|
||||
};
|
||||
static bNodeSocketTemplate cmp_node_normalize_out[]= {
|
||||
static bNodeSocketTemplate cmp_node_normalize_out[] = {
|
||||
{ SOCK_FLOAT, 0, N_("Value")},
|
||||
{ -1, 0, "" }
|
||||
};
|
||||
|
|
|
@ -35,11 +35,11 @@
|
|||
|
||||
/* **************** Premul and Key Alpha Convert ******************** */
|
||||
|
||||
static bNodeSocketTemplate cmp_node_premulkey_in[]= {
|
||||
static bNodeSocketTemplate cmp_node_premulkey_in[] = {
|
||||
{ SOCK_RGBA, 1, N_("Image"), 1.0f, 1.0f, 1.0f, 1.0f},
|
||||
{ -1, 0, "" }
|
||||
};
|
||||
static bNodeSocketTemplate cmp_node_premulkey_out[]= {
|
||||
static bNodeSocketTemplate cmp_node_premulkey_out[] = {
|
||||
{ SOCK_RGBA, 0, N_("Image")},
|
||||
{ -1, 0, "" }
|
||||
};
|
||||
|
|
|
@ -34,7 +34,7 @@
|
|||
|
||||
|
||||
/* **************** RGB ******************** */
|
||||
static bNodeSocketTemplate cmp_node_rgb_out[]= {
|
||||
static bNodeSocketTemplate cmp_node_rgb_out[] = {
|
||||
{ SOCK_RGBA, 0, N_("RGBA"), 0.5f, 0.5f, 0.5f, 1.0f},
|
||||
{ -1, 0, "" }
|
||||
};
|
||||
|
|
|
@ -34,12 +34,12 @@
|
|||
|
||||
/* **************** Rotate ******************** */
|
||||
|
||||
static bNodeSocketTemplate cmp_node_rotate_in[]= {
|
||||
static bNodeSocketTemplate cmp_node_rotate_in[] = {
|
||||
{ SOCK_RGBA, 1, N_("Image"), 1.0f, 1.0f, 1.0f, 1.0f},
|
||||
{ SOCK_FLOAT, 1, N_("Degr"), 0.0f, 0.0f, 0.0f, 0.0f, -10000.0f, 10000.0f, PROP_ANGLE},
|
||||
{ -1, 0, "" }
|
||||
};
|
||||
static bNodeSocketTemplate cmp_node_rotate_out[]= {
|
||||
static bNodeSocketTemplate cmp_node_rotate_out[] = {
|
||||
{ SOCK_RGBA, 0, N_("Image")},
|
||||
{ -1, 0, "" }
|
||||
};
|
||||
|
|
|
@ -34,11 +34,11 @@
|
|||
|
||||
|
||||
/* **************** SEPARATE HSVA ******************** */
|
||||
static bNodeSocketTemplate cmp_node_sephsva_in[]= {
|
||||
static bNodeSocketTemplate cmp_node_sephsva_in[] = {
|
||||
{ SOCK_RGBA, 1, N_("Image"), 1.0f, 1.0f, 1.0f, 1.0f},
|
||||
{ -1, 0, "" }
|
||||
};
|
||||
static bNodeSocketTemplate cmp_node_sephsva_out[]= {
|
||||
static bNodeSocketTemplate cmp_node_sephsva_out[] = {
|
||||
{ SOCK_FLOAT, 0, N_("H")},
|
||||
{ SOCK_FLOAT, 0, N_("S")},
|
||||
{ SOCK_FLOAT, 0, N_("V")},
|
||||
|
@ -54,10 +54,10 @@ static void do_sephsva(bNode *UNUSED(node), float *out, float *in)
|
|||
|
||||
rgb_to_hsv(in[0], in[1], in[2], &h, &s, &v);
|
||||
|
||||
out[0]= h;
|
||||
out[1]= s;
|
||||
out[2]= v;
|
||||
out[3]= in[3];
|
||||
out[0] = h;
|
||||
out[1] = s;
|
||||
out[2] = v;
|
||||
out[3] = in[3];
|
||||
}
|
||||
|
||||
static void node_composit_exec_sephsva(void *UNUSED(data), bNode *node, bNodeStack **in, bNodeStack **out)
|
||||
|
@ -126,7 +126,7 @@ static bNodeSocketTemplate cmp_node_combhsva_in[] = {
|
|||
{ SOCK_FLOAT, 1, N_("A"), 1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f, PROP_NONE},
|
||||
{ -1, 0, "" }
|
||||
};
|
||||
static bNodeSocketTemplate cmp_node_combhsva_out[]= {
|
||||
static bNodeSocketTemplate cmp_node_combhsva_out[] = {
|
||||
{ SOCK_RGBA, 0, N_("Image")},
|
||||
{ -1, 0, "" }
|
||||
};
|
||||
|
|
|
@ -33,11 +33,11 @@
|
|||
#include "node_composite_util.h"
|
||||
|
||||
/* **************** SEPARATE RGBA ******************** */
|
||||
static bNodeSocketTemplate cmp_node_seprgba_in[]= {
|
||||
static bNodeSocketTemplate cmp_node_seprgba_in[] = {
|
||||
{ SOCK_RGBA, 1, N_("Image"), 1.0f, 1.0f, 1.0f, 1.0f},
|
||||
{ -1, 0, "" }
|
||||
};
|
||||
static bNodeSocketTemplate cmp_node_seprgba_out[]= {
|
||||
static bNodeSocketTemplate cmp_node_seprgba_out[] = {
|
||||
{ SOCK_FLOAT, 0, N_("R")},
|
||||
{ SOCK_FLOAT, 0, N_("G")},
|
||||
{ SOCK_FLOAT, 0, N_("B")},
|
||||
|
@ -98,14 +98,14 @@ void register_node_type_cmp_seprgba(bNodeTreeType *ttype)
|
|||
|
||||
|
||||
/* **************** COMBINE RGBA ******************** */
|
||||
static bNodeSocketTemplate cmp_node_combrgba_in[]= {
|
||||
static bNodeSocketTemplate cmp_node_combrgba_in[] = {
|
||||
{ SOCK_FLOAT, 1, N_("R"), 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f, PROP_NONE},
|
||||
{ SOCK_FLOAT, 1, N_("G"), 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f, PROP_NONE},
|
||||
{ SOCK_FLOAT, 1, N_("B"), 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f, PROP_NONE},
|
||||
{ SOCK_FLOAT, 1, N_("A"), 1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f, PROP_NONE},
|
||||
{ -1, 0, "" }
|
||||
};
|
||||
static bNodeSocketTemplate cmp_node_combrgba_out[]= {
|
||||
static bNodeSocketTemplate cmp_node_combrgba_out[] = {
|
||||
{ SOCK_RGBA, 0, N_("Image")},
|
||||
{ -1, 0, "" }
|
||||
};
|
||||
|
|
|
@ -34,11 +34,11 @@
|
|||
|
||||
|
||||
/* **************** SEPARATE YCCA ******************** */
|
||||
static bNodeSocketTemplate cmp_node_sepycca_in[]= {
|
||||
static bNodeSocketTemplate cmp_node_sepycca_in[] = {
|
||||
{ SOCK_RGBA, 1, N_("Image"), 1.0f, 1.0f, 1.0f, 1.0f},
|
||||
{ -1, 0, "" }
|
||||
};
|
||||
static bNodeSocketTemplate cmp_node_sepycca_out[]= {
|
||||
static bNodeSocketTemplate cmp_node_sepycca_out[] = {
|
||||
{ SOCK_FLOAT, 0, N_("Y")},
|
||||
{ SOCK_FLOAT, 0, N_("Cb")},
|
||||
{ SOCK_FLOAT, 0, N_("Cr")},
|
||||
|
@ -55,10 +55,10 @@ static void do_sepycca_601(bNode *UNUSED(node), float *out, float *in)
|
|||
rgb_to_ycc(in[0], in[1], in[2], &y, &cb, &cr, BLI_YCC_ITU_BT601);
|
||||
|
||||
/*divided by 255 to normalize for viewing in */
|
||||
out[0]= y/255.0f;
|
||||
out[1]= cb/255.0f;
|
||||
out[2]= cr/255.0f;
|
||||
out[3]= in[3];
|
||||
out[0] = y/255.0f;
|
||||
out[1] = cb/255.0f;
|
||||
out[2] = cr/255.0f;
|
||||
out[3] = in[3];
|
||||
}
|
||||
|
||||
static void do_sepycca_709(bNode *UNUSED(node), float *out, float *in)
|
||||
|
@ -68,10 +68,10 @@ static void do_sepycca_709(bNode *UNUSED(node), float *out, float *in)
|
|||
rgb_to_ycc(in[0], in[1], in[2], &y, &cb, &cr, BLI_YCC_ITU_BT709);
|
||||
|
||||
/*divided by 255 to normalize for viewing in */
|
||||
out[0]= y/255.0f;
|
||||
out[1]= cb/255.0f;
|
||||
out[2]= cr/255.0f;
|
||||
out[3]= in[3];
|
||||
out[0] = y/255.0f;
|
||||
out[1] = cb/255.0f;
|
||||
out[2] = cr/255.0f;
|
||||
out[3] = in[3];
|
||||
}
|
||||
|
||||
static void do_sepycca_jfif(bNode *UNUSED(node), float *out, float *in)
|
||||
|
@ -81,10 +81,10 @@ static void do_sepycca_jfif(bNode *UNUSED(node), float *out, float *in)
|
|||
rgb_to_ycc(in[0], in[1], in[2], &y, &cb, &cr, BLI_YCC_JFIF_0_255);
|
||||
|
||||
/*divided by 255 to normalize for viewing in */
|
||||
out[0]= y/255.0f;
|
||||
out[1]= cb/255.0f;
|
||||
out[2]= cr/255.0f;
|
||||
out[3]= in[3];
|
||||
out[0] = y/255.0f;
|
||||
out[1] = cb/255.0f;
|
||||
out[2] = cr/255.0f;
|
||||
out[3] = in[3];
|
||||
}
|
||||
|
||||
static void node_composit_exec_sepycca(void *UNUSED(data), bNode *node, bNodeStack **in, bNodeStack **out)
|
||||
|
@ -167,14 +167,14 @@ void register_node_type_cmp_sepycca(bNodeTreeType *ttype)
|
|||
|
||||
|
||||
/* **************** COMBINE YCCA ******************** */
|
||||
static bNodeSocketTemplate cmp_node_combycca_in[]= {
|
||||
static bNodeSocketTemplate cmp_node_combycca_in[] = {
|
||||
{ SOCK_FLOAT, 1, N_("Y"), 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f, PROP_NONE},
|
||||
{ SOCK_FLOAT, 1, N_("Cb"), 0.5f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f, PROP_NONE},
|
||||
{ SOCK_FLOAT, 1, N_("Cr"), 0.5f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f, PROP_NONE},
|
||||
{ SOCK_FLOAT, 1, N_("A"), 1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f, PROP_NONE},
|
||||
{ -1, 0, "" }
|
||||
};
|
||||
static bNodeSocketTemplate cmp_node_combycca_out[]= {
|
||||
static bNodeSocketTemplate cmp_node_combycca_out[] = {
|
||||
{ SOCK_RGBA, 0, N_("Image")},
|
||||
{ -1, 0, "" }
|
||||
};
|
||||
|
|
|
@ -34,11 +34,11 @@
|
|||
|
||||
|
||||
/* **************** SEPARATE YUVA ******************** */
|
||||
static bNodeSocketTemplate cmp_node_sepyuva_in[]= {
|
||||
static bNodeSocketTemplate cmp_node_sepyuva_in[] = {
|
||||
{ SOCK_RGBA, 1, N_("Image"), 1.0f, 1.0f, 1.0f, 1.0f},
|
||||
{ -1, 0, "" }
|
||||
};
|
||||
static bNodeSocketTemplate cmp_node_sepyuva_out[]= {
|
||||
static bNodeSocketTemplate cmp_node_sepyuva_out[] = {
|
||||
{ SOCK_FLOAT, 0, N_("Y")},
|
||||
{ SOCK_FLOAT, 0, N_("U")},
|
||||
{ SOCK_FLOAT, 0, N_("V")},
|
||||
|
@ -54,10 +54,10 @@ static void do_sepyuva(bNode *UNUSED(node), float *out, float *in)
|
|||
|
||||
rgb_to_yuv(in[0], in[1], in[2], &y, &u, &v);
|
||||
|
||||
out[0]= y;
|
||||
out[1]= u;
|
||||
out[2]= v;
|
||||
out[3]= in[3];
|
||||
out[0] = y;
|
||||
out[1] = u;
|
||||
out[2] = v;
|
||||
out[3] = in[3];
|
||||
}
|
||||
|
||||
static void node_composit_exec_sepyuva(void *UNUSED(data), bNode *node, bNodeStack **in, bNodeStack **out)
|
||||
|
@ -121,14 +121,14 @@ void register_node_type_cmp_sepyuva(bNodeTreeType *ttype)
|
|||
|
||||
|
||||
/* **************** COMBINE YUVA ******************** */
|
||||
static bNodeSocketTemplate cmp_node_combyuva_in[]= {
|
||||
static bNodeSocketTemplate cmp_node_combyuva_in[] = {
|
||||
{ SOCK_FLOAT, 1, N_("Y"), 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f, PROP_NONE},
|
||||
{ SOCK_FLOAT, 1, N_("U"), 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f, PROP_NONE},
|
||||
{ SOCK_FLOAT, 1, N_("V"), 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f, PROP_NONE},
|
||||
{ SOCK_FLOAT, 1, N_("A"), 1.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f, PROP_NONE},
|
||||
{ -1, 0, "" }
|
||||
};
|
||||
static bNodeSocketTemplate cmp_node_combyuva_out[]= {
|
||||
static bNodeSocketTemplate cmp_node_combyuva_out[] = {
|
||||
{ SOCK_RGBA, 0, N_("Image")},
|
||||
{ -1, 0, "" }
|
||||
};
|
||||
|
|
|
@ -33,12 +33,12 @@
|
|||
#include "node_composite_util.h"
|
||||
|
||||
/* **************** SET ALPHA ******************** */
|
||||
static bNodeSocketTemplate cmp_node_setalpha_in[]= {
|
||||
static bNodeSocketTemplate cmp_node_setalpha_in[] = {
|
||||
{ SOCK_RGBA, 1, N_("Image"), 0.0f, 0.0f, 0.0f, 1.0f},
|
||||
{ SOCK_FLOAT, 1, N_("Alpha"), 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, PROP_NONE},
|
||||
{ -1, 0, "" }
|
||||
};
|
||||
static bNodeSocketTemplate cmp_node_setalpha_out[]= {
|
||||
static bNodeSocketTemplate cmp_node_setalpha_out[] = {
|
||||
{ SOCK_RGBA, 0, N_("Image")},
|
||||
{ -1, 0, "" }
|
||||
};
|
||||
|
|
|
@ -33,7 +33,7 @@
|
|||
#include "node_composite_util.h"
|
||||
|
||||
/* **************** SPLIT VIEWER ******************** */
|
||||
static bNodeSocketTemplate cmp_node_splitviewer_in[]= {
|
||||
static bNodeSocketTemplate cmp_node_splitviewer_in[] = {
|
||||
{ SOCK_RGBA, 1, N_("Image"), 0.0f, 0.0f, 0.0f, 1.0f},
|
||||
{ SOCK_RGBA, 1, N_("Image"), 0.0f, 0.0f, 0.0f, 1.0f},
|
||||
{ -1, 0, "" }
|
||||
|
|
|
@ -35,12 +35,12 @@
|
|||
|
||||
/* **************** Translate ******************** */
|
||||
|
||||
static bNodeSocketTemplate cmp_node_stabilize2d_in[]= {
|
||||
static bNodeSocketTemplate cmp_node_stabilize2d_in[] = {
|
||||
{ SOCK_RGBA, 1, N_("Image"), 0.8f, 0.8f, 0.8f, 1.0f, 0.0f, 1.0f},
|
||||
{ -1, 0, "" }
|
||||
};
|
||||
|
||||
static bNodeSocketTemplate cmp_node_stabilize2d_out[]= {
|
||||
static bNodeSocketTemplate cmp_node_stabilize2d_out[] = {
|
||||
{ SOCK_RGBA, 0, N_("Image")},
|
||||
{ -1, 0, "" }
|
||||
};
|
||||
|
|
|
@ -34,13 +34,13 @@
|
|||
#include "../node_composite_util.h"
|
||||
|
||||
/* **************** MIX RGB ******************** */
|
||||
static bNodeSocketTemplate cmp_node_switch_in[]= {
|
||||
static bNodeSocketTemplate cmp_node_switch_in[] = {
|
||||
{ SOCK_RGBA, 1, N_("Off"), 0.8f, 0.8f, 0.8f, 1.0f, 0.0f, 1.0f},
|
||||
{ SOCK_RGBA, 1, N_("On"), 0.8f, 0.8f, 0.8f, 1.0f, 0.0f, 1.0f},
|
||||
{ -1, 0, "" }
|
||||
};
|
||||
|
||||
static bNodeSocketTemplate cmp_node_switch_out[]= {
|
||||
static bNodeSocketTemplate cmp_node_switch_out[] = {
|
||||
{ SOCK_RGBA, 0, N_("Image"), 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f},
|
||||
{ -1, 0, "" }
|
||||
};
|
||||
|
|
|
@ -33,12 +33,12 @@
|
|||
#include "node_composite_util.h"
|
||||
|
||||
/* **************** TEXTURE ******************** */
|
||||
static bNodeSocketTemplate cmp_node_texture_in[]= {
|
||||
static bNodeSocketTemplate cmp_node_texture_in[] = {
|
||||
{ SOCK_VECTOR, 1, N_("Offset"), 0.0f, 0.0f, 0.0f, 0.0f, -2.0f, 2.0f, PROP_TRANSLATION},
|
||||
{ SOCK_VECTOR, 1, N_("Scale"), 1.0f, 1.0f, 1.0f, 1.0f, -10.0f, 10.0f, PROP_XYZ},
|
||||
{ -1, 0, "" }
|
||||
};
|
||||
static bNodeSocketTemplate cmp_node_texture_out[]= {
|
||||
static bNodeSocketTemplate cmp_node_texture_out[] = {
|
||||
{ SOCK_FLOAT, 0, N_("Value")},
|
||||
{ SOCK_RGBA, 0, N_("Color")},
|
||||
{ -1, 0, "" }
|
||||
|
@ -51,28 +51,28 @@ static void texture_procedural(CompBuf *cbuf, float *out, float xco, float yco)
|
|||
{
|
||||
bNode *node= cbuf->node;
|
||||
TexResult texres= {0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0, NULL};
|
||||
float vec[3], *size, nor[3]={0.0f, 0.0f, 0.0f}, col[4];
|
||||
float vec[3], *size, nor[3] = {0.0f, 0.0f, 0.0f}, col[4];
|
||||
int retval, type= cbuf->procedural_type;
|
||||
|
||||
size= cbuf->procedural_size;
|
||||
|
||||
vec[0]= size[0]*(xco + cbuf->procedural_offset[0]);
|
||||
vec[1]= size[1]*(yco + cbuf->procedural_offset[1]);
|
||||
vec[2]= size[2]*cbuf->procedural_offset[2];
|
||||
vec[0] = size[0]*(xco + cbuf->procedural_offset[0]);
|
||||
vec[1] = size[1]*(yco + cbuf->procedural_offset[1]);
|
||||
vec[2] = size[2]*cbuf->procedural_offset[2];
|
||||
|
||||
retval= multitex_ext((Tex *)node->id, vec, NULL, NULL, 0, &texres);
|
||||
|
||||
if (type==CB_VAL) {
|
||||
if (texres.talpha)
|
||||
col[0]= texres.ta;
|
||||
col[0] = texres.ta;
|
||||
else
|
||||
col[0]= texres.tin;
|
||||
col[0] = texres.tin;
|
||||
}
|
||||
else if (type==CB_RGBA) {
|
||||
if (texres.talpha)
|
||||
col[3]= texres.ta;
|
||||
col[3] = texres.ta;
|
||||
else
|
||||
col[3]= texres.tin;
|
||||
col[3] = texres.tin;
|
||||
|
||||
if ((retval & TEX_RGB)) {
|
||||
copy_v3_v3(col, &texres.tr);
|
||||
|
|
|
@ -32,11 +32,11 @@
|
|||
|
||||
#include "node_composite_util.h"
|
||||
|
||||
static bNodeSocketTemplate cmp_node_tonemap_in[]= {
|
||||
static bNodeSocketTemplate cmp_node_tonemap_in[] = {
|
||||
{ SOCK_RGBA, 1, N_("Image"), 1.0f, 1.0f, 1.0f, 1.0f},
|
||||
{ -1, 0, "" }
|
||||
};
|
||||
static bNodeSocketTemplate cmp_node_tonemap_out[]= {
|
||||
static bNodeSocketTemplate cmp_node_tonemap_out[] = {
|
||||
{ SOCK_RGBA, 0, N_("Image")},
|
||||
{ -1, 0, "" }
|
||||
};
|
||||
|
|
|
@ -35,13 +35,13 @@
|
|||
|
||||
/* **************** Translate ******************** */
|
||||
|
||||
static bNodeSocketTemplate cmp_node_translate_in[]= {
|
||||
static bNodeSocketTemplate cmp_node_translate_in[] = {
|
||||
{ SOCK_RGBA, 1, N_("Image"), 1.0f, 1.0f, 1.0f, 1.0f},
|
||||
{ SOCK_FLOAT, 1, N_("X"), 0.0f, 0.0f, 0.0f, 0.0f, -10000.0f, 10000.0f, PROP_NONE},
|
||||
{ SOCK_FLOAT, 1, N_("Y"), 0.0f, 0.0f, 0.0f, 0.0f, -10000.0f, 10000.0f, PROP_NONE},
|
||||
{ -1, 0, "" }
|
||||
};
|
||||
static bNodeSocketTemplate cmp_node_translate_out[]= {
|
||||
static bNodeSocketTemplate cmp_node_translate_out[] = {
|
||||
{ SOCK_RGBA, 0, N_("Image")},
|
||||
{ -1, 0, "" }
|
||||
};
|
||||
|
|
|
@ -34,11 +34,11 @@
|
|||
|
||||
|
||||
/* **************** VALTORGB ******************** */
|
||||
static bNodeSocketTemplate cmp_node_valtorgb_in[]= {
|
||||
static bNodeSocketTemplate cmp_node_valtorgb_in[] = {
|
||||
{ SOCK_FLOAT, 1, N_("Fac"), 0.5f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, PROP_FACTOR},
|
||||
{ -1, 0, "" }
|
||||
};
|
||||
static bNodeSocketTemplate cmp_node_valtorgb_out[]= {
|
||||
static bNodeSocketTemplate cmp_node_valtorgb_out[] = {
|
||||
{ SOCK_RGBA, 0, N_("Image")},
|
||||
{ SOCK_FLOAT, 0, N_("Alpha")},
|
||||
{ -1, 0, "" }
|
||||
|
@ -106,11 +106,11 @@ void register_node_type_cmp_valtorgb(bNodeTreeType *ttype)
|
|||
|
||||
|
||||
/* **************** RGBTOBW ******************** */
|
||||
static bNodeSocketTemplate cmp_node_rgbtobw_in[]= {
|
||||
static bNodeSocketTemplate cmp_node_rgbtobw_in[] = {
|
||||
{ SOCK_RGBA, 1, N_("Image"), 0.8f, 0.8f, 0.8f, 1.0f, 0.0f, 1.0f},
|
||||
{ -1, 0, "" }
|
||||
};
|
||||
static bNodeSocketTemplate cmp_node_rgbtobw_out[]= {
|
||||
static bNodeSocketTemplate cmp_node_rgbtobw_out[] = {
|
||||
{ SOCK_FLOAT, 0, N_("Val"), 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f},
|
||||
{ -1, 0, "" }
|
||||
};
|
||||
|
|
|
@ -33,7 +33,7 @@
|
|||
#include "node_composite_util.h"
|
||||
|
||||
/* **************** VALUE ******************** */
|
||||
static bNodeSocketTemplate cmp_node_value_out[]= {
|
||||
static bNodeSocketTemplate cmp_node_value_out[] = {
|
||||
/* XXX value nodes use the output sockets for buttons, so we need explicit limits here! */
|
||||
{ SOCK_FLOAT, 0, N_("Value"), 0.0f, 0.0f, 0.0f, 0.0f, -FLT_MAX, FLT_MAX},
|
||||
{ -1, 0, "" }
|
||||
|
@ -56,7 +56,7 @@ static void node_composit_exec_value(void *UNUSED(data), bNode *node, bNodeStack
|
|||
bNodeSocket *sock= node->outputs.first;
|
||||
float val= ((bNodeSocketValueFloat*)sock->default_value)->value;
|
||||
|
||||
out[0]->vec[0]= val;
|
||||
out[0]->vec[0] = val;
|
||||
}
|
||||
|
||||
#endif /* WITH_COMPOSITOR_LEGACY */
|
||||
|
|
|
@ -35,14 +35,14 @@
|
|||
|
||||
/* **************** Z COMBINE ******************** */
|
||||
/* lazy coder note: node->custom2 is abused to send signal */
|
||||
static bNodeSocketTemplate cmp_node_zcombine_in[]= {
|
||||
static bNodeSocketTemplate cmp_node_zcombine_in[] = {
|
||||
{ SOCK_RGBA, 1, N_("Image"), 1.0f, 1.0f, 1.0f, 1.0f},
|
||||
{ SOCK_FLOAT, 1, N_("Z"), 1.0f, 1.0f, 1.0f, 1.0f, 0.0f, 10000.0f, PROP_NONE},
|
||||
{ SOCK_RGBA, 1, N_("Image"), 1.0f, 1.0f, 1.0f, 1.0f},
|
||||
{ SOCK_FLOAT, 1, N_("Z"), 1.0f, 1.0f, 1.0f, 1.0f, 0.0f, 10000.0f, PROP_NONE},
|
||||
{ -1, 0, "" }
|
||||
};
|
||||
static bNodeSocketTemplate cmp_node_zcombine_out[]= {
|
||||
static bNodeSocketTemplate cmp_node_zcombine_out[] = {
|
||||
{ SOCK_RGBA, 0, N_("Image")},
|
||||
{ SOCK_FLOAT, 0, N_("Z")},
|
||||
{ -1, 0, "" }
|
||||
|
@ -60,10 +60,10 @@ static void do_zcombine(bNode *node, float *out, float *src1, float *z1, float *
|
|||
// use alpha in combine operation
|
||||
alpha= src1[3];
|
||||
malpha= 1.0f - alpha;
|
||||
out[0]= malpha*src2[0] + alpha*src1[0];
|
||||
out[1]= malpha*src2[1] + alpha*src1[1];
|
||||
out[2]= malpha*src2[2] + alpha*src1[2];
|
||||
out[3]= malpha*src2[3] + alpha*src1[3];
|
||||
out[0] = malpha*src2[0] + alpha*src1[0];
|
||||
out[1] = malpha*src2[1] + alpha*src1[1];
|
||||
out[2] = malpha*src2[2] + alpha*src1[2];
|
||||
out[3] = malpha*src2[3] + alpha*src1[3];
|
||||
}
|
||||
else {
|
||||
// do combination based solely on z value
|
||||
|
@ -75,10 +75,10 @@ static void do_zcombine(bNode *node, float *out, float *src1, float *z1, float *
|
|||
// use alpha in combine operation
|
||||
alpha= src2[3];
|
||||
malpha= 1.0f - alpha;
|
||||
out[0]= malpha*src1[0] + alpha*src2[0];
|
||||
out[1]= malpha*src1[1] + alpha*src2[1];
|
||||
out[2]= malpha*src1[2] + alpha*src2[2];
|
||||
out[3]= malpha*src1[3] + alpha*src2[3];
|
||||
out[0] = malpha*src1[0] + alpha*src2[0];
|
||||
out[1] = malpha*src1[1] + alpha*src2[1];
|
||||
out[2] = malpha*src1[2] + alpha*src2[2];
|
||||
out[3] = malpha*src1[3] + alpha*src2[3];
|
||||
}
|
||||
else {
|
||||
// do combination based solely on z value
|
||||
|
@ -111,20 +111,20 @@ static void do_zcombine_add(bNode *node, float *out, float *col1, float *col2, f
|
|||
malpha= 1.0f - alpha;
|
||||
|
||||
|
||||
out[0]= malpha*col1[0] + alpha*col2[0];
|
||||
out[1]= malpha*col1[1] + alpha*col2[1];
|
||||
out[2]= malpha*col1[2] + alpha*col2[2];
|
||||
out[3]= malpha*col1[3] + alpha*col2[3];
|
||||
out[0] = malpha*col1[0] + alpha*col2[0];
|
||||
out[1] = malpha*col1[1] + alpha*col2[1];
|
||||
out[2] = malpha*col1[2] + alpha*col2[2];
|
||||
out[3] = malpha*col1[3] + alpha*col2[3];
|
||||
}
|
||||
else {
|
||||
alpha= col1[3];
|
||||
malpha= 1.0f - alpha;
|
||||
|
||||
|
||||
out[0]= malpha*col2[0] + alpha*col1[0];
|
||||
out[1]= malpha*col2[1] + alpha*col1[1];
|
||||
out[2]= malpha*col2[2] + alpha*col1[2];
|
||||
out[3]= malpha*col2[3] + alpha*col1[3];
|
||||
out[0] = malpha*col2[0] + alpha*col1[0];
|
||||
out[1] = malpha*col2[1] + alpha*col1[1];
|
||||
out[2] = malpha*col2[2] + alpha*col1[2];
|
||||
out[3] = malpha*col2[3] + alpha*col1[3];
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
@ -132,10 +132,10 @@ static void do_zcombine_add(bNode *node, float *out, float *col1, float *col2, f
|
|||
alpha = *acol;
|
||||
malpha= 1.0f - alpha;
|
||||
|
||||
out[0]= malpha*col1[0] + alpha*col2[0];
|
||||
out[1]= malpha*col1[1] + alpha*col2[1];
|
||||
out[2]= malpha*col1[2] + alpha*col2[2];
|
||||
out[3]= malpha*col1[3] + alpha*col2[3];
|
||||
out[0] = malpha*col1[0] + alpha*col2[0];
|
||||
out[1] = malpha*col1[1] + alpha*col2[1];
|
||||
out[2] = malpha*col1[2] + alpha*col2[2];
|
||||
out[3] = malpha*col1[3] + alpha*col2[3];
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -202,8 +202,8 @@ static void node_composit_exec_zcombine(void *data, bNode *node, bNodeStack **in
|
|||
aabuf= MEM_mallocN(cbuf->x*cbuf->y, "aa buf");
|
||||
fp= mbuf->rect;
|
||||
for (x= cbuf->x*cbuf->y-1; x>=0; x--)
|
||||
if (fp[x]==0.0f) aabuf[x]= 0;
|
||||
else aabuf[x]= 255;
|
||||
if (fp[x]==0.0f) aabuf[x] = 0;
|
||||
else aabuf[x] = 255;
|
||||
|
||||
antialias_tagbuf(cbuf->x, cbuf->y, aabuf);
|
||||
|
||||
|
@ -211,7 +211,7 @@ static void node_composit_exec_zcombine(void *data, bNode *node, bNodeStack **in
|
|||
fp= mbuf->rect;
|
||||
for (x= cbuf->x*cbuf->y-1; x>=0; x--)
|
||||
if (aabuf[x]>1)
|
||||
fp[x]= (1.0f/255.0f)*(float)aabuf[x];
|
||||
fp[x] = (1.0f/255.0f)*(float)aabuf[x];
|
||||
|
||||
composit3_pixel_processor(node, stackbuf, in[0]->data, in[0]->vec, in[2]->data, in[2]->vec, mbuf, NULL,
|
||||
do_zcombine_add, CB_RGBA, CB_RGBA, CB_VAL);
|
||||
|
|
|
@ -88,7 +88,7 @@ void node_init_output_index(bNodeSocket *sock, int *index)
|
|||
static struct bNodeStack *setup_stack(bNodeStack *stack, bNodeSocket *sock)
|
||||
{
|
||||
bNodeStack *ns = node_get_socket_stack(stack, sock);
|
||||
float null_value[4]= {0.0f, 0.0f, 0.0f, 0.0f};
|
||||
float null_value[4] = {0.0f, 0.0f, 0.0f, 0.0f};
|
||||
|
||||
/* don't mess with remote socket stacks, these are initialized by other nodes! */
|
||||
if (sock->link)
|
||||
|
|
|
@ -50,9 +50,9 @@ void nodestack_get_vec(float *in, short type_in, bNodeStack *ns)
|
|||
}
|
||||
else if (type_in==SOCK_VECTOR) {
|
||||
if (ns->sockettype==SOCK_FLOAT) {
|
||||
in[0]= from[0];
|
||||
in[1]= from[0];
|
||||
in[2]= from[0];
|
||||
in[0] = from[0];
|
||||
in[1] = from[0];
|
||||
in[2] = from[0];
|
||||
}
|
||||
else {
|
||||
copy_v3_v3(in, from);
|
||||
|
@ -63,14 +63,14 @@ void nodestack_get_vec(float *in, short type_in, bNodeStack *ns)
|
|||
copy_v4_v4(in, from);
|
||||
}
|
||||
else if (ns->sockettype==SOCK_FLOAT) {
|
||||
in[0]= from[0];
|
||||
in[1]= from[0];
|
||||
in[2]= from[0];
|
||||
in[3]= 1.0f;
|
||||
in[0] = from[0];
|
||||
in[1] = from[0];
|
||||
in[2] = from[0];
|
||||
in[3] = 1.0f;
|
||||
}
|
||||
else {
|
||||
copy_v3_v3(in, from);
|
||||
in[3]= 1.0f;
|
||||
in[3] = 1.0f;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -29,13 +29,13 @@
|
|||
|
||||
/* **************** OUTPUT ******************** */
|
||||
|
||||
static bNodeSocketTemplate sh_node_add_shader_in[]= {
|
||||
static bNodeSocketTemplate sh_node_add_shader_in[] = {
|
||||
{ SOCK_SHADER, 1, N_("Shader")},
|
||||
{ SOCK_SHADER, 1, N_("Shader")},
|
||||
{ -1, 0, "" }
|
||||
};
|
||||
|
||||
static bNodeSocketTemplate sh_node_add_shader_out[]= {
|
||||
static bNodeSocketTemplate sh_node_add_shader_out[] = {
|
||||
{ SOCK_SHADER, 0, N_("Shader")},
|
||||
{ -1, 0, "" }
|
||||
};
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
|
||||
/* **************** OUTPUT ******************** */
|
||||
|
||||
static bNodeSocketTemplate sh_node_attribute_out[]= {
|
||||
static bNodeSocketTemplate sh_node_attribute_out[] = {
|
||||
{ SOCK_RGBA, 0, N_("Color")},
|
||||
{ SOCK_VECTOR, 0, N_("Vector"), 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f},
|
||||
{ SOCK_FLOAT, 0, N_("Fac"), 0.0f, 0.0f, 0.0f, 0.0f, -FLT_MAX, FLT_MAX},
|
||||
|
|
|
@ -29,13 +29,13 @@
|
|||
|
||||
/* **************** OUTPUT ******************** */
|
||||
|
||||
static bNodeSocketTemplate sh_node_background_in[]= {
|
||||
static bNodeSocketTemplate sh_node_background_in[] = {
|
||||
{ SOCK_RGBA, 1, N_("Color"), 0.8f, 0.8f, 0.8f, 1.0f, 0.0f, 1.0f},
|
||||
{ SOCK_FLOAT, 1, N_("Strength"), 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1000000.0f},
|
||||
{ -1, 0, "" }
|
||||
};
|
||||
|
||||
static bNodeSocketTemplate sh_node_background_out[]= {
|
||||
static bNodeSocketTemplate sh_node_background_out[] = {
|
||||
{ SOCK_SHADER, 0, N_("Background")},
|
||||
{ -1, 0, "" }
|
||||
};
|
||||
|
|
|
@ -31,14 +31,14 @@
|
|||
|
||||
/* **************** Brigh and contrsast ******************** */
|
||||
|
||||
static bNodeSocketTemplate sh_node_brightcontrast_in[]= {
|
||||
static bNodeSocketTemplate sh_node_brightcontrast_in[] = {
|
||||
{ SOCK_RGBA, 1, N_("Color"), 1.0f, 1.0f, 1.0f, 1.0f},
|
||||
{ SOCK_FLOAT, 1, N_("Bright"), 0.0f, 0.0f, 0.0f, 0.0f, -100.0f, 100.0f, PROP_NONE},
|
||||
{ SOCK_FLOAT, 1, N_("Contrast"), 0.0f, 0.0f, 0.0f, 0.0f, -100.0f, 100.0f, PROP_NONE},
|
||||
{ -1, 0, "" }
|
||||
};
|
||||
|
||||
static bNodeSocketTemplate sh_node_brightcontrast_out[]= {
|
||||
static bNodeSocketTemplate sh_node_brightcontrast_out[] = {
|
||||
{ SOCK_RGBA, 0, N_("Color")},
|
||||
{ -1, 0, "" }
|
||||
};
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
|
||||
/* **************** OUTPUT ******************** */
|
||||
|
||||
static bNodeSocketTemplate sh_node_bsdf_anisotropic_in[]= {
|
||||
static bNodeSocketTemplate sh_node_bsdf_anisotropic_in[] = {
|
||||
{ SOCK_RGBA, 1, N_("Color"), 0.8f, 0.8f, 0.8f, 1.0f, 0.0f, 1.0f},
|
||||
{ SOCK_FLOAT, 1, N_("Roughness U"), 0.2f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f},
|
||||
{ SOCK_FLOAT, 1, N_("Roughness V"), 0.2f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f},
|
||||
|
@ -38,7 +38,7 @@ static bNodeSocketTemplate sh_node_bsdf_anisotropic_in[]= {
|
|||
{ -1, 0, "" }
|
||||
};
|
||||
|
||||
static bNodeSocketTemplate sh_node_bsdf_anisotropic_out[]= {
|
||||
static bNodeSocketTemplate sh_node_bsdf_anisotropic_out[] = {
|
||||
{ SOCK_SHADER, 0, N_("BSDF")},
|
||||
{ -1, 0, "" }
|
||||
};
|
||||
|
|
|
@ -29,14 +29,14 @@
|
|||
|
||||
/* **************** OUTPUT ******************** */
|
||||
|
||||
static bNodeSocketTemplate sh_node_bsdf_diffuse_in[]= {
|
||||
static bNodeSocketTemplate sh_node_bsdf_diffuse_in[] = {
|
||||
{ SOCK_RGBA, 1, N_("Color"), 0.8f, 0.8f, 0.8f, 1.0f, 0.0f, 1.0f},
|
||||
{ SOCK_FLOAT, 1, N_("Roughness"), 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f},
|
||||
{ SOCK_VECTOR, 1, N_("Normal"), 0.0f, 0.0f, 0.0f, 1.0f, -1.0f, 1.0f, PROP_NONE, SOCK_HIDE_VALUE},
|
||||
{ -1, 0, "" }
|
||||
};
|
||||
|
||||
static bNodeSocketTemplate sh_node_bsdf_diffuse_out[]= {
|
||||
static bNodeSocketTemplate sh_node_bsdf_diffuse_out[] = {
|
||||
{ SOCK_SHADER, 0, N_("BSDF")},
|
||||
{ -1, 0, "" }
|
||||
};
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
|
||||
/* **************** OUTPUT ******************** */
|
||||
|
||||
static bNodeSocketTemplate sh_node_bsdf_glass_in[]= {
|
||||
static bNodeSocketTemplate sh_node_bsdf_glass_in[] = {
|
||||
{ SOCK_RGBA, 1, N_("Color"), 0.8f, 0.8f, 0.8f, 1.0f, 0.0f, 1.0f},
|
||||
{ SOCK_FLOAT, 1, N_("Roughness"), 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f},
|
||||
{ SOCK_FLOAT, 1, N_("IOR"), 1.45f, 0.0f, 0.0f, 0.0f, 1.0f, 1000.0f},
|
||||
|
@ -37,7 +37,7 @@ static bNodeSocketTemplate sh_node_bsdf_glass_in[]= {
|
|||
{ -1, 0, "" }
|
||||
};
|
||||
|
||||
static bNodeSocketTemplate sh_node_bsdf_glass_out[]= {
|
||||
static bNodeSocketTemplate sh_node_bsdf_glass_out[] = {
|
||||
{ SOCK_SHADER, 0, N_("BSDF")},
|
||||
{ -1, 0, "" }
|
||||
};
|
||||
|
|
|
@ -29,14 +29,14 @@
|
|||
|
||||
/* **************** OUTPUT ******************** */
|
||||
|
||||
static bNodeSocketTemplate sh_node_bsdf_glossy_in[]= {
|
||||
static bNodeSocketTemplate sh_node_bsdf_glossy_in[] = {
|
||||
{ SOCK_RGBA, 1, N_("Color"), 0.8f, 0.8f, 0.8f, 1.0f, 0.0f, 1.0f},
|
||||
{ SOCK_FLOAT, 1, N_("Roughness"), 0.2f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f},
|
||||
{ SOCK_VECTOR, 1, N_("Normal"), 0.0f, 0.0f, 0.0f, 1.0f, -1.0f, 1.0f, PROP_NONE, SOCK_HIDE_VALUE},
|
||||
{ -1, 0, "" }
|
||||
};
|
||||
|
||||
static bNodeSocketTemplate sh_node_bsdf_glossy_out[]= {
|
||||
static bNodeSocketTemplate sh_node_bsdf_glossy_out[] = {
|
||||
{ SOCK_SHADER, 0, N_("BSDF")},
|
||||
{ -1, 0, "" }
|
||||
};
|
||||
|
|
|
@ -29,13 +29,13 @@
|
|||
|
||||
/* **************** OUTPUT ******************** */
|
||||
|
||||
static bNodeSocketTemplate sh_node_bsdf_translucent_in[]= {
|
||||
static bNodeSocketTemplate sh_node_bsdf_translucent_in[] = {
|
||||
{ SOCK_RGBA, 1, N_("Color"), 0.8f, 0.8f, 0.8f, 1.0f, 0.0f, 1.0f},
|
||||
{ SOCK_VECTOR, 1, N_("Normal"), 0.0f, 0.0f, 0.0f, 1.0f, -1.0f, 1.0f, PROP_NONE, SOCK_HIDE_VALUE},
|
||||
{ -1, 0, "" }
|
||||
};
|
||||
|
||||
static bNodeSocketTemplate sh_node_bsdf_translucent_out[]= {
|
||||
static bNodeSocketTemplate sh_node_bsdf_translucent_out[] = {
|
||||
{ SOCK_SHADER, 0, N_("BSDF")},
|
||||
{ -1, 0, "" }
|
||||
};
|
||||
|
|
|
@ -29,12 +29,12 @@
|
|||
|
||||
/* **************** OUTPUT ******************** */
|
||||
|
||||
static bNodeSocketTemplate sh_node_bsdf_transparent_in[]= {
|
||||
static bNodeSocketTemplate sh_node_bsdf_transparent_in[] = {
|
||||
{ SOCK_RGBA, 1, N_("Color"), 1.0f, 1.0f, 1.0f, 1.0f, 0.0f, 1.0f},
|
||||
{ -1, 0, "" }
|
||||
};
|
||||
|
||||
static bNodeSocketTemplate sh_node_bsdf_transparent_out[]= {
|
||||
static bNodeSocketTemplate sh_node_bsdf_transparent_out[] = {
|
||||
{ SOCK_SHADER, 0, N_("BSDF")},
|
||||
{ -1, 0, "" }
|
||||
};
|
||||
|
|
|
@ -29,14 +29,14 @@
|
|||
|
||||
/* **************** OUTPUT ******************** */
|
||||
|
||||
static bNodeSocketTemplate sh_node_bsdf_velvet_in[]= {
|
||||
static bNodeSocketTemplate sh_node_bsdf_velvet_in[] = {
|
||||
{ SOCK_RGBA, 1, N_("Color"), 0.8f, 0.8f, 0.8f, 1.0f, 0.0f, 1.0f},
|
||||
{ SOCK_FLOAT, 1, N_("Sigma"), 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f},
|
||||
{ SOCK_VECTOR, 1, N_("Normal"), 0.0f, 0.0f, 0.0f, 1.0f, -1.0f, 1.0f, PROP_NONE, SOCK_HIDE_VALUE},
|
||||
{ -1, 0, "" }
|
||||
};
|
||||
|
||||
static bNodeSocketTemplate sh_node_bsdf_velvet_out[]= {
|
||||
static bNodeSocketTemplate sh_node_bsdf_velvet_out[] = {
|
||||
{ SOCK_SHADER, 0, N_("BSDF")},
|
||||
{ -1, 0, "" }
|
||||
};
|
||||
|
|
|
@ -35,13 +35,13 @@
|
|||
|
||||
|
||||
/* **************** BUMP ******************** */
|
||||
static bNodeSocketTemplate sh_node_bump_in[]= {
|
||||
static bNodeSocketTemplate sh_node_bump_in[] = {
|
||||
{ SOCK_FLOAT, 1, "Strength", 0.1f, 0.0f, 0.0f, 0.0f, -1000.0f, 1000.0f},
|
||||
{ SOCK_FLOAT, 1, "Height", 1.0f, 1.0f, 1.0f, 1.0f, -1000.0f, 1000.0f, PROP_NONE, SOCK_HIDE_VALUE},
|
||||
{ -1, 0, "" }
|
||||
};
|
||||
|
||||
static bNodeSocketTemplate sh_node_bump_out[]= {
|
||||
static bNodeSocketTemplate sh_node_bump_out[] = {
|
||||
{ SOCK_VECTOR, 0, "Normal"},
|
||||
{ -1, 0, "" }
|
||||
};
|
||||
|
|
|
@ -33,7 +33,7 @@
|
|||
#include "node_shader_util.h"
|
||||
|
||||
/* **************** CAMERA INFO ******************** */
|
||||
static bNodeSocketTemplate sh_node_camera_out[]= {
|
||||
static bNodeSocketTemplate sh_node_camera_out[] = {
|
||||
{ SOCK_VECTOR, 0, N_("View Vector")},
|
||||
{ SOCK_FLOAT, 0, N_("View Z Depth")},
|
||||
{ SOCK_FLOAT, 0, N_("View Distance")},
|
||||
|
@ -47,8 +47,8 @@ static void node_shader_exec_camera(void *data, bNode *UNUSED(node), bNodeStack
|
|||
ShadeInput *shi= ((ShaderCallData *)data)->shi; /* Data we need for shading. */
|
||||
|
||||
copy_v3_v3(out[0]->vec, shi->co); /* get view vector */
|
||||
out[1]->vec[0]= fabs(shi->co[2]); /* get view z-depth */
|
||||
out[2]->vec[0]= normalize_v3(out[0]->vec); /* get view distance */
|
||||
out[1]->vec[0] = fabs(shi->co[2]); /* get view z-depth */
|
||||
out[2]->vec[0] = normalize_v3(out[0]->vec); /* get view distance */
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue