2012-10-28 16:09:51 +00:00
|
|
|
# ##### 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>
|
2019-03-14 15:14:43 +11:00
|
|
|
from bpy.types import Panel
|
2012-10-28 16:09:51 +00:00
|
|
|
|
|
|
|
|
2017-11-22 10:52:39 -02:00
|
|
|
class ViewLayerButtonsPanel:
|
2012-10-28 16:09:51 +00:00
|
|
|
bl_space_type = 'PROPERTIES'
|
|
|
|
bl_region_type = 'WINDOW'
|
2017-11-22 10:52:39 -02:00
|
|
|
bl_context = "view_layer"
|
2012-10-28 16:09:51 +00:00
|
|
|
# COMPAT_ENGINES must be defined in each subclass, external engines can add themselves here
|
|
|
|
|
|
|
|
@classmethod
|
|
|
|
def poll(cls, context):
|
2018-04-17 13:35:05 +02:00
|
|
|
return (context.engine in cls.COMPAT_ENGINES)
|
2012-10-28 16:09:51 +00:00
|
|
|
|
|
|
|
|
2018-04-24 15:20:17 +02:00
|
|
|
class VIEWLAYER_PT_layer(ViewLayerButtonsPanel, Panel):
|
|
|
|
bl_label = "View Layer"
|
2018-11-26 19:00:01 +01:00
|
|
|
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH'}
|
2012-10-28 16:09:51 +00:00
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
2018-09-11 16:49:52 +10:00
|
|
|
|
|
|
|
layout.use_property_split = True
|
|
|
|
|
2012-10-28 16:09:51 +00:00
|
|
|
scene = context.scene
|
2017-10-16 17:59:09 -02:00
|
|
|
rd = scene.render
|
2019-03-13 13:13:29 +11:00
|
|
|
layer = context.view_layer
|
2012-10-28 16:09:51 +00:00
|
|
|
|
UI: Layout changes for new checkbox layout possibilities
Follow-up to previous commit.
Some examples:
{F8473507} {F8473508} {F8473509} {F8473510}
For more screenshots, please see D7430.
We use column or row headings here to bring more structure, and to give
the eye visual anchors which aid eye-scanning. The left-aligned
checkboxes likewise help with this. And we keep the adherence to the
center line, so the alignment matches up between the various buttons and
controls.
* Changes the property split percentage from 50/50% to 40/60%. This is
needed to give enough space for the checkboxes. But in most cases this
looks better anyway - see Transform panel. In some cases it simply
fills out the available space more efficently.
* Fix various hacks where we previously used manually defined splits.
When we did this, the alignment was never quite right, and the layout
code was a mess.
* Adds column headings to many places where a list of checkboxes all
share a common purpose or leading text.
* Add checkbox + value configurations various places where a checkbox
only serves to enable the value slider
* Removes most uses of grid flow layout. The grid flow layouts combine
poorly with column headings, and also they would mess alignment up
badly. The grid flow layouts also often made buttons and controls jump
around on the screen if you would just resize editors slightly,
causing visual confusion, making users lose their place. The logic for
at what time the list of items would re-flow was often flawed, jumping
to multiple columns too fast or too late - and frankly, the grid flow
layouts would often just look bad.
Maniphest Task: https://developer.blender.org/T65965
Differential Revision: https://developer.blender.org/D7430
Reviewed by: Brecht Van Lommel, Pablo Vazquez.
Most work here by William Reynish, few changes by Julian Eisel.
2020-04-17 16:54:03 +02:00
|
|
|
col = layout.column()
|
2018-09-11 16:49:52 +10:00
|
|
|
col.prop(layer, "use", text="Use for Rendering")
|
|
|
|
col.prop(rd, "use_single_layer", text="Render Single Layer")
|
2012-10-28 16:09:51 +00:00
|
|
|
|
2012-10-29 23:11:55 +00:00
|
|
|
|
2018-01-29 21:59:34 +01:00
|
|
|
class VIEWLAYER_PT_eevee_layer_passes(ViewLayerButtonsPanel, Panel):
|
|
|
|
bl_label = "Passes"
|
|
|
|
COMPAT_ENGINES = {'BLENDER_EEVEE'}
|
|
|
|
|
|
|
|
def draw(self, context):
|
2020-02-20 14:53:53 +01:00
|
|
|
pass
|
2018-09-11 16:49:52 +10:00
|
|
|
|
2018-01-29 21:59:34 +01:00
|
|
|
|
2020-02-20 14:53:53 +01:00
|
|
|
class VIEWLAYER_PT_eevee_layer_passes_data(ViewLayerButtonsPanel, Panel):
|
|
|
|
bl_label = "Data"
|
|
|
|
bl_parent_id = "VIEWLAYER_PT_eevee_layer_passes"
|
2018-09-11 16:49:52 +10:00
|
|
|
|
2020-02-20 14:53:53 +01:00
|
|
|
COMPAT_ENGINES = {'BLENDER_EEVEE'}
|
2020-03-05 08:05:21 +11:00
|
|
|
|
2020-02-20 14:53:53 +01:00
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
layout.use_property_split = True
|
|
|
|
layout.use_property_decorate = False
|
|
|
|
|
|
|
|
scene = context.scene
|
|
|
|
rd = scene.render
|
2018-04-24 15:20:17 +02:00
|
|
|
view_layer = context.view_layer
|
2018-01-29 21:59:34 +01:00
|
|
|
|
UI: Layout changes for new checkbox layout possibilities
Follow-up to previous commit.
Some examples:
{F8473507} {F8473508} {F8473509} {F8473510}
For more screenshots, please see D7430.
We use column or row headings here to bring more structure, and to give
the eye visual anchors which aid eye-scanning. The left-aligned
checkboxes likewise help with this. And we keep the adherence to the
center line, so the alignment matches up between the various buttons and
controls.
* Changes the property split percentage from 50/50% to 40/60%. This is
needed to give enough space for the checkboxes. But in most cases this
looks better anyway - see Transform panel. In some cases it simply
fills out the available space more efficently.
* Fix various hacks where we previously used manually defined splits.
When we did this, the alignment was never quite right, and the layout
code was a mess.
* Adds column headings to many places where a list of checkboxes all
share a common purpose or leading text.
* Add checkbox + value configurations various places where a checkbox
only serves to enable the value slider
* Removes most uses of grid flow layout. The grid flow layouts combine
poorly with column headings, and also they would mess alignment up
badly. The grid flow layouts also often made buttons and controls jump
around on the screen if you would just resize editors slightly,
causing visual confusion, making users lose their place. The logic for
at what time the list of items would re-flow was often flawed, jumping
to multiple columns too fast or too late - and frankly, the grid flow
layouts would often just look bad.
Maniphest Task: https://developer.blender.org/T65965
Differential Revision: https://developer.blender.org/D7430
Reviewed by: Brecht Van Lommel, Pablo Vazquez.
Most work here by William Reynish, few changes by Julian Eisel.
2020-04-17 16:54:03 +02:00
|
|
|
col = layout.column()
|
2018-01-29 21:59:34 +01:00
|
|
|
col.prop(view_layer, "use_pass_combined")
|
|
|
|
col.prop(view_layer, "use_pass_z")
|
2018-02-01 18:09:06 +01:00
|
|
|
col.prop(view_layer, "use_pass_mist")
|
2018-01-31 01:09:38 +01:00
|
|
|
col.prop(view_layer, "use_pass_normal")
|
2018-01-31 21:17:27 +01:00
|
|
|
|
2018-01-29 21:59:34 +01:00
|
|
|
|
2020-02-20 14:53:53 +01:00
|
|
|
class VIEWLAYER_PT_eevee_layer_passes_light(ViewLayerButtonsPanel, Panel):
|
|
|
|
bl_label = "Light"
|
|
|
|
bl_parent_id = "VIEWLAYER_PT_eevee_layer_passes"
|
|
|
|
COMPAT_ENGINES = {'BLENDER_EEVEE'}
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
layout.use_property_split = True
|
|
|
|
layout.use_property_decorate = False
|
|
|
|
|
|
|
|
view_layer = context.view_layer
|
|
|
|
view_layer_eevee = view_layer.eevee
|
|
|
|
scene = context.scene
|
|
|
|
scene_eevee = scene.eevee
|
|
|
|
|
UI: Layout changes for new checkbox layout possibilities
Follow-up to previous commit.
Some examples:
{F8473507} {F8473508} {F8473509} {F8473510}
For more screenshots, please see D7430.
We use column or row headings here to bring more structure, and to give
the eye visual anchors which aid eye-scanning. The left-aligned
checkboxes likewise help with this. And we keep the adherence to the
center line, so the alignment matches up between the various buttons and
controls.
* Changes the property split percentage from 50/50% to 40/60%. This is
needed to give enough space for the checkboxes. But in most cases this
looks better anyway - see Transform panel. In some cases it simply
fills out the available space more efficently.
* Fix various hacks where we previously used manually defined splits.
When we did this, the alignment was never quite right, and the layout
code was a mess.
* Adds column headings to many places where a list of checkboxes all
share a common purpose or leading text.
* Add checkbox + value configurations various places where a checkbox
only serves to enable the value slider
* Removes most uses of grid flow layout. The grid flow layouts combine
poorly with column headings, and also they would mess alignment up
badly. The grid flow layouts also often made buttons and controls jump
around on the screen if you would just resize editors slightly,
causing visual confusion, making users lose their place. The logic for
at what time the list of items would re-flow was often flawed, jumping
to multiple columns too fast or too late - and frankly, the grid flow
layouts would often just look bad.
Maniphest Task: https://developer.blender.org/T65965
Differential Revision: https://developer.blender.org/D7430
Reviewed by: Brecht Van Lommel, Pablo Vazquez.
Most work here by William Reynish, few changes by Julian Eisel.
2020-04-17 16:54:03 +02:00
|
|
|
col = layout.column(heading="Diffuse", align=True)
|
|
|
|
col.prop(view_layer, "use_pass_diffuse_direct", text="Light")
|
|
|
|
col.prop(view_layer, "use_pass_diffuse_color", text="Color")
|
|
|
|
|
|
|
|
col = layout.column(heading="Specular", align=True)
|
|
|
|
col.prop(view_layer, "use_pass_glossy_direct", text="Light")
|
|
|
|
col.prop(view_layer, "use_pass_glossy_color", text="Color")
|
|
|
|
|
|
|
|
col = layout.column(heading="Volume", align=True)
|
|
|
|
col.prop(view_layer_eevee, "use_pass_volume_transmittance", text="Transmittance")
|
|
|
|
col.prop(view_layer_eevee, "use_pass_volume_scatter", text="Scatter")
|
|
|
|
|
|
|
|
col = layout.column(heading="Other", align=True)
|
2020-02-20 14:53:53 +01:00
|
|
|
col.prop(view_layer, "use_pass_emit", text="Emission")
|
|
|
|
col.prop(view_layer, "use_pass_environment")
|
|
|
|
col.prop(view_layer, "use_pass_shadow")
|
|
|
|
row = col.row()
|
|
|
|
row.prop(view_layer, "use_pass_ambient_occlusion", text="Ambient Occlusion")
|
|
|
|
row.active = scene_eevee.use_gtao
|
|
|
|
|
|
|
|
|
|
|
|
class VIEWLAYER_PT_eevee_layer_passes_effects(ViewLayerButtonsPanel, Panel):
|
|
|
|
bl_label = "Effects"
|
|
|
|
bl_parent_id = "VIEWLAYER_PT_eevee_layer_passes"
|
|
|
|
COMPAT_ENGINES = {'BLENDER_EEVEE'}
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
layout.use_property_split = True
|
|
|
|
layout.use_property_decorate = False
|
|
|
|
|
|
|
|
view_layer = context.view_layer
|
|
|
|
view_layer_eevee = view_layer.eevee
|
|
|
|
scene = context.scene
|
|
|
|
scene_eevee = scene.eevee
|
|
|
|
|
UI: Layout changes for new checkbox layout possibilities
Follow-up to previous commit.
Some examples:
{F8473507} {F8473508} {F8473509} {F8473510}
For more screenshots, please see D7430.
We use column or row headings here to bring more structure, and to give
the eye visual anchors which aid eye-scanning. The left-aligned
checkboxes likewise help with this. And we keep the adherence to the
center line, so the alignment matches up between the various buttons and
controls.
* Changes the property split percentage from 50/50% to 40/60%. This is
needed to give enough space for the checkboxes. But in most cases this
looks better anyway - see Transform panel. In some cases it simply
fills out the available space more efficently.
* Fix various hacks where we previously used manually defined splits.
When we did this, the alignment was never quite right, and the layout
code was a mess.
* Adds column headings to many places where a list of checkboxes all
share a common purpose or leading text.
* Add checkbox + value configurations various places where a checkbox
only serves to enable the value slider
* Removes most uses of grid flow layout. The grid flow layouts combine
poorly with column headings, and also they would mess alignment up
badly. The grid flow layouts also often made buttons and controls jump
around on the screen if you would just resize editors slightly,
causing visual confusion, making users lose their place. The logic for
at what time the list of items would re-flow was often flawed, jumping
to multiple columns too fast or too late - and frankly, the grid flow
layouts would often just look bad.
Maniphest Task: https://developer.blender.org/T65965
Differential Revision: https://developer.blender.org/D7430
Reviewed by: Brecht Van Lommel, Pablo Vazquez.
Most work here by William Reynish, few changes by Julian Eisel.
2020-04-17 16:54:03 +02:00
|
|
|
col = layout.column()
|
2020-02-20 14:53:53 +01:00
|
|
|
col.prop(view_layer_eevee, "use_pass_bloom", text="Bloom")
|
|
|
|
col.active = scene_eevee.use_bloom
|
|
|
|
|
2017-03-18 20:03:24 +11:00
|
|
|
classes = (
|
2018-04-24 15:20:17 +02:00
|
|
|
VIEWLAYER_PT_layer,
|
2018-01-29 21:59:34 +01:00
|
|
|
VIEWLAYER_PT_eevee_layer_passes,
|
2020-02-20 14:53:53 +01:00
|
|
|
VIEWLAYER_PT_eevee_layer_passes_data,
|
|
|
|
VIEWLAYER_PT_eevee_layer_passes_light,
|
|
|
|
VIEWLAYER_PT_eevee_layer_passes_effects,
|
2017-03-18 20:03:24 +11:00
|
|
|
)
|
|
|
|
|
2012-10-28 16:09:51 +00:00
|
|
|
if __name__ == "__main__": # only for live edit.
|
2017-03-18 20:03:24 +11:00
|
|
|
from bpy.utils import register_class
|
|
|
|
for cls in classes:
|
|
|
|
register_class(cls)
|