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:
Diffstat (limited to 'source/blender/modifiers/intern/MOD_particlesystem.c')
-rw-r--r--source/blender/modifiers/intern/MOD_particlesystem.c104
1 files changed, 7 insertions, 97 deletions
diff --git a/source/blender/modifiers/intern/MOD_particlesystem.c b/source/blender/modifiers/intern/MOD_particlesystem.c
index 4791e41d433..b61eea6d238 100644
--- a/source/blender/modifiers/intern/MOD_particlesystem.c
+++ b/source/blender/modifiers/intern/MOD_particlesystem.c
@@ -37,13 +37,13 @@
#include "DNA_material_types.h"
#include "DNA_mesh_types.h"
+#include "DNA_object_types.h"
#include "BLI_utildefines.h"
#include "BKE_cdderivedmesh.h"
#include "BKE_modifier.h"
-#include "BKE_particle.h"
#include "MOD_util.h"
@@ -70,11 +70,6 @@ static void freeData(ModifierData *md)
psmd->dm_deformed = NULL;
}
}
-
- /* ED_object_modifier_remove may have freed this first before calling
- * modifier_free (which calls this function) */
- if (psmd->psys)
- psmd->psys->flag |= PSYS_DELETE;
}
static void copyData(ModifierData *md, ModifierData *target)
{
@@ -90,105 +85,20 @@ static void copyData(ModifierData *md, ModifierData *target)
tpsmd->totdmvert = tpsmd->totdmedge = tpsmd->totdmface = 0;
}
-static CustomDataMask requiredDataMask(Object *UNUSED(ob), ModifierData *md)
+static CustomDataMask requiredDataMask(Object *UNUSED(ob), ModifierData *UNUSED(md))
{
- ParticleSystemModifierData *psmd = (ParticleSystemModifierData *) md;
- return psys_emitter_customdata_mask(psmd->psys);
+ return 0;
}
/* saves the current emitter state for a particle system and calculates particles */
-static void deformVerts(ModifierData *md, Object *ob,
- DerivedMesh *derivedData,
+static void deformVerts(ModifierData *UNUSED(md), Object *UNUSED(ob),
+ DerivedMesh *UNUSED(derivedData),
float (*vertexCos)[3],
int UNUSED(numVerts),
ModifierApplyFlag UNUSED(flag))
{
- DerivedMesh *dm = derivedData;
- ParticleSystemModifierData *psmd = (ParticleSystemModifierData *) md;
- ParticleSystem *psys = NULL;
- bool needsFree = false;
- /* float cfra = BKE_scene_frame_get(md->scene); */ /* UNUSED */
-
- if (ob->particlesystem.first)
- psys = psmd->psys;
- else
- return;
-
- if (!psys_check_enabled(ob, psys))
- return;
-
- if (dm == NULL) {
- dm = get_dm(ob, NULL, NULL, vertexCos, false, true);
-
- if (!dm)
- return;
-
- needsFree = true;
- }
-
- /* clear old dm */
- if (psmd->dm_final) {
- psmd->dm_final->needsFree = true;
- psmd->dm_final->release(psmd->dm_final);
- if (psmd->dm_deformed) {
- psmd->dm_deformed->needsFree = 1;
- psmd->dm_deformed->release(psmd->dm_deformed);
- psmd->dm_deformed = NULL;
- }
- }
- else if (psmd->flag & eParticleSystemFlag_file_loaded) {
- /* in file read dm just wasn't saved in file so no need to reset everything */
- psmd->flag &= ~eParticleSystemFlag_file_loaded;
- }
- else {
- /* no dm before, so recalc particles fully */
- psys->recalc |= PSYS_RECALC_RESET;
- }
-
- /* make new dm */
- psmd->dm_final = CDDM_copy(dm);
- CDDM_apply_vert_coords(psmd->dm_final, vertexCos);
- CDDM_calc_normals(psmd->dm_final);
-
- if (needsFree) {
- dm->needsFree = true;
- dm->release(dm);
- }
-
- /* protect dm */
- psmd->dm_final->needsFree = false;
-
- DM_ensure_tessface(psmd->dm_final);
-
- if (!psmd->dm_final->deformedOnly) {
- /* XXX Think we can assume here that if current DM is not only-deformed, ob->deformedOnly has been set.
- * This is awfully weak though. :| */
- if (ob->derivedDeform) {
- psmd->dm_deformed = CDDM_copy(ob->derivedDeform);
- }
- else { /* Can happen in some cases, e.g. when rendering from Edit mode... */
- psmd->dm_deformed = CDDM_from_mesh((Mesh *)ob->data);
- }
- DM_ensure_tessface(psmd->dm_deformed);
- }
-
- /* report change in mesh structure */
- if (psmd->dm_final->getNumVerts(psmd->dm_final) != psmd->totdmvert ||
- psmd->dm_final->getNumEdges(psmd->dm_final) != psmd->totdmedge ||
- psmd->dm_final->getNumTessFaces(psmd->dm_final) != psmd->totdmface)
- {
- psys->recalc |= PSYS_RECALC_RESET;
-
- psmd->totdmvert = psmd->dm_final->getNumVerts(psmd->dm_final);
- psmd->totdmedge = psmd->dm_final->getNumEdges(psmd->dm_final);
- psmd->totdmface = psmd->dm_final->getNumTessFaces(psmd->dm_final);
- }
-
- if (!(ob->transflag & OB_NO_PSYS_UPDATE)) {
- psmd->flag &= ~eParticleSystemFlag_psys_updated;
- particle_system_update(md->scene, ob, psys);
- psmd->flag |= eParticleSystemFlag_psys_updated;
- }
+ UNUSED_VARS(vertexCos);
+ return;
}
/* disabled particles in editmode for now, until support for proper derivedmesh