[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [38733] branches/soc-2011-tomato: Merging r38704 through r38732 from trunk into soc-2011-tomato

Sergey Sharybin g.ulairi at gmail.com
Tue Jul 26 17:56:54 CEST 2011


Revision: 38733
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=38733
Author:   nazgul
Date:     2011-07-26 15:56:53 +0000 (Tue, 26 Jul 2011)
Log Message:
-----------
Merging r38704 through r38732 from trunk into soc-2011-tomato

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

Modified Paths:
--------------
    branches/soc-2011-tomato/doc/python_api/examples/mathutils.Vector.py
    branches/soc-2011-tomato/release/scripts/startup/bl_ui/space_text.py
    branches/soc-2011-tomato/source/blender/blenkernel/BKE_blender.h
    branches/soc-2011-tomato/source/blender/blenkernel/intern/text.c
    branches/soc-2011-tomato/source/blender/editors/interface/interface_regions.c
    branches/soc-2011-tomato/source/blender/editors/object/object_add.c
    branches/soc-2011-tomato/source/blender/editors/space_view3d/view3d_edit.c
    branches/soc-2011-tomato/source/blender/editors/transform/transform_snap.c
    branches/soc-2011-tomato/source/blender/editors/util/undo.c
    branches/soc-2011-tomato/source/blender/editors/uvedit/uvedit_ops.c
    branches/soc-2011-tomato/source/blender/makesrna/intern/rna_object_api.c
    branches/soc-2011-tomato/source/blender/makesrna/intern/rna_wm.c
    branches/soc-2011-tomato/source/blender/windowmanager/WM_api.h
    branches/soc-2011-tomato/source/blender/windowmanager/intern/wm.c
    branches/soc-2011-tomato/source/blenderplayer/bad_level_call_stubs/stubs.c

Added Paths:
-----------
    branches/soc-2011-tomato/release/scripts/templates/ui_menu.py
    branches/soc-2011-tomato/release/scripts/templates/ui_menu_simple.py
    branches/soc-2011-tomato/release/scripts/templates/ui_panel_simple.py

Removed Paths:
-------------
    branches/soc-2011-tomato/release/scripts/templates/panel_simple.py

Property Changed:
----------------
    branches/soc-2011-tomato/
    branches/soc-2011-tomato/intern/audaspace/OpenAL/


Property changes on: branches/soc-2011-tomato
___________________________________________________________________
Modified: svn:mergeinfo
   - /trunk/blender:36831-38703
   + /trunk/blender:36831-38732

Modified: branches/soc-2011-tomato/doc/python_api/examples/mathutils.Vector.py
===================================================================
--- branches/soc-2011-tomato/doc/python_api/examples/mathutils.Vector.py	2011-07-26 15:27:57 UTC (rev 38732)
+++ branches/soc-2011-tomato/doc/python_api/examples/mathutils.Vector.py	2011-07-26 15:56:53 UTC (rev 38733)
@@ -1,15 +1,15 @@
 import mathutils
 
 # zero length vector
-vec = mathutils.Vector((0, 0, 1))
+vec = mathutils.Vector((0.0, 0.0, 1.0))
 
 # unit length vector
 vec_a = vec.copy().normalize()
 
-vec_b = mathutils.Vector((0, 1, 2))
+vec_b = mathutils.Vector((0.0, 1.0, 2.0))
 
-vec2d = mathutils.Vector((1, 2))
-vec3d = mathutils.Vector((1, 0, 0))
+vec2d = mathutils.Vector((1.0, 2.0))
+vec3d = mathutils.Vector((1.0, 0.0, 0.0))
 vec4d = vec_a.to_4d()
 
 # other mathutuls types
@@ -34,9 +34,9 @@
 vec_a - vec_b
 vec_a * vec_b
 vec_a * 10.0
-vec_a * matrix
+matrix * vec_a
+quat * vec_a
 vec_a * vec_b
-vec_a * quat
 -vec_a
 
 
@@ -44,6 +44,7 @@
 x = vec_a[0]
 len(vec)
 vec_a[:] = vec_b
+vec_a[:] = 1.0, 2.0, 3.0
 vec2d[:] = vec3d[:2]
 
 


Property changes on: branches/soc-2011-tomato/intern/audaspace/OpenAL
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/soc-2011-pepper/intern/audaspace/OpenAL:38630
/trunk/blender/intern/audaspace/OpenAL:36831-38703
   + /branches/soc-2011-pepper/intern/audaspace/OpenAL:38630
/trunk/blender/intern/audaspace/OpenAL:36831-38732

Modified: branches/soc-2011-tomato/release/scripts/startup/bl_ui/space_text.py
===================================================================
--- branches/soc-2011-tomato/release/scripts/startup/bl_ui/space_text.py	2011-07-26 15:27:57 UTC (rev 38732)
+++ branches/soc-2011-tomato/release/scripts/startup/bl_ui/space_text.py	2011-07-26 15:56:53 UTC (rev 38733)
@@ -16,7 +16,7 @@
 #
 # ##### END GPL LICENSE BLOCK #####
 
-# <pep8 compliant>
+# <pep8-80 compliant>
 import bpy
 
 
@@ -36,10 +36,13 @@
             sub = row.row(align=True)
             sub.menu("TEXT_MT_view")
             sub.menu("TEXT_MT_text")
+
             if text:
                 sub.menu("TEXT_MT_edit")
                 sub.menu("TEXT_MT_format")
 
+            sub.menu("TEXT_MT_templates")
+
         if text and text.is_modified:
             row = layout.row()
             row.alert = True
@@ -63,11 +66,13 @@
             row = layout.row()
             if text.filepath:
                 if text.is_dirty:
-                    row.label(text="File: *%s (unsaved)" % text.filepath)
+                    row.label(text="File: *%r (unsaved)" % text.filepath)
                 else:
-                    row.label(text="File: %s" % text.filepath)
+                    row.label(text="File: %r" % text.filepath)
             else:
-                row.label(text="Text: External" if text.library else "Text: Internal")
+                row.label(text="Text: External"
+                          if text.library
+                          else "Text: Internal")
 
 
 class TEXT_PT_properties(bpy.types.Panel):
@@ -150,8 +155,12 @@
 
         layout.separator()
 
-        layout.operator("text.move", text="Top of File").type = 'FILE_TOP'
-        layout.operator("text.move", text="Bottom of File").type = 'FILE_BOTTOM'
+        layout.operator("text.move",
+                        text="Top of File",
+                        ).type = 'FILE_TOP'
+        layout.operator("text.move",
+                        text="Bottom of File",
+                        ).type = 'FILE_BOTTOM'
 
 
 class TEXT_MT_text(bpy.types.Menu):
@@ -185,19 +194,15 @@
             # XXX   uiMenuItemO(head, 0, "text.refresh_pyconstraints");
             #endif
 
-        layout.separator()
 
-        layout.menu("TEXT_MT_templates")
-
-
 class TEXT_MT_templates(bpy.types.Menu):
-    '''
-    Creates the menu items by scanning scripts/templates
-    '''
-    bl_label = "Script Templates"
+    bl_label = "Templates"
 
     def draw(self, context):
-        self.path_menu(bpy.utils.script_paths("templates"), "text.open", {"internal": True})
+        self.path_menu(bpy.utils.script_paths("templates"),
+                       "text.open",
+                       {"internal": True},
+                       )
 
 
 class TEXT_MT_edit_select(bpy.types.Menu):
@@ -246,8 +251,12 @@
     def draw(self, context):
         layout = self.layout
 
-        layout.operator("text.to_3d_object", text="One Object").split_lines = False
-        layout.operator("text.to_3d_object", text="One Object Per Line").split_lines = True
+        layout.operator("text.to_3d_object",
+                        text="One Object",
+                        ).split_lines = False
+        layout.operator("text.to_3d_object",
+                        text="One Object Per Line",
+                        ).split_lines = True
 
 
 class TEXT_MT_edit(bpy.types.Menu):

Deleted: branches/soc-2011-tomato/release/scripts/templates/panel_simple.py
===================================================================
--- branches/soc-2011-tomato/release/scripts/templates/panel_simple.py	2011-07-26 15:27:57 UTC (rev 38732)
+++ branches/soc-2011-tomato/release/scripts/templates/panel_simple.py	2011-07-26 15:56:53 UTC (rev 38733)
@@ -1,33 +0,0 @@
-import bpy
-
-
-class OBJECT_PT_hello(bpy.types.Panel):
-    bl_label = "Hello World Panel"
-    bl_space_type = "PROPERTIES"
-    bl_region_type = "WINDOW"
-    bl_context = "object"
-
-    def draw(self, context):
-        layout = self.layout
-
-        obj = context.object
-
-        row = layout.row()
-        row.label(text="Hello world!", icon='WORLD_DATA')
-
-        row = layout.row()
-        row.label(text="Active object is: " + obj.name)
-        row = layout.row()
-        row.prop(obj, "name")
-
-
-def register():
-    bpy.utils.register_class(OBJECT_PT_hello)
-
-
-def unregister():
-    bpy.utils.unregister_class(OBJECT_PT_hello)
-
-
-if __name__ == "__main__":
-    register()

Copied: branches/soc-2011-tomato/release/scripts/templates/ui_menu.py (from rev 38732, trunk/blender/release/scripts/templates/ui_menu.py)
===================================================================
--- branches/soc-2011-tomato/release/scripts/templates/ui_menu.py	                        (rev 0)
+++ branches/soc-2011-tomato/release/scripts/templates/ui_menu.py	2011-07-26 15:56:53 UTC (rev 38733)
@@ -0,0 +1,49 @@
+import bpy
+
+
+class CustomMenu(bpy.types.Menu):
+    bl_label = "Custom Menu"
+    bl_idname = "OBJECT_MT_custom_menu"
+
+    def draw(self, context):
+        layout = self.layout
+
+        layout.operator("wm.open_mainfile")
+        layout.operator("wm.save_as_mainfile").copy = True
+
+        layout.operator("object.shade_smooth")
+
+        layout.label(text="Hello world!", icon='WORLD_DATA')
+
+        # use an operator enum property to populate a submenu
+        layout.operator_menu_enum("object.select_by_type",
+                                  property="type",
+                                  text="Select All by Type...",
+                                  )
+
+        # call another menu
+        layout.operator("wm.call_menu", text="Unwrap").name = "VIEW3D_MT_uv_map"
+
+
+def draw_item(self, context):
+	layout = self.layout
+	layout.menu(CustomMenu.bl_idname)
+
+
+def register():
+    bpy.utils.register_class(CustomMenu)
+
+    # lets add ourselves to the main header
+    bpy.types.INFO_HT_header.append(draw_item)
+
+
+def unregister():
+    bpy.utils.unregister_class(CustomMenu)
+
+    bpy.types.INFO_HT_header.remove(draw_item)
+
+if __name__ == "__main__":
+    register()
+
+    # The menu can also be called from scripts
+    bpy.ops.wm.call_menu(name=CustomMenu.bl_idname)

Copied: branches/soc-2011-tomato/release/scripts/templates/ui_menu_simple.py (from rev 38732, trunk/blender/release/scripts/templates/ui_menu_simple.py)
===================================================================
--- branches/soc-2011-tomato/release/scripts/templates/ui_menu_simple.py	                        (rev 0)
+++ branches/soc-2011-tomato/release/scripts/templates/ui_menu_simple.py	2011-07-26 15:56:53 UTC (rev 38733)
@@ -0,0 +1,26 @@
+import bpy
+
+
+class SimpleCustomMenu(bpy.types.Menu):
+    bl_label = "Simple Custom Menu"
+    bl_idname = "OBJECT_MT_simple_custom_menu"
+
+    def draw(self, context):
+        layout = self.layout
+
+        layout.operator("wm.open_mainfile")
+        layout.operator("wm.save_as_mainfile")
+
+
+def register():
+    bpy.utils.register_class(SimpleCustomMenu)
+
+
+def unregister():
+    bpy.utils.unregister_class(SimpleCustomMenu)
+
+if __name__ == "__main__":
+    register()
+
+    # The menu can also be called from scripts
+    bpy.ops.wm.call_menu(name=SimpleCustomMenu.bl_idname)

Copied: branches/soc-2011-tomato/release/scripts/templates/ui_panel_simple.py (from rev 38732, trunk/blender/release/scripts/templates/ui_panel_simple.py)
===================================================================
--- branches/soc-2011-tomato/release/scripts/templates/ui_panel_simple.py	                        (rev 0)
+++ branches/soc-2011-tomato/release/scripts/templates/ui_panel_simple.py	2011-07-26 15:56:53 UTC (rev 38733)
@@ -0,0 +1,34 @@
+import bpy
+
+
+class HelloWorldPanel(bpy.types.Panel):
+    bl_label = "Hello World Panel"
+    bl_idname = "OBJECT_PT_hello"
+    bl_space_type = "PROPERTIES"
+    bl_region_type = "WINDOW"
+    bl_context = "object"
+
+    def draw(self, context):
+        layout = self.layout
+
+        obj = context.object
+
+        row = layout.row()
+        row.label(text="Hello world!", icon='WORLD_DATA')
+
+        row = layout.row()
+        row.label(text="Active object is: " + obj.name)
+        row = layout.row()
+        row.prop(obj, "name")
+
+
+def register():
+    bpy.utils.register_class(HelloWorldPanel)
+
+
+def unregister():
+    bpy.utils.unregister_class(HelloWorldPanel)
+
+
+if __name__ == "__main__":
+    register()

Modified: branches/soc-2011-tomato/source/blender/blenkernel/BKE_blender.h
===================================================================
--- branches/soc-2011-tomato/source/blender/blenkernel/BKE_blender.h	2011-07-26 15:27:57 UTC (rev 38732)
+++ branches/soc-2011-tomato/source/blender/blenkernel/BKE_blender.h	2011-07-26 15:56:53 UTC (rev 38733)
@@ -53,7 +53,7 @@

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list