[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [26192] branches/render25: svn merge https ://svn.blender.org/svnroot/bf-blender/trunk/blender -r26172:26191

Brecht Van Lommel brecht at blender.org
Fri Jan 22 14:57:36 CET 2010


Revision: 26192
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=26192
Author:   blendix
Date:     2010-01-22 14:57:35 +0100 (Fri, 22 Jan 2010)

Log Message:
-----------
svn merge https://svn.blender.org/svnroot/bf-blender/trunk/blender -r26172:26191

Modified Paths:
--------------
    branches/render25/intern/guardedalloc/intern/mallocn.c
    branches/render25/release/datafiles/blenderbuttons
    branches/render25/release/scripts/modules/bpy/app.py
    branches/render25/release/scripts/modules/bpy/utils.py
    branches/render25/release/scripts/ui/space_userpref.py
    branches/render25/source/blender/blenkernel/BKE_blender.h
    branches/render25/source/blender/blenkernel/intern/blender.c
    branches/render25/source/blender/blenkernel/intern/brush.c
    branches/render25/source/blender/blenkernel/intern/effect.c
    branches/render25/source/blender/blenkernel/intern/object.c
    branches/render25/source/blender/blenlib/BLI_gsqueue.h
    branches/render25/source/blender/blenlib/BLI_math_base.h
    branches/render25/source/blender/blenlib/BLI_math_color.h
    branches/render25/source/blender/blenlib/BLI_math_geom.h
    branches/render25/source/blender/blenlib/BLI_math_vector.h
    branches/render25/source/blender/blenlib/BLI_threads.h
    branches/render25/source/blender/blenlib/intern/gsqueue.c
    branches/render25/source/blender/blenlib/intern/math_base.c
    branches/render25/source/blender/blenlib/intern/math_color.c
    branches/render25/source/blender/blenlib/intern/math_geom.c
    branches/render25/source/blender/blenlib/intern/math_vector.c
    branches/render25/source/blender/blenlib/intern/math_vector_inline.c
    branches/render25/source/blender/blenlib/intern/threads.c
    branches/render25/source/blender/blenloader/intern/readfile.c
    branches/render25/source/blender/blenloader/intern/writefile.c
    branches/render25/source/blender/editors/animation/keyframing.c
    branches/render25/source/blender/editors/armature/editarmature.c
    branches/render25/source/blender/editors/armature/poselib.c
    branches/render25/source/blender/editors/curve/editcurve.c
    branches/render25/source/blender/editors/datafiles/blenderbuttons.c
    branches/render25/source/blender/editors/include/UI_icons.h
    branches/render25/source/blender/editors/interface/interface_handlers.c
    branches/render25/source/blender/editors/interface/interface_icons.c
    branches/render25/source/blender/editors/interface/interface_style.c
    branches/render25/source/blender/editors/interface/interface_templates.c
    branches/render25/source/blender/editors/interface/view2d.c
    branches/render25/source/blender/editors/mesh/editmesh_add.c
    branches/render25/source/blender/editors/mesh/editmesh_lib.c
    branches/render25/source/blender/editors/mesh/editmesh_loop.c
    branches/render25/source/blender/editors/object/object_add.c
    branches/render25/source/blender/editors/object/object_relations.c
    branches/render25/source/blender/editors/object/object_vgroup.c
    branches/render25/source/blender/editors/physics/particle_object.c
    branches/render25/source/blender/editors/screen/area.c
    branches/render25/source/blender/editors/screen/screen_edit.c
    branches/render25/source/blender/editors/screen/screen_ops.c
    branches/render25/source/blender/editors/screen/screendump.c
    branches/render25/source/blender/editors/space_image/image_ops.c
    branches/render25/source/blender/editors/space_node/node_edit.c
    branches/render25/source/blender/editors/space_view3d/drawobject.c
    branches/render25/source/blender/editors/space_view3d/view3d_buttons.c
    branches/render25/source/blender/editors/space_view3d/view3d_toolbar.c
    branches/render25/source/blender/editors/transform/transform.c
    branches/render25/source/blender/editors/transform/transform.h
    branches/render25/source/blender/editors/transform/transform_numinput.c
    branches/render25/source/blender/makesrna/RNA_types.h
    branches/render25/source/blender/makesrna/intern/makesrna.c
    branches/render25/source/blender/makesrna/intern/rna_curve.c
    branches/render25/source/blender/makesrna/intern/rna_modifier.c
    branches/render25/source/blender/nodes/intern/CMP_nodes/CMP_huecorrect.c
    branches/render25/source/blender/python/generic/vector.c
    branches/render25/source/blender/python/intern/bpy_props.c
    branches/render25/source/blender/python/sphinx_doc_gen.py
    branches/render25/source/blender/windowmanager/intern/wm_event_system.c
    branches/render25/source/blender/windowmanager/intern/wm_operators.c

Added Paths:
-----------
    branches/render25/source/blender/blenlib/BLI_math_inline.h
    branches/render25/source/blender/blenlib/intern/math_base_inline.c

Modified: branches/render25/intern/guardedalloc/intern/mallocn.c
===================================================================
--- branches/render25/intern/guardedalloc/intern/mallocn.c	2010-01-22 11:10:24 UTC (rev 26191)
+++ branches/render25/intern/guardedalloc/intern/mallocn.c	2010-01-22 13:57:35 UTC (rev 26192)
@@ -539,8 +539,10 @@
 	if (membl) membl = MEMNEXT(membl);
 
 	while(membl) {
-		if (vmemh == membl+1)
+		if (vmemh == membl+1) {
+			mem_unlock_thread();
 			return 1;
+		}
 
 		if(membl->next)
 			membl= MEMNEXT(membl->next);

Modified: branches/render25/release/datafiles/blenderbuttons
===================================================================
(Binary files differ)

Modified: branches/render25/release/scripts/modules/bpy/app.py
===================================================================
--- branches/render25/release/scripts/modules/bpy/app.py	2010-01-22 11:10:24 UTC (rev 26191)
+++ branches/render25/release/scripts/modules/bpy/app.py	2010-01-22 13:57:35 UTC (rev 26192)
@@ -18,6 +18,27 @@
 
 # <pep8 compliant>
 
+"""
+This module contains application values that remain unchanged during runtime.
+
+.. data:: version
+
+   The Blender version as a tuple of 3 numbers. eg. (2, 50, 11)
+
+
+.. data:: version_string
+
+   The Blender version formatted as a string.
+
+.. data:: home
+
+   The blender home directory, normally matching $HOME
+
+.. data:: binary_path
+
+   The location of blenders executable, useful for utilities that spawn new instances.
+
+"""
 # constants
 import _bpy
 version = _bpy._VERSION

Modified: branches/render25/release/scripts/modules/bpy/utils.py
===================================================================
--- branches/render25/release/scripts/modules/bpy/utils.py	2010-01-22 11:10:24 UTC (rev 26191)
+++ branches/render25/release/scripts/modules/bpy/utils.py	2010-01-22 13:57:35 UTC (rev 26192)
@@ -18,13 +18,18 @@
 
 # <pep8 compliant>
 
-import bpy
-import os
+"""
+This module contains utility functions spesific to blender but
+not assosiated with blenders internal data.
+"""
 
+import bpy as _bpy
+import os as _os
 
+
 def expandpath(path):
     if path.startswith("//"):
-        return os.path.join(os.path.dirname(bpy.data.filename), path[2:])
+        return _os.path.join(_os.path.dirname(_bpy.data.filename), path[2:])
 
     return path
 
@@ -47,21 +52,23 @@
 
 
 def clean_name(name, replace="_"):
-    '''
+    """
+    Returns a name with characters replaced that may cause problems under various circumstances, such as writing to a file.
     All characters besides A-Z/a-z, 0-9 are replaced with "_"
     or the replace argumet if defined.
-    '''
+    """
     for ch in _unclean_chars:
         name = name.replace(ch, replace)
     return name
 
 
 def display_name(name):
-    '''
-    Only capitalize all lowercase names, mixed case use them as is.
-    should work with filenames and module names.
-    '''
-    name_base = os.path.splitext(name)[0]
+    """
+    Creates a display string from name to be used menus and the user interface.
+    Capitalize the first letter in all lowercase names, mixed case names are kept as is.
+    Intended for use with filenames and module names.
+    """
+    name_base = _os.path.splitext(name)[0]
 
     # string replacements
     name_base = name_base.replace("_colon_", ":")
@@ -75,39 +82,44 @@
 
 
 # base scripts
-_scripts = os.path.join(os.path.dirname(__file__), os.path.pardir, os.path.pardir)
-_scripts = (os.path.normpath(_scripts), )
+_scripts = _os.path.join(_os.path.dirname(__file__), _os.path.pardir, _os.path.pardir)
+_scripts = (_os.path.normpath(_scripts), )
 
 
 def script_paths(*args):
+    """
+    Returns a list of valid script paths from the home directory and user preferences.
+
+    Accepts any number of string arguments which are joined to make a path.
+    """
     scripts = list(_scripts)
 
     # add user scripts dir
-    user_script_path = bpy.context.user_preferences.filepaths.python_scripts_directory
+    user_script_path = _bpy.context.user_preferences.filepaths.python_scripts_directory
 
     if not user_script_path:
         # XXX - WIN32 needs checking, perhaps better call a blender internal function.
-        user_script_path = os.path.join(os.path.expanduser("~"), ".blender", "scripts")
+        user_script_path = _os.path.join(_os.path.expanduser("~"), ".blender", "scripts")
 
-    user_script_path = os.path.normpath(user_script_path)
+    user_script_path = _os.path.normpath(user_script_path)
 
-    if user_script_path not in scripts and os.path.isdir(user_script_path):
+    if user_script_path not in scripts and _os.path.isdir(user_script_path):
         scripts.append(user_script_path)
 
     if not args:
         return scripts
 
-    subdir = os.path.join(*args)
+    subdir = _os.path.join(*args)
     script_paths = []
     for path in scripts:
-        path_subdir = os.path.join(path, subdir)
-        if os.path.isdir(path_subdir):
+        path_subdir = _os.path.join(path, subdir)
+        if _os.path.isdir(path_subdir):
             script_paths.append(path_subdir)
 
     return script_paths
 
 
-_presets = os.path.join(_scripts[0], "presets") # FIXME - multiple paths
+_presets = _os.path.join(_scripts[0], "presets") # FIXME - multiple paths
 
 
 def preset_paths(subdir):
@@ -115,4 +127,4 @@
     Returns a list of paths for a spesific preset.
     '''
 
-    return (os.path.join(_presets, subdir), )
+    return (_os.path.join(_presets, subdir), )

Modified: branches/render25/release/scripts/ui/space_userpref.py
===================================================================
--- branches/render25/release/scripts/ui/space_userpref.py	2010-01-22 11:10:24 UTC (rev 26191)
+++ branches/render25/release/scripts/ui/space_userpref.py	2010-01-22 13:57:35 UTC (rev 26192)
@@ -18,6 +18,7 @@
 
 # <pep8 compliant>
 import bpy
+import os.path
 
 # General UI Theme Settings (User Interface)
 def ui_items_general(col, context):
@@ -161,7 +162,8 @@
 
         if userpref.active_section == 'INPUT':
             layout.operator_context = 'INVOKE_DEFAULT'
-            layout.operator("wm.keyconfig_export", "Export Key Configuration...").path = "keymap.py"
+            op = layout.operator("wm.keyconfig_export", "Export Key Configuration...")
+            op.path = "keymap.py"
 
 
 class USERPREF_PT_tabs(bpy.types.Panel):
@@ -1166,15 +1168,24 @@
                 subrow.prop(kmi, "alt")
                 subrow.prop(kmi, "oskey", text="Cmd")
                 subrow.prop(kmi, "key_modifier", text="", event=True)
+                
+            def display_properties(properties, title = None):
+                box.separator()
+                if title:
+                    box.label(text=title)
+                flow = box.column_flow(columns=2)
+                for pname in dir(properties):
+                    if not properties.is_property_hidden(pname):
+                        value = eval("properties." + pname)
+                        if isinstance(value, bpy.types.OperatorProperties):
+                            display_properties(value, title = pname)
+                        else:
+                            flow.prop(properties, pname)
 
             # Operator properties
             props = kmi.properties
             if props is not None:
-                box.separator()
-                flow = box.column_flow(columns=2)
-                for pname in dir(props):
-                    if not props.is_property_hidden(pname):
-                        flow.prop(props, pname)
+                display_properties(props)
 
             # Modal key maps attached to this operator
             if not km.modal:
@@ -1344,16 +1355,22 @@
                 s.append(", key_modifier=\'%s\'" % kmi.key_modifier)
 
             s.append(")\n")
+            
+            def export_properties(prefix, properties):
+                for pname in dir(properties):
+                    if not properties.is_property_hidden(pname):
+                        value = eval("properties.%s" % pname)
+                        if isinstance(value, bpy.types.OperatorProperties):
+                            export_properties(prefix + "." + pname, value)
+                        elif properties.is_property_set(pname):
+                            value = _string_value(value)
+                            if value != "":
+                                s.append(prefix + ".%s = %s\n" % (pname, value))
 
             props = kmi.properties
 
             if props is not None:
-                for pname in dir(props):
-                    if props.is_property_set(pname) and not props.is_property_hidden(pname):
-                        value = eval("props.%s" % pname)
-                        value = _string_value(value)
-                        if value != "":
-                            s.append("kmi.properties.%s = %s\n" % (pname, value))
+                export_properties("kmi.properties", props)
 
             return "".join(s).strip()
 
@@ -1451,6 +1468,9 @@
     bl_label = "Export Key Configuration..."
 
     path = bpy.props.StringProperty(name="File Path", description="File path to write file to.")
+    filter_folder = bpy.props.BoolProperty(name="Filter folders", description="", default=True)
+    filter_text = bpy.props.BoolProperty(name="Filter text", description="", default=True)
+    filter_python = bpy.props.BoolProperty(name="Filter python", description="", default=True)
 
     def execute(self, context):
         if not self.properties.path:
@@ -1463,10 +1483,15 @@
         wm = context.manager
         kc = wm.active_keyconfig
 
-        f.write('# Configuration %s\n' % kc.name)
+        if kc.name == 'Blender':
+            name = os.path.splitext(os.path.basename(self.properties.path))[0]
+        else:
+            name = kc.name
 
+        f.write('# Configuration %s\n' % name)
+
         f.write("wm = bpy.data.window_managers[0]\n")
-        f.write("kc = wm.add_keyconfig(\'%s\')\n\n" % kc.name)
+        f.write("kc = wm.add_keyconfig(\'%s\')\n\n" % name)
 
         for km in kc.keymaps:
             km = km.active()
@@ -1492,18 +1517,25 @@
                     f.write(", key_modifier=\'%s\'" % kmi.key_modifier)
                 f.write(")\n")
 
+                def export_properties(prefix, properties):
+                    for pname in dir(properties):
+                        if not properties.is_property_hidden(pname):
+                            value = eval("properties.%s" % pname)

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list