Renaming "Kink" texture influence to "Kink Frequency" to be more

specific.
This commit is contained in:
Lukas Tönne
2015-01-14 12:03:55 +01:00
parent 68608c5428
commit 9698182227
7 changed files with 36 additions and 33 deletions

View File

@@ -1164,7 +1164,7 @@ class TEXTURE_PT_influence(TextureSlotPanel, Panel):
factor_but(col, "use_map_clump", "clump_factor", "Clump") factor_but(col, "use_map_clump", "clump_factor", "Clump")
col = split.column() col = split.column()
factor_but(col, "use_map_kink", "kink_factor", "Kink") factor_but(col, "use_map_kink_freq", "kink_freq_factor", "Kink Frequency")
factor_but(col, "use_map_rough", "rough_factor", "Rough") factor_but(col, "use_map_rough", "rough_factor", "Rough")
elif isinstance(idblock, FreestyleLineStyle): elif isinstance(idblock, FreestyleLineStyle):

View File

@@ -110,7 +110,7 @@ typedef struct ParticleTexture {
float ivel; /* used in reset */ float ivel; /* used in reset */
float time, life, exist, size; /* used in init */ float time, life, exist, size; /* used in init */
float damp, gravity, field; /* used in physics */ 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 */ float rough1, rough2, roughe; /* used in path caching */
} ParticleTexture; } ParticleTexture;

View File

@@ -3331,7 +3331,7 @@ static void get_cpa_texture(DerivedMesh *dm, ParticleSystem *psys, ParticleSetti
float value, rgba[4], texvec[3]; float value, rgba[4], texvec[3];
ptex->ivel = ptex->life = ptex->exist = ptex->size = ptex->damp = 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->effector = ptex->rough1 = ptex->rough2 = ptex->roughe = 1.0f;
ptex->length = 1.0f - part->randlength * psys_frand(psys, child_index + 26); 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_LENGTH, ptex->length, mtex->lengthfac);
SET_PARTICLE_TEXTURE(PAMAP_CLUMP, ptex->clump, mtex->clumpfac); 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); SET_PARTICLE_TEXTURE(PAMAP_DENS, ptex->exist, mtex->padensfac);
} }
} }
CLAMP_PARTICLE_TEXTURE_POS(PAMAP_LENGTH, ptex->length); CLAMP_PARTICLE_TEXTURE_POS(PAMAP_LENGTH, ptex->length);
CLAMP_PARTICLE_TEXTURE_POS(PAMAP_CLUMP, ptex->clump); 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_ROUGH, ptex->rough1);
CLAMP_PARTICLE_TEXTURE_POS(PAMAP_DENS, ptex->exist); CLAMP_PARTICLE_TEXTURE_POS(PAMAP_DENS, ptex->exist);
} }
@@ -3402,7 +3402,7 @@ void psys_get_texture(ParticleSimulationData *sim, ParticleData *pa, ParticleTex
/* initialize ptex */ /* initialize ptex */
ptex->ivel = ptex->life = ptex->exist = ptex->size = ptex->damp = 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->effector = ptex->rough1 = ptex->rough2 = ptex->roughe = 1.0f;
ptex->time = (float)(pa - sim->psys->particles) / (float)sim->psys->totpart; 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) if (ctx->vg_clump)
ptex->clump *= psys_interpolate_value_from_verts(ctx->dm, cpa_from, cpa_num, cpa_fuv, 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) 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) if (ctx->vg_rough1)
ptex->rough1 *= psys_interpolate_value_from_verts(ctx->dm, cpa_from, cpa_num, cpa_fuv, 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) if (ctx->vg_rough2)

View File

