[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [54352] trunk/blender/source: some fixes for building blender as a python module again (wip, more work needed).

Campbell Barton ideasman42 at gmail.com
Wed Feb 6 14:07:46 CET 2013


Revision: 54352
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=54352
Author:   campbellbarton
Date:     2013-02-06 13:07:45 +0000 (Wed, 06 Feb 2013)
Log Message:
-----------
some fixes for building blender as a python module again (wip, more work needed).

Modified Paths:
--------------
    trunk/blender/source/blender/python/generic/idprop_py_api.c
    trunk/blender/source/creator/creator.c

Modified: trunk/blender/source/blender/python/generic/idprop_py_api.c
===================================================================
--- trunk/blender/source/blender/python/generic/idprop_py_api.c	2013-02-06 12:16:53 UTC (rev 54351)
+++ trunk/blender/source/blender/python/generic/idprop_py_api.c	2013-02-06 13:07:45 UTC (rev 54352)
@@ -1497,7 +1497,7 @@
 
 	mod = PyModule_Create(&IDProp_module_def);
 
-	/* bmesh.types */
+	/* idprop.types */
 	PyModule_AddObject(mod, "types", (submodule = BPyInit_idprop_types()));
 	PyDict_SetItemString(sys_modules, PyModule_GetName(submodule), submodule);
 	Py_INCREF(submodule);

Modified: trunk/blender/source/creator/creator.c
===================================================================
--- trunk/blender/source/creator/creator.c	2013-02-06 12:16:53 UTC (rev 54351)
+++ trunk/blender/source/creator/creator.c	2013-02-06 13:07:45 UTC (rev 54352)
@@ -158,7 +158,10 @@
 #endif
 
 /*	Local Function prototypes */
-#ifndef WITH_PYTHON_MODULE
+#ifdef WITH_PYTHON_MODULE
+int  main_python_enter(int argc, const char **argv);
+void main_python_exit(void);
+#else
 static int print_help(int argc, const char **argv, void *data);
 static int print_version(int argc, const char **argv, void *data);
 #endif
@@ -173,10 +176,10 @@
 /* Initialize callbacks for the modules that need them */
 static void setCallbacks(void); 
 
+#ifndef WITH_PYTHON_MODULE
+
 static bool use_crash_handler = true;
 
-#ifndef WITH_PYTHON_MODULE
-
 /* set breakpoints here when running in debug mode, useful to catch floating point errors */
 #if defined(__linux__) || defined(_WIN32) || defined(OSX_SSE_FPE)
 static void fpe_handler(int UNUSED(sig))
@@ -1469,12 +1472,14 @@
 	setupArguments(C, ba, &syshandle);
 
 	BLI_argsParse(ba, 1, NULL, NULL);
-#endif
 
 	if (use_crash_handler) {
 		/* after parsing args */
 		signal(SIGSEGV, blender_crash_handler);
 	}
+#else
+	(void)syshandle;
+#endif
 
 	/* after level 1 args, this is so playanim skips RNA init */
 	RNA_init();
@@ -1486,7 +1491,6 @@
 
 #if defined(WITH_PYTHON_MODULE) || defined(WITH_HEADLESS)
 	G.background = true; /* python module mode ALWAYS runs in background mode (for now) */
-	(void)blender_esc;
 #else
 	/* for all platforms, even windos has it! */
 	if (G.background) {




More information about the Bf-blender-cvs mailing list