[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [57268] branches/multiview: multiview : merging from github branch

Dalai Felinto dfelinto at gmail.com
Thu Jun 6 21:14:40 CEST 2013


Revision: 57268
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=57268
Author:   dfelinto
Date:     2013-06-06 19:14:40 +0000 (Thu, 06 Jun 2013)
Log Message:
-----------
multiview : merging from github branch

NOTE: this is the version of the first patch sent for review

github: af95667bbf717ee4a4637b1eeaa3398e3ac974c5
http://github.com/dfelinto/blender/tree/multiview

note: this is trunk/svn revision: 57266

Modified Paths:
--------------
    branches/multiview/CMakeLists.txt
    branches/multiview/intern/cycles/render/graph.cpp
    branches/multiview/intern/guardedalloc/test/simpletest/memtest.c
    branches/multiview/release/scripts/modules/nodeitems_utils.py
    branches/multiview/release/scripts/startup/bl_operators/mesh.py
    branches/multiview/release/scripts/startup/bl_operators/node.py
    branches/multiview/release/scripts/startup/bl_ui/properties_data_mesh.py
    branches/multiview/release/scripts/startup/bl_ui/space_userpref.py
    branches/multiview/release/scripts/startup/bl_ui/space_view3d.py
    branches/multiview/release/scripts/startup/nodeitems_builtins.py
    branches/multiview/source/blender/blenkernel/intern/image.c
    branches/multiview/source/blender/blenkernel/intern/lamp.c
    branches/multiview/source/blender/blenkernel/intern/material.c
    branches/multiview/source/blender/blenkernel/intern/node.c
    branches/multiview/source/blender/blenkernel/intern/paint.c
    branches/multiview/source/blender/blenkernel/intern/texture.c
    branches/multiview/source/blender/blenkernel/intern/world.c
    branches/multiview/source/blender/blenlib/intern/math_vector.c
    branches/multiview/source/blender/blenlib/intern/path_util.c
    branches/multiview/source/blender/blenloader/intern/readfile.c
    branches/multiview/source/blender/bmesh/intern/bmesh_edgeloop.c
    branches/multiview/source/blender/bmesh/intern/bmesh_edgeloop.h
    branches/multiview/source/blender/bmesh/operators/bmo_fill_grid.c
    branches/multiview/source/blender/bmesh/operators/bmo_subdivide_edgering.c
    branches/multiview/source/blender/editors/animation/anim_filter.c
    branches/multiview/source/blender/editors/include/ED_mesh.h
    branches/multiview/source/blender/editors/include/ED_screen.h
    branches/multiview/source/blender/editors/include/UI_view2d.h
    branches/multiview/source/blender/editors/interface/view2d.c
    branches/multiview/source/blender/editors/mesh/editmesh_select.c
    branches/multiview/source/blender/editors/mesh/editmesh_tools.c
    branches/multiview/source/blender/editors/mesh/editmesh_utils.c
    branches/multiview/source/blender/editors/mesh/mesh_data.c
    branches/multiview/source/blender/editors/object/object_relations.c
    branches/multiview/source/blender/editors/object/object_shapekey.c
    branches/multiview/source/blender/editors/object/object_vgroup.c
    branches/multiview/source/blender/editors/render/render_internal.c
    branches/multiview/source/blender/editors/screen/screen_edit.c
    branches/multiview/source/blender/editors/screen/screen_ops.c
    branches/multiview/source/blender/editors/sculpt_paint/paint_image.c
    branches/multiview/source/blender/editors/space_file/filesel.c
    branches/multiview/source/blender/editors/space_image/image_buttons.c
    branches/multiview/source/blender/editors/space_image/image_draw.c
    branches/multiview/source/blender/editors/space_node/node_add.c
    branches/multiview/source/blender/editors/space_node/node_edit.c
    branches/multiview/source/blender/editors/space_node/node_group.c
    branches/multiview/source/blender/editors/space_node/node_intern.h
    branches/multiview/source/blender/editors/space_node/node_relationships.c
    branches/multiview/source/blender/editors/space_view3d/drawobject.c
    branches/multiview/source/blender/editors/space_view3d/view3d_draw.c
    branches/multiview/source/blender/editors/transform/transform_conversions.c
    branches/multiview/source/blender/editors/transform/transform_ops.c
    branches/multiview/source/blender/editors/uvedit/uvedit_smart_stitch.c
    branches/multiview/source/blender/gpu/intern/gpu_buffers.c
    branches/multiview/source/blender/gpu/shaders/gpu_shader_material.glsl
    branches/multiview/source/blender/makesdna/DNA_screen_types.h
    branches/multiview/source/blender/makesdna/DNA_userdef_types.h
    branches/multiview/source/blender/makesrna/intern/rna_define.c
    branches/multiview/source/blender/makesrna/intern/rna_mesh.c
    branches/multiview/source/blender/makesrna/intern/rna_nodetree.c
    branches/multiview/source/blender/makesrna/intern/rna_object.c
    branches/multiview/source/blender/makesrna/intern/rna_userdef.c
    branches/multiview/source/blender/modifiers/intern/MOD_ocean.c
    branches/multiview/source/blender/modifiers/intern/MOD_uvwarp.c
    branches/multiview/source/blender/nodes/shader/nodes/node_shader_attribute.c
    branches/multiview/source/blender/nodes/shader/nodes/node_shader_common.c
    branches/multiview/source/blender/render/extern/include/RE_pipeline.h
    branches/multiview/source/blender/render/intern/source/pipeline.c
    branches/multiview/source/blender/render/intern/source/render_result.c
    branches/multiview/source/blender/windowmanager/intern/wm_draw.c
    branches/multiview/source/blender/windowmanager/intern/wm_stereo.c
    branches/multiview/source/blender/windowmanager/intern/wm_window.c

Modified: branches/multiview/CMakeLists.txt
===================================================================
--- branches/multiview/CMakeLists.txt	2013-06-06 19:04:56 UTC (rev 57267)
+++ branches/multiview/CMakeLists.txt	2013-06-06 19:14:40 UTC (rev 57268)
@@ -931,20 +931,26 @@
 	#  include(${CMAKE_ROOT}/Modules/Platform/Windows-cl.cmake)
 
 	if(CMAKE_COMPILER_IS_GNUCC)
-		set(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/mingw32)
 		include(CheckCSourceCompiles)
 		# Setup 64bit and 64bit windows systems
 		CHECK_C_SOURCE_COMPILES("
 			#ifndef __MINGW64__
 			#error
 			#endif
-			main(){}
+			int main(void) { return 0; }
 			" 
 			WITH_MINGW64)
 		
 		if(WITH_MINGW64)
 			message(STATUS "Compiling for 64 bit with MinGW-w64.")
 			set(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/mingw64)
+		else()
+			message(STATUS "Compiling for 32 bit with MinGW-w32.")
+			set(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/mingw32)
+			
+			if(WITH_RAYOPTIMIZATION)
+				message(WARNING "MinGW-w32 is known to be unstable with 'WITH_RAYOPTIMIZATION' option enabled.")
+			endif()
 		endif()
 	else()
 		# Setup 64bit and 64bit windows systems

Modified: branches/multiview/intern/cycles/render/graph.cpp
===================================================================
--- branches/multiview/intern/cycles/render/graph.cpp	2013-06-06 19:04:56 UTC (rev 57267)
+++ branches/multiview/intern/cycles/render/graph.cpp	2013-06-06 19:14:40 UTC (rev 57268)
@@ -192,9 +192,9 @@
 		/* for closures we can't do automatic conversion */
 		if(from->type == SHADER_SOCKET_CLOSURE || to->type == SHADER_SOCKET_CLOSURE) {
 			fprintf(stderr, "Cycles shader graph connect: can only connect closure to closure "
-			        "(ShaderNode:%s, ShaderOutput:%s , type:%d -> to ShaderNode:%s, ShaderInput:%s, type:%d).\n",
-			        from->parent->name.c_str(), from->name, (int)from->type,
-			        to->parent->name.c_str(),   to->name,   (int)to->type);
+			        "(%s.%s to %s.%s).\n",
+			        from->parent->name.c_str(), from->name,
+			        to->parent->name.c_str(), to->name);
 			return;
 		}
 

