[Bf-blender-cvs] [ab2c1271ed9] cycles_path_guiding: Cycles-X: Path Guiding: UI: updating ui behavior

Sebastian Herholz noreply at git.blender.org
Wed Jun 29 14:31:10 CEST 2022


Commit: ab2c1271ed940fbf45378479b9de582556eb4209
Author: Sebastian Herholz
Date:   Mon Jun 27 11:06:58 2022 +0200
Branches: cycles_path_guiding
https://developer.blender.org/rBab2c1271ed940fbf45378479b9de582556eb4209

Cycles-X: Path Guiding: UI: updating ui behavior

`Guiding` is now disabled by default.

The `Guiding` menu is now disabled when blender is compiled without path guiding support

The `Guiding` tap is now not visible anymore when using the GPU device.

Some of the guiding parameters are now only shown if the `Experimental` features are active.

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

M	intern/cycles/blender/addon/engine.py
M	intern/cycles/blender/addon/properties.py
M	intern/cycles/blender/addon/ui.py
M	intern/cycles/blender/python.cpp

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

diff --git a/intern/cycles/blender/addon/engine.py b/intern/cycles/blender/addon/engine.py
index e211f53cf31..746f8b23af3 100644
--- a/intern/cycles/blender/addon/engine.py
+++ b/intern/cycles/blender/addon/engine.py
@@ -156,6 +156,11 @@ def with_osl():
     return _cycles.with_osl
 
 
+def with_path_guiding():
+    import _cycles
+    return _cycles.with_path_guiding
+
+
 def system_info():
     import _cycles
     return _cycles.system_info()
diff --git a/intern/cycles/blender/addon/properties.py b/intern/cycles/blender/addon/properties.py
index 13b1f8fe29e..321b3cda6f9 100644
--- a/intern/cycles/blender/addon/properties.py
+++ b/intern/cycles/blender/addon/properties.py
@@ -515,7 +515,7 @@ class CyclesRenderSettings(bpy.types.PropertyGroup):
     guiding: BoolProperty(
         name="Guiding",
         description="Use path guiding for sampling paths",
-        default=True,
+        default=False,
     )
 
     guiding_distribution_type: EnumProperty(
diff --git a/intern/cycles/blender/addon/ui.py b/intern/cycles/blender/addon/ui.py
index aef86d8c019..21d474c280d 100644
--- a/intern/cycles/blender/addon/ui.py
+++ b/intern/cycles/blender/addon/ui.py
@@ -462,21 +462,22 @@ class CYCLES_RENDER_PT_light_paths_guiding(CyclesButtonsPanel, Panel):
     bl_label = "Guiding"
     bl_parent_id = "CYCLES_RENDER_PT_light_paths"
 
+    @classmethod
+    def poll(cls, context):
+        from . import engine
+        return use_cpu(context) and engine.with_path_guiding()
+
     def draw_header(self, context):
         scene = context.scene
         cscene = scene.cycles
 
-        if cscene.device != 'CPU':
-            return
-
         self.layout.prop(cscene, "guiding", text="")
 
     def draw(self, context):
         scene = context.scene
         cscene = scene.cycles
 
-        if cscene.device != 'CPU':
-            return
+        experimentalView = context.scene.cycles.feature_set == 'EXPERIMENTAL'
 
         layout = self.layout
         layout.use_property_split = True
@@ -484,13 +485,16 @@ class CYCLES_RENDER_PT_light_paths_guiding(CyclesButtonsPanel, Panel):
         layout.active = cscene.guiding
 
         col = layout.column(align=True)
-        col.prop(cscene, "guiding_distribution_type", text="Distribution Type")
+        if experimentalView:
+            col.prop(cscene, "guiding_distribution_type", text="Distribution Type")
         col.prop(cscene, "surface_guiding", text="Surface Guiding")
-        col.prop(cscene, "surface_guiding_probability", text="Surface Guiding Probability")
+        if experimentalView:
+            col.prop(cscene, "surface_guiding_probability", text="Surface Guiding Probability")
         col.prop(cscene, "volume_guiding", text="Volume Guiding")
-        col.prop(cscene, "volume_guiding_probability", text="Volume Guiding Probability")
-        col.prop(cscene, "guide_direct_light", text="Guide Direct Light")
-        col.prop(cscene, "use_mis_weights", text="Use MIS Weights")
+        if experimentalView:
+            col.prop(cscene, "volume_guiding_probability", text="Volume Guiding Probability")
+            col.prop(cscene, "guide_direct_light", text="Guide Direct Light")
+            col.prop(cscene, "use_mis_weights", text="Use MIS Weights")
 
 
 class CYCLES_RENDER_PT_light_paths_fast_gi(CyclesButtonsPanel, Panel):
diff --git a/intern/cycles/blender/python.cpp b/intern/cycles/blender/python.cpp
index 7bd1ad2cafe..1ee14c2b717 100644
--- a/intern/cycles/blender/python.cpp
+++ b/intern/cycles/blender/python.cpp
@@ -1007,6 +1007,14 @@ void *CCL_python_module_init()
   PyModule_AddStringConstant(mod, "osl_version_string", "unknown");
 #endif
 
+#ifdef WITH_PATH_GUIDING
+  PyModule_AddObject(mod, "with_path_guiding", Py_True);
+  Py_INCREF(Py_True);
+#else  /* WITH_PATH_GUIDING */
+  PyModule_AddObject(mod, "with_path_guiding", Py_False);
+  Py_INCREF(Py_False);
+#endif /* WITH_PATH_GUIDING */
+
 #ifdef WITH_EMBREE
   PyModule_AddObject(mod, "with_embree", Py_True);
   Py_INCREF(Py_True);



More information about the Bf-blender-cvs mailing list