[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [57484] branches/soc-2013-cycles_mblur/ intern/cycles/blender: This is the initial commit to add the UI elements for selecting the
Gavin Howard
gavin.d.howard at gmail.com
Sat Jun 15 23:15:24 CEST 2013
Revision: 57484
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=57484
Author: gdh
Date: 2013-06-15 21:15:23 +0000 (Sat, 15 Jun 2013)
Log Message:
-----------
This is the initial commit to add the UI elements for selecting the
number of export steps and to enable deformation motion blur for
certain objects.
Modified Paths:
--------------
branches/soc-2013-cycles_mblur/intern/cycles/blender/addon/properties.py
branches/soc-2013-cycles_mblur/intern/cycles/blender/addon/ui.py
branches/soc-2013-cycles_mblur/intern/cycles/blender/blender_object.cpp
Modified: branches/soc-2013-cycles_mblur/intern/cycles/blender/addon/properties.py
===================================================================
--- branches/soc-2013-cycles_mblur/intern/cycles/blender/addon/properties.py 2013-06-15 21:14:00 UTC (rev 57483)
+++ branches/soc-2013-cycles_mblur/intern/cycles/blender/addon/properties.py 2013-06-15 21:15:23 UTC (rev 57484)
@@ -668,6 +668,36 @@
del bpy.types.Mesh.cycles
del bpy.types.Curve.cycles
del bpy.types.MetaBall.cycles
+
+
+class CyclesObjectBlurSettings(bpy.types.PropertyGroup):
+
+ @classmethod
+ def register(cls):
+
+ bpy.types.Object.cycles_mblur = PointerProperty(
+ name="Cycles Motion Blur Settings",
+ description="Per-Object Cycles motion blur settings",
+ type=cls,
+ )
+
+ cls.use_deformation_mblur = BoolProperty(
+ name="Use Deformation Motion Blur",
+ description="Use deformation motion blur for this object",
+ default=False,
+ )
+
+ cls.mblur_steps = IntProperty(
+ name="Motion Blur Steps",
+ description="Number of steps to export for rendering motion blur",
+ min=3, soft_max=256,
+ default=3,
+ )
+
+
+ @classmethod
+ def unregister(cls):
+ del bpy.types.Object.cycles_blur
class CyclesCurveRenderSettings(bpy.types.PropertyGroup):
Modified: branches/soc-2013-cycles_mblur/intern/cycles/blender/addon/ui.py
===================================================================
--- branches/soc-2013-cycles_mblur/intern/cycles/blender/addon/ui.py 2013-06-15 21:14:00 UTC (rev 57483)
+++ branches/soc-2013-cycles_mblur/intern/cycles/blender/addon/ui.py 2013-06-15 21:15:23 UTC (rev 57484)
@@ -518,6 +518,32 @@
col = split.column()
col.label()
+
+
+class CyclesObject_PT_mblur(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'} # todo: 'LAMP'
+
+ def draw(self, context):
+ layout = self.layout
+
+ rd = context.scene.render
+ layout.active = rd.use_motion_blur
+
+ ob = context.object
+ blur = ob.cycles_mblur
+
+ row = layout.row()
+ row.prop(blur, "mblur_steps", text="Steps")
+
+ row = layout.row()
+ row.prop(blur, "use_deformation_mblur", text="Deformation Motion Blur")
class CyclesObject_PT_ray_visibility(CyclesButtonsPanel, Panel):
Modified: branches/soc-2013-cycles_mblur/intern/cycles/blender/blender_object.cpp
===================================================================
--- branches/soc-2013-cycles_mblur/intern/cycles/blender/blender_object.cpp 2013-06-15 21:14:00 UTC (rev 57483)
+++ branches/soc-2013-cycles_mblur/intern/cycles/blender/blender_object.cpp 2013-06-15 21:15:23 UTC (rev 57484)
@@ -84,6 +84,36 @@
return flag;
}
+/* Returns the number of steps the user chose to export for mblur. */
+static uint object_mblur_steps(BL::Object b_ob)
+{
+ PointerRNA cmblur = RNA_pointer_get(&b_ob.ptr, "cycles_mblur");
+
+ // 3 is the default.
+ uint steps = 3;
+
+ steps = get_int(cmblur, "mblur_steps");
+
+ // Make sure we get the minimum.
+ steps = steps >= 3 ? steps : 3;
+
+ return steps;
+}
+
+/*
+ * Returns true if the user wants deformation motion blur for the object.
+ * It returns false otherwise.
+ */
+static bool object_use_deform_mblur(BL::Object b_ob)
+{
+ PointerRNA cdeform = RNA_pointer_get(&b_ob.ptr, "cycles_mblur");
+ bool useDeform = false;
+
+ useDeform = get_boolean(cdeform, "use_deformation_mblur");
+
+ return useDeform;
+}
+
/* Light */
void BlenderSync::sync_light(BL::Object b_parent, int persistent_id[OBJECT_PERSISTENT_ID_SIZE], BL::Object b_ob, Transform& tfm)
More information about the Bf-blender-cvs
mailing list