@@ -204,7 +204,7 @@ static void do_kink_spiral(ParticleThreadContext *ctx, ParticleTexture *ptex, co
float kink_base[3]; float kink_base[3];
if (ptex) { if (ptex) {
kink_freq *= ptex->kink; kink_freq *= ptex->kink_freq;
rough1 *= ptex->rough1; rough1 *= ptex->rough1;
rough2 *= ptex->rough2; rough2 *= ptex->rough2;
rough_end *= ptex->roughe; 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); const bool smooth_start = (sim->psys->part->childtype == PART_CHILD_FACES);
if (ptex) { if (ptex) {
kink_freq *= ptex->kink; kink_freq *= ptex->kink_freq;
rough1 *= ptex->rough1; rough1 *= ptex->rough1;
rough2 *= ptex->rough2; rough2 *= ptex->rough2;
rough_end *= ptex->roughe; rough_end *= ptex->roughe;

View File

@@ -438,6 +438,7 @@ typedef struct Material {
#define MAP_PA_CLUMP 128 #define MAP_PA_CLUMP 128
#define MAP_PA_KINK 256 #define MAP_PA_KINK 256
#define MAP_PA_ROUGH 512 #define MAP_PA_ROUGH 512
#define MAP_PA_FREQ 1024
/* pr_type */ /* pr_type */
#define MA_FLAT 0 #define MA_FLAT 0

View File

@@ -583,24 +583,26 @@ typedef enum eParticleChildFlag {
#define PTARGET_MODE_ENEMY 2 #define PTARGET_MODE_ENEMY 2
/* mapto */ /* mapto */
/* init */ typedef enum eParticleTextureInfluence {
#define PAMAP_INIT (PAMAP_TIME | PAMAP_LIFE | PAMAP_DENS | PAMAP_SIZE) /* init */
#define PAMAP_TIME (1<<0) /* emission time */ PAMAP_TIME = (1<<0), /* emission time */
#define PAMAP_LIFE (1<<1) /* life time */ PAMAP_LIFE = (1<<1), /* life time */
#define PAMAP_DENS (1<<2) /* density */ PAMAP_DENS = (1<<2), /* density */
#define PAMAP_SIZE (1<<3) /* physical size */ PAMAP_SIZE = (1<<3), /* physical size */
/* reset */ PAMAP_INIT = (PAMAP_TIME | PAMAP_LIFE | PAMAP_DENS | PAMAP_SIZE),
#define PAMAP_IVEL (1<<5) /* initial velocity */ /* reset */
/* physics */ PAMAP_IVEL = (1<<5), /* initial velocity */
#define PAMAP_PHYSICS (PAMAP_FIELD | PAMAP_GRAVITY | PAMAP_DAMP) /* physics */
#define PAMAP_FIELD (1<<6) /* force fields */ PAMAP_FIELD = (1<<6), /* force fields */
#define PAMAP_GRAVITY (1<<10) PAMAP_GRAVITY = (1<<10),
#define PAMAP_DAMP (1<<11) PAMAP_DAMP = (1<<11),
/* children */ PAMAP_PHYSICS = (PAMAP_FIELD | PAMAP_GRAVITY | PAMAP_DAMP),
#define PAMAP_CHILD (PAMAP_CLUMP | PAMAP_KINK | PAMAP_ROUGH | PAMAP_LENGTH) /* children */
#define PAMAP_CLUMP (1<<7) PAMAP_CLUMP = (1<<7),
#define PAMAP_KINK (1<<8) PAMAP_KINK_FREQ = (1<<8),
#define PAMAP_ROUGH (1<<9) PAMAP_ROUGH = (1<<9),
#define PAMAP_LENGTH (1<<4) PAMAP_LENGTH = (1<<4),
PAMAP_CHILD = (PAMAP_CLUMP | PAMAP_KINK_FREQ | PAMAP_ROUGH | PAMAP_LENGTH),
} eParticleTextureInfluence;
#endif #endif

View File

@@ -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_ui_text(prop, "Clump", "Affect the child clumping");
RNA_def_property_update(prop, 0, "rna_Particle_reset"); RNA_def_property_update(prop, 0, "rna_Particle_reset");
prop = RNA_def_property(srna, "use_map_kink", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_map_kink_freq", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "mapto", PAMAP_KINK); RNA_def_property_boolean_sdna(prop, NULL, "mapto", PAMAP_KINK_FREQ);
RNA_def_property_ui_text(prop, "Kink", "Affect the child kink"); RNA_def_property_ui_text(prop, "Kink Frequency", "Affect the child kink frequency");
RNA_def_property_update(prop, 0, "rna_Particle_redo_child"); RNA_def_property_update(prop, 0, "rna_Particle_redo_child");
prop = RNA_def_property(srna, "use_map_rough", PROP_BOOLEAN, PROP_NONE); 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_ui_text(prop, "Clump Factor", "Amount texture affects child clump");
RNA_def_property_update(prop, 0, "rna_Particle_redo_child"); 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_float_sdna(prop, NULL, "kinkfac");
RNA_def_property_ui_range(prop, 0, 1, 10, 3); 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"); RNA_def_property_update(prop, 0, "rna_Particle_redo_child");
prop = RNA_def_property(srna, "rough_factor", PROP_FLOAT, PROP_NONE); prop = RNA_def_property(srna, "rough_factor", PROP_FLOAT, PROP_NONE);