"Fix" for [#21591] Explode modifier bug

* The new default particle size is quite small, so exploded pieces didn't match the original pieces
* There's now an option to use the particle size (useful for some effects), but it isn't used by default
* This commit will change how some old files look (explode modifier and not 1.0 particle size), but the exact old behavior is achieved with the new "size" option
This commit is contained in:
2010-04-06 08:43:52 +00:00
parent 12f2a75294
commit f1ac9b559e
4 changed files with 9 additions and 2 deletions

View File

@@ -291,6 +291,7 @@ class DATA_PT_modifiers(DataButtonsPanel):
col.prop(md, "unborn")
col.prop(md, "alive")
col.prop(md, "dead")
col.prop(md, "size")
layout.operator("object.explode_refresh", text="Refresh")

View File

@@ -8637,7 +8637,8 @@ static DerivedMesh * explodeModifier_explodeMesh(ExplodeModifierData *emd,
/* apply rotation, size & location */
mul_qt_v3(state.rot,vertco);
mul_v3_fl(vertco,pa->size);
if(emd->flag & eExplodeFlag_PaSize)
mul_v3_fl(vertco,pa->size);
VECADD(vertco,vertco,state.co);
mul_m4_v3(imat,vertco);

View File

@@ -571,7 +571,7 @@ typedef struct ParticleInstanceModifierData {
typedef enum {
eExplodeFlag_CalcFaces = (1<<0),
//eExplodeFlag_PaSize = (1<<1),
eExplodeFlag_PaSize = (1<<1),
eExplodeFlag_EdgeSplit = (1<<2),
eExplodeFlag_Unborn = (1<<3),
eExplodeFlag_Alive = (1<<4),

View File

@@ -1676,6 +1676,11 @@ static void rna_def_modifier_explode(BlenderRNA *brna)
RNA_def_property_boolean_sdna(prop, NULL, "flag", eExplodeFlag_Dead);
RNA_def_property_ui_text(prop, "Dead", "Show mesh when particles are dead");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
prop= RNA_def_property(srna, "size", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", eExplodeFlag_PaSize);
RNA_def_property_ui_text(prop, "Size", "Use particle size for the shrapnel");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
}
static void rna_def_modifier_cloth(BlenderRNA *brna)