From b73fe01295636aea92bf3076874b5e3cbcba9057 Mon Sep 17 00:00:00 2001 From: Matt Ebb Date: Thu, 12 May 2011 22:52:30 +0000 Subject: * Enabled rna access to fluid sim velocity vectors The main purpose for this is to allow rendering motion blurred blender fluids in external renderers (eg. http://vimeo.com/21870635 ). Python code snippet for interpreting this data here: http://www.pasteall.org/21577 . Cleaned up some ugly hacks in this area too * Also added read-only access to scene.subframe to RNA - setting current frame and subframe should still go via scene.frame_set() --- source/blender/makesdna/DNA_object_fluidsim.h | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'source/blender/makesdna/DNA_object_fluidsim.h') diff --git a/source/blender/makesdna/DNA_object_fluidsim.h b/source/blender/makesdna/DNA_object_fluidsim.h index e8360b99d69..6f4c16cb7f3 100644 --- a/source/blender/makesdna/DNA_object_fluidsim.h +++ b/source/blender/makesdna/DNA_object_fluidsim.h @@ -42,7 +42,10 @@ extern "C" { struct Mesh; struct Ipo; -struct MVert; + +typedef struct FluidVertexVelocity { + float vel[3]; +} FluidVertexVelocity; typedef struct FluidsimSettings { struct FluidsimModifierData *fmd; /* for fast RNA access */ @@ -82,8 +85,6 @@ typedef struct FluidsimSettings { /* store pointer to original mesh (for replacing the current one) */ struct Mesh *orgMesh; - /* pointer to the currently loaded fluidsim mesh */ - struct Mesh *meshSurface; /* a mesh to display the bounding box used for simulation */ struct Mesh *meshBB; @@ -122,8 +123,10 @@ typedef struct FluidsimSettings { /* testing vars */ float farFieldSize; - /* save fluidsurface normals in mvert.no, and surface vertex velocities (if available) in mvert.co */ - struct MVert *meshSurfNormals; + /* vertex velocities of simulated fluid mesh */ + struct FluidVertexVelocity *meshVelocities; + /* number of vertices in simulated fluid mesh */ + int totvert; /* Fluid control settings */ float cpsTimeStart; @@ -136,6 +139,8 @@ typedef struct FluidsimSettings { float velocityforceRadius; int lastgoodframe; + + int pad; } FluidsimSettings; -- cgit v1.2.3