[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [40484] branches/bmesh/blender: svn merge ^/trunk/blender -r40390:40394

Campbell Barton ideasman42 at gmail.com
Fri Sep 23 09:20:27 CEST 2011


Revision: 40484
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=40484
Author:   campbellbarton
Date:     2011-09-23 07:20:27 +0000 (Fri, 23 Sep 2011)
Log Message:
-----------
svn merge ^/trunk/blender -r40390:40394

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

Modified Paths:
--------------
    branches/bmesh/blender/GNUmakefile
    branches/bmesh/blender/source/blender/editors/transform/transform_conversions.c
    branches/bmesh/blender/source/blender/python/intern/CMakeLists.txt
    branches/bmesh/blender/source/blender/python/intern/bpy.h
    branches/bmesh/blender/source/blender/python/intern/bpy_interface.c
    branches/bmesh/blender/source/blender/windowmanager/WM_api.h
    branches/bmesh/blender/source/blender/windowmanager/intern/wm_init_exit.c

Added Paths:
-----------
    branches/bmesh/blender/source/blender/python/intern/bpy_interface_atexit.c

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-40390
   + /trunk/blender:39992-40394

Modified: branches/bmesh/blender/GNUmakefile
===================================================================
--- branches/bmesh/blender/GNUmakefile	2011-09-23 07:17:07 UTC (rev 40483)
+++ branches/bmesh/blender/GNUmakefile	2011-09-23 07:20:27 UTC (rev 40484)
@@ -36,7 +36,7 @@
 BLENDER_DIR:=$(shell pwd -P)
 BUILD_DIR:=$(shell dirname $(BLENDER_DIR))/build/$(OS_NCASE)
 BUILD_TYPE:=Release
-BUILD_CMAKE_ARGS:=""
+BUILD_CMAKE_ARGS:=
 
 
 # -----------------------------------------------------------------------------
@@ -77,14 +77,24 @@
 	NPROCS:=$(shell sysctl -a | grep "hw.ncpu " | cut -d" " -f3 )
 endif
 
+
 # -----------------------------------------------------------------------------
+# Macro for configuring cmake
+
+CMAKE_CONFIG = cmake $(BUILD_CMAKE_ARGS) \
+                     -H$(BLENDER_DIR) \
+                     -B$(BUILD_DIR) \
+                     -DCMAKE_BUILD_TYPE:STRING=$(BUILD_TYPE)
+
+
+# -----------------------------------------------------------------------------
 # Build Blender
 all:
 	@echo
 	@echo Configuring Blender ...
 
 	if test ! -f $(BUILD_DIR)/CMakeCache.txt ; then \
-		cmake $(BUILD_CMAKE_ARGS) -H$(BLENDER_DIR) -B$(BUILD_DIR) -DCMAKE_BUILD_TYPE:STRING=$(BUILD_TYPE); \
+		$(CMAKE_CONFIG); \
 	fi
 
 	@echo
@@ -186,12 +196,15 @@
 #
 
 check_cppcheck:
+	$(CMAKE_CONFIG)
 	cd $(BUILD_DIR) ; python3 $(BLENDER_DIR)/build_files/cmake/cmake_static_check_cppcheck.py
 
 check_splint:
+	$(CMAKE_CONFIG)
 	cd $(BUILD_DIR) ; python3 $(BLENDER_DIR)/build_files/cmake/cmake_static_check_splint.py
 
 check_sparse:
+	$(CMAKE_CONFIG)
 	cd $(BUILD_DIR) ; python3 $(BLENDER_DIR)/build_files/cmake/cmake_static_check_sparse.py
 
 


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


Property changes on: branches/bmesh/blender/source/blender/editors/space_outliner
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/soc-2011-pepper/source/blender/editors/space_outliner:36831-38987
/trunk/blender/source/blender/editors/space_outliner:31524-40390
   + /branches/soc-2011-pepper/source/blender/editors/space_outliner:36831-38987
/trunk/blender/source/blender/editors/space_outliner:31524-40394

Modified: branches/bmesh/blender/source/blender/editors/transform/transform_conversions.c
===================================================================
--- branches/bmesh/blender/source/blender/editors/transform/transform_conversions.c	2011-09-23 07:17:07 UTC (rev 40483)
+++ branches/bmesh/blender/source/blender/editors/transform/transform_conversions.c	2011-09-23 07:20:27 UTC (rev 40484)
@@ -1816,7 +1816,7 @@
 /* ********************* mesh ****************** */
 
 /* proportional distance based on connectivity  */
-#define THRESHOLD	0.000000000000001f
+#define THRESHOLD	0.0001f
 
 /*I did this wrong, it should be a breadth-first search
   but instead it's a depth-first search, fudged

Modified: branches/bmesh/blender/source/blender/python/intern/CMakeLists.txt
===================================================================
--- branches/bmesh/blender/source/blender/python/intern/CMakeLists.txt	2011-09-23 07:17:07 UTC (rev 40483)
+++ branches/bmesh/blender/source/blender/python/intern/CMakeLists.txt	2011-09-23 07:20:27 UTC (rev 40484)
@@ -47,6 +47,7 @@
 	bpy_app_handlers.c
 	bpy_driver.c
 	bpy_interface.c
+	bpy_interface_atexit.c
 	bpy_intern_string.c
 	bpy_library.c
 	bpy_operator.c

Modified: branches/bmesh/blender/source/blender/python/intern/bpy.h
===================================================================
--- branches/bmesh/blender/source/blender/python/intern/bpy.h	2011-09-23 07:17:07 UTC (rev 40483)
+++ branches/bmesh/blender/source/blender/python/intern/bpy.h	2011-09-23 07:20:27 UTC (rev 40484)
@@ -28,3 +28,6 @@
  
 void BPy_init_modules(void);
 extern PyObject *bpy_package_py;
+
+/* bpy_interface_atexit.c */
+void BPY_atexit_init(void);

Modified: branches/bmesh/blender/source/blender/python/intern/bpy_interface.c
===================================================================
--- branches/bmesh/blender/source/blender/python/intern/bpy_interface.c	2011-09-23 07:17:07 UTC (rev 40483)
+++ branches/bmesh/blender/source/blender/python/intern/bpy_interface.c	2011-09-23 07:20:27 UTC (rev 40484)
@@ -30,7 +30,7 @@
  
 /* grr, python redefines */
 #ifdef _POSIX_C_SOURCE
-#undef _POSIX_C_SOURCE
+#  undef _POSIX_C_SOURCE
 #endif
 
 #include <Python.h>
@@ -241,6 +241,8 @@
 	
 	pyrna_alloc_types();
 
+	BPY_atexit_init(); /* this can init any time */
+
 #ifndef WITH_PYTHON_MODULE
 	py_tstate= PyGILState_GetThisThreadState();
 	PyEval_ReleaseThread(py_tstate);

Copied: branches/bmesh/blender/source/blender/python/intern/bpy_interface_atexit.c (from rev 40394, trunk/blender/source/blender/python/intern/bpy_interface_atexit.c)
===================================================================
--- branches/bmesh/blender/source/blender/python/intern/bpy_interface_atexit.c	                        (rev 0)
+++ branches/bmesh/blender/source/blender/python/intern/bpy_interface_atexit.c	2011-09-23 07:20:27 UTC (rev 40484)
@@ -0,0 +1,76 @@
+/*
+ * $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): Campbell Barton
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+/** \file blender/python/intern/bpy_interface_atexit.c
+ *  \ingroup pythonintern
+ */
+
+
+#include <Python.h>
+
+#include "bpy_util.h"
+
+#include "WM_api.h"
+
+#include "BLI_utildefines.h"
+
+static PyObject *bpy_atexit(PyObject *UNUSED(self), PyObject *UNUSED(args), PyObject *UNUSED(kw))
+{
+	/* close down enough of blender at least not to crash */
+	struct bContext *C= BPy_GetContext();
+
+	WM_exit_ext(C, 0);
+
+	Py_RETURN_NONE;
+}
+
+static PyMethodDef meth_bpy_atexit= {"bpy_atexit", (PyCFunction)bpy_atexit, METH_NOARGS, NULL};
+
+void BPY_atexit_init(void)
+{
+	/* note - no error checking, if any of these fail we'll get a crash
+	 * this is intended, but if its problematic it could be changed
+	 * - campbell */
+
+	PyObject *atexit_mod= PyImport_ImportModuleLevel((char *)"atexit", NULL, NULL, NULL, 0);
+	PyObject *atexit_register= PyObject_GetAttrString(atexit_mod, "register");
+	PyObject *args= PyTuple_New(1);
+	PyObject *ret;
+
+	PyTuple_SET_ITEM(args, 0, (PyObject *)PyCFunction_New(&meth_bpy_atexit, NULL));
+
+	ret= PyObject_CallObject(atexit_register, args);
+
+	Py_DECREF(atexit_mod);
+	Py_DECREF(atexit_register);
+	Py_DECREF(args);
+
+	if(ret) {
+		Py_DECREF(ret);
+	}
+	else { /* should never happen */
+		PyErr_Print();
+	}
+
+}

Modified: branches/bmesh/blender/source/blender/windowmanager/WM_api.h
===================================================================
--- branches/bmesh/blender/source/blender/windowmanager/WM_api.h	2011-09-23 07:17:07 UTC (rev 40483)
+++ branches/bmesh/blender/source/blender/windowmanager/WM_api.h	2011-09-23 07:20:27 UTC (rev 40484)
@@ -72,6 +72,7 @@
 void		WM_setinitialstate_normal(void);
 
 void		WM_init				(struct bContext *C, int argc, const char **argv);
+void		WM_exit_ext			(struct bContext *C, const short do_python);
 void		WM_exit				(struct bContext *C);
 void		WM_main				(struct bContext *C);
 

Modified: branches/bmesh/blender/source/blender/windowmanager/intern/wm_init_exit.c
===================================================================
--- branches/bmesh/blender/source/blender/windowmanager/intern/wm_init_exit.c	2011-09-23 07:17:07 UTC (rev 40483)
+++ branches/bmesh/blender/source/blender/windowmanager/intern/wm_init_exit.c	2011-09-23 07:20:27 UTC (rev 40484)
@@ -343,7 +343,8 @@
 extern void free_posebuf(void); 
 
 /* called in creator.c even... tsk, split this! */
-void WM_exit(bContext *C)
+/* note, doesnt run exit() call WM_exit() for that */
+void WM_exit_ext(bContext *C, const short do_python)
 {
 	wmWindow *win;
 
@@ -409,14 +410,17 @@
 	
 
 #ifdef WITH_PYTHON
-	/* XXX - old note */
-	/* before free_blender so py's gc happens while library still exists */
-	/* needed at least for a rare sigsegv that can happen in pydrivers */
+	/* option not to close python so we can use 'atexit' */
+	if(do_python) {
+		/* XXX - old note */
+		/* before free_blender so py's gc happens while library still exists */
+		/* needed at least for a rare sigsegv that can happen in pydrivers */
 
-	/* Update for blender 2.5, move after free_blender because blender now holds references to PyObject's
-	 * so decref'ing them after python ends causes bad problems every time
-	 * the pyDriver bug can be fixed if it happens again we can deal with it then */
-	BPY_python_end();
+		/* Update for blender 2.5, move after free_blender because blender now holds references to PyObject's
+		 * so decref'ing them after python ends causes bad problems every time
+		 * the pyDriver bug can be fixed if it happens again we can deal with it then */
+		BPY_python_end();
+	}
 #endif
 
 	GPU_global_buffer_pool_free();
@@ -463,6 +467,10 @@
 		getchar();
 	}
 #endif 
+}
+
+void WM_exit(bContext *C)
+{
+	WM_exit_ext(C, 1);
 	exit(G.afbreek==1);
 }
-




More information about the Bf-blender-cvs mailing list