Modified: branches/multiview/intern/guardedalloc/test/simpletest/memtest.c
===================================================================
--- branches/multiview/intern/guardedalloc/test/simpletest/memtest.c	2013-06-06 19:04:56 UTC (rev 57267)
+++ branches/multiview/intern/guardedalloc/test/simpletest/memtest.c	2013-06-06 19:14:40 UTC (rev 57268)
@@ -47,7 +47,7 @@
 	fflush(stderr);
 }
 
-int main (int argc, char *argv[])
+int main(int argc, char *argv[])
 {
 	int verbose       = 0;
 	int error_status  = 0;

Modified: branches/multiview/release/scripts/modules/nodeitems_utils.py
===================================================================
--- branches/multiview/release/scripts/modules/nodeitems_utils.py	2013-06-06 19:04:56 UTC (rev 57267)
+++ branches/multiview/release/scripts/modules/nodeitems_utils.py	2013-06-06 19:14:40 UTC (rev 57268)
@@ -57,7 +57,28 @@
             # if no custom label is defined, fall back to the node type UI name
             return getattr(bpy.types, self.nodetype).bl_rna.name
 
+    # NB: is a staticmethod because called with an explicit self argument
+    # NodeItemCustom sets this as a variable attribute in __init__
+    @staticmethod
+    def draw(self, layout, context):
+        default_context = bpy.app.translations.contexts.default
 
+        props = layout.operator("node.add_node", text=self.label, text_ctxt=default_context)
+        props.type = self.nodetype
+        props.use_transform = True
+
+        for setting in self.settings.items():
+            ops = props.settings.add()
+            ops.name = setting[0]
+            ops.value = setting[1]
+
+
+class NodeItemCustom():
+    def __init__(self, poll=None, draw=None):
+        self.poll = poll
+        self.draw = draw
+
+
 _node_categories = {}
 
 def register_node_categories(identifier, cat_list):
@@ -71,15 +92,8 @@
         col = layout.column()
         default_context = bpy.app.translations.contexts.default
         for item in self.category.items(context):
-            props = col.operator("node.add_node", text=item.label, text_ctxt=default_context)
-            props.type = item.nodetype
-            props.use_transform = True
+            item.draw(item, col, context)
 
-            for setting in item.settings.items():
-                ops = props.settings.add()
-                ops.name = setting[0]
-                ops.value = setting[1]
-
     menu_types = []
     panel_types = []
     for cat in cat_list:

Modified: branches/multiview/release/scripts/startup/bl_operators/mesh.py
===================================================================
--- branches/multiview/release/scripts/startup/bl_operators/mesh.py	2013-06-06 19:04:56 UTC (rev 57267)
+++ branches/multiview/release/scripts/startup/bl_operators/mesh.py	2013-06-06 19:14:40 UTC (rev 57268)
@@ -21,7 +21,7 @@
 import bpy
 from bpy.types import Operator
 
-from bpy.props import EnumProperty
+from bpy.props import EnumProperty, IntProperty
 
 
 class MeshMirrorUV(Operator):
@@ -36,6 +36,14 @@
                    ('NEGATIVE', "Negative", "")),
             )
 
