Revision: 23589 http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=23589 Author: blendix Date: 2009-10-01 19:15:23 +0200 (Thu, 01 Oct 2009)
Log Message: ----------- Texture stack influences are now all separate values, and negative mapped values now have their influence negated instead. Also a few RNA changes for TextureSlot. Bumped subversion for the version patch. Modified Paths: -------------- trunk/blender/release/scripts/ui/buttons_texture.py trunk/blender/source/blender/blenkernel/BKE_blender.h trunk/blender/source/blender/blenkernel/intern/particle.c trunk/blender/source/blender/blenkernel/intern/particle_system.c trunk/blender/source/blender/blenkernel/intern/texture.c trunk/blender/source/blender/blenloader/intern/readfile.c trunk/blender/source/blender/gpu/intern/gpu_material.c trunk/blender/source/blender/gpu/intern/gpu_shader_material.glsl trunk/blender/source/blender/makesdna/DNA_material_types.h trunk/blender/source/blender/makesdna/DNA_texture_types.h trunk/blender/source/blender/makesrna/intern/rna_brush.c trunk/blender/source/blender/makesrna/intern/rna_internal.h trunk/blender/source/blender/makesrna/intern/rna_lamp.c trunk/blender/source/blender/makesrna/intern/rna_material.c trunk/blender/source/blender/makesrna/intern/rna_texture.c trunk/blender/source/blender/makesrna/intern/rna_world.c trunk/blender/source/blender/render/extern/include/RE_render_ext.h trunk/blender/source/blender/render/extern/include/RE_shader_ext.h trunk/blender/source/blender/render/intern/source/renderdatabase.c trunk/blender/source/blender/render/intern/source/texture.c Modified: trunk/blender/release/scripts/ui/buttons_texture.py =================================================================== --- trunk/blender/release/scripts/ui/buttons_texture.py 2009-10-01 16:37:08 UTC (rev 23588) +++ trunk/blender/release/scripts/ui/buttons_texture.py 2009-10-01 17:15:23 UTC (rev 23589) @@ -175,14 +175,14 @@ row.itemR(tex, "z_mapping", text="") if br: - layout.itemR(tex, "brush_map_mode", expand=True) + layout.itemR(tex, "map_mode", expand=True) row = layout.row() - row.active = tex.brush_map_mode in ('FIXED', 'TILED') + row.active = tex.map_mode in ('FIXED', 'TILED') row.itemR(tex, "angle") row = layout.row() - row.active = tex.brush_map_mode in ('TILED', '3D') + row.active = tex.map_mode in ('TILED', '3D') row.column().itemR(tex, "size") else: row = layout.row() Modified: trunk/blender/source/blender/blenkernel/BKE_blender.h =================================================================== --- trunk/blender/source/blender/blenkernel/BKE_blender.h 2009-10-01 16:37:08 UTC (rev 23588) +++ trunk/blender/source/blender/blenkernel/BKE_blender.h 2009-10-01 17:15:23 UTC (rev 23589) @@ -43,7 +43,7 @@ struct ReportList; #define BLENDER_VERSION 250 -#define BLENDER_SUBVERSION 3 +#define BLENDER_SUBVERSION 4 #define BLENDER_MINVERSION 250 #define BLENDER_MINSUBVERSION 0 Modified: trunk/blender/source/blender/blenkernel/intern/particle.c =================================================================== --- trunk/blender/source/blender/blenkernel/intern/particle.c 2009-10-01 16:37:08 UTC (rev 23588) +++ trunk/blender/source/blender/blenkernel/intern/particle.c 2009-10-01 17:15:23 UTC (rev 23589) @@ -2057,7 +2057,7 @@ } static void do_path_effectors(ParticleSimulationData *sim, int i, ParticleCacheKey *ca, int k, int steps, float *rootco, float effector, float dfra, float cfra, float *length, float *vec) { - float force[3] = {0.0f,0.0f,0.0f}, vel[3] = {0.0f,0.0f,0.0f}; + float force[3] = {0.0f,0.0f,0.0f}; ParticleKey eff_key; EffectedPoint epoint; @@ -3410,9 +3410,7 @@ mtex=ma->mtex[m]; if(mtex && (ma->septex & (1<<m))==0 && mtex->pmapto){ float def=mtex->def_var; - float var=mtex->varfac; short blend=mtex->blendtype; - short neg=mtex->pmaptoneg; if((mtex->texco & TEXCO_UV) && fw) { if(!get_particle_uv(dm, NULL, face_index, fw, mtex->uvname, texco)) @@ -3427,18 +3425,18 @@ ptex->time=0.0; setvars|=MAP_PA_TIME; } - ptex->time= texture_value_blend(mtex->def_var,ptex->time,value,var,blend,neg & MAP_PA_TIME); + ptex->time= texture_value_blend(mtex->def_var,ptex->time,value,mtex->timefac,blend); } if((event & mtex->pmapto) & MAP_PA_LENGTH) - ptex->length= texture_value_blend(def,ptex->length,value,var,blend,neg & MAP_PA_LENGTH); + ptex->length= texture_value_blend(def,ptex->length,value,mtex->lengthfac,blend); if((event & mtex->pmapto) & MAP_PA_CLUMP) - ptex->clump= texture_value_blend(def,ptex->clump,value,var,blend,neg & MAP_PA_CLUMP); + ptex->clump= texture_value_blend(def,ptex->clump,value,mtex->clumpfac,blend); if((event & mtex->pmapto) & MAP_PA_KINK) - ptex->kink= texture_value_blend(def,ptex->kink,value,var,blend,neg & MAP_PA_KINK); + ptex->kink= texture_value_blend(def,ptex->kink,value,mtex->kinkfac,blend); if((event & mtex->pmapto) & MAP_PA_ROUGH) - ptex->rough1= ptex->rough2= ptex->roughe= texture_value_blend(def,ptex->rough1,value,var,blend,neg & MAP_PA_ROUGH); + ptex->rough1= ptex->rough2= ptex->roughe= texture_value_blend(def,ptex->rough1,value,mtex->roughfac,blend); if((event & mtex->pmapto) & MAP_PA_DENS) - ptex->exist= texture_value_blend(def,ptex->exist,value,var,blend,neg & MAP_PA_DENS); + ptex->exist= texture_value_blend(def,ptex->exist,value,mtex->padensfac,blend); } } if(event & MAP_PA_TIME) { CLAMP(ptex->time,0.0,1.0); } @@ -3462,10 +3460,8 @@ if(ma) for(m=0; m<MAX_MTEX; m++){ mtex=ma->mtex[m]; if(mtex && (ma->septex & (1<<m))==0 && mtex->pmapto){ - float var=mtex->varfac; float def=mtex->def_var; short blend=mtex->blendtype; - short neg=mtex->pmaptoneg; if((mtex->texco & TEXCO_UV) && ELEM(sim->psys->part->from, PART_FROM_FACE, PART_FROM_VOLUME)) { if(!get_particle_uv(sim->psmd->dm, pa, 0, pa->fuv, mtex->uvname, texco)) { @@ -3482,29 +3478,31 @@ if((event & mtex->pmapto) & MAP_PA_TIME){ /* the first time has to set the base value for time regardless of blend mode */ if((setvars&MAP_PA_TIME)==0){ - ptex->time *= 1.0f - var; - ptex->time += var * ((neg & MAP_PA_TIME)? 1.0f - value : value); + int flip= (mtex->timefac < 0.0f); + float timefac= fabsf(mtex->timefac); + ptex->time *= 1.0f - timefac; + ptex->time += timefac * ((flip)? 1.0f - value : value); setvars |= MAP_PA_TIME; } else - ptex->time= texture_value_blend(def,ptex->time,value,var,blend,neg & MAP_PA_TIME); + ptex->time= texture_value_blend(def,ptex->time,value,mtex->timefac,blend); } if((event & mtex->pmapto) & MAP_PA_LIFE) - ptex->life= texture_value_blend(def,ptex->life,value,var,blend,neg & MAP_PA_LIFE); + ptex->life= texture_value_blend(def,ptex->life,value,mtex->lifefac,blend); if((event & mtex->pmapto) & MAP_PA_DENS) - ptex->exist= texture_value_blend(def,ptex->exist,value,var,blend,neg & MAP_PA_DENS); + ptex->exist= texture_value_blend(def,ptex->exist,value,mtex->padensfac,blend); if((event & mtex->pmapto) & MAP_PA_SIZE) - ptex->size= texture_value_blend(def,ptex->size,value,var,blend,neg & MAP_PA_SIZE); + ptex->size= texture_value_blend(def,ptex->size,value,mtex->sizefac,blend); if((event & mtex->pmapto) & MAP_PA_IVEL) - ptex->ivel= texture_value_blend(def,ptex->ivel,value,var,blend,neg & MAP_PA_IVEL); + ptex->ivel= texture_value_blend(def,ptex->ivel,value,mtex->ivelfac,blend); if((event & mtex->pmapto) & MAP_PA_PVEL) - texture_rgb_blend(ptex->pvel,rgba,ptex->pvel,value,var,blend); + texture_rgb_blend(ptex->pvel,rgba,ptex->pvel,value,mtex->pvelfac,blend); if((event & mtex->pmapto) & MAP_PA_LENGTH) - ptex->length= texture_value_blend(def,ptex->length,value,var,blend,neg & MAP_PA_LENGTH); + ptex->length= texture_value_blend(def,ptex->length,value,mtex->lengthfac,blend); if((event & mtex->pmapto) & MAP_PA_CLUMP) - ptex->clump= texture_value_blend(def,ptex->clump,value,var,blend,neg & MAP_PA_CLUMP); + ptex->clump= texture_value_blend(def,ptex->clump,value,mtex->clumpfac,blend); if((event & mtex->pmapto) & MAP_PA_KINK) - ptex->kink= texture_value_blend(def,ptex->kink,value,var,blend,neg & MAP_PA_CLUMP); + ptex->kink= texture_value_blend(def,ptex->kink,value,mtex->kinkfac,blend); } } if(event & MAP_PA_TIME) { CLAMP(ptex->time,0.0,1.0); } Modified: trunk/blender/source/blender/blenkernel/intern/particle_system.c =================================================================== --- trunk/blender/source/blender/blenkernel/intern/particle_system.c 2009-10-01 16:37:08 UTC (rev 23588) +++ trunk/blender/source/blender/blenkernel/intern/particle_system.c 2009-10-01 17:15:23 UTC (rev 23589) @@ -2217,11 +2217,12 @@ psys->tree = BLI_kdtree_new(psys->totpart); LOOP_SHOWN_PARTICLES { - if(pa->alive == PARS_ALIVE) + if(pa->alive == PARS_ALIVE) { if(pa->state.time == cfra) BLI_kdtree_insert(psys->tree, p, pa->prev_state.co, NULL); else BLI_kdtree_insert(psys->tree, p, pa->state.co, NULL); + } } BLI_kdtree_balance(psys->tree); @@ -3134,7 +3135,7 @@ ParticleSystem *psys = sim->psys; ParticleSettings *part=psys->part; KDTree *tree=0; - IpoCurve *icu_esize= NULL; //=find_ipocurve(part->ipo,PART_EMIT_SIZE); // XXX old animation system + //IpoCurve *icu_esize= NULL; //=find_ipocurve(part->ipo,PART_EMIT_SIZE); // XXX old animation system /* Material *ma=give_current_material(sim->ob, part->omat); */ BoidBrainData bbd; PARTICLE_P; @@ -3331,7 +3332,7 @@ { ParticleSystem *psys = sim->psys; ParticleSettings *part = psys->part; - IpoCurve *icu_esize = NULL; //=find_ipocurve(part->ipo,PART_EMIT_SIZE); // XXX old animation system + //IpoCurve *icu_esize = NULL; //=find_ipocurve(part->ipo,PART_EMIT_SIZE); // XXX old animation system /* Material *ma = give_current_material(sim->ob,part->omat); */ PARTICLE_P; float disp, birthtime, dietime, *vg_size= NULL; // XXX ipotime=cfra Modified: trunk/blender/source/blender/blenkernel/intern/texture.c =================================================================== --- trunk/blender/source/blender/blenkernel/intern/texture.c 2009-10-01 16:37:08 UTC (rev 23588) +++ trunk/blender/source/blender/blenkernel/intern/texture.c 2009-10-01 17:15:23 UTC (rev 23589) @@ -559,6 +559,36 @@ mtex->norfac= 1.0; mtex->varfac= 1.0; mtex->dispfac=0.2; + mtex->colspecfac= 1.0f; + mtex->mirrfac= 1.0f; + mtex->alphafac= 1.0f; + mtex->difffac= 1.0f; + mtex->specfac= 1.0f; + mtex->emitfac= 1.0f; + mtex->hardfac= 1.0f; + mtex->raymirrfac= 1.0f; + mtex->translfac= 1.0f; + mtex->ambfac= 1.0f; + mtex->colemitfac= 1.0f; + mtex->colreflfac= 1.0f; + mtex->coltransfac= 1.0f; + mtex->densfac= 1.0f; + mtex->scatterfac= 1.0f; + mtex->reflfac= 1.0f; + mtex->shadowfac= 1.0f; + mtex->zenupfac= 1.0f; + mtex->zendownfac= 1.0f; + mtex->blendfac= 1.0f; + mtex->timefac= 1.0f; + mtex->lengthfac= 1.0f; + mtex->clumpfac= 1.0f; + mtex->kinkfac= 1.0f; + mtex->roughfac= 1.0f; + mtex->padensfac= 1.0f; + mtex->lifefac= 1.0f; + mtex->sizefac= 1.0f; + mtex->ivelfac= 1.0f; + mtex->pvelfac= 1.0f; mtex->normapspace= MTEX_NSPACE_TANGENT; } Modified: trunk/blender/source/blender/blenloader/intern/readfile.c =================================================================== --- trunk/blender/source/blender/blenloader/intern/readfile.c 2009-10-01 16:37:08 UTC (rev 23588) +++ trunk/blender/source/blender/blenloader/intern/readfile.c 2009-10-01 17:15:23 UTC (rev 23589) @@ -6186,8 +6186,71 @@ } } +static void do_version_mtex_factor_2_50(MTex **mtex_array, short idtype) +{ + MTex *mtex; + float varfac, colfac; + int a, neg; + if(!mtex_array) + return; + for(a=0; a<MAX_MTEX; a++) { + if(mtex_array[a]) { + mtex= mtex_array[a]; + + neg= mtex->maptoneg; + varfac= mtex->varfac; + colfac= mtex->colfac; + + if(neg & MAP_DISP) mtex->dispfac= -mtex->dispfac; + if(neg & MAP_NORM) mtex->norfac= -mtex->norfac; + if(neg & MAP_WARP) mtex->warpfac= -mtex->warpfac; + @@ Diff output truncated at 10240 characters. @@ _______________________________________________ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs