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

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJanne Karhu <jhkarh@gmail.com>2008-03-31 23:57:40 +0400
committerJanne Karhu <jhkarh@gmail.com>2008-03-31 23:57:40 +0400
commit5e3ff914cbde895b54dda11bb3689c35937ac7d0 (patch)
tree9c54f5ae36bbb0502ebdf4499425582a375c588b /source/blender/src/buttons_shading.c
parent1ccf92aecd62914b87e0c4f1e70ba01b2e4eca09 (diff)
Fix for bug: [#8302] Particle atributes (Materials) wrong behavior
-Particle texture calculations weren't using the mtex->def_var properly -Texture buttons didn't set proper update flags for hair
Diffstat (limited to 'source/blender/src/buttons_shading.c')
-rw-r--r--source/blender/src/buttons_shading.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/source/blender/src/buttons_shading.c b/source/blender/src/buttons_shading.c
index e4a271ffc28..4ff6ff7b7d9 100644
--- a/source/blender/src/buttons_shading.c
+++ b/source/blender/src/buttons_shading.c
@@ -3167,7 +3167,7 @@ void do_matbuts(unsigned short event)
ob=base->object;
for(psys=ob->particlesystem.first; psys; psys=psys->next) {
if(psys && ma==give_current_material(ob,psys->part->omat)) {
- psys->recalc |= PSYS_INIT;
+ psys->recalc |= PSYS_INIT | PSYS_RECALC_HAIR;
DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA);
}
@@ -3193,7 +3193,7 @@ static void particle_recalc_material(void *ma_v, void *arg2)
ob=base->object;
for(psys=ob->particlesystem.first; psys; psys=psys->next){
if(psys && ma==give_current_material(ob,psys->part->omat)){
- psys->recalc |= PSYS_INIT;
+ psys->recalc |= PSYS_INIT | PSYS_RECALC_HAIR;
DAG_object_flush_update(G.scene, ob, OB_RECALC_DATA);
}
@@ -3249,16 +3249,18 @@ static void material_panel_map_to(Object *ob, Material *ma, int from_nodes)
uiDefButF(block, NUMSLI, B_MATPRV, "B ", 10,40,135,19, &(mtex->b), 0.0, 1.0, B_MTEXCOL, 0, "The default color for textures that don't return RGB");
}
uiBlockEndAlign(block);
-
- uiDefButF(block, NUMSLI, B_MATPRV, "DVar ", 10,10,135,19, &(mtex->def_var), 0.0, 1.0, 0, 0, "Value to use for Ref, Spec, Amb, Emit, Alpha, RayMir, TransLu and Hard");
-
- /* MAP TO */
- uiBlockBeginAlign(block);
/*check if material is being used by particles*/
for(psys=ob->particlesystem.first; psys; psys=psys->next)
if(psys->part->omat==ob->actcol)
psys_mapto=1;
+
+ but = uiDefButF(block, NUMSLI, B_MATPRV, "DVar ", 10,10,135,19, &(mtex->def_var), 0.0, 1.0, 0, 0, "Value to use for Ref, Spec, Amb, Emit, Alpha, RayMir, TransLu and Hard");
+ if(psys_mapto && mtex->pmapto & MAP_PA_INIT)
+ uiButSetFunc(but, particle_recalc_material, ma, NULL);
+
+ /* MAP TO */
+ uiBlockBeginAlign(block);
if(psys_mapto && pattr) {
but=uiDefButBitS(block, TOG3, MAP_PA_TIME, B_MAT_PARTICLE, "Time", 10,180,60,19, &(mtex->pmapto), 0, 0, 0, 0, "Causes the texture to affect the emission time of particles");