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:
authorKévin Dietrich <kevin.dietrich@mailoo.org>2020-08-03 04:28:04 +0300
committerKévin Dietrich <kevin.dietrich@mailoo.org>2020-08-03 04:44:40 +0300
commitb5dcf746369e51c08285292cd78f621999dd09e9 (patch)
tree1eec4e7e262b40711002002a13df94ed91015a92 /source/blender/makesdna/DNA_modifier_types.h
parent396d0b5cd0bcd9dd3dfa8d9006ee9f6f91c7196d (diff)
Cycles: add support for rendering deformation motion blur from Alembic caches.
This patch adds the ability to render motion blur from Alembic caches. The motion blur data is derived from a velocity attribute whose name has to be defined by the user through the MeshSequenceCache modifier, with a default value of ".velocities", which is the standard name in Alembic for the velocity property, although other software may ignore it and write velocity with their own naming convention (e.g. "v" in Houdini). Furthermore, a property was added to define how the velocity vectors are interpreted with regard to time : frame or second. "Frame" means that the velocity is already scaled by the time step and we do not need to modify it for it to look proper. "Second" means that the unit the velocity was measured in is in seconds and so has to be scaled by some time step computed here as being the time between two frames (1 / FPS, which would be typical for a simulation). This appears to be common, and is the default behavior. Another property was added to control the scale of the velocity to further modify the look of the motion blur. Reviewed By: brecht, sybren Differential Revision: https://developer.blender.org/D2388
Diffstat (limited to 'source/blender/makesdna/DNA_modifier_types.h')
-rw-r--r--source/blender/makesdna/DNA_modifier_types.h26
1 files changed, 25 insertions, 1 deletions
diff --git a/source/blender/makesdna/DNA_modifier_types.h b/source/blender/makesdna/DNA_modifier_types.h
index 8c564bda3d0..9b1543d0f79 100644
--- a/source/blender/makesdna/DNA_modifier_types.h
+++ b/source/blender/makesdna/DNA_modifier_types.h
@@ -2052,6 +2052,10 @@ enum {
MOD_NORMALEDIT_MIX_MUL = 3,
};
+typedef struct MeshCacheVertexVelocity {
+ float vel[3];
+} MeshCacheVertexVelocity;
+
typedef struct MeshSeqCacheModifierData {
ModifierData modifier;
@@ -2060,11 +2064,31 @@ typedef struct MeshSeqCacheModifierData {
char object_path[1024];
char read_flag;
- char _pad[7];
+ char _pad[3];
+
+ float velocity_scale;
/* 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;
} MeshSeqCacheModifierData;
/* MeshSeqCacheModifierData.read_flag */