diff options
Diffstat (limited to 'source/blender/render/intern/source/voxeldata.c')
-rw-r--r-- | source/blender/render/intern/source/voxeldata.c | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/source/blender/render/intern/source/voxeldata.c b/source/blender/render/intern/source/voxeldata.c index 50b5e392b3f..8bc5c7a1c8f 100644 --- a/source/blender/render/intern/source/voxeldata.c +++ b/source/blender/render/intern/source/voxeldata.c @@ -51,22 +51,24 @@ #include "IMB_imbuf.h" #include "IMB_imbuf_types.h" +#include "BKE_cloth.h" #include "BKE_global.h" #include "BKE_image.h" #include "BKE_main.h" #include "BKE_modifier.h" #include "smoke_API.h" +#include "BPH_mass_spring.h" #include "DNA_texture_types.h" #include "DNA_object_force.h" #include "DNA_object_types.h" +#include "DNA_particle_types.h" #include "DNA_modifier_types.h" #include "DNA_smoke_types.h" #include "render_types.h" -#include "renderdatabase.h" #include "texture.h" #include "voxeldata.h" @@ -365,6 +367,27 @@ static void init_frame_smoke(VoxelData *vd, int cfra) #endif } +static void init_frame_hair(VoxelData *vd, int UNUSED(cfra)) +{ + Object *ob; + ModifierData *md; + bool found = false; + + vd->dataset = NULL; + if (vd->object == NULL) return; + ob = vd->object; + + if ((md = (ModifierData *)modifiers_findByType(ob, eModifierType_ParticleSystem))) { + ParticleSystemModifierData *pmd = (ParticleSystemModifierData *)md; + + if (pmd->psys && pmd->psys->clmd) { + found |= BPH_cloth_solver_get_texture_data(ob, pmd->psys->clmd, vd); + } + } + + vd->ok = found; +} + void cache_voxeldata(Tex *tex, int scene_frame) { VoxelData *vd = tex->vd; @@ -398,6 +421,9 @@ void cache_voxeldata(Tex *tex, int scene_frame) case TEX_VD_SMOKE: init_frame_smoke(vd, scene_frame); return; + case TEX_VD_HAIR: + init_frame_hair(vd, scene_frame); + return; case TEX_VD_BLENDERVOXEL: BLI_path_abs(path, G.main->name); if (!BLI_exists(path)) return; |