[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [26479] trunk/blender: Mathutils doc improvements + other small things

Campbell Barton ideasman42 at gmail.com
Sun Jan 31 22:52:26 CET 2010


Revision: 26479
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=26479
Author:   campbellbarton
Date:     2010-01-31 22:52:26 +0100 (Sun, 31 Jan 2010)

Log Message:
-----------
Mathutils doc improvements + other small things
- bpy.app moved into PyStructSequence (used by sys.float_info)
- added buildinfo into bpy.app.build_*
- bpy.ui removed (wasnt used)
- include external example files in Mathutils docs (only Mathutils and Vector are currently written)
- added support to auto document PyStructSequence's
- CMake had "'s inside all its strings.

Modified Paths:
--------------
    trunk/blender/release/scripts/modules/bpy/__init__.py
    trunk/blender/source/blender/python/CMakeLists.txt
    trunk/blender/source/blender/python/doc/epy/Mathutils.py
    trunk/blender/source/blender/python/generic/BGL.c
    trunk/blender/source/blender/python/generic/BGL.h
    trunk/blender/source/blender/python/generic/Mathutils.c
    trunk/blender/source/blender/python/generic/euler.c
    trunk/blender/source/blender/python/generic/matrix.c
    trunk/blender/source/blender/python/generic/quat.c
    trunk/blender/source/blender/python/generic/vector.c
    trunk/blender/source/blender/python/intern/bpy_interface.c
    trunk/blender/source/creator/CMakeLists.txt

Added Paths:
-----------
    trunk/blender/source/blender/python/doc/examples/
    trunk/blender/source/blender/python/doc/examples/mathutils.py
    trunk/blender/source/blender/python/doc/examples/mathutils_euler.py
    trunk/blender/source/blender/python/doc/examples/mathutils_matrix.py
    trunk/blender/source/blender/python/doc/examples/mathutils_quat.py
    trunk/blender/source/blender/python/doc/examples/mathutils_vector.py
    trunk/blender/source/blender/python/doc/sphinx_doc_gen.py
    trunk/blender/source/blender/python/generic/CMakeLists.txt

Removed Paths:
-------------
    trunk/blender/release/scripts/modules/bpy/app.py
    trunk/blender/source/blender/python/intern/bpy_ui.c
    trunk/blender/source/blender/python/intern/bpy_ui.h
    trunk/blender/source/blender/python/sphinx_doc_gen.py

Modified: trunk/blender/release/scripts/modules/bpy/__init__.py
===================================================================
--- trunk/blender/release/scripts/modules/bpy/__init__.py	2010-01-31 20:53:04 UTC (rev 26478)
+++ trunk/blender/release/scripts/modules/bpy/__init__.py	2010-01-31 21:52:26 UTC (rev 26479)
@@ -20,14 +20,13 @@
 
 # internal blender C module
 import _bpy
-from _bpy import types, props
+from _bpy import types, props, app
 
 data = _bpy.data
 context = _bpy.context
 
 # python modules
 from bpy import utils
-from bpy import app
 
 from bpy import ops as _ops_module
 

Deleted: trunk/blender/release/scripts/modules/bpy/app.py
===================================================================
--- trunk/blender/release/scripts/modules/bpy/app.py	2010-01-31 20:53:04 UTC (rev 26478)
+++ trunk/blender/release/scripts/modules/bpy/app.py	2010-01-31 21:52:26 UTC (rev 26479)
@@ -1,52 +0,0 @@
-# ##### BEGIN GPL LICENSE BLOCK #####
-#
-#  This program is free software; you can redistribute it and/or
-#  modify it under the terms of the GNU General Public License
-#  as published by the Free Software Foundation; either version 2
-#  of the License, or (at your option) any later version.
-#
-#  This program is distributed in the hope that it will be useful,
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#  GNU General Public License for more details.
-#
-#  You should have received a copy of the GNU General Public License
-#  along with this program; if not, write to the Free Software Foundation,
-#  Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-#
-# ##### END GPL LICENSE BLOCK #####
-
-# <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.
-
-.. data:: debug
-
-   Boolean, set when blender is running in debug mode (started with -d)
-
-"""
-# constants
-import _bpy
-version = _bpy._VERSION
-version_string = _bpy._VERSION_STR
-home = _bpy._HOME
-binary_path = _bpy._BINPATH
-debug = _bpy._DEBUG

Modified: trunk/blender/source/blender/python/CMakeLists.txt
===================================================================
--- trunk/blender/source/blender/python/CMakeLists.txt	2010-01-31 20:53:04 UTC (rev 26478)
+++ trunk/blender/source/blender/python/CMakeLists.txt	2010-01-31 21:52:26 UTC (rev 26479)
@@ -19,33 +19,30 @@
 #
 # The Original Code is: all of this file.
 #
-# Contributor(s): Jacques Beaurain.
+# Contributor(s): Jacques Beaurainm, Campbell Barton
 #
 # ***** END GPL LICENSE BLOCK *****
 
+ADD_SUBDIRECTORY(generic)
+
 FILE(GLOB SRC intern/*.c)
-FILE(GLOB GENSRC generic/*.c)
 
 SET(INC 
-	. ../../../intern/guardedalloc ../blenlib ../makesdna ../makesrna
-	../blenkernel ../editors/include ../windowmanager ${PYTHON_INC}
-	../../../extern/glew/include
+	.
+	../blenlib
+	../makesdna
+	../makesrna
+	../blenkernel
+	../windowmanager
+	../editors/include
+	../../../intern/guardedalloc
+	${PYTHON_INC}
 )
 
-IF(WITH_OPENEXR)
-	ADD_DEFINITIONS(-DWITH_OPENEXR)
-ENDIF(WITH_OPENEXR)
+# only to check if buildinfo is available
+IF(WITH_BUILDINFO)
+	ADD_DEFINITIONS(-DBUILD_DATE)
+ENDIF(WITH_BUILDINFO)
 
-IF(WITH_QUICKTIME)
-	SET(INC ${INC} ${QUICKTIME_INC})
-	ADD_DEFINITIONS(-DWITH_QUICKTIME)
-ENDIF(WITH_QUICKTIME)
-
-IF(WITH_FFMPEG)
-	SET(INC ${INC} ${FFMPEG_INC})
-	ADD_DEFINITIONS(-DWITH_FFMPEG)
-ENDIF(WITH_FFMPEG)
-
 BLENDERLIB(bf_python "${SRC}" "${INC}")
-BLENDERLIB(bf_gen_python "${GENSRC}" "${INC}")
 

Modified: trunk/blender/source/blender/python/doc/epy/Mathutils.py
===================================================================
--- trunk/blender/source/blender/python/doc/epy/Mathutils.py	2010-01-31 20:53:04 UTC (rev 26478)
+++ trunk/blender/source/blender/python/doc/epy/Mathutils.py	2010-01-31 21:52:26 UTC (rev 26479)
@@ -1,60 +1,9 @@
 # Blender.Mathutils module and its subtypes
 
-"""
-The Blender.Mathutils submodule.
 
-Mathutils
-=========
-(when accessing it from the Game Engine use Mathutils instead of Blender.Mathutils)
 
-This module provides access to matrices, eulers, quaternions and vectors.
-
-Example::
-  import Blender
-  from Blender import Mathutils
-  from Blender.Mathutils import *
-
-  vec = Vector([1,2,3])
-  mat = RotationMatrix(90, 4, 'x')
-  matT = TranslationMatrix(vec)
-
-  matTotal = mat * matT
-  matTotal.invert()
-
-  mat3 = matTotal.rotationPart
-  quat1 = mat.to_quat()
-  quat2 = mat3.to_quat()
-
-  angle = DifferenceQuats(quat1, quat2)
-  print angle  
-"""
-
 class Vector:
   """
-  The Vector object
-  =================
-  @note: Comparison operators can be done on Vector classes:
-      - >, >=, <, <= test the vector magnitude
-      - ==, != test vector values e.g. 1,2,3 != 1,2,4 even if they are the same length
-  @note: Math can be performed on Vector classes
-      - vec + vec
-      - vec - vec
-      - vec * float/int
-      - vec * matrix
-      - vec * vec
-      - vec * quat
-      - -vec
-  @note: You can access a vector object like a sequence
-      - x = vector[0]
-      - vec_a[:] vec_b
-      - vec2d[:] vec3d[:2]
-  @note: Vectors support 'swizzle' operations
-      - vec.xyz = vec.zyx
-      - vec.xy = vec.zw
-      - vec.xxy = vec.wzz
-      - vec.yzyz = vec.yxyx
-
-      See U{http://en.wikipedia.org/wiki/Swizzling_(computer_graphics)}
   
   @attention: Vector data can be wrapped or non-wrapped. When a object is wrapped it
   means that the object will give you direct access to the data inside of blender. Modification
@@ -62,15 +11,6 @@
   you need to use the object's constructor. If you copy and object by assignment you will not get
   a second copy but a second reference to the same data. Only certain functions will return 
   wrapped data. This will be indicated in the method description.
-  Example::
-      wrappedObject = Object.getAttribute() #this is wrapped data
-      print wrappedObject.wrapped #prints 'True'
-      copyOfObject = wrappedObject.copy() #creates a copy of the object
-      secondPointer = wrappedObject #creates a second pointer to the same data
-      print wrappedObject.attribute #prints '5'
-      secondPointer.attribute = 10
-      print wrappedObject.attribute #prints '10'
-      print copyOfObject.attribute #prints '5'
   """
 
   def __init__(list = None):
@@ -107,15 +47,6 @@
   you need to use the object's constructor. If you copy and object by assignment you will not get
   a second copy but a second reference to the same data. Only certain functions will return 
   wrapped data. This will be indicated in the method description.
-  Example::
-      wrappedObject = Object.getAttribute() #this is wrapped data
-      print wrappedObject.wrapped #prints 'True'
-      copyOfObject = wrappedObject.copy() #creates a copy of the object
-      secondPointer = wrappedObject #creates a second pointer to the same data
-      print wrappedObject.attribute #prints '5'
-      secondPointer.attribute = 10
-      print wrappedObject.attribute #prints '10'
-      print copyOfObject.attribute #prints '5'
   """
 
   def __init__(list = None):
@@ -154,15 +85,6 @@
   you need to use the object's constructor. If you copy and object by assignment you will not get
   a second copy but a second reference to the same data. Only certain functions will return 
   wrapped data. This will be indicated in the method description.
-  Example::
-      wrappedObject = Object.getAttribute() #this is wrapped data
-      print wrappedObject.wrapped #prints 'True'
-      copyOfObject = wrappedObject.copy() #creates a copy of the object
-      secondPointer = wrappedObject #creates a second pointer to the same data
-      print wrappedObject.attribute #prints '5'
-      secondPointer.attribute = 10
-      print wrappedObject.attribute #prints '10'
-      print copyOfObject.attribute #prints '5'
   """
 
   def __init__(list, angle = None):
@@ -208,15 +130,6 @@
   you need to use the object's constructor. If you copy and object by assignment you will not get
   a second copy but a second reference to the same data. Only certain functions will return 
   wrapped data. This will be indicated in the method description.
-  Example::
-      wrappedObject = Object.getAttribute() #this is wrapped data
-      print wrappedObject.wrapped #prints 'True'
-      copyOfObject = wrappedObject.copy() #creates a copy of the object
-      secondPointer = wrappedObject #creates a second pointer to the same data
-      print wrappedObject.attribute #prints '5'
-      secondPointer.attribute = 10
-      print wrappedObject.attribute #prints '10'
-      print copyOfObject.attribute #prints '5'
   """
 
   def __init__(list1 = None, list2 = None, list3 = None, list4 = None):

Added: trunk/blender/source/blender/python/doc/examples/mathutils.py
===================================================================
--- trunk/blender/source/blender/python/doc/examples/mathutils.py	                        (rev 0)
+++ trunk/blender/source/blender/python/doc/examples/mathutils.py	2010-01-31 21:52:26 UTC (rev 26479)
@@ -0,0 +1,17 @@
+import Mathutils
+
+vec = Mathutils.Vector(1.0, 2.0, 3.0)
+
+mat_rot = Mathutils.RotationMatrix(90, 4, 'X')
+mat_trans = Mathutils.TranslationMatrix(vec)
+
+mat = mat_trans * mat_rot
+mat.invert()
+
+mat3 = mat.rotation_part()
+quat1 = mat.to_quat()
+quat2 = mat3.to_quat()
+
+angle = quat1.difference(quat2)
+
+print(angle)
\ No newline at end of file

Added: trunk/blender/source/blender/python/doc/examples/mathutils_euler.py
===================================================================
--- trunk/blender/source/blender/python/doc/examples/mathutils_euler.py	                        (rev 0)
+++ trunk/blender/source/blender/python/doc/examples/mathutils_euler.py	2010-01-31 21:52:26 UTC (rev 26479)
@@ -0,0 +1,3 @@
+import Mathutils
+
+# todo
\ No newline at end of file

Added: trunk/blender/source/blender/python/doc/examples/mathutils_matrix.py
===================================================================
--- trunk/blender/source/blender/python/doc/examples/mathutils_matrix.py	                        (rev 0)

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list