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:
authorLukas Tönne <lukas.toenne@gmail.com>2014-08-26 21:29:16 +0400
committerLukas Tönne <lukas.toenne@gmail.com>2015-01-20 11:29:21 +0300
commit5f41b19463bb4af38880ecda0839c2a20cf45d74 (patch)
tree42ec2f12bad4e876ec304f34afc73ff5687287d8 /source/blender/render
parent4cd6111159715f8efb52d7ce38f99d0bdb8f0cb5 (diff)
New voxel texture mode "Hair", for displaying the internal hair volume
structure as a texture. This is mostly a debugging feature that may be removed again later.
Diffstat (limited to 'source/blender/render')
-rw-r--r--source/blender/render/intern/source/voxeldata.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/source/blender/render/intern/source/voxeldata.c b/source/blender/render/intern/source/voxeldata.c
index f21a1e5fa9b..d360282d985 100644
--- a/source/blender/render/intern/source/voxeldata.c
+++ b/source/blender/render/intern/source/voxeldata.c
@@ -51,6 +51,7 @@
#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"
@@ -61,6 +62,7 @@
#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"
@@ -364,6 +366,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 |= implicit_hair_volume_get_texture_data(ob, pmd->psys->clmd, NULL, vd);
+ }
+ }
+
+ vd->ok = found;
+}
+
void cache_voxeldata(Tex *tex, int scene_frame)
{
VoxelData *vd = tex->vd;
@@ -397,6 +420,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;