[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [59183] branches/soc-2013-dingto/intern/ cycles: Cycles / Motion Blur:

Thomas Dinges blender at dingto.org
Fri Aug 16 14:18:01 CEST 2013


Revision: 59183
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=59183
Author:   dingto
Date:     2013-08-16 12:18:01 +0000 (Fri, 16 Aug 2013)
Log Message:
-----------
Cycles / Motion Blur:
* Added a new panel "Settings" to the object tab.
* Motion blur can now be enabled/disabled on a per object basis, so we can disable motion blur for certain objects.
* Also added some code for the Motion Multiplier, to weaken/strengthen the motion effect per object, but that is still disabled and hidden from the UI. 

Modified Paths:
--------------
    branches/soc-2013-dingto/intern/cycles/blender/addon/properties.py
    branches/soc-2013-dingto/intern/cycles/blender/addon/ui.py
    branches/soc-2013-dingto/intern/cycles/blender/blender_object.cpp
    branches/soc-2013-dingto/intern/cycles/render/object.cpp
    branches/soc-2013-dingto/intern/cycles/render/object.h

Modified: branches/soc-2013-dingto/intern/cycles/blender/addon/properties.py
===================================================================
--- branches/soc-2013-dingto/intern/cycles/blender/addon/properties.py	2013-08-16 10:33:14 UTC (rev 59182)
+++ branches/soc-2013-dingto/intern/cycles/blender/addon/properties.py	2013-08-16 12:18:01 UTC (rev 59183)
@@ -591,6 +591,31 @@
         del bpy.types.World.cycles
 
 
+class CyclesObjectSettings(bpy.types.PropertyGroup):
+    @classmethod
+    def register(cls):
+        bpy.types.Object.cycles_settings = PointerProperty(
+                name="Cycles Object Settings",
+                description="Cycles object settings",
+                type=cls,
+                ) 
+        cls.use_motion = BoolProperty(
+                name="Motion Blur",
+                description="Enable or disable motion blur for this object",
+                default=True,
+                )
+        cls.motion_multiplier = FloatProperty(
+                name="Motion Multiplier",
+                description="Multiplier for Object motion blur shutter time",
+                min=0.0, soft_max=10.0, max=100.0,
+                default=1.0,
+                )
+
+
+    @classmethod
+    def unregister(cls):
+        del bpy.types.Object.cycles_settings
+
 class CyclesVisibilitySettings(bpy.types.PropertyGroup):
     @classmethod
     def register(cls):

Modified: branches/soc-2013-dingto/intern/cycles/blender/addon/ui.py
===================================================================
--- branches/soc-2013-dingto/intern/cycles/blender/addon/ui.py	2013-08-16 10:33:14 UTC (rev 59182)
+++ branches/soc-2013-dingto/intern/cycles/blender/addon/ui.py	2013-08-16 12:18:01 UTC (rev 59183)
@@ -572,6 +572,26 @@
             flow.prop(visibility, "shadow")
 
 
+class CyclesObject_PT_settings(CyclesButtonsPanel, Panel):
+    bl_label = "Settings"
+    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', 'LAMP'}
+
+    def draw(self, context):
+        layout = self.layout
+
+        ob = context.object
+        settings = ob.cycles_settings
+        
+        layout.prop(settings, "use_motion")
+        #layout.prop(settings, "motion_multiplier")
+
+
 class CYCLES_OT_use_shading_nodes(Operator):
     """Enable nodes on a material, world or lamp"""
     bl_idname = "cycles.use_shading_nodes"

Modified: branches/soc-2013-dingto/intern/cycles/blender/blender_object.cpp
===================================================================
--- branches/soc-2013-dingto/intern/cycles/blender/blender_object.cpp	2013-08-16 10:33:14 UTC (rev 59182)
+++ branches/soc-2013-dingto/intern/cycles/blender/blender_object.cpp	2013-08-16 12:18:01 UTC (rev 59183)
@@ -241,13 +241,17 @@
 		object = object_map.find(key);
 
 		if(object) {
+			PointerRNA csettings = RNA_pointer_get(&b_ob.ptr, "cycles_settings");
+
+			object->motion_multiplier = get_float(csettings, "motion_multiplier");
+
 			if(tfm != object->tfm) {
 				if(motion == -1)
 					object->motion.pre = tfm;
 				else
 					object->motion.post = tfm;
-
-				object->use_motion = true;
+					
+				object->use_motion = get_boolean(csettings, "use_motion");
 			}
 
 			/* mesh deformation blur not supported yet */

Modified: branches/soc-2013-dingto/intern/cycles/render/object.cpp
===================================================================
--- branches/soc-2013-dingto/intern/cycles/render/object.cpp	2013-08-16 10:33:14 UTC (rev 59182)
+++ branches/soc-2013-dingto/intern/cycles/render/object.cpp	2013-08-16 12:18:01 UTC (rev 59183)
@@ -47,6 +47,7 @@
 	use_motion = false;
 	use_holdout = false;
 	curverender = false;
+	motion_multiplier = 1.0f;
 }
 
 Object::~Object()

Modified: branches/soc-2013-dingto/intern/cycles/render/object.h
===================================================================
--- branches/soc-2013-dingto/intern/cycles/render/object.h	2013-08-16 10:33:14 UTC (rev 59182)
+++ branches/soc-2013-dingto/intern/cycles/render/object.h	2013-08-16 12:18:01 UTC (rev 59183)
@@ -54,6 +54,8 @@
 	float2 dupli_uv;
 
 	int particle_id;
+	
+	float motion_multiplier;
 
 	Object();
 	~Object();




More information about the Bf-blender-cvs mailing list