diff options
author | Thomas Dinges <blender@dingto.org> | 2012-12-28 20:25:41 +0400 |
---|---|---|
committer | Thomas Dinges <blender@dingto.org> | 2012-12-28 20:25:41 +0400 |
commit | 81b371a451407f77a7a79e4ca1aec4744cb845aa (patch) | |
tree | f8ab8ea50c67ed28d9988f7f0279926e04bc9f3e /intern | |
parent | 357b02f65ff31392fd3b0b8a875af73bcd7977c9 (diff) |
Cycles Hair UI:
* Code cleanup, removed some unneeded code
* Moved "Cycles Hair Rendering" panel above "Cycles Hair settings"
* "Cycles Hair settings" panel is only visible when hair rendering ("use_curves") is enabled.
Diffstat (limited to 'intern')
-rw-r--r-- | intern/cycles/blender/addon/ui.py | 129 |
1 files changed, 62 insertions, 67 deletions
diff --git a/intern/cycles/blender/addon/ui.py b/intern/cycles/blender/addon/ui.py index 03724c9bb4c..c990e4e4e40 100644 --- a/intern/cycles/blender/addon/ui.py +++ b/intern/cycles/blender/addon/ui.py @@ -944,95 +944,90 @@ class CyclesParticle_PT_textures(CyclesButtonsPanel, Panel): else: slot = part.texture_slots[part.active_texture_index] layout.template_ID(slot, "texture", new="texture.new") - -class CyclesParticle_PT_CurveSettings(CyclesButtonsPanel, Panel): - bl_label = "Cycles Hair Settings" + +class CyclesRender_PT_CurveRendering(CyclesButtonsPanel, Panel): + bl_label = "Cycles Hair Rendering" bl_context = "particle" @classmethod def poll(cls, context): psys = context.particle_system device_type = context.user_preferences.system.compute_device_type - if context.scene.cycles.feature_set == 'EXPERIMENTAL' and (context.scene.cycles.device == 'CPU' or device_type == 'NONE'): - if CyclesButtonsPanel.poll(context) and psys: - return True - - return False - + experimental = context.scene.cycles.feature_set == 'EXPERIMENTAL' and (context.scene.cycles.device == 'CPU' or device_type == 'NONE') + return CyclesButtonsPanel.poll(context) and experimental and psys + + def draw_header(self, context): + cscene = context.scene.cycles_curves + self.layout.prop(cscene, "use_curves", text="") + def draw(self, context): layout = self.layout - psys = context.particle_settings + scene = context.scene + cscene = scene.cycles_curves - cpsys = psys.cycles + layout.active = cscene.use_curves - row = layout.row() - row.prop(cpsys, "shape", text="Shape") - row.prop(cpsys, "use_closetip", text="Close tip") - row = layout.row() - row.prop(cpsys, "root_width", text="Root Width multiplier") - row = layout.row() - row.prop(cpsys, "tip_width", text="Tip Width multiplier") - -class CyclesRender_PT_CurveRendering(CyclesButtonsPanel, Panel): - bl_label = "Cycles Hair Rendering" + layout.prop(cscene, "preset", text="Mode") + + if cscene.preset == 'CUSTOM': + layout.prop(cscene, "primitive", text="Primitive") + + if cscene.primitive == 'TRIANGLES': + layout.prop(cscene, "triangle_method", text="Method") + if cscene.triangle_method == 'TESSELATED': + layout.prop(cscene, "resolution", text="Resolution") + layout.prop(cscene, "use_smooth", text="Smooth") + elif cscene.primitive == 'LINE_SEGMENTS': + layout.prop(cscene, "use_backfacing", text="Check back-faces") + + row = layout.row() + row.prop(cscene, "use_encasing", text="Exclude encasing") + sub = row.row() + sub.active = cscene.use_encasing + sub.prop(cscene, "encasing_ratio", text="Ratio for encasing") + + layout.prop(cscene, "line_method", text="Method") + layout.prop(cscene, "use_tangent_normal", text="Use tangent normal as default") + layout.prop(cscene, "use_tangent_normal_geometry", text="Use tangent normal geometry") + layout.prop(cscene, "use_tangent_normal_correction", text="Correct tangent normal for slope") + layout.prop(cscene, "interpolation", text="Interpolation") + + row = layout.row() + row.prop(cscene, "segments", text="Segments") + row.prop(cscene, "normalmix", text="Ray Mix") + + row = layout.row() + row.prop(cscene, "use_cache", text="Export cache with children") + if cscene.use_cache: + row.prop(cscene, "use_parents", text="Include parents") + +class CyclesParticle_PT_CurveSettings(CyclesButtonsPanel, Panel): + bl_label = "Cycles Hair Settings" bl_context = "particle" @classmethod def poll(cls, context): + use_curves = context.scene.cycles_curves.use_curves device_type = context.user_preferences.system.compute_device_type - if CyclesButtonsPanel.poll(context): - if context.scene.cycles.feature_set == 'EXPERIMENTAL' and (context.scene.cycles.device == 'CPU' or device_type == 'NONE'): - return True + experimental = context.scene.cycles.feature_set == 'EXPERIMENTAL' and (context.scene.cycles.device == 'CPU' or device_type == 'NONE') + return CyclesButtonsPanel.poll(context) and experimental and use_curves - return False - def draw(self, context): layout = self.layout - scene = context.scene - csscene = scene.cycles_curves - row = layout.row() - row.prop(csscene, "use_curves", text="Enable Cycles Hair") - row = layout.row() - row.prop(csscene, "preset", text="Mode") + psys = context.particle_settings + cpsys = psys.cycles - if csscene.preset == 'CUSTOM': - row = layout.row() - row.prop(csscene, "primitive", text="Primitive") - row = layout.row() + row = layout.row() + row.prop(cpsys, "shape", text="Shape") + row.prop(cpsys, "use_closetip", text="Close tip") - if csscene.primitive == 'TRIANGLES': - row.prop(csscene, "triangle_method", text="Method") - if csscene.triangle_method == 'TESSELATED': - row = layout.row() - row.prop(csscene, "resolution", text="Resolution") - row = layout.row() - row.prop(csscene, "use_smooth", text="Smooth") - elif csscene.primitive == 'LINE_SEGMENTS': - row.prop(csscene, "use_backfacing", text="Check back-faces") - row = layout.row() - row.prop(csscene, "use_encasing", text="Exclude encasing") - if csscene.use_encasing: - row.prop(csscene, "encasing_ratio", text="Ratio for encasing") - row = layout.row() - row.prop(csscene, "line_method", text="Method") - row = layout.row() - row.prop(csscene, "use_tangent_normal", text="Use tangent normal as default") - row = layout.row() - row.prop(csscene, "use_tangent_normal_geometry", text="Use tangent normal geometry") - row = layout.row() - row.prop(csscene, "use_tangent_normal_correction", text="Correct tangent normal for slope") - row = layout.row() - row.prop(csscene, "interpolation", text="Interpolation") - row = layout.row() - row.prop(csscene, "segments", text="Segments") - row = layout.row() - row.prop(csscene, "normalmix", text="Ray Mix") - row = layout.row() - row.prop(csscene, "use_cache", text="Export cache with children") - if csscene.use_cache: - row.prop(csscene, "use_parents", text="Include parents") + layout.label(text="Width multiplier:") + row = layout.row() + row.prop(cpsys, "root_width", text="Root") + row.prop(cpsys, "tip_width", text="Tip") + class CyclesScene_PT_simplify(CyclesButtonsPanel, Panel): bl_label = "Simplify" |