diff options
author | Martin Poirier <theeth@yahoo.com> | 2009-02-24 00:00:42 +0300 |
---|---|---|
committer | Martin Poirier <theeth@yahoo.com> | 2009-02-24 00:00:42 +0300 |
commit | 7c830b75f160db4de8c415dcf1c0b3bf554a4821 (patch) | |
tree | 4892c025ae6bffdb20fb81213ba57f538a4b2e53 /source/blender/blenkernel | |
parent | e25318ebefb4dd34443430ab0b7408d3a6118b3d (diff) | |
parent | 334da0fa57195af65c2877ee2882714efe5431f9 (diff) |
merging trunk 17520:19093
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r-- | source/blender/blenkernel/BKE_brush.h | 1 | ||||
-rw-r--r-- | source/blender/blenkernel/BKE_customdata.h | 8 | ||||
-rw-r--r-- | source/blender/blenkernel/BKE_global.h | 1 | ||||
-rw-r--r-- | source/blender/blenkernel/BKE_node.h | 6 | ||||
-rw-r--r-- | source/blender/blenkernel/CMakeLists.txt | 2 | ||||
-rw-r--r-- | source/blender/blenkernel/SConscript | 6 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/brush.c | 17 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/collision.c | 2 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/constraint.c | 14 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/curve.c | 2 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/customdata.c | 90 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/displist.c | 3 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/effect.c | 2 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/image.c | 36 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/modifier.c | 17 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/node.c | 16 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/particle_system.c | 8 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/softbody.c | 6 |
18 files changed, 198 insertions, 39 deletions
diff --git a/source/blender/blenkernel/BKE_brush.h b/source/blender/blenkernel/BKE_brush.h index f1f4653f092..398d203709f 100644 --- a/source/blender/blenkernel/BKE_brush.h +++ b/source/blender/blenkernel/BKE_brush.h @@ -53,6 +53,7 @@ int brush_clone_image_delete(struct Brush *brush); /* sampling */ float brush_sample_falloff(struct Brush *brush, float dist); +float brush_sample_falloff_noalpha(struct Brush *brush, float dist); void brush_sample_tex(struct Brush *brush, float *xy, float *rgba); void brush_imbuf_new(struct Brush *brush, short flt, short texfalloff, int size, struct ImBuf **imbuf); diff --git a/source/blender/blenkernel/BKE_customdata.h b/source/blender/blenkernel/BKE_customdata.h index c84b690bc49..10791968f79 100644 --- a/source/blender/blenkernel/BKE_customdata.h +++ b/source/blender/blenkernel/BKE_customdata.h @@ -198,8 +198,12 @@ int CustomData_get_layer_index(const struct CustomData *data, int type); int CustomData_get_named_layer_index(const struct CustomData *data, int type, char *name); int CustomData_get_active_layer_index(const struct CustomData *data, int type); int CustomData_get_render_layer_index(const struct CustomData *data, int type); +int CustomData_get_clone_layer_index(const struct CustomData *data, int type); +int CustomData_get_mask_layer_index(const struct CustomData *data, int type); int CustomData_get_active_layer(const struct CustomData *data, int type); int CustomData_get_render_layer(const struct CustomData *data, int type); +int CustomData_get_clone_layer(const struct CustomData *data, int type); +int CustomData_get_mask_layer(const struct CustomData *data, int type); /* copies the data from source to the data element at index in the first * layer of type @@ -227,10 +231,14 @@ void *CustomData_set_layer_n(const struct CustomData *data, int type, int n, voi /* sets the nth layer of type as active */ void CustomData_set_layer_active(struct CustomData *data, int type, int n); void CustomData_set_layer_render(struct CustomData *data, int type, int n); +void CustomData_set_layer_clone(struct CustomData *data, int type, int n); +void CustomData_set_layer_mask(struct CustomData *data, int type, int n); /* same as above but works with an index from CustomData_get_layer_index */ void CustomData_set_layer_active_index(struct CustomData *data, int type, int n); void CustomData_set_layer_render_index(struct CustomData *data, int type, int n); +void CustomData_set_layer_clone_index(struct CustomData *data, int type, int n); +void CustomData_set_layer_mask_index(struct CustomData *data, int type, int n); /* adds flag to the layer flags */ void CustomData_set_layer_flag(struct CustomData *data, int type, int flag); diff --git a/source/blender/blenkernel/BKE_global.h b/source/blender/blenkernel/BKE_global.h index bb474d3f8c8..eb89e1699ea 100644 --- a/source/blender/blenkernel/BKE_global.h +++ b/source/blender/blenkernel/BKE_global.h @@ -226,6 +226,7 @@ typedef struct Global { #define G_FILE_GLSL_NO_RAMPS (1 << 19) #define G_FILE_GLSL_NO_NODES (1 << 20) #define G_FILE_GLSL_NO_EXTRA_TEX (1 << 21) +#define G_FILE_IGNORE_DEPRECATION_WARNINGS (1 << 22) /* G.windowstate */ #define G_WINDOWSTATE_USERDEF 0 diff --git a/source/blender/blenkernel/BKE_node.h b/source/blender/blenkernel/BKE_node.h index fa3a654c1c2..3f04330f2a3 100644 --- a/source/blender/blenkernel/BKE_node.h +++ b/source/blender/blenkernel/BKE_node.h @@ -401,6 +401,12 @@ struct TexResult; #define TEX_NODE_ROTATE 114 #define TEX_NODE_VIEWER 115 #define TEX_NODE_TRANSLATE 116 +#define TEX_NODE_COORD 117 +#define TEX_NODE_DISTANCE 118 +#define TEX_NODE_COMPOSE 119 +#define TEX_NODE_DECOMPOSE 120 +#define TEX_NODE_VALTONOR 121 +#define TEX_NODE_SCALE 122 /* 201-299 reserved. Use like this: TEX_NODE_PROC + TEX_CLOUDS, etc */ #define TEX_NODE_PROC 200 diff --git a/source/blender/blenkernel/CMakeLists.txt b/source/blender/blenkernel/CMakeLists.txt index 0ed4f38e457..04ca5c79a11 100644 --- a/source/blender/blenkernel/CMakeLists.txt +++ b/source/blender/blenkernel/CMakeLists.txt @@ -65,8 +65,6 @@ IF(WITH_PLAYER) SUBDIRS(bad_level_call_stubs) ENDIF(WITH_PLAYER) -ADD_DEFINITIONS(-DWITH_CCGSUBSURF) - BLENDERLIB(bf_blenkernel "${SRC}" "${INC}") IF(WITH_VERSE) diff --git a/source/blender/blenkernel/SConscript b/source/blender/blenkernel/SConscript index ab122e40bfc..fb67c855b81 100644 --- a/source/blender/blenkernel/SConscript +++ b/source/blender/blenkernel/SConscript @@ -42,6 +42,9 @@ if env['WITH_BF_VERSE']: if env['WITH_BF_OPENEXR']: defs += ' WITH_OPENEXR' +if env['WITH_BF_OPENJPEG']: + defs += ' WITH_OPENJPEG' + if env['WITH_BF_DDS']: defs += ' WITH_DDS' @@ -53,6 +56,9 @@ if env['WITH_BF_QUICKTIME']: defs += ' WITH_QUICKTIME' incs += ' ' + env['BF_QUICKTIME_INC'] +if env['WITH_BF_BULLET']: + defs += ' WITH_BULLET' + if env['BF_NO_ELBEEM']: defs += ' DISABLE_ELBEEM' diff --git a/source/blender/blenkernel/intern/brush.c b/source/blender/blenkernel/intern/brush.c index 1c53af97dbb..021f76fd2f1 100644 --- a/source/blender/blenkernel/intern/brush.c +++ b/source/blender/blenkernel/intern/brush.c @@ -328,6 +328,23 @@ float brush_sample_falloff(Brush *brush, float dist) return 0.0f; } +float brush_sample_falloff_noalpha(Brush *brush, float dist) +{ + float outer, inner; + + outer = brush->size >> 1; + inner = outer*brush->innerradius; + + if (dist <= inner) { + return 1.0f; + } + else if ((dist < outer) && (inner < outer)) { + return 1.0f - sqrt((dist - inner)/(outer - inner)); + } + else + return 0.0f; +} + void brush_sample_tex(Brush *brush, float *xy, float *rgba) { MTex *mtex= brush->mtex[brush->texact]; diff --git a/source/blender/blenkernel/intern/collision.c b/source/blender/blenkernel/intern/collision.c index 775f1dee241..0b5465ea25d 100644 --- a/source/blender/blenkernel/intern/collision.c +++ b/source/blender/blenkernel/intern/collision.c @@ -1236,7 +1236,7 @@ int cloth_collision_moving_edges ( ClothModifierData *clmd, CollisionModifierDat if(out_normalVelocity < 0.0) { out_normalVelocity*= -1.0; - VecMulf(out_normal, -1.0); + VecNegf(out_normal); } */ /* Inelastic repulsion impulse. */ diff --git a/source/blender/blenkernel/intern/constraint.c b/source/blender/blenkernel/intern/constraint.c index 5639f00ee39..b668a1f214d 100644 --- a/source/blender/blenkernel/intern/constraint.c +++ b/source/blender/blenkernel/intern/constraint.c @@ -1044,7 +1044,7 @@ static void vectomat (float *vec, float *target_up, short axis, short upflag, sh n[2] = 1.0; } if (axis > 2) axis -= 3; - else VecMulf(n,-1); + else VecNegf(n); /* n specifies the transformation of the track axis */ if (flags & TARGET_Z_UP) { @@ -2182,7 +2182,7 @@ static void locktrack_evaluate (bConstraint *con, bConstraintOb *cob, ListBase * Projf(vec2, vec, cob->matrix[0]); VecSubf(totmat[1], vec, vec2); Normalize(totmat[1]); - VecMulf(totmat[1],-1); + VecNegf(totmat[1]); /* the x axis is fixed */ totmat[0][0] = cob->matrix[0][0]; @@ -2200,7 +2200,7 @@ static void locktrack_evaluate (bConstraint *con, bConstraintOb *cob, ListBase * Projf(vec2, vec, cob->matrix[0]); VecSubf(totmat[2], vec, vec2); Normalize(totmat[2]); - VecMulf(totmat[2],-1); + VecNegf(totmat[2]); /* the x axis is fixed */ totmat[0][0] = cob->matrix[0][0]; @@ -2265,7 +2265,7 @@ static void locktrack_evaluate (bConstraint *con, bConstraintOb *cob, ListBase * Projf(vec2, vec, cob->matrix[1]); VecSubf(totmat[0], vec, vec2); Normalize(totmat[0]); - VecMulf(totmat[0],-1); + VecNegf(totmat[0]); /* the y axis is fixed */ totmat[1][0] = cob->matrix[1][0]; @@ -2283,7 +2283,7 @@ static void locktrack_evaluate (bConstraint *con, bConstraintOb *cob, ListBase * Projf(vec2, vec, cob->matrix[1]); VecSubf(totmat[2], vec, vec2); Normalize(totmat[2]); - VecMulf(totmat[2],-1); + VecNegf(totmat[2]); /* the y axis is fixed */ totmat[1][0] = cob->matrix[1][0]; @@ -2348,7 +2348,7 @@ static void locktrack_evaluate (bConstraint *con, bConstraintOb *cob, ListBase * Projf(vec2, vec, cob->matrix[2]); VecSubf(totmat[0], vec, vec2); Normalize(totmat[0]); - VecMulf(totmat[0],-1); + VecNegf(totmat[0]); /* the z axis is fixed */ totmat[2][0] = cob->matrix[2][0]; @@ -2366,7 +2366,7 @@ static void locktrack_evaluate (bConstraint *con, bConstraintOb *cob, ListBase * Projf(vec2, vec, cob->matrix[2]); VecSubf(totmat[1], vec, vec2); Normalize(totmat[1]); - VecMulf(totmat[1],-1); + VecNegf(totmat[1]); /* the z axis is fixed */ totmat[2][0] = cob->matrix[2][0]; diff --git a/source/blender/blenkernel/intern/curve.c b/source/blender/blenkernel/intern/curve.c index 1a671dfe771..7fa4f406c7b 100644 --- a/source/blender/blenkernel/intern/curve.c +++ b/source/blender/blenkernel/intern/curve.c @@ -833,7 +833,6 @@ void makeNurbcurve(Nurb *nu, float *coord_array, float *tilt_array, float *radiu sum= (float *)MEM_callocN(sizeof(float)*len, "makeNurbcurve1"); resolu= (resolu*SEGMENTSU(nu)); - if((nu->flagu & CU_CYCLIC)==0) resolu++; if(resolu==0) { MEM_freeN(sum); @@ -1685,7 +1684,6 @@ void makeBevelList(Object *ob) else if((nu->type & 7)==CU_NURBS) { if(nu->pntsv==1) { len= (resolu*SEGMENTSU(nu)); - if((nu->flagu & CU_CYCLIC)==0) len++; bl= MEM_callocN(sizeof(BevList)+len*sizeof(BevPoint), "makeBevelList3"); BLI_addtail(&(cu->bev), bl); diff --git a/source/blender/blenkernel/intern/customdata.c b/source/blender/blenkernel/intern/customdata.c index e93266c85f3..05271aa59a7 100644 --- a/source/blender/blenkernel/intern/customdata.c +++ b/source/blender/blenkernel/intern/customdata.c @@ -606,7 +606,7 @@ void CustomData_merge(const struct CustomData *source, struct CustomData *dest, { const LayerTypeInfo *typeInfo; CustomDataLayer *layer, *newlayer; - int i, type, number = 0, lasttype = -1, lastactive = 0, lastrender = 0; + int i, type, number = 0, lasttype = -1, lastactive = 0, lastrender = 0, lastclone = 0, lastmask = 0; for(i = 0; i < source->totlayer; ++i) { layer = &source->layers[i]; @@ -618,6 +618,8 @@ void CustomData_merge(const struct CustomData *source, struct CustomData *dest, number = 0; lastactive = layer->active; lastrender = layer->active_rnd; + lastclone = layer->active_clone; + lastmask = layer->active_mask; lasttype = type; } else @@ -637,6 +639,8 @@ void CustomData_merge(const struct CustomData *source, struct CustomData *dest, if(newlayer) { newlayer->active = lastactive; newlayer->active_rnd = lastrender; + newlayer->active_clone = lastclone; + newlayer->active_mask = lastmask; } } } @@ -736,6 +740,28 @@ int CustomData_get_render_layer_index(const CustomData *data, int type) return -1; } +int CustomData_get_clone_layer_index(const CustomData *data, int type) +{ + int i; + + for(i=0; i < data->totlayer; ++i) + if(data->layers[i].type == type) + return i + data->layers[i].active_clone; + + return -1; +} + +int CustomData_get_mask_layer_index(const CustomData *data, int type) +{ + int i; + + for(i=0; i < data->totlayer; ++i) + if(data->layers[i].type == type) + return i + data->layers[i].active_mask; + + return -1; +} + int CustomData_get_active_layer(const CustomData *data, int type) { int i; @@ -758,6 +784,27 @@ int CustomData_get_render_layer(const CustomData *data, int type) return -1; } +int CustomData_get_clone_layer(const CustomData *data, int type) +{ + int i; + + for(i=0; i < data->totlayer; ++i) + if(data->layers[i].type == type) + return data->layers[i].active_clone; + + return -1; +} + +int CustomData_get_mask_layer(const CustomData *data, int type) +{ + int i; + + for(i=0; i < data->totlayer; ++i) + if(data->layers[i].type == type) + return data->layers[i].active_mask; + + return -1; +} void CustomData_set_layer_active(CustomData *data, int type, int n) { @@ -777,6 +824,24 @@ void CustomData_set_layer_render(CustomData *data, int type, int n) data->layers[i].active_rnd = n; } +void CustomData_set_layer_clone(CustomData *data, int type, int n) +{ + int i; + + for(i=0; i < data->totlayer; ++i) + if(data->layers[i].type == type) + data->layers[i].active_clone = n; +} + +void CustomData_set_layer_mask(CustomData *data, int type, int n) +{ + int i; + + for(i=0; i < data->totlayer; ++i) + if(data->layers[i].type == type) + data->layers[i].active_mask = n; +} + /* for using with an index from CustomData_get_active_layer_index and CustomData_get_render_layer_index */ void CustomData_set_layer_active_index(CustomData *data, int type, int n) { @@ -796,6 +861,23 @@ void CustomData_set_layer_render_index(CustomData *data, int type, int n) data->layers[i].active_rnd = n-i; } +void CustomData_set_layer_clone_index(CustomData *data, int type, int n) +{ + int i; + + for(i=0; i < data->totlayer; ++i) + if(data->layers[i].type == type) + data->layers[i].active_clone = n-i; +} + +void CustomData_set_layer_mask_index(CustomData *data, int type, int n) +{ + int i; + + for(i=0; i < data->totlayer; ++i) + if(data->layers[i].type == type) + data->layers[i].active_mask = n-i; +} void CustomData_set_layer_flag(struct CustomData *data, int type, int flag) { @@ -882,9 +964,13 @@ static CustomDataLayer *customData_add_layer__internal(CustomData *data, if(index > 0 && data->layers[index-1].type == type) { data->layers[index].active = data->layers[index-1].active; data->layers[index].active_rnd = data->layers[index-1].active_rnd; + data->layers[index].active_clone = data->layers[index-1].active_clone; + data->layers[index].active_mask = data->layers[index-1].active_mask; } else { data->layers[index].active = 0; data->layers[index].active_rnd = 0; + data->layers[index].active_clone = 0; + data->layers[index].active_mask = 0; } customData_update_offsets(data); @@ -944,6 +1030,8 @@ int CustomData_free_layer(CustomData *data, int type, int totelem, int index) for (; i < data->totlayer && data->layers[i].type == type; i++) { data->layers[i].active--; data->layers[i].active_rnd--; + data->layers[i].active_clone--; + data->layers[i].active_mask--; } } diff --git a/source/blender/blenkernel/intern/displist.c b/source/blender/blenkernel/intern/displist.c index 35097c05358..7716d71225e 100644 --- a/source/blender/blenkernel/intern/displist.c +++ b/source/blender/blenkernel/intern/displist.c @@ -887,7 +887,6 @@ static void curve_to_displist(Curve *cu, ListBase *nubase, ListBase *dispbase) } else if((nu->type & 7)==CU_NURBS) { len= (resolu*SEGMENTSU(nu)); - if((nu->flagu & CU_CYCLIC)==0) len++; dl= MEM_callocN(sizeof(DispList), "makeDispListsurf"); dl->verts= MEM_callocN(len*3*sizeof(float), "dlverts"); @@ -1381,7 +1380,7 @@ void makeDispListSurf(Object *ob, ListBase *dispbase, int forRender) for (nu=nubase->first; nu; nu=nu->next) { if(forRender || nu->hide==0) { if(nu->pntsv==1) { - len= nu->pntsu*nu->resolu; + len= SEGMENTSU(nu)*nu->resolu; dl= MEM_callocN(sizeof(DispList), "makeDispListsurf"); dl->verts= MEM_callocN(len*3*sizeof(float), "dlverts"); diff --git a/source/blender/blenkernel/intern/effect.c b/source/blender/blenkernel/intern/effect.c index 122c6c71a6c..0338ec92414 100644 --- a/source/blender/blenkernel/intern/effect.c +++ b/source/blender/blenkernel/intern/effect.c @@ -251,7 +251,7 @@ static float eff_calc_visibility(Object *ob, float *co, float *dir) return 0; VECCOPY(norm, dir); - VecMulf(norm, -1.0); + VecNegf(norm); len = Normalize(norm); // check all collision objects diff --git a/source/blender/blenkernel/intern/image.c b/source/blender/blenkernel/intern/image.c index d5166fc7a83..e817c38618f 100644 --- a/source/blender/blenkernel/intern/image.c +++ b/source/blender/blenkernel/intern/image.c @@ -767,6 +767,10 @@ int BKE_imtype_to_ftype(int imtype) return RAWTGA; else if(imtype==R_HAMX) return AN_hamx; +#ifdef WITH_OPENJPEG + else if(imtype==R_JP2) + return JP2; +#endif else return JPG|90; } @@ -801,6 +805,10 @@ int BKE_ftype_to_imtype(int ftype) return R_RAWTGA; else if(ftype == AN_hamx) return R_HAMX; +#ifdef WITH_OPENJPEG + else if(ftype & JP2) + return R_JP2; +#endif else return R_JPEG90; } @@ -877,6 +885,12 @@ void BKE_add_image_extension(char *string, int imtype) if(!BLI_testextensie(string, ".tga")) extension= ".tga"; } +#ifdef WITH_OPENJPEG + else if(imtype==R_JP2) { + if(!BLI_testextensie(string, ".jp2")) + extension= ".jp2"; + } +#endif else { // R_MOVIE, R_AVICODEC, R_AVIRAW, R_AVIJPEG, R_JPEG90, R_QUICKTIME etc if(!( BLI_testextensie(string, ".jpg") || BLI_testextensie(string, ".jpeg"))) extension= ".jpg"; @@ -1220,6 +1234,28 @@ int BKE_write_ibuf(ImBuf *ibuf, char *name, int imtype, int subimtype, int quali else if(imtype==R_HAMX) { ibuf->ftype= AN_hamx; } +#ifdef WITH_OPENJPEG + else if(imtype==R_JP2) { + if(quality < 10) quality= 90; + ibuf->ftype= JP2|quality; + + if (subimtype & R_JPEG2K_16BIT) { + ibuf->ftype |= JP2_16BIT; + } else if (subimtype & R_JPEG2K_12BIT) { + ibuf->ftype |= JP2_12BIT; + } + + if (subimtype & R_JPEG2K_YCC) { + ibuf->ftype |= JP2_YCC; + } + + if (subimtype & R_JPEG2K_CINE_PRESET) { + ibuf->ftype |= JP2_CINE; + if (subimtype & R_JPEG2K_CINE_48FPS) + ibuf->ftype |= JP2_CINE_48FPS; + } + } +#endif else { /* R_JPEG90, R_MOVIE, etc. default we save jpegs */ if(quality < 10) quality= 90; diff --git a/source/blender/blenkernel/intern/modifier.c b/source/blender/blenkernel/intern/modifier.c index 6bdd395a2ac..566a139f72c 100644 --- a/source/blender/blenkernel/intern/modifier.c +++ b/source/blender/blenkernel/intern/modifier.c @@ -6380,20 +6380,11 @@ static DerivedMesh * particleInstanceModifier_applyModifier( psys->lattice=psys_get_lattice(ob, psys); if(psys->flag & (PSYS_HAIR_DONE|PSYS_KEYED)){ - float co[3]; - for(i=0; i< totvert; i++){ - dm->getVertCo(dm,i,co); - if(i==0){ - min_co=max_co=co[track]; - } - else{ - if(co[track]<min_co) - min_co=co[track]; - if(co[track]>max_co) - max_co=co[track]; - } - } + float min_r[3], max_r[3]; + dm->getMinMax(dm, min_r, max_r); + min_co=min_r[track]; + max_co=max_r[track]; } result = CDDM_from_template(dm, maxvert,dm->getNumEdges(dm)*totpart,maxface); diff --git a/source/blender/blenkernel/intern/node.c b/source/blender/blenkernel/intern/node.c index ae81a31c373..9a78f8ea02a 100644 --- a/source/blender/blenkernel/intern/node.c +++ b/source/blender/blenkernel/intern/node.c @@ -1999,19 +1999,23 @@ static bNodeThreadStack *ntreeGetThreadStack(bNodeTree *ntree, int thread) { ListBase *lb= &ntree->threadstack[thread]; bNodeThreadStack *nts; - + + /* for material shading this is called quite a lot (perhaps too much locking unlocking) + * however without locking we get bug #18058 - Campbell */ + BLI_lock_thread(LOCK_CUSTOM1); + for(nts=lb->first; nts; nts=nts->next) { if(!nts->used) { nts->used= 1; + BLI_unlock_thread(LOCK_CUSTOM1); return nts; } } - nts= MEM_callocN(sizeof(bNodeThreadStack), "bNodeThreadStack"); nts->stack= MEM_dupallocN(ntree->stack); nts->used= 1; BLI_addtail(lb, nts); - + BLI_unlock_thread(LOCK_CUSTOM1); return nts; } @@ -2882,10 +2886,15 @@ static void registerTextureNodes(ListBase *ntypelist) nodeRegisterType(ntypelist, &tex_node_mix_rgb); nodeRegisterType(ntypelist, &tex_node_valtorgb); nodeRegisterType(ntypelist, &tex_node_rgbtobw); + nodeRegisterType(ntypelist, &tex_node_valtonor); nodeRegisterType(ntypelist, &tex_node_curve_rgb); nodeRegisterType(ntypelist, &tex_node_curve_time); nodeRegisterType(ntypelist, &tex_node_invert); nodeRegisterType(ntypelist, &tex_node_hue_sat); + nodeRegisterType(ntypelist, &tex_node_coord); + nodeRegisterType(ntypelist, &tex_node_distance); + nodeRegisterType(ntypelist, &tex_node_compose); + nodeRegisterType(ntypelist, &tex_node_decompose); nodeRegisterType(ntypelist, &tex_node_output); nodeRegisterType(ntypelist, &tex_node_viewer); @@ -2897,6 +2906,7 @@ static void registerTextureNodes(ListBase *ntypelist) nodeRegisterType(ntypelist, &tex_node_rotate); nodeRegisterType(ntypelist, &tex_node_translate); + nodeRegisterType(ntypelist, &tex_node_scale); nodeRegisterType(ntypelist, &tex_node_proc_voronoi); nodeRegisterType(ntypelist, &tex_node_proc_blend); diff --git a/source/blender/blenkernel/intern/particle_system.c b/source/blender/blenkernel/intern/particle_system.c index 39226faff1e..8a964c5b32e 100644 --- a/source/blender/blenkernel/intern/particle_system.c +++ b/source/blender/blenkernel/intern/particle_system.c @@ -831,7 +831,7 @@ void psys_thread_distribute_particle(ParticleThread *thread, ParticleData *pa, C VecCopyf(tan,seam->tan); VecSubf(temp2,co1,temp); if(Inpf(tan,temp2)<0.0f) - VecMulf(tan,-1.0f); + VecNegf(tan); } for(w=0; w<maxw; w++){ VecSubf(temp2,ptn[w].co,temp); @@ -1877,7 +1877,7 @@ void reset_particle(ParticleData *pa, ParticleSystem *psys, ParticleSystemModifi } /* create rotation quat */ - VecMulf(rot_vec,-1.0); + VecNegf(rot_vec); vectoquat(rot_vec, OB_POSX, OB_POSZ, q2); /* randomize rotation quat */ @@ -3022,7 +3022,7 @@ static void particle_intersect_face(void *userdata, int index, const BVHTreeRay CalcNormFloat(t0, t1, t2, col->nor); VECSUB(temp, co2, co1); if(Inpf(col->nor, temp) > 0.0f) - VecMulf(col->nor, -1.0f); + VecNegf(col->nor); VECCOPY(col->vel,vel); @@ -3802,7 +3802,7 @@ static void boid_body(BoidVecFunc *bvf, ParticleData *pa, ParticleSystem *psys, VecRotToQuat(pa->state.vel,bank,q); VECCOPY(dvec,pa->state.vel); - VecMulf(dvec,-1.0f); + VecNegf(dvec); vectoquat(dvec, OB_POSX, OB_POSZ, q2); QuatMul(pa->state.rot,q,q2); diff --git a/source/blender/blenkernel/intern/softbody.c b/source/blender/blenkernel/intern/softbody.c index 5d93f10526a..f63f6edf4b3 100644 --- a/source/blender/blenkernel/intern/softbody.c +++ b/source/blender/blenkernel/intern/softbody.c @@ -1562,7 +1562,7 @@ static void _scan_for_ext_spring_forces(Object *ob,float timenow,int ifirst,int /* note we don't use sb->mediafrict but use sb->aeroedge for magnitude of effect*/ if(sb->aeroedge){ float vel[3],sp[3],pr[3],force[3]; - float f,windfactor = 250.0f; + float f,windfactor = 0.25f; /*see if we have wind*/ if(do_effector) { float speed[3]={0.0f,0.0f,0.0f}; @@ -2392,7 +2392,7 @@ static void softbody_calc_forcesEx(Object *ob, float forcetime, float timenow, i BodyPoint *bproot; ListBase *do_effector; float iks, gravity; - float fieldfactor = 1000.0f, windfactor = 250.0f; + float fieldfactor = -1.0f, windfactor = 0.25; int do_deflector,do_selfcollision,do_springcollision,do_aero; gravity = sb->grav * sb_grav_force_scale(ob); @@ -2454,7 +2454,7 @@ static void softbody_calc_forces(Object *ob, float forcetime, float timenow, int BodySpring *bs; ListBase *do_effector; float iks, ks, kd, gravity; - float fieldfactor = 1000.0f, windfactor = 250.0f; + float fieldfactor = -1.0f, windfactor = 0.25f; float tune = sb->ballstiff; int a, b, do_deflector,do_selfcollision,do_springcollision,do_aero; |