[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [57481] branches/soc-2013-cycles_mblur: Added initial code to change the UI, in order to allow the user to
Gavin Howard
gavin.d.howard at gmail.com
Sat Jun 15 23:00:06 CEST 2013
Revision: 57481
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=57481
Author: gdh
Date: 2013-06-15 21:00:06 +0000 (Sat, 15 Jun 2013)
Log Message:
-----------
Added initial code to change the UI, in order to allow the user to
choose how many steps they would like to export. This option is done
per-object (Cycles will allow the user to specify different numbers of
steps on each object.
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
branches/soc-2013-cycles_mblur/scons/scons-time.py
branches/soc-2013-cycles_mblur/scons/scons.py
branches/soc-2013-cycles_mblur/scons/sconsign.py
branches/soc-2013-cycles_mblur/source/blender/windowmanager/intern/wm_files.c
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 20:54:14 UTC (rev 57480)
+++ branches/soc-2013-cycles_mblur/intern/cycles/blender/addon/properties.py 2013-06-15 21:00:06 UTC (rev 57481)
@@ -668,36 +668,6 @@
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 20:54:14 UTC (rev 57480)
+++ branches/soc-2013-cycles_mblur/intern/cycles/blender/addon/ui.py 2013-06-15 21:00:06 UTC (rev 57481)
@@ -518,32 +518,6 @@
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 20:54:14 UTC (rev 57480)
+++ branches/soc-2013-cycles_mblur/intern/cycles/blender/blender_object.cpp 2013-06-15 21:00:06 UTC (rev 57481)
@@ -84,36 +84,6 @@
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)
Modified: branches/soc-2013-cycles_mblur/scons/scons-time.py
===================================================================
--- branches/soc-2013-cycles_mblur/scons/scons-time.py 2013-06-15 20:54:14 UTC (rev 57480)
+++ branches/soc-2013-cycles_mblur/scons/scons-time.py 2013-06-15 21:00:06 UTC (rev 57481)
@@ -9,7 +9,7 @@
#
#
-# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 The SCons Foundation
+# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
@@ -29,58 +29,36 @@
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-from __future__ import division
+#
+
from __future__ import nested_scopes
-__revision__ = "src/script/scons-time.py 2013/03/03 09:48:35 garyo"
+__revision__ = "src/script/scons-time.py 4043 2009/02/23 09:06:45 scons"
import getopt
import glob
import os
+import os.path
import re
import shutil
+import string
import sys
import tempfile
import time
try:
- sorted
+ False
except NameError:
- # Pre-2.4 Python has no sorted() function.
- #
- # The pre-2.4 Python list.sort() method does not support
- # list.sort(key=) nor list.sort(reverse=) keyword arguments, so
- # we must implement the functionality of those keyword arguments
- # by hand instead of passing them to list.sort().
- def sorted(iterable, cmp=None, key=None, reverse=False):
- if key is not None:
- result = [(key(x), x) for x in iterable]
- else:
- result = iterable[:]
- if cmp is None:
- # Pre-2.3 Python does not support list.sort(None).
- result.sort()
- else:
- result.sort(cmp)
- if key is not None:
- result = [t1 for t0,t1 in result]
- if reverse:
- result.reverse()
- return result
+ # Pre-2.2 Python has no False keyword.
+ import __builtin__
+ __builtin__.False = not 1
-if os.environ.get('SCONS_HORRIBLE_REGRESSION_TEST_HACK') is not None:
- # We can't apply the 'callable' fixer until the floor is 2.6, but the
- # '-3' option to Python 2.6 and 2.7 generates almost ten thousand
- # warnings. This hack allows us to run regression tests with the '-3'
- # option by replacing the callable() built-in function with a hack
- # that performs the same function but doesn't generate the warning.
- # Note that this hack is ONLY intended to be used for regression
- # testing, and should NEVER be used for real runs.
- from types import ClassType
- def callable(obj):
- if hasattr(obj, '__call__'): return True
- if isinstance(obj, (ClassType, type)): return True
- return False
+try:
+ True
+except NameError:
+ # Pre-2.2 Python has no True keyword.
+ import __builtin__
+ __builtin__.True = not 0
def make_temp_file(**kw):
try:
@@ -101,18 +79,7 @@
tempfile.template = save_template
return result
-def HACK_for_exec(cmd, *args):
- '''
- For some reason, Python won't allow an exec() within a function
- that also declares an internal function (including lambda functions).
- This function is a hack that calls exec() in a function with no
- internal functions.
- '''
- if not args: exec(cmd)
- elif len(args) == 1: exec cmd in args[0]
- else: exec cmd in args[0], args[1]
-
-class Plotter(object):
+class Plotter:
def increment_size(self, largest):
"""
Return the size of each horizontal increment line for a specified
@@ -120,12 +87,12 @@
between 5 and 9 horizontal lines on the graph, on some set of
boundaries that are multiples of 10/100/1000/etc.
"""
- i = largest // 5
+ i = largest / 5
if not i:
return largest
multiplier = 1
while i >= 10:
- i = i // 10
+ i = i / 10
multiplier = multiplier * 10
return i * multiplier
@@ -133,9 +100,9 @@
# Round up to next integer.
largest = int(largest) + 1
increment = self.increment_size(largest)
- return ((largest + increment - 1) // increment) * increment
+ return ((largest + increment - 1) / increment) * increment
-class Line(object):
+class Line:
def __init__(self, points, type, title, label, comment, fmt="%s %s"):
self.points = points
self.type = type
@@ -199,13 +166,13 @@
result = []
for line in self.lines:
result.extend(line.get_x_values())
- return [r for r in result if not r is None]
+ return filter(lambda r: not r is None, result)
def get_all_y_values(self):
result = []
for line in self.lines:
result.extend(line.get_y_values())
- return [r for r in result if not r is None]
+ return filter(lambda r: not r is None, result)
def get_min_x(self):
try:
@@ -258,9 +225,10 @@
min_y = self.get_min_y()
max_y = self.max_graph_value(self.get_max_y())
- incr = (max_y - min_y) / 10.0
+ range = max_y - min_y
+ incr = range / 10.0
start = min_y + (max_y / 2.0) + (2.0 * incr)
- position = [ start - (i * incr) for i in range(5) ]
+ position = [ start - (i * incr) for i in xrange(5) ]
inx = 1
for line in self.lines:
@@ -295,11 +263,12 @@
open(name, 'w').write(zf.read(name))
def read_tree(dir):
- for dirpath, dirnames, filenames in os.walk(dir):
- for fn in filenames:
- fn = os.path.join(dirpath, fn)
+ def read_files(arg, dirname, fnames):
+ for fn in fnames:
+ fn = os.path.join(dirname, fn)
if os.path.isfile(fn):
open(fn, 'rb').read()
+ os.path.walk('.', read_files, None)
def redirect_to_file(command, log):
return '%s > %s 2>&1' % (command, log)
@@ -309,7 +278,7 @@
-class SConsTimer(object):
+class SConsTimer:
"""
Usage: scons-time SUBCOMMAND [ARGUMENTS]
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list