Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenkernel/intern/particle.c
| Show All 28 Lines | |||||
| #include "DNA_collection_types.h" | #include "DNA_collection_types.h" | ||||
| #include "DNA_curve_types.h" | #include "DNA_curve_types.h" | ||||
| #include "DNA_key_types.h" | #include "DNA_key_types.h" | ||||
| #include "DNA_material_types.h" | #include "DNA_material_types.h" | ||||
| #include "DNA_mesh_types.h" | #include "DNA_mesh_types.h" | ||||
| #include "DNA_meshdata_types.h" | #include "DNA_meshdata_types.h" | ||||
| #include "DNA_particle_types.h" | #include "DNA_particle_types.h" | ||||
| #include "DNA_smoke_types.h" | #include "DNA_manta_types.h" | ||||
| #include "DNA_scene_types.h" | #include "DNA_scene_types.h" | ||||
| #include "DNA_dynamicpaint_types.h" | #include "DNA_dynamicpaint_types.h" | ||||
| #include "BLI_blenlib.h" | #include "BLI_blenlib.h" | ||||
| #include "BLI_math.h" | #include "BLI_math.h" | ||||
| #include "BLI_utildefines.h" | #include "BLI_utildefines.h" | ||||
| #include "BLI_kdopbvh.h" | #include "BLI_kdopbvh.h" | ||||
| #include "BLI_kdtree.h" | #include "BLI_kdtree.h" | ||||
| ▲ Show 20 Lines • Show All 309 Lines • ▼ Show 20 Lines | |||||
| { | { | ||||
| ParticleSystemModifierData *psmd; | ParticleSystemModifierData *psmd; | ||||
| if (psys->flag & PSYS_DISABLED || psys->flag & PSYS_DELETE || !psys->part) { | if (psys->flag & PSYS_DISABLED || psys->flag & PSYS_DELETE || !psys->part) { | ||||
| return 0; | return 0; | ||||
| } | } | ||||
| psmd = psys_get_modifier(ob, psys); | psmd = psys_get_modifier(ob, psys); | ||||
| if (!psmd) { | |||||
| return 0; | |||||
| } | |||||
| if (use_render_params) { | if (use_render_params) { | ||||
| if (!(psmd->modifier.mode & eModifierMode_Render)) { | if (!(psmd->modifier.mode & eModifierMode_Render)) { | ||||
| return 0; | return 0; | ||||
| } | } | ||||
| } | } | ||||
| else if (!(psmd->modifier.mode & eModifierMode_Realtime)) { | else if (!(psmd->modifier.mode & eModifierMode_Realtime)) { | ||||
| return 0; | return 0; | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 3,201 Lines • ▼ Show 20 Lines | void object_remove_particle_system(Main *bmain, Scene *UNUSED(scene), Object *ob) | ||||
| ParticleSystem *psys = psys_get_current(ob); | ParticleSystem *psys = psys_get_current(ob); | ||||
| ParticleSystemModifierData *psmd; | ParticleSystemModifierData *psmd; | ||||
| ModifierData *md; | ModifierData *md; | ||||
| if (!psys) { | if (!psys) { | ||||
| return; | return; | ||||
| } | } | ||||
| /* clear all other appearances of this pointer (like on smoke flow modifier) */ | /* clear all other appearances of this pointer (like on manta flow modifier) */ | ||||
| if ((md = modifiers_findByType(ob, eModifierType_Smoke))) { | if ((md = modifiers_findByType(ob, eModifierType_Manta))) { | ||||
| SmokeModifierData *smd = (SmokeModifierData *)md; | MantaModifierData *mmd = (MantaModifierData *)md; | ||||
| if ((smd->type == MOD_SMOKE_TYPE_FLOW) && smd->flow && smd->flow->psys) { | if ((mmd->type == MOD_MANTA_TYPE_FLOW) && mmd->flow && mmd->flow->psys) { | ||||
| if (smd->flow->psys == psys) { | if (mmd->flow->psys == psys) { | ||||
| smd->flow->psys = NULL; | mmd->flow->psys = NULL; | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| if ((md = modifiers_findByType(ob, eModifierType_DynamicPaint))) { | if ((md = modifiers_findByType(ob, eModifierType_DynamicPaint))) { | ||||
| DynamicPaintModifierData *pmd = (DynamicPaintModifierData *)md; | DynamicPaintModifierData *pmd = (DynamicPaintModifierData *)md; | ||||
| if (pmd->brush && pmd->brush->psys) { | if (pmd->brush && pmd->brush->psys) { | ||||
| if (pmd->brush->psys == psys) { | if (pmd->brush->psys == psys) { | ||||
| ▲ Show 20 Lines • Show All 1,332 Lines • Show Last 20 Lines | |||||