diff options
author | Campbell Barton <ideasman42@gmail.com> | 2017-06-12 13:59:54 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2017-06-12 14:34:55 +0300 |
commit | f52dc2f371923c22a974df7105245f7e0b8148ee (patch) | |
tree | bd65af657cf7f06fdb01ee953182562c69189fed /release/scripts/startup/bl_ui/properties_data_lightprobe.py | |
parent | 12bd960df9bb9d96477b9913df8aec6fc7d87f95 (diff) |
Rename probe to light-probe
Probe is a real general term, the new name is used often in docs online.
Diffstat (limited to 'release/scripts/startup/bl_ui/properties_data_lightprobe.py')
-rw-r--r-- | release/scripts/startup/bl_ui/properties_data_lightprobe.py | 140 |
1 files changed, 140 insertions, 0 deletions
diff --git a/release/scripts/startup/bl_ui/properties_data_lightprobe.py b/release/scripts/startup/bl_ui/properties_data_lightprobe.py new file mode 100644 index 00000000000..5c5f4c3365f --- /dev/null +++ b/release/scripts/startup/bl_ui/properties_data_lightprobe.py @@ -0,0 +1,140 @@ +# ##### BEGIN GPL LICENSE BLOCK ##### +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software Foundation, +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# ##### END GPL LICENSE BLOCK ##### + +# <pep8 compliant> +import bpy +from bpy.types import Panel + + +class DataButtonsPanel: + bl_space_type = 'PROPERTIES' + bl_region_type = 'WINDOW' + bl_context = "data" + + @classmethod + def poll(cls, context): + engine = context.scene.render.engine + return context.lightprobe and (engine in cls.COMPAT_ENGINES) + + +class DATA_PT_context_lightprobe(DataButtonsPanel, Panel): + bl_label = "" + bl_options = {'HIDE_HEADER'} + COMPAT_ENGINES = {'BLENDER_CLAY', 'BLENDER_EEVEE'} + + def draw(self, context): + layout = self.layout + + ob = context.object + probe = context.lightprobe + space = context.space_data + + if ob: + layout.template_ID(ob, "data") + elif probe: + layout.template_ID(space, "pin_id") + + +class DATA_PT_lightprobe(DataButtonsPanel, Panel): + bl_label = "Probe" + COMPAT_ENGINES = {'BLENDER_CLAY', 'BLENDER_EEVEE'} + + def draw(self, context): + layout = self.layout + + ob = context.object + probe = context.lightprobe + + layout.prop(probe, "type", expand=True) + + split = layout.split() + + col = split.column(align=True) + col.label("Influence:") + col.prop(probe, "influence_type", text="") + + if probe.influence_type == 'ELIPSOID': + col.prop(probe, "influence_distance", "Radius") + else: + col.prop(probe, "influence_distance", "Size") + + col.prop(probe, "falloff") + + col = split.column(align=True) + col.label("Clipping:") + col.prop(probe, "clip_start", text="Start") + col.prop(probe, "clip_end", text="End") + + +class DATA_PT_lightprobe_parallax(DataButtonsPanel, Panel): + bl_label = "Parallax" + COMPAT_ENGINES = {'BLENDER_CLAY', 'BLENDER_EEVEE'} + + def draw(self, context): + layout = self.layout + + ob = context.object + probe = context.lightprobe + + layout.prop(probe, "use_custom_parallax") + + col = layout.column() + col.active = probe.use_custom_parallax + + row = col.row() + row.prop(probe, "parallax_type", expand=True) + + if probe.parallax_type == 'ELIPSOID': + col.prop(probe, "parallax_distance", "Radius") + else: + col.prop(probe, "parallax_distance", "Size") + + +class DATA_PT_lightprobe_display(DataButtonsPanel, Panel): + bl_label = "Display" + COMPAT_ENGINES = {'BLENDER_CLAY', 'BLENDER_EEVEE'} + + def draw(self, context): + layout = self.layout + + ob = context.object + probe = context.lightprobe + + split = layout.split() + + col = split.column() + col.prop(probe, "show_influence") + + col = split.column() + col.prop(probe, "show_parallax") + + col = split.column() + col.prop(probe, "show_clip") + + +classes = ( + DATA_PT_context_lightprobe, + DATA_PT_lightprobe, + DATA_PT_lightprobe_parallax, + DATA_PT_lightprobe_display, +) + +if __name__ == "__main__": # only for live edit. + from bpy.utils import register_class + for cls in classes: + register_class(cls) |