[Bf-blender-cvs] [be58a2f] soc-2016-layer_manager: Expose and use WITH_ADVANCED_LAYERS build option in BPY

Julian Eisel noreply at git.blender.org
Wed Jun 29 18:36:41 CEST 2016


Commit: be58a2f62de880668a6bb8fc57dbea4dbf4412bd
Author: Julian Eisel
Date:   Wed Jun 29 18:35:49 2016 +0200
Branches: soc-2016-layer_manager
https://developer.blender.org/rBbe58a2f62de880668a6bb8fc57dbea4dbf4412bd

Expose and use WITH_ADVANCED_LAYERS build option in BPY

===================================================================

M	release/scripts/startup/bl_ui/__init__.py
M	source/blender/python/intern/CMakeLists.txt
M	source/blender/python/intern/bpy_app_build_options.c

===================================================================

diff --git a/release/scripts/startup/bl_ui/__init__.py b/release/scripts/startup/bl_ui/__init__.py
index 4faaae1..44ec902 100644
--- a/release/scripts/startup/bl_ui/__init__.py
+++ b/release/scripts/startup/bl_ui/__init__.py
@@ -69,7 +69,6 @@ _modules = [
     "space_graph",
     "space_image",
     "space_info",
-    "space_layers", # TODO only for WITH_ADVANCED_LAYERS
     "space_logic",
     "space_nla",
     "space_node",
@@ -88,6 +87,9 @@ import bpy
 if bpy.app.build_options.freestyle:
     _modules.append("properties_freestyle")
 
+if bpy.app.build_options.advanced_layers:
+    _modules.append("space_layers")
+
 __import__(name=__name__, fromlist=_modules)
 _namespace = globals()
 _modules_loaded = [_namespace[name] for name in _modules]
diff --git a/source/blender/python/intern/CMakeLists.txt b/source/blender/python/intern/CMakeLists.txt
index 2715d2c..d0bd722 100644
--- a/source/blender/python/intern/CMakeLists.txt
+++ b/source/blender/python/intern/CMakeLists.txt
@@ -286,6 +286,10 @@ if(WITH_PLAYER)
 	add_definitions(-DWITH_PLAYER)
 endif()
 
+if (WITH_ADVANCED_LAYERS)
+	add_definitions(-DWITH_ADVANCED_LAYERS)
+endif()
+
 add_definitions(${GL_DEFINITIONS})
 
 blender_add_lib(bf_python "${SRC}" "${INC}" "${INC_SYS}")
diff --git a/source/blender/python/intern/bpy_app_build_options.c b/source/blender/python/intern/bpy_app_build_options.c
index 4c186aa..a242cfb 100644
--- a/source/blender/python/intern/bpy_app_build_options.c
+++ b/source/blender/python/intern/bpy_app_build_options.c
@@ -34,6 +34,7 @@ static PyTypeObject BlenderAppBuildOptionsType;
 
 static PyStructSequence_Field app_builtopts_info_fields[] = {
 	/* names mostly follow CMake options, lowercase, after WITH_ */
+	{(char *)"advanced_layers", NULL},
 	{(char *)"bullet", NULL},
 	{(char *)"codec_avi", NULL},
 	{(char *)"codec_ffmpeg", NULL},
@@ -93,6 +94,12 @@ static PyObject *make_builtopts_info(void)
 #define SetObjIncref(item) \
 	PyStructSequence_SET_ITEM(builtopts_info, pos++, (Py_IncRef(item), item))
 
+#ifdef WITH_ADVANCED_LAYERS
+	SetObjIncref(Py_True);
+#else
+	SetObjIncref(Py_False);
+#endif
+
 #ifdef WITH_BULLET
 	SetObjIncref(Py_True);
 #else




More information about the Bf-blender-cvs mailing list