+    precision = IntProperty(
+            name="Precision",
+            description=("Tolerance for finding vertex duplicates"),
+            min=1, max=16,
+            soft_min=1, soft_max=16,
+            default=3,
+            )
+
     @classmethod
     def poll(cls, context):
         obj = context.active_object
@@ -43,6 +51,8 @@
 
     def execute(self, context):
         DIR = (self.direction == 'NEGATIVE')
+        precision = self.precision
+        double_warn = 0
 
         ob = context.active_object
         is_editmode = (ob.mode == 'EDIT')
@@ -55,12 +65,14 @@
         mirror_gt = {}
         mirror_lt = {}
 
-        vcos = (v.co.to_tuple(5) for v in mesh.vertices)
+        vcos = (v.co.to_tuple(precision) for v in mesh.vertices)
 
         for i, co in enumerate(vcos):
             if co[0] >= 0.0:
+                double_warn += co in mirror_gt
                 mirror_gt[co] = i
             if co[0] <= 0.0:
+                double_warn += co in mirror_lt
                 mirror_lt[co] = i
 
         #for i, v in enumerate(mesh.vertices):
@@ -95,10 +107,7 @@
                          (uv.select for uv in uv_loops[lstart:lend]))
             # Vert idx of the poly.
             vidxs[i] = tuple(l.vertex_index for l in loops[lstart:lend])
