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 <brechtvanlommel@gmail.com>2014-03-29 16:03:47 +0400
committerBrecht Van Lommel <brechtvanlommel@gmail.com>2014-03-29 16:03:47 +0400
commit6997908afc38a3c98d09939f3b46f10d7a165d2e (patch)
tree4e38154ce0b5ebd5cc19b908fd9d1122da7a9077 /intern/cycles/blender/blender_util.h
parente2184c653e1f2cc7e05cf9a42a87d23ea3050eac (diff)
Cycles: add per object options to disable motion blur and set deformation motion steps.
Notes: * The motion steps only affect deformation motion blur. * The actual number of steps is 2^(steps - 1). This avoids having to sample at many different times for object with more/fewer steps, now the times overlap. * Deformation motion blur is enabled by default in existing files that have motion blur enabled. If the object is not deforming, this will be detected at export time, so raytracing performance will not be affected. Part of the code is from the summer of code project by Gavin Howard.
Diffstat (limited to 'intern/cycles/blender/blender_util.h')
-rw-r--r--intern/cycles/blender/blender_util.h30
1 files changed, 30 insertions, 0 deletions
diff --git a/intern/cycles/blender/blender_util.h b/intern/cycles/blender/blender_util.h
index 58e523d7fc2..bea5ee49bf4 100644
--- a/intern/cycles/blender/blender_util.h
+++ b/intern/cycles/blender/blender_util.h
@@ -341,6 +341,36 @@ static inline void mesh_texture_space(BL::Mesh b_mesh, float3& loc, float3& size
loc = loc*size - make_float3(0.5f, 0.5f, 0.5f);
}
+/* object used for motion blur */
+static inline bool object_use_motion(BL::Object b_ob)
+{
+ PointerRNA cobject = RNA_pointer_get(&b_ob.ptr, "cycles");
+ bool use_motion = get_boolean(cobject, "use_motion_blur");
+
+ return use_motion;
+}
+
+/* object motion steps */
+static inline uint object_motion_steps(BL::Object b_ob)
+{
+ PointerRNA cobject = RNA_pointer_get(&b_ob.ptr, "cycles");
+ uint steps = get_int(cobject, "motion_steps");
+
+ /* use uneven number of steps so we get one keyframe at the current frame,
+ * and ue 2^(steps - 1) so objects with more/fewer steps still have samples
+ * at the same times, to avoid sampling at many different times */
+ return (2 << (steps - 1)) + 1;
+}
+
+/* object uses deformation motion blur */
+static inline bool object_use_deform_motion(BL::Object b_ob)
+{
+ PointerRNA cobject = RNA_pointer_get(&b_ob.ptr, "cycles");
+ bool use_deform_motion = get_boolean(cobject, "use_deform_motion");
+
+ return use_deform_motion;
+}
+
/* ID Map
*
* Utility class to keep in sync with blender data.