diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2014-03-29 16:03:47 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2014-03-29 16:03:47 +0400 |
commit | 6997908afc38a3c98d09939f3b46f10d7a165d2e (patch) | |
tree | 4e38154ce0b5ebd5cc19b908fd9d1122da7a9077 /intern/cycles/blender/addon | |
parent | e2184c653e1f2cc7e05cf9a42a87d23ea3050eac (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/addon')
-rw-r--r-- | intern/cycles/blender/addon/properties.py | 35 | ||||
-rw-r--r-- | intern/cycles/blender/addon/ui.py | 44 |
2 files changed, 79 insertions, 0 deletions
diff --git a/intern/cycles/blender/addon/properties.py b/intern/cycles/blender/addon/properties.py index 1d568247327..eb6680b02a0 100644 --- a/intern/cycles/blender/addon/properties.py +++ b/intern/cycles/blender/addon/properties.py @@ -742,6 +742,41 @@ class CyclesMeshSettings(bpy.types.PropertyGroup): del bpy.types.MetaBall.cycles +class CyclesObjectBlurSettings(bpy.types.PropertyGroup): + + @classmethod + def register(cls): + + bpy.types.Object.cycles = PointerProperty( + name="Cycles Object Settings", + description="Cycles object settings", + type=cls, + ) + + cls.use_motion_blur = BoolProperty( + name="Use Motion Blur", + description="Use motion blur for this object", + default=True, + ) + + cls.use_deform_motion = BoolProperty( + name="Use Deformation Motion", + description="Use deformation motion blur for this object", + default=True, + ) + + cls.motion_steps = IntProperty( + name="Motion Steps", + description="Control accuracy of deformation motion blur, more steps gives more memory usage (actual number of steps is 2^(steps - 1))", + min=1, soft_max=8, + default=1, + ) + + @classmethod + def unregister(cls): + del bpy.types.Object.cycles + + class CyclesCurveRenderSettings(bpy.types.PropertyGroup): @classmethod def register(cls): diff --git a/intern/cycles/blender/addon/ui.py b/intern/cycles/blender/addon/ui.py index 70368c25435..60d1b036d9d 100644 --- a/intern/cycles/blender/addon/ui.py +++ b/intern/cycles/blender/addon/ui.py @@ -572,6 +572,50 @@ class Cycles_PT_mesh_normals(CyclesButtonsPanel, Panel): col.label() +class CyclesObject_PT_motion_blur(CyclesButtonsPanel, Panel): + bl_label = "Motion Blur" + bl_context = "object" + bl_options = {'DEFAULT_CLOSED'} + + @classmethod + def poll(cls, context): + ob = context.object + return CyclesButtonsPanel.poll(context) and ob and ob.type in {'MESH', 'CURVE', 'CURVE', 'SURFACE', 'FONT', 'META'} + + def draw_header(self, context): + layout = self.layout + + rd = context.scene.render + scene = context.scene + cscene = scene.cycles + + layout.active = (rd.use_motion_blur and cscene.device == 'CPU') + + ob = context.object + cob = ob.cycles + + layout.prop(cob, "use_motion_blur", text="") + + def draw(self, context): + layout = self.layout + + rd = context.scene.render + scene = context.scene + cscene = scene.cycles + + ob = context.object + cob = ob.cycles + + layout.active = (rd.use_motion_blur and cscene.device == 'CPU' and cob.use_motion_blur) + + row = layout.row() + row.prop(cob, "use_deform_motion", text="Deformation") + + sub = row.row() + sub.active = cob.use_deform_motion + sub.prop(cob, "motion_steps", text="Steps") + + class CyclesObject_PT_ray_visibility(CyclesButtonsPanel, Panel): bl_label = "Ray Visibility" bl_context = "object" |