[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [40052] branches/bmesh/blender: svn merge -r40034:40051 https://svn.blender.org/svnroot/bf-blender/trunk/ blender

Campbell Barton ideasman42 at gmail.com
Fri Sep 9 04:29:44 CEST 2011


Revision: 40052
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=40052
Author:   campbellbarton
Date:     2011-09-09 02:29:44 +0000 (Fri, 09 Sep 2011)
Log Message:
-----------
svn merge -r40034:40051 https://svn.blender.org/svnroot/bf-blender/trunk/blender

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

Modified Paths:
--------------
    branches/bmesh/blender/build_files/scons/config/linuxcross-config.py
    branches/bmesh/blender/doc/python_api/rst/info_quickstart.rst
    branches/bmesh/blender/doc/python_api/rst/info_tips_and_tricks.rst
    branches/bmesh/blender/doc/python_api/sphinx_doc_gen.py
    branches/bmesh/blender/release/scripts/modules/bpy_types.py
    branches/bmesh/blender/release/scripts/startup/bl_ui/properties_data_modifier.py
    branches/bmesh/blender/source/blender/blenlib/BLI_utildefines.h
    branches/bmesh/blender/source/blender/editors/interface/interface_layout.c
    branches/bmesh/blender/source/blender/editors/interface/interface_templates.c
    branches/bmesh/blender/source/blender/makesdna/DNA_modifier_types.h
    branches/bmesh/blender/source/blender/makesrna/RNA_access.h
    branches/bmesh/blender/source/blender/makesrna/intern/rna_access.c
    branches/bmesh/blender/source/blender/makesrna/intern/rna_modifier.c
    branches/bmesh/blender/source/blender/makesrna/intern/rna_ui_api.c
    branches/bmesh/blender/source/blender/makesrna/intern/rna_userdef.c
    branches/bmesh/blender/source/blender/modifiers/intern/MOD_weightvg_util.c
    branches/bmesh/blender/source/blender/modifiers/intern/MOD_weightvg_util.h
    branches/bmesh/blender/source/blender/modifiers/intern/MOD_weightvgedit.c
    branches/bmesh/blender/source/blender/modifiers/intern/MOD_weightvgmix.c
    branches/bmesh/blender/source/blender/modifiers/intern/MOD_weightvgproximity.c
    branches/bmesh/blender/source/blender/python/intern/bpy_rna.c
    branches/bmesh/blender/source/blender/windowmanager/intern/wm_keymap.c

Added Paths:
-----------
    branches/bmesh/blender/doc/python_api/rst/info_best_practice.rst

Property Changed:
----------------
    branches/bmesh/blender/
    branches/bmesh/blender/release/
    branches/bmesh/blender/source/blender/editors/space_outliner/


Property changes on: branches/bmesh/blender
___________________________________________________________________
Modified: svn:mergeinfo
   - /trunk/blender:39992-40034
   + /trunk/blender:39992-40051

Modified: branches/bmesh/blender/build_files/scons/config/linuxcross-config.py
===================================================================
--- branches/bmesh/blender/build_files/scons/config/linuxcross-config.py	2011-09-09 02:21:57 UTC (rev 40051)
+++ branches/bmesh/blender/build_files/scons/config/linuxcross-config.py	2011-09-09 02:29:44 UTC (rev 40052)
@@ -127,6 +127,7 @@
 WITH_BF_FFMPEG = True  # -DWITH_FFMPEG
 BF_FFMPEG = LIBDIR + '/ffmpeg'
 BF_FFMPEG_LIB = 'avformat-53 avcodec-53 avdevice-53 avutil-51 swscale-2'
+BF_FFMPEG_DLL = '${BF_FFMPEG_LIBPATH}/avformat-53.dll ${BF_FFMPEG_LIBPATH}/avcodec-53.dll ${BF_FFMPEG_LIBPATH}/avdevice-53.dll ${BF_FFMPEG_LIBPATH}/avutil-51.dll ${BF_FFMPEG_LIBPATH}/swscale-2.dll'
 BF_FFMPEG_INC = '${BF_FFMPEG}/include'
 BF_FFMPEG_LIBPATH = '${BF_FFMPEG}/lib'
 BF_FFMPEG_DLL = '${BF_FFMPEG_LIBPATH}/avformat-53.dll ${BF_FFMPEG_LIBPATH}/avcodec-53.dll ${BF_FFMPEG_LIBPATH}/avdevice-53.dll ${BF_FFMPEG_LIBPATH}/avutil-51.dll ${BF_FFMPEG_LIBPATH}/swscale-2.dll'

Copied: branches/bmesh/blender/doc/python_api/rst/info_best_practice.rst (from rev 40051, trunk/blender/doc/python_api/rst/info_best_practice.rst)
===================================================================
--- branches/bmesh/blender/doc/python_api/rst/info_best_practice.rst	                        (rev 0)
+++ branches/bmesh/blender/doc/python_api/rst/info_best_practice.rst	2011-09-09 02:29:44 UTC (rev 40052)
@@ -0,0 +1,65 @@
+*************
+Best Practice
+*************
+
+
+TODO: Intro text
+
+
+Style Conventions
+=================
+
+For Blender 2.5 we have chosen to follow python suggested style guide to avoid mixing styles amongst our own scripts and make it easier to use python scripts from other projects.
+
+Using our style guide for your own scripts makes it easier if you eventually want to contribute them to blender.
+
+This style guide is known as pep8 and can be found `here <http://www.python.org/dev/peps/pep-0008>`_
+
+A brief listing of pep8 criteria.
+
+* camel caps for class names: MyClass
+
+* all lower case underscore separated module names: my_module
+
+* indentation of 4 spaces (no tabs)
+
+* spaces around operators. ``1 + 1``, not ``1+1``
+
+* only use explicit imports, (no importing '*')
+
+* don't use single line: ``if val: body``, separate onto 2 lines instead.
+
+
+As well as pep8 we have other conventions used for blender python scripts.
+
+* Use single quotes for enums, and double quotes for strings.
+
+  Both are of course strings but in our internal API enums are unique items from a limited set. eg.
+
+  .. code-block:: python
+
+     bpy.context.scene.render.file_format = 'PNG'
+     bpy.context.scene.render.filepath = "//render_out"
+
+* pep8 also defines that lines should not exceed 79 characters, we felt this is too restrictive so this is optional per script.
+
+Periodically we run checks for pep8 compliance on blender scripts, for scripts to be included in this check add this line as a comment at the top of the script.
+
+``# <pep8 compliant>``
+
+To enable line length checks use this instead.
+
+``# <pep8-80 compliant>``
+
+
+User Interface Layout
+=====================
+
+TODO: Thomas
+
+
+Script Efficiency
+=================
+
+TODO: Campbell
+

Modified: branches/bmesh/blender/doc/python_api/rst/info_quickstart.rst
===================================================================
--- branches/bmesh/blender/doc/python_api/rst/info_quickstart.rst	2011-09-09 02:21:57 UTC (rev 40051)
+++ branches/bmesh/blender/doc/python_api/rst/info_quickstart.rst	2011-09-09 02:29:44 UTC (rev 40052)
@@ -420,49 +420,3 @@
    fcu_z.keyframe_points[0].co = 10.0, 0.0
    fcu_z.keyframe_points[1].co = 20.0, 1.0
 
-
-Style Conventions
-=================
-
-For Blender 2.5 we have chosen to follow python suggested style guide to avoid mixing styles amongst our own scripts and make it easier to use python scripts from other projects.
-
-Using our style guide for your own scripts makes it easier if you eventually want to contribute them to blender.
-
-This style guide is known as pep8 and can be found `here <http://www.python.org/dev/peps/pep-0008>`_
-
-A brief listing of pep8 criteria.
-
-* camel caps for class names: MyClass
-
-* all lower case underscore separated module names: my_module
-
-* indentation of 4 spaces (no tabs)
-
-* spaces around operators. ``1 + 1``, not ``1+1``
-
-* only use explicit imports, (no importing '*')
-
-* don't use single line: ``if val: body``, separate onto 2 lines instead.
-
-
-As well as pep8 we have other conventions used for blender python scripts.
-
-* Use single quotes for enums, and double quotes for strings.
-
-  Both are of course strings but in our internal API enums are unique items from a limited set. eg.
-
-  .. code-block:: python
-
-     bpy.context.scene.render.file_format = 'PNG'
-     bpy.context.scene.render.filepath = "//render_out"
-
-* pep8 also defines that lines should not exceed 79 characters, we felt this is too restrictive so this is optional per script.
-
-Periodically we run checks for pep8 compliance on blender scripts, for scripts to be included in this check add this line as a comment at the top of the script.
-
-``# <pep8 compliant>``
-
-To enable line length checks use this instead.
-
-``# <pep8-80 compliant>``
-

Modified: branches/bmesh/blender/doc/python_api/rst/info_tips_and_tricks.rst
===================================================================
--- branches/bmesh/blender/doc/python_api/rst/info_tips_and_tricks.rst	2011-09-09 02:21:57 UTC (rev 40051)
+++ branches/bmesh/blender/doc/python_api/rst/info_tips_and_tricks.rst	2011-09-09 02:29:44 UTC (rev 40052)
@@ -31,6 +31,7 @@
 
 Editing a text file externally and having the same text open in blender does work but isn't that optimal so here are 2 ways you can easily use an external file from blender.
 
+Using the following examples you'll still need textblock in blender to execute, but reference an external file rather then including it directly.
 
 Executing External Scripts
 --------------------------
@@ -163,7 +164,7 @@
 .. code-block:: python
 
    import code
-   code.interact(locals=locals())
+   code.interact(local=locals())
 
 
 If you want to access both global and local variables do this...
@@ -173,14 +174,14 @@
    import code
    namespace = globals().copy()
    namespace.update(locals())
-   code.interact(locals=namespace)
+   code.interact(local=namespace)
 
 
 The next example is an equivalent single line version of the script above which is easier to paste into you're code:
 
 .. code-block:: python
 
-   __import__('code').interact(locals={k: v for ns in (globals(), locals()) for k, v in ns.items()})
+   __import__('code').interact(local={k: v for ns in (globals(), locals()) for k, v in ns.items()})
 
 
 `code.interact` can be added at any line in the script and will pause the script an launch an interactive interpreter in the terminal, when you're done you can quit the interpreter and the script will continue execution.

Modified: branches/bmesh/blender/doc/python_api/sphinx_doc_gen.py
===================================================================
--- branches/bmesh/blender/doc/python_api/sphinx_doc_gen.py	2011-09-09 02:21:57 UTC (rev 40051)
+++ branches/bmesh/blender/doc/python_api/sphinx_doc_gen.py	2011-09-09 02:29:44 UTC (rev 40052)
@@ -103,6 +103,7 @@
 INFO_DOCS = (
     ("info_quickstart.rst", "Blender/Python Quickstart: new to blender/scripting and want to get you're feet wet?"),
     ("info_overview.rst", "Blender/Python API Overview: a more complete explanation of python integration"),
+    ("info_best_practice.rst", "Best Practice: Conventions to follow for writing good scripts"),
     ("info_tips_and_tricks.rst", "Tips and Tricks: Hints to help you while writeing scripts for blender"),
     ("info_gotcha.rst", "Gotcha's: some of the problems you may come up against when writing scripts"),
     )


Property changes on: branches/bmesh/blender/release
___________________________________________________________________
Modified: svn:mergeinfo
   - /trunk/blender/release:31524-40034
   + /trunk/blender/release:31524-40051

Modified: branches/bmesh/blender/release/scripts/modules/bpy_types.py
===================================================================
--- branches/bmesh/blender/release/scripts/modules/bpy_types.py	2011-09-09 02:21:57 UTC (rev 40051)
+++ branches/bmesh/blender/release/scripts/modules/bpy_types.py	2011-09-09 02:29:44 UTC (rev 40052)
@@ -353,10 +353,7 @@
 
     @property
     def edge_keys(self):
-        return list({edge_key
-                     for face in self.faces
-                     for edge_key in face.edge_keys
-                     })
+        return [ed.key for ed in self.edges]
 
 
 class MeshEdge(StructRNA):

Modified: branches/bmesh/blender/release/scripts/startup/bl_ui/properties_data_modifier.py
===================================================================
--- branches/bmesh/blender/release/scripts/startup/bl_ui/properties_data_modifier.py	2011-09-09 02:21:57 UTC (rev 40051)
+++ branches/bmesh/blender/release/scripts/startup/bl_ui/properties_data_modifier.py	2011-09-09 02:29:44 UTC (rev 40052)
@@ -612,32 +612,31 @@
         layout.label(text="Settings can be found inside the Physics context")
 
     def UV_PROJECT(self, layout, ob, md):
-        if ob.type == 'MESH':
-            split = layout.split()
+        split = layout.split()
 
-            col = split.column()
-            col.label(text="Image:")
-            col.prop(md, "image", text="")
+        col = split.column()
+        col.label(text="Image:")
+        col.prop(md, "image", text="")
 
-            col = split.column()
-            col.label(text="UV Layer:")
-            col.prop_search(md, "uv_layer", ob.data, "uv_textures", text="")
+        col = split.column()
+        col.label(text="UV Layer:")
+        col.prop_search(md, "uv_layer", ob.data, "uv_textures", text="")
 
-            split = layout.split()
-            col = split.column()
-            col.prop(md, "use_image_override")
-            col.prop(md, "projector_count", text="Projectors")
-            for proj in md.projectors:
-                col.prop(proj, "object", text="")
+        split = layout.split()
+        col = split.column()

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list