[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [33123] trunk/blender: - move cmake file for python.
Campbell Barton
ideasman42 at gmail.com
Wed Nov 17 08:22:21 CET 2010
Revision: 33123
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=33123
Author: campbellbarton
Date: 2010-11-17 08:22:20 +0100 (Wed, 17 Nov 2010)
Log Message:
-----------
- move cmake file for python.
- move bpy_array.c to bpy_rna_array.c
- minor syntax changes
Modified Paths:
--------------
trunk/blender/release/scripts/op/wm.py
trunk/blender/release/scripts/ui/space_view3d.py
trunk/blender/source/blender/python/CMakeLists.txt
trunk/blender/source/blender/python/generic/CMakeLists.txt
Added Paths:
-----------
trunk/blender/source/blender/python/intern/CMakeLists.txt
trunk/blender/source/blender/python/intern/bpy_rna_array.c
Removed Paths:
-------------
trunk/blender/source/blender/python/intern/bpy_array.c
Modified: trunk/blender/release/scripts/op/wm.py
===================================================================
--- trunk/blender/release/scripts/op/wm.py 2010-11-17 07:00:14 UTC (rev 33122)
+++ trunk/blender/release/scripts/op/wm.py 2010-11-17 07:22:20 UTC (rev 33123)
@@ -268,8 +268,8 @@
class WM_OT_context_cycle_int(bpy.types.Operator):
- '''Set a context value. Useful for cycling active material,
- vertex keys, groups' etc.'''
+ '''Set a context value. Useful for cycling active material, '''
+ '''vertex keys, groups' etc.'''
bl_idname = "wm.context_cycle_int"
bl_label = "Context Int Cycle"
bl_options = {'UNDO'}
Modified: trunk/blender/release/scripts/ui/space_view3d.py
===================================================================
--- trunk/blender/release/scripts/ui/space_view3d.py 2010-11-17 07:00:14 UTC (rev 33122)
+++ trunk/blender/release/scripts/ui/space_view3d.py 2010-11-17 07:22:20 UTC (rev 33123)
@@ -1439,7 +1439,7 @@
totvert = mesh.total_vert_sel
if select_mode[2] and totface == 1:
- return bpy.ops.mesh.extrude_region_move('INVOKE_REGION_WIN', TRANSFORM_OT_translate={"constraint_orientation": "NORMAL", "constraint_axis": [False, False, True]})
+ return bpy.ops.mesh.extrude_region_move('INVOKE_REGION_WIN', TRANSFORM_OT_translate={"constraint_orientation": 'NORMAL', "constraint_axis": (False, False, True)})
elif select_mode[2] and totface > 1:
return bpy.ops.mesh.extrude_faces_move('INVOKE_REGION_WIN')
elif select_mode[1] and totedge >= 1:
@@ -1464,9 +1464,9 @@
totvert = mesh.total_vert_sel
if totface >= 1:
- return bpy.ops.mesh.extrude_region_move('INVOKE_REGION_WIN', TRANSFORM_OT_translate={"constraint_orientation": "NORMAL", "constraint_axis": [False, False, True]})
+ return bpy.ops.mesh.extrude_region_move('INVOKE_REGION_WIN', TRANSFORM_OT_translate={"constraint_orientation": 'NORMAL', "constraint_axis": (False, False, True)})
elif totedge == 1:
- return bpy.ops.mesh.extrude_region_move('INVOKE_REGION_WIN', TRANSFORM_OT_translate={"constraint_orientation": "NORMAL", "constraint_axis": [True, True, False]})
+ return bpy.ops.mesh.extrude_region_move('INVOKE_REGION_WIN', TRANSFORM_OT_translate={"constraint_orientation": 'NORMAL', "constraint_axis": (True, True, False)})
else:
return bpy.ops.mesh.extrude_region_move('INVOKE_REGION_WIN')
Modified: trunk/blender/source/blender/python/CMakeLists.txt
===================================================================
--- trunk/blender/source/blender/python/CMakeLists.txt 2010-11-17 07:00:14 UTC (rev 33122)
+++ trunk/blender/source/blender/python/CMakeLists.txt 2010-11-17 07:22:20 UTC (rev 33123)
@@ -14,48 +14,7 @@
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
-# The Original Code is Copyright (C) 2006, Blender Foundation
-# All rights reserved.
-#
-# The Original Code is: all of this file.
-#
-# Contributor(s): Jacques Beaurainm, Campbell Barton
-#
# ***** END GPL LICENSE BLOCK *****
+ADD_SUBDIRECTORY(intern)
ADD_SUBDIRECTORY(generic)
-
-SET(INC
- .
- ../blenlib
- ../makesdna
- ../makesrna
- ../blenkernel
- ../windowmanager
- ../editors/include
- ../../../intern/guardedalloc
- ../../../intern/audaspace/intern
- ${PYTHON_INC}
-)
-
-SET(SRC
- intern/bpy.c
- intern/bpy_app.c
- intern/bpy_array.c
- intern/bpy_driver.c
- intern/bpy_interface.c
- intern/bpy_operator.c
- intern/bpy_operator_wrap.c
- intern/bpy_props.c
- intern/bpy_rna.c
- intern/bpy_rna_callback.c
- intern/bpy_util.c
- intern/stubs.c
-)
-
-# only to check if buildinfo is available
-IF(WITH_BUILDINFO)
- ADD_DEFINITIONS(-DBUILD_DATE)
-ENDIF(WITH_BUILDINFO)
-
-BLENDERLIB(bf_python "${SRC}" "${INC}")
Modified: trunk/blender/source/blender/python/generic/CMakeLists.txt
===================================================================
--- trunk/blender/source/blender/python/generic/CMakeLists.txt 2010-11-17 07:00:14 UTC (rev 33122)
+++ trunk/blender/source/blender/python/generic/CMakeLists.txt 2010-11-17 07:22:20 UTC (rev 33123)
@@ -23,7 +23,6 @@
../../blenlib
../../makesdna
../../blenkernel
- ../../editors/include
../../../../intern/guardedalloc
../../../../extern/glew/include
${PYTHON_INC}
Copied: trunk/blender/source/blender/python/intern/CMakeLists.txt (from rev 33120, trunk/blender/source/blender/python/CMakeLists.txt)
===================================================================
--- trunk/blender/source/blender/python/intern/CMakeLists.txt (rev 0)
+++ trunk/blender/source/blender/python/intern/CMakeLists.txt 2010-11-17 07:22:20 UTC (rev 33123)
@@ -0,0 +1,59 @@
+# ***** 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#
+# The Original Code is Copyright (C) 2006, Blender Foundation
+# All rights reserved.
+#
+# The Original Code is: all of this file.
+#
+# Contributor(s): Jacques Beaurainm, Campbell Barton
+#
+# ***** END GPL LICENSE BLOCK *****
+
+SET(INC
+ ../
+ ../../blenlib
+ ../../makesdna
+ ../../makesrna
+ ../../blenkernel
+ ../../windowmanager
+ ../../editors/include
+ ../../../../intern/guardedalloc
+ ../../../../intern/audaspace/intern
+ ${PYTHON_INC}
+)
+
+SET(SRC
+ bpy.c
+ bpy_app.c
+ bpy_driver.c
+ bpy_interface.c
+ bpy_operator.c
+ bpy_operator_wrap.c
+ bpy_props.c
+ bpy_rna.c
+ bpy_rna_array.c
+ bpy_rna_callback.c
+ bpy_util.c
+ stubs.c
+)
+
+# only to check if buildinfo is available
+IF(WITH_BUILDINFO)
+ ADD_DEFINITIONS(-DBUILD_DATE)
+ENDIF(WITH_BUILDINFO)
+
+BLENDERLIB(bf_python "${SRC}" "${INC}")
Deleted: trunk/blender/source/blender/python/intern/bpy_array.c
===================================================================
--- trunk/blender/source/blender/python/intern/bpy_array.c 2010-11-17 07:00:14 UTC (rev 33122)
+++ trunk/blender/source/blender/python/intern/bpy_array.c 2010-11-17 07:22:20 UTC (rev 33123)
@@ -1,606 +0,0 @@
-/**
- * $Id$
- *
- * ***** 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- * Contributor(s): Arystanbek Dyussenov
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#include "bpy_rna.h"
-#include "BKE_global.h"
-#include "MEM_guardedalloc.h"
-
-#define MAX_ARRAY_DIMENSION 10
-
-typedef void (*ItemConvertFunc)(PyObject *, char *);
-typedef int (*ItemTypeCheckFunc)(PyObject *);
-typedef void (*RNA_SetArrayFunc)(PointerRNA *, PropertyRNA *, const char *);
-typedef void (*RNA_SetIndexFunc)(PointerRNA *, PropertyRNA *, int index, void *);
-
-/*
- arr[3][4][5]
- 0 1 2 <- dimension index
-*/
-
-/*
- arr[2] = x
-
- py_to_array_index(arraydim=0, arrayoffset=0, index=2)
- validate_array(lvalue_dim=0)
- ... make real index ...
-*/
-
-/* arr[3]=x, self->arraydim is 0, lvalue_dim is 1 */
-/* Ensures that a python sequence has expected number of items/sub-items and items are of desired type. */
-static int validate_array_type(PyObject *seq, int dim, int totdim, int dimsize[],
- ItemTypeCheckFunc check_item_type, const char *item_type_str, const char *error_prefix)
-{
- int i;
-
- /* not the last dimension */
- if (dim + 1 < totdim) {
- /* check that a sequence contains dimsize[dim] items */
-
- for (i= 0; i < PySequence_Length(seq); i++) {
- PyObject *item;
- int ok= 1;
- item= PySequence_GetItem(seq, i);
-
- if (!PySequence_Check(item)) {
- /* BLI_snprintf(error_str, error_str_size, "expected a sequence of %s", item_type_str); */
- PyErr_Format(PyExc_TypeError, "%s expected a sequence of %s", error_prefix, item_type_str);
- ok= 0;
- }
- /* arr[3][4][5]
- dimsize[1]=4
- dimsize[2]=5
-
- dim=0 */
- else if (PySequence_Length(item) != dimsize[dim + 1]) {
- /* BLI_snprintf(error_str, error_str_size, "sequences of dimension %d should contain %d items", (int)dim + 1, (int)dimsize[dim + 1]); */
- PyErr_Format(PyExc_ValueError, "%s sequences of dimension %d should contain %d items", error_prefix, (int)dim + 1, (int)dimsize[dim + 1]);
- ok= 0;
- }
- else if (!validate_array_type(item, dim + 1, totdim, dimsize, check_item_type, item_type_str, error_prefix)) {
- ok= 0;
- }
-
- Py_DECREF(item);
-
- if (!ok)
- return 0;
- }
- }
- else {
- /* check that items are of correct type */
- for (i= 0; i < PySequence_Length(seq); i++) {
- PyObject *item= PySequence_GetItem(seq, i);
-
- if (!check_item_type(item)) {
- Py_DECREF(item);
-
- /* BLI_snprintf(error_str, error_str_size, "sequence items should be of type %s", item_type_str); */
- PyErr_Format(PyExc_TypeError, "sequence items should be of type %s", item_type_str);
- return 0;
- }
-
- Py_DECREF(item);
- }
- }
-
- return 1;
-}
-
-/* Returns the number of items in a single- or multi-dimensional sequence. */
-static int count_items(PyObject *seq)
-{
- int totitem= 0;
-
- if (PySequence_Check(seq)) {
- int i;
- for (i= 0; i < PySequence_Length(seq); i++) {
- PyObject *item= PySequence_GetItem(seq, i);
- totitem += count_items(item);
- Py_DECREF(item);
- }
- }
- else
- totitem= 1;
-
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list