[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [49711] branches/soc-2011-tomato: svn merge ^/trunk/blender -r49707:49710

Campbell Barton ideasman42 at gmail.com
Wed Aug 8 19:10:01 CEST 2012


Revision: 49711
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=49711
Author:   campbellbarton
Date:     2012-08-08 17:10:01 +0000 (Wed, 08 Aug 2012)
Log Message:
-----------
svn merge ^/trunk/blender -r49707:49710

Revision Links:
--------------
    http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=49707

Modified Paths:
--------------
    branches/soc-2011-tomato/release/scripts/startup/bl_operators/node.py
    branches/soc-2011-tomato/source/blender/compositor/operations/COM_VariableSizeBokehBlurOperation.cpp

Property Changed:
----------------
    branches/soc-2011-tomato/
    branches/soc-2011-tomato/source/blender/editors/interface/interface.c
    branches/soc-2011-tomato/source/blender/editors/space_outliner/


Property changes on: branches/soc-2011-tomato
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/ge_harmony:42255,42279-42282,42286,42302,42338,42349,42616,42620,42698-42699,42739,42753,42773-42774,42832,44568,44597-44598,44793-44794
/branches/soc-2011-cucumber:37517,38166-38167,38177,38179-38180,38187,38242,38384,38387,38403-38404,38407,38968,38970,38973,39045,40845,42997-42998,43439
/branches/vgroup_modifiers:38694-39989
/trunk/blender:36831-49707
   + /branches/ge_harmony:42255,42279-42282,42286,42302,42338,42349,42616,42620,42698-42699,42739,42753,42773-42774,42832,44568,44597-44598,44793-44794
/branches/soc-2011-cucumber:37517,38166-38167,38177,38179-38180,38187,38242,38384,38387,38403-38404,38407,38968,38970,38973,39045,40845,42997-42998,43439
/branches/vgroup_modifiers:38694-39989
/trunk/blender:36831-49710

Modified: branches/soc-2011-tomato/release/scripts/startup/bl_operators/node.py
===================================================================
--- branches/soc-2011-tomato/release/scripts/startup/bl_operators/node.py	2012-08-08 17:02:14 UTC (rev 49710)
+++ branches/soc-2011-tomato/release/scripts/startup/bl_operators/node.py	2012-08-08 17:10:01 UTC (rev 49711)
@@ -20,11 +20,7 @@
 
 import bpy
 from bpy.types import Operator
-from bpy.props import (EnumProperty,
-                       FloatVectorProperty,
-                       StringProperty,
-                       CollectionProperty
-                       )
+from bpy.props import EnumProperty
 
 # XXX These node item lists should actually be generated by a callback at operator execution time (see node_type_items below),
 # using the active node tree from the context. Due to a difficult bug in bpy this is not possible (item list memory gets freed too early),
@@ -33,51 +29,66 @@
 # In the custom_nodes branch, the static per-tree-type node items are replaced by a single independent type list anyway (with a poll function
 # to limit node types to the respective trees). So this workaround is only temporary.
 
+# lazy init
 node_type_items_dict = {}
-node_type_items_dict['SHADER'] = [(item.identifier, item.name, item.description, item.value) for item in bpy.types.ShaderNode.bl_rna.properties['type'].enum_items]
-node_type_items_dict['COMPOSITING'] = [(item.identifier, item.name, item.description, item.value) for item in bpy.types.CompositorNode.bl_rna.properties['type'].enum_items]
-node_type_items_dict['TEXTURE'] = [(item.identifier, item.name, item.description, item.value) for item in bpy.types.TextureNode.bl_rna.properties['type'].enum_items]
 
 # Returns the enum item list for the edited tree in the context
-def node_type_items(self, context):
+def node_type_items_cb(self, context):
     snode = context.space_data
     if not snode:
         return []
     tree = snode.edit_tree
     if not tree:
         return []
-    
+
+    if not node_type_items_dict:
+        node_type_items_dict.update({
+            'SHADER': [(item.identifier, item.name, item.description, item.value)
+                    for item in bpy.types.ShaderNode.bl_rna.properties['type'].enum_items],
+            'COMPOSITING': [(item.identifier, item.name, item.description, item.value)
+                    for item in bpy.types.CompositorNode.bl_rna.properties['type'].enum_items],
+            'TEXTURE': [(item.identifier, item.name, item.description, item.value)
+                    for item in bpy.types.TextureNode.bl_rna.properties['type'].enum_items],
+            })
+
     # XXX Does not work correctly, see comment above
     #return [(item.identifier, item.name, item.description, item.value) for item in tree.nodes.bl_rna.functions['new'].parameters['type'].enum_items]
-    
+
     if tree.type in node_type_items_dict:
         return node_type_items_dict[tree.type]
     else:
         return []
 
-class NODE_OT_add_search(bpy.types.Operator):
+
+class NODE_OT_add_search(Operator):
     '''Add a node to the active tree'''
     bl_idname = "node.add_search"
     bl_label = "Search and Add Node"
     bl_options = {'REGISTER', 'UNDO'}
 
     # XXX this should be called 'node_type' but the operator search property is hardcoded to 'type' by a hack in bpy_operator_wrap.c ...
-    type = EnumProperty(items=node_type_items, name="Node Type", description="Node type")
+    type = EnumProperty(
+            name="Node Type",
+            description="Node type",
+            items=node_type_items_cb,
+            )
 
+    _node_type_items_dict = None
+
     def create_node(self, context):
         space = context.space_data
         tree = space.edit_tree
-        
+
         node = tree.nodes.new(type=self.type)
         for n in tree.nodes:
-            if n==node:
+            if n == node:
                 node.select = True
                 tree.nodes.active = node
             else:
                 node.select = False
         node.location = space.cursor_location
         return node
-    
+
     @classmethod
     def poll(cls, context):
         space = context.space_data
@@ -94,7 +105,6 @@
 
         # convert mouse position to the View2D for later node placement
         space.cursor_location = v2d.region_to_view(event.mouse_region_x, event.mouse_region_y)
-        
+
         context.window_manager.invoke_search_popup(self)
         return {'CANCELLED'}
-

Modified: branches/soc-2011-tomato/source/blender/compositor/operations/COM_VariableSizeBokehBlurOperation.cpp
===================================================================
--- branches/soc-2011-tomato/source/blender/compositor/operations/COM_VariableSizeBokehBlurOperation.cpp	2012-08-08 17:02:14 UTC (rev 49710)
+++ branches/soc-2011-tomato/source/blender/compositor/operations/COM_VariableSizeBokehBlurOperation.cpp	2012-08-08 17:10:01 UTC (rev 49711)
@@ -158,6 +158,15 @@
 		color[1] = color_accum[1] / multiplier_accum[1];
 		color[2] = color_accum[2] / multiplier_accum[2];
 		color[3] = color_accum[3] / multiplier_accum[3];
+
+		/* blend in out values over the threshold, otherwise we get sharp, ugly transitions */
+		if ((sizeCenter > this->m_threshold) &&
+		    (sizeCenter < this->m_threshold * 2.0f))
+		{
+			/* factor from 0-1 */
+			float fac = (sizeCenter - this->m_threshold) / this->m_threshold;
+			interp_v4_v4v4(color, readColor, color, fac);
+		}
 	}
 
 }


