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:
authorBrecht Van Lommel <brecht>2021-09-09 18:22:20 +0300
committerBrecht Van Lommel <brecht@blender.org>2021-09-10 17:48:30 +0300
commit128eb6cbe928e58dfee1c64f340fd8d663134c26 (patch)
tree68c510ccb7bc3b60af06462392ec46da5baf53a6 /source/blender/makesdna
parent42215d7cb8797ba5b631b9df93d07e895c4b1dda (diff)
Modifiers: export motion blur velocity through attribute
Previously fluid simulation and Alembic modifiers had a dedicated function to query the velocity for motion blur. Now use a more generic system where those modifiers output a velocity attribute. Advantages: * Geometry and particle nodes can output velocity through the same mechanism, or read the attribute coming from earlier modifiers. * The velocity can be preserved through modifiers like subdivision surface or auto smooth. * USD and Alembic previously only output velocity from fluid simulation, now they work with velocity from other sources too. * Simplifies the code for renderers like Cycles and exporters like Alembic and USD. This breaks compatibility: * External renderers and exporters accessing these velocities through the Python API now need to use the attribute instead. * Existing modifier node setups that create an attribute named "velocity" will render differently with motion blur. Differential Revision: https://developer.blender.org/D12305
Diffstat (limited to 'source/blender/makesdna')
-rw-r--r--source/blender/makesdna/DNA_fluid_defaults.h2
-rw-r--r--source/blender/makesdna/DNA_fluid_types.h9
-rw-r--r--source/blender/makesdna/DNA_modifier_defaults.h4
-rw-r--r--source/blender/makesdna/DNA_modifier_types.h23
4 files changed, 1 insertions, 37 deletions
diff --git a/source/blender/makesdna/DNA_fluid_defaults.h b/source/blender/makesdna/DNA_fluid_defaults.h
index 95f5b8b66b0..4135c4d40a8 100644
--- a/source/blender/makesdna/DNA_fluid_defaults.h
+++ b/source/blender/makesdna/DNA_fluid_defaults.h
@@ -50,7 +50,6 @@
.tex_flags = NULL, \
.tex_range_field = NULL, \
.guide_parent = NULL, \
- .mesh_velocities = NULL, \
.effector_weights = NULL, /* #BKE_effector_add_weights. */ \
.p0 = {0.0f, 0.0f, 0.0f}, \
.p1 = {0.0f, 0.0f, 0.0f}, \
@@ -122,7 +121,6 @@
.mesh_smoothen_pos = 1, \
.mesh_smoothen_neg = 1, \
.mesh_scale = 2, \
- .totvert = 0, \
.mesh_generator = FLUID_DOMAIN_MESH_IMPROVED, \
.particle_type = 0, \
.particle_scale = 1, \
diff --git a/source/blender/makesdna/DNA_fluid_types.h b/source/blender/makesdna/DNA_fluid_types.h
index 835af3c6ff8..0cbef540306 100644
--- a/source/blender/makesdna/DNA_fluid_types.h
+++ b/source/blender/makesdna/DNA_fluid_types.h
@@ -480,10 +480,6 @@ enum {
SM_HRES_FULLSAMPLE = 2,
};
-typedef struct FluidDomainVertexVelocity {
- float vel[3];
-} FluidDomainVertexVelocity;
-
typedef struct FluidDomainSettings {
/* -- Runtime-only fields (from here on). -- */
@@ -509,8 +505,6 @@ typedef struct FluidDomainSettings {
struct GPUTexture *tex_flags;
struct GPUTexture *tex_range_field;
struct Object *guide_parent;
- /** Vertex velocities of simulated fluid mesh. */
- struct FluidDomainVertexVelocity *mesh_velocities;
struct EffectorWeights *effector_weights;
/* Domain object data. */
@@ -607,9 +601,8 @@ typedef struct FluidDomainSettings {
int mesh_smoothen_pos;
int mesh_smoothen_neg;
int mesh_scale;
- int totvert;
short mesh_generator;
- char _pad6[6]; /* Unused. */
+ char _pad6[2]; /* Unused. */
/* Secondary particle options. */
int particle_type;
diff --git a/source/blender/makesdna/DNA_modifier_defaults.h b/source/blender/makesdna/DNA_modifier_defaults.h
index 1b3dbd148df..5b2694f420b 100644
--- a/source/blender/makesdna/DNA_modifier_defaults.h
+++ b/source/blender/makesdna/DNA_modifier_defaults.h
@@ -419,10 +419,6 @@
.velocity_scale = 1.0f, \
.reader = NULL, \
.reader_object_path = "", \
- .vertex_velocities = NULL, \
- .num_vertices = 0, \
- .velocity_delta = 0.0f, \
- .last_lookup_time = 0.0f, \
}
#define _DNA_DEFAULT_MirrorModifierData \
diff --git a/source/blender/makesdna/DNA_modifier_types.h b/source/blender/makesdna/DNA_modifier_types.h
index 8520786a030..31daa778b03 100644
--- a/source/blender/makesdna/DNA_modifier_types.h
+++ b/source/blender/makesdna/DNA_modifier_types.h
@@ -2144,10 +2144,6 @@ enum {
MOD_NORMALEDIT_MIX_MUL = 3,
};
-typedef struct MeshCacheVertexVelocity {
- float vel[3];
-} MeshCacheVertexVelocity;
-
typedef struct MeshSeqCacheModifierData {
ModifierData modifier;
@@ -2163,25 +2159,6 @@ typedef struct MeshSeqCacheModifierData {
/* Runtime. */
struct CacheReader *reader;
char reader_object_path[1024];
-
- /* Vertex velocities read from the cache. The velocities are not automatically read during
- * modifier execution, and therefore have to manually be read when needed. This is only used
- * through the RNA for now. */
- struct MeshCacheVertexVelocity *vertex_velocities;
-
- /* The number of vertices of the Alembic mesh, set when the modifier is executed. */
- int num_vertices;
-
- /* Time (in frames or seconds) between two velocity samples. Automatically computed to
- * scale the velocity vectors at render time for generating proper motion blur data. */
- float velocity_delta;
-
- /* Caches the scene time (in seconds) used to lookup data in the Alembic archive when the
- * modifier was last executed. Used to access Alembic samples through the RNA. */
- float last_lookup_time;
-
- int _pad1;
- void *_pad2;
} MeshSeqCacheModifierData;
/* MeshSeqCacheModifierData.read_flag */