Cycles: Make UI for subdivision more clear
authorMai Lavelle <mai.lavelle@gmail.com>
Wed, 24 Aug 2016 15:26:19 +0000 (11:26 -0400)
committerMai Lavelle <mai.lavelle@gmail.com>
Fri, 26 Aug 2016 16:14:07 +0000 (12:14 -0400)
Users have been getting a bit confused by the way things are worded/arranged in
the UI. This patch makes a few changes to the UI to make it more clear how to
use subdivision:

- make Subdivide UVs option inactive when adaptive subdivision is enabled as UV
  subdivision is currently unsupported
- add "px" to dicing rates in the Geometry Panel
- display the final dicing rate in the modifier
- reworded "Dicing Rate" in the modifier to "Dicing Scale" to make more clear
  that this is a multiplier for the scene dicing rate and added a note the the
  tooltip pointing the user to that setting in the Geometry Panel

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D2174

intern/cycles/blender/addon/properties.py
release/scripts/startup/bl_ui/properties_data_modifier.py

index 8e82eac2b59d65e7329c7c08aafd703e958600a1..82a18b3f6a9875b2b85b9d060767cd3584005116 100644 (file)
@@ -369,12 +369,14 @@ class CyclesRenderSettings(bpy.types.PropertyGroup):
                 description="Size of a micropolygon in pixels",
                 min=0.1, max=1000.0,
                 default=1.0,
+                subtype="PIXEL"
                 )
         cls.preview_dicing_rate = FloatProperty(
                 name="Preview Dicing Rate",
                 description="Size of a micropolygon in pixels during preview render",
                 min=0.1, max=1000.0,
                 default=8.0,
+                subtype="PIXEL"
                 )
 
         cls.max_subdivisions = IntProperty(
@@ -1007,8 +1009,8 @@ class CyclesObjectSettings(bpy.types.PropertyGroup):
                 )
 
         cls.dicing_rate = FloatProperty(
-                name="Dicing Rate",
-                description="Multiplier for scene dicing rate",
+                name="Dicing Scale",
+                description="Multiplier for scene dicing rate (located in the Geometry Panel)",
                 min=0.1, max=1000.0,
                 default=1.0,
                 )
index 50221d57b4928d817030501b921284e6c98c7cdb..84ee06c7d709d57805d351e552c26d6b22a20e80 100644 (file)
@@ -900,9 +900,13 @@ class DATA_PT_modifiers(ModifierButtonsPanel, Panel):
         split = layout.split()
         col = split.column()
 
-        engine = bpy.context.scene.render.engine
-        if engine == "CYCLES" and md == ob.modifiers[-1] and bpy.context.scene.cycles.feature_set == "EXPERIMENTAL":
-            col.label(text="Preview:")
+        scene = bpy.context.scene
+        engine = scene.render.engine
+        show_adaptive_options = (engine == "CYCLES" and md == ob.modifiers[-1] and
+                                 scene.cycles.feature_set == "EXPERIMENTAL")
+
+        if show_adaptive_options:
+            col.label(text="View:")
             col.prop(md, "levels", text="Levels")
             col.label(text="Render:")
             col.prop(ob.cycles, "use_adaptive_subdivision", text="Adaptive")
@@ -917,11 +921,26 @@ class DATA_PT_modifiers(ModifierButtonsPanel, Panel):
 
         col = split.column()
         col.label(text="Options:")
-        col.prop(md, "use_subsurf_uv")
+
+        sub = col.column()
+        sub.active = (not show_adaptive_options) or (not ob.cycles.use_adaptive_subdivision)
+        sub.prop(md, "use_subsurf_uv")
+
         col.prop(md, "show_only_control_edges")
         if hasattr(md, "use_opensubdiv"):
             col.prop(md, "use_opensubdiv")
 
+        if show_adaptive_options and ob.cycles.use_adaptive_subdivision:
+            col = layout.column(align=True)
+            col.scale_y = 0.6
+            col.separator()
+            col.label("Final Dicing Rate:")
+            col.separator()
+
+            render = max(scene.cycles.dicing_rate * ob.cycles.dicing_rate, 0.1)
+            preview = max(scene.cycles.preview_dicing_rate * ob.cycles.dicing_rate, 0.1)
+            col.label("Render %.2f px, Preview %.2f px" % (render, preview))
+
     def SURFACE(self, layout, ob, md):
         layout.label(text="Settings are inside the Physics tab")