From 99f59930885ed69890967f8864a3aa0626249d86 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Sat, 29 Mar 2014 13:03:46 +0100 Subject: Cycles code refactor: improve vertex motion attribute storage and export. This now supports multiple steps and subframe sampling of motion. There is one difference for object and camera transform motion blur. It still only supports two steps there, but the transforms are now sampled at subframe times instead of the previous and next frame and then interpolated/extrapolated. This will give different render results in some cases but it's more accurate. Part of the code is from the summer of code project by Gavin Howard, but it has been significantly rewritten and extended. --- intern/cycles/blender/blender_sync.h | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'intern/cycles/blender/blender_sync.h') diff --git a/intern/cycles/blender/blender_sync.h b/intern/cycles/blender/blender_sync.h index 205761ad302..9c4175ef690 100644 --- a/intern/cycles/blender/blender_sync.h +++ b/intern/cycles/blender/blender_sync.h @@ -71,7 +71,7 @@ private: /* sync */ void sync_lamps(bool update_all); void sync_materials(bool update_all); - void sync_objects(BL::SpaceView3D b_v3d, int motion = 0); + void sync_objects(BL::SpaceView3D b_v3d, float motion_time = 0.0f); void sync_motion(BL::SpaceView3D b_v3d, BL::Object b_override, void **python_thread_state); void sync_film(); void sync_view(); @@ -81,12 +81,13 @@ private: void sync_nodes(Shader *shader, BL::ShaderNodeTree b_ntree); Mesh *sync_mesh(BL::Object b_ob, bool object_updated, bool hide_tris); - void sync_curves(Mesh *mesh, BL::Mesh b_mesh, BL::Object b_ob, int motion); - Object *sync_object(BL::Object b_parent, int persistent_id[OBJECT_PERSISTENT_ID_SIZE], BL::DupliObject b_dupli_object, Transform& tfm, uint layer_flag, int motion, bool hide_tris); + void sync_curves(Mesh *mesh, BL::Mesh b_mesh, BL::Object b_ob, bool motion, int time_index = 0); + Object *sync_object(BL::Object b_parent, int persistent_id[OBJECT_PERSISTENT_ID_SIZE], BL::DupliObject b_dupli_ob, + Transform& tfm, uint layer_flag, float motion_time, bool hide_tris); void sync_light(BL::Object b_parent, int persistent_id[OBJECT_PERSISTENT_ID_SIZE], BL::Object b_ob, Transform& tfm); void sync_background_light(); - void sync_mesh_motion(BL::Object b_ob, Mesh *mesh, int motion); - void sync_camera_motion(BL::Object b_ob, int motion); + void sync_mesh_motion(BL::Object b_ob, Object *object, float motion_time); + void sync_camera_motion(BL::Object b_ob, float motion_time); /* particles */ bool sync_dupli_particle(BL::Object b_ob, BL::DupliObject b_dup, Object *object); @@ -109,6 +110,7 @@ private: id_map particle_system_map; set mesh_synced; set mesh_motion_synced; + std::set motion_times; void *world_map; bool world_recalc; -- cgit v1.2.3