-            # As we have no poly.center yet...
-            pcents[i] = tuple(map(lambda x: x / p.loop_total,
-                                  map(sum, zip(*(verts[idx].co
-                                                 for idx in vidxs[i])))))
+            pcents[i] = p.center
             # Preparing next step finding matching polys.
             mirror_pm[tuple(sorted(vidxs[i]))] = i
 
@@ -135,4 +144,9 @@
         if is_editmode:
             bpy.ops.object.mode_set(mode='EDIT', toggle=False)
 
+        if double_warn:
+            self.report({'WARNING'},
+                        "%d duplicates found, mirror may be incomplete" %
+                        double_warn)
+
         return {'FINISHED'}

Modified: branches/multiview/release/scripts/startup/bl_operators/node.py
===================================================================
--- branches/multiview/release/scripts/startup/bl_operators/node.py	2013-06-06 19:04:56 UTC (rev 57267)
+++ branches/multiview/release/scripts/startup/bl_operators/node.py	2013-06-06 19:14:40 UTC (rev 57268)
@@ -100,7 +100,7 @@
     def poll(cls, context):
         space = context.space_data
         # needs active node editor and a tree to add nodes to
-        return (space.type == 'NODE_EDITOR' and space.edit_tree)
+        return (space.type == 'NODE_EDITOR' and space.edit_tree and not space.edit_tree.library)
 
     # Default execute simply adds a node
     def execute(self, context):
@@ -231,7 +231,7 @@
     def poll(cls, context):
         space = context.space_data
         # needs active node editor and a tree
-        return (space.type == 'NODE_EDITOR' and space.edit_tree)
+        return (space.type == 'NODE_EDITOR' and space.edit_tree and not space.edit_tree.library)
 
     def execute(self, context):
         space = context.space_data

Modified: branches/multiview/release/scripts/startup/bl_ui/properties_data_mesh.py
===================================================================
--- branches/multiview/release/scripts/startup/bl_ui/properties_data_mesh.py	2013-06-06 19:04:56 UTC (rev 57267)
+++ branches/multiview/release/scripts/startup/bl_ui/properties_data_mesh.py	2013-06-06 19:14:40 UTC (rev 57268)
@@ -34,8 +34,9 @@
         layout.operator("object.vertex_group_copy_to_linked", icon='LINK_AREA')
         layout.operator("object.vertex_group_copy_to_selected", icon='LINK_AREA')
         layout.operator("object.vertex_group_mirror", icon='ARROW_LEFTRIGHT')
-        layout.operator("object.vertex_group_remove", icon='X', text="Delete All Vertex Groups").all = True
-        layout.operator("object.vertex_group_remove_from", icon='X', text="Remove Selected from All Vertex Groups").all = True
+        layout.operator("object.vertex_group_remove_from", icon='X', text="Remove from All Groups").use_all_groups = True
+        layout.operator("object.vertex_group_remove_from", icon='X', text="Clear Active Group").use_all_verts = True
+        layout.operator("object.vertex_group_remove", icon='X', text="Delete All Groups").all = True
         layout.separator()
         layout.operator("object.vertex_group_lock", icon='LOCKED', text="Lock All").action = 'LOCK'
         layout.operator("object.vertex_group_lock", icon='UNLOCKED', text="UnLock All").action = 'UNLOCK'
@@ -53,6 +54,7 @@
         layout.operator("object.join_shapes", icon='COPY_ID')  # icon is not ideal
         layout.operator("object.shape_key_mirror", icon='ARROW_LEFTRIGHT')
         layout.operator("object.shape_key_add", icon='ZOOMIN', text="New Shape From Mix").from_mix = True
+        layout.operator("object.shape_key_remove", icon='X', text="Delete All Shapes").all = True
 
 
 class MESH_UL_vgroups(UIList):
@@ -256,7 +258,7 @@
 
         sub = col.column(align=True)
         sub.operator("object.shape_key_add", icon='ZOOMIN', text="").from_mix = False
-        sub.operator("object.shape_key_remove", icon='ZOOMOUT', text="")
+        sub.operator("object.shape_key_remove", icon='ZOOMOUT', text="").all = False

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list