[Bf-blender-cvs] [30634f59027] cycles_embree: Cycles: Embree option is now only visible when Cycles was compiled with Embree.
Stefan Werner
noreply at git.blender.org
Tue Nov 6 20:41:04 CET 2018
Commit: 30634f5902719b1029775129788c4fe70e028f2a
Author: Stefan Werner
Date: Tue Nov 6 20:41:01 2018 +0100
Branches: cycles_embree
https://developer.blender.org/rB30634f5902719b1029775129788c4fe70e028f2a
Cycles: Embree option is now only visible when Cycles was compiled with Embree.
===================================================================
M intern/cycles/blender/addon/ui.py
M intern/cycles/blender/blender_python.cpp
===================================================================
diff --git a/intern/cycles/blender/addon/ui.py b/intern/cycles/blender/addon/ui.py
index 017c5735176..f862e0371d2 100644
--- a/intern/cycles/blender/addon/ui.py
+++ b/intern/cycles/blender/addon/ui.py
@@ -17,6 +17,7 @@
# <pep8 compliant>
import bpy
+import _cycles
from bpy.types import (
Panel,
@@ -430,9 +431,10 @@ class CYCLES_RENDER_PT_performance(CyclesButtonsPanel, Panel):
col.separator()
col.label(text="Acceleration structure:")
- row = col.row()
- row.active = use_cpu(context)
- row.prop(cscene, "use_bvh_embree")
+ if _cycles.with_embree:
+ row = col.row()
+ row.active = use_cpu(context)
+ row.prop(cscene, "use_bvh_embree")
row = col.row()
col.prop(cscene, "debug_use_spatial_splits")
row = col.row()
@@ -497,8 +499,6 @@ class CYCLES_RENDER_PT_layer_passes(CyclesButtonsPanel, Panel):
bl_options = {'DEFAULT_CLOSED'}
def draw(self, context):
- import _cycles
-
layout = self.layout
scene = context.scene
diff --git a/intern/cycles/blender/blender_python.cpp b/intern/cycles/blender/blender_python.cpp
index 4b01eb5f2d4..997176f9d44 100644
--- a/intern/cycles/blender/blender_python.cpp
+++ b/intern/cycles/blender/blender_python.cpp
@@ -844,5 +844,13 @@ void *CCL_python_module_init()
Py_INCREF(Py_False);
#endif /* WITH_NETWORK */
+#ifdef WITH_EMBREE
+ PyModule_AddObject(mod, "with_embree", Py_True);
+ Py_INCREF(Py_True);
+#else /* WITH_EMBREE */
+ PyModule_AddObject(mod, "with_embree", Py_False);
+ Py_INCREF(Py_False);
+#endif /* WITH_EMBREE */
+
return (void*)mod;
}
More information about the Bf-blender-cvs
mailing list