From 96981822277f38f4ed3a97c072022d5fcc3a8111 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20T=C3=B6nne?= Date: Wed, 14 Jan 2015 12:03:55 +0100 Subject: Renaming "Kink" texture influence to "Kink Frequency" to be more specific. --- source/blender/blenkernel/BKE_particle.h | 2 +- source/blender/blenkernel/intern/particle.c | 10 +++--- source/blender/blenkernel/intern/particle_child.c | 4 +-- source/blender/makesdna/DNA_material_types.h | 1 + source/blender/makesdna/DNA_particle_types.h | 40 ++++++++++++----------- source/blender/makesrna/intern/rna_particle.c | 10 +++--- 6 files changed, 35 insertions(+), 32 deletions(-) (limited to 'source') diff --git a/source/blender/blenkernel/BKE_particle.h b/source/blender/blenkernel/BKE_particle.h index a2b283a4f70..a53b871f33c 100644 --- a/source/blender/blenkernel/BKE_particle.h +++ b/source/blender/blenkernel/BKE_particle.h @@ -110,7 +110,7 @@ typedef struct ParticleTexture { float ivel; /* used in reset */ float time, life, exist, size; /* used in init */ float damp, gravity, field; /* used in physics */ - float length, clump, kink, effector; /* used in path caching */ + float length, clump, kink_freq, effector; /* used in path caching */ float rough1, rough2, roughe; /* used in path caching */ } ParticleTexture; diff --git a/source/blender/blenkernel/intern/particle.c b/source/blender/blenkernel/intern/particle.c index 2d873067cbc..cf611ef4f90 100644 --- a/source/blender/blenkernel/intern/particle.c +++ b/source/blender/blenkernel/intern/particle.c @@ -3331,7 +3331,7 @@ static void get_cpa_texture(DerivedMesh *dm, ParticleSystem *psys, ParticleSetti float value, rgba[4], texvec[3]; ptex->ivel = ptex->life = ptex->exist = ptex->size = ptex->damp = - ptex->gravity = ptex->field = ptex->time = ptex->clump = ptex->kink = + ptex->gravity = ptex->field = ptex->time = ptex->clump = ptex->kink_freq = ptex->effector = ptex->rough1 = ptex->rough2 = ptex->roughe = 1.0f; ptex->length = 1.0f - part->randlength * psys_frand(psys, child_index + 26); @@ -3378,14 +3378,14 @@ static void get_cpa_texture(DerivedMesh *dm, ParticleSystem *psys, ParticleSetti SET_PARTICLE_TEXTURE(PAMAP_LENGTH, ptex->length, mtex->lengthfac); SET_PARTICLE_TEXTURE(PAMAP_CLUMP, ptex->clump, mtex->clumpfac); - SET_PARTICLE_TEXTURE(PAMAP_KINK, ptex->kink, mtex->kinkfac); + SET_PARTICLE_TEXTURE(PAMAP_KINK_FREQ, ptex->kink_freq, mtex->kinkfac); SET_PARTICLE_TEXTURE(PAMAP_DENS, ptex->exist, mtex->padensfac); } } CLAMP_PARTICLE_TEXTURE_POS(PAMAP_LENGTH, ptex->length); CLAMP_PARTICLE_TEXTURE_POS(PAMAP_CLUMP, ptex->clump); - CLAMP_PARTICLE_TEXTURE_POS(PAMAP_KINK, ptex->kink); + CLAMP_PARTICLE_TEXTURE_POS(PAMAP_KINK_FREQ, ptex->kink_freq); CLAMP_PARTICLE_TEXTURE_POS(PAMAP_ROUGH, ptex->rough1); CLAMP_PARTICLE_TEXTURE_POS(PAMAP_DENS, ptex->exist); } @@ -3402,7 +3402,7 @@ void psys_get_texture(ParticleSimulationData *sim, ParticleData *pa, ParticleTex /* initialize ptex */ ptex->ivel = ptex->life = ptex->exist = ptex->size = ptex->damp = - ptex->gravity = ptex->field = ptex->length = ptex->clump = ptex->kink = + ptex->gravity = ptex->field = ptex->length = ptex->clump = ptex->kink_freq = ptex->effector = ptex->rough1 = ptex->rough2 = ptex->roughe = 1.0f; ptex->time = (float)(pa - sim->psys->particles) / (float)sim->psys->totpart; @@ -3556,7 +3556,7 @@ static void get_child_modifier_parameters(ParticleSettings *part, ParticleThread if (ctx->vg_clump) ptex->clump *= psys_interpolate_value_from_verts(ctx->dm, cpa_from, cpa_num, cpa_fuv, ctx->vg_clump); if (ctx->vg_kink) - ptex->kink *= psys_interpolate_value_from_verts(ctx->dm, cpa_from, cpa_num, cpa_fuv, ctx->vg_kink); + ptex->kink_freq *= psys_interpolate_value_from_verts(ctx->dm, cpa_from, cpa_num, cpa_fuv, ctx->vg_kink); if (ctx->vg_rough1) ptex->rough1 *= psys_interpolate_value_from_verts(ctx->dm, cpa_from, cpa_num, cpa_fuv, ctx->vg_rough1); if (ctx->vg_rough2) diff --git a/source/blender/blenkernel/intern/particle_child.c b/source/blender/blenkernel/intern/particle_child.c index e26a61fa261..d79dd91d9dd 100644 --- a/source/blender/blenkernel/intern/particle_child.c +++ b/source/blender/blenkernel/intern/particle_child.c @@ -204,7 +204,7 @@ static void do_kink_spiral(ParticleThreadContext *ctx, ParticleTexture *ptex, co float kink_base[3]; if (ptex) { - kink_freq *= ptex->kink; + kink_freq *= ptex->kink_freq; rough1 *= ptex->rough1; rough2 *= ptex->rough2; rough_end *= ptex->roughe; @@ -677,7 +677,7 @@ void do_child_modifiers(ParticleSimulationData *sim, ParticleTexture *ptex, cons const bool smooth_start = (sim->psys->part->childtype == PART_CHILD_FACES); if (ptex) { - kink_freq *= ptex->kink; + kink_freq *= ptex->kink_freq; rough1 *= ptex->rough1; rough2 *= ptex->rough2; rough_end *= ptex->roughe; diff --git a/source/blender/makesdna/DNA_material_types.h b/source/blender/makesdna/DNA_material_types.h index 3f94a9cfebb..c3270430a3a 100644 --- a/source/blender/makesdna/DNA_material_types.h +++ b/source/blender/makesdna/DNA_material_types.h @@ -438,6 +438,7 @@ typedef struct Material { #define MAP_PA_CLUMP 128 #define MAP_PA_KINK 256 #define MAP_PA_ROUGH 512 +#define MAP_PA_FREQ 1024 /* pr_type */ #define MA_FLAT 0 diff --git a/source/blender/makesdna/DNA_particle_types.h b/source/blender/makesdna/DNA_particle_types.h index 819e3109d6d..9ea1a55908d 100644 --- a/source/blender/makesdna/DNA_particle_types.h +++ b/source/blender/makesdna/DNA_particle_types.h @@ -583,24 +583,26 @@ typedef enum eParticleChildFlag { #define PTARGET_MODE_ENEMY 2 /* mapto */ -/* init */ -#define PAMAP_INIT (PAMAP_TIME | PAMAP_LIFE | PAMAP_DENS | PAMAP_SIZE) -#define PAMAP_TIME (1<<0) /* emission time */ -#define PAMAP_LIFE (1<<1) /* life time */ -#define PAMAP_DENS (1<<2) /* density */ -#define PAMAP_SIZE (1<<3) /* physical size */ -/* reset */ -#define PAMAP_IVEL (1<<5) /* initial velocity */ -/* physics */ -#define PAMAP_PHYSICS (PAMAP_FIELD | PAMAP_GRAVITY | PAMAP_DAMP) -#define PAMAP_FIELD (1<<6) /* force fields */ -#define PAMAP_GRAVITY (1<<10) -#define PAMAP_DAMP (1<<11) -/* children */ -#define PAMAP_CHILD (PAMAP_CLUMP | PAMAP_KINK | PAMAP_ROUGH | PAMAP_LENGTH) -#define PAMAP_CLUMP (1<<7) -#define PAMAP_KINK (1<<8) -#define PAMAP_ROUGH (1<<9) -#define PAMAP_LENGTH (1<<4) +typedef enum eParticleTextureInfluence { + /* init */ + PAMAP_TIME = (1<<0), /* emission time */ + PAMAP_LIFE = (1<<1), /* life time */ + PAMAP_DENS = (1<<2), /* density */ + PAMAP_SIZE = (1<<3), /* physical size */ + PAMAP_INIT = (PAMAP_TIME | PAMAP_LIFE | PAMAP_DENS | PAMAP_SIZE), + /* reset */ + PAMAP_IVEL = (1<<5), /* initial velocity */ + /* physics */ + PAMAP_FIELD = (1<<6), /* force fields */ + PAMAP_GRAVITY = (1<<10), + PAMAP_DAMP = (1<<11), + PAMAP_PHYSICS = (PAMAP_FIELD | PAMAP_GRAVITY | PAMAP_DAMP), + /* children */ + PAMAP_CLUMP = (1<<7), + PAMAP_KINK_FREQ = (1<<8), + PAMAP_ROUGH = (1<<9), + PAMAP_LENGTH = (1<<4), + PAMAP_CHILD = (PAMAP_CLUMP | PAMAP_KINK_FREQ | PAMAP_ROUGH | PAMAP_LENGTH), +} eParticleTextureInfluence; #endif diff --git a/source/blender/makesrna/intern/rna_particle.c b/source/blender/makesrna/intern/rna_particle.c index a687086e480..ab2e7943c09 100644 --- a/source/blender/makesrna/intern/rna_particle.c +++ b/source/blender/makesrna/intern/rna_particle.c @@ -1835,9 +1835,9 @@ static void rna_def_particle_settings_mtex(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Clump", "Affect the child clumping"); RNA_def_property_update(prop, 0, "rna_Particle_reset"); - prop = RNA_def_property(srna, "use_map_kink", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "mapto", PAMAP_KINK); - RNA_def_property_ui_text(prop, "Kink", "Affect the child kink"); + prop = RNA_def_property(srna, "use_map_kink_freq", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "mapto", PAMAP_KINK_FREQ); + RNA_def_property_ui_text(prop, "Kink Frequency", "Affect the child kink frequency"); RNA_def_property_update(prop, 0, "rna_Particle_redo_child"); prop = RNA_def_property(srna, "use_map_rough", PROP_BOOLEAN, PROP_NONE); @@ -1914,10 +1914,10 @@ static void rna_def_particle_settings_mtex(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Clump Factor", "Amount texture affects child clump"); RNA_def_property_update(prop, 0, "rna_Particle_redo_child"); - prop = RNA_def_property(srna, "kink_factor", PROP_FLOAT, PROP_NONE); + prop = RNA_def_property(srna, "kink_freq_factor", PROP_FLOAT, PROP_NONE); RNA_def_property_float_sdna(prop, NULL, "kinkfac"); RNA_def_property_ui_range(prop, 0, 1, 10, 3); - RNA_def_property_ui_text(prop, "Kink Factor", "Amount texture affects child kink"); + RNA_def_property_ui_text(prop, "Kink Frequency Factor", "Amount texture affects child kink frequency"); RNA_def_property_update(prop, 0, "rna_Particle_redo_child"); prop = RNA_def_property(srna, "rough_factor", PROP_FLOAT, PROP_NONE); -- cgit v1.2.3