Property changes on: branches/soc-2011-tomato/source/blender/editors/interface/interface.c
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/ge_candy/source/blender/editors/interface/interface.c:45070-46163
/branches/ge_harmony/source/blender/editors/interface/interface.c:42255,42279-42282,42286,42302,42338,42349,42616,42620,42698-42699,42739,42753,42773-42774,42832,44568,44597-44598,44793-44794
/branches/soc-2011-cucumber/source/blender/editors/interface/interface.c:37517,38166-38167,38177,38179-38180,38187,38242,38384,38387,38403-38404,38407,38968,38970,38973,39045,40845,42997-42998,43439
/branches/vgroup_modifiers/source/blender/editors/interface/interface.c:38694-39989
/trunk/blender/source/blender/editors/interface/interface.c:36831-49707
   + /branches/ge_candy/source/blender/editors/interface/interface.c:45070-46163
/branches/ge_harmony/source/blender/editors/interface/interface.c:42255,42279-42282,42286,42302,42338,42349,42616,42620,42698-42699,42739,42753,42773-42774,42832,44568,44597-44598,44793-44794
/branches/soc-2011-cucumber/source/blender/editors/interface/interface.c:37517,38166-38167,38177,38179-38180,38187,38242,38384,38387,38403-38404,38407,38968,38970,38973,39045,40845,42997-42998,43439
/branches/vgroup_modifiers/source/blender/editors/interface/interface.c:38694-39989
/trunk/blender/source/blender/editors/interface/interface.c:36831-49710


Property changes on: branches/soc-2011-tomato/source/blender/editors/space_outliner
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/soc-2011-cucumber/source/blender/editors/space_outliner:38968,38970,38973,39045,40845
/branches/soc-2011-pepper/source/blender/editors/space_outliner:36831-38987
/trunk/blender/source/blender/editors/space_outliner:36831-49707
   + /branches/soc-2011-cucumber/source/blender/editors/space_outliner:38968,38970,38973,39045,40845
/branches/soc-2011-pepper/source/blender/editors/space_outliner:36831-38987
/trunk/blender/source/blender/editors/space_outliner:36831-49710




More information about the Bf-blender-cvs mailing list