2023-08-16 00:20:26 +10:00
|
|
|
# SPDX-FileCopyrightText: 2009-2023 Blender Authors
|
2023-06-15 13:09:04 +10:00
|
|
|
#
|
2022-02-11 09:07:11 +11:00
|
|
|
# SPDX-License-Identifier: GPL-2.0-or-later
|
2023-06-15 13:09:04 +10:00
|
|
|
|
2009-04-27 18:05:58 +00:00
|
|
|
import bpy
|
2018-10-25 12:03:34 +11:00
|
|
|
from bpy.types import Panel
|
2023-02-23 22:00:57 +01:00
|
|
|
from bpy.app.translations import contexts as i18n_contexts
|
2010-01-08 08:54:41 +00:00
|
|
|
from rna_prop_ui import PropertyPanel
|
2019-03-13 12:41:22 +11:00
|
|
|
from bl_ui.utils import PresetPanel
|
2025-05-04 13:26:03 +02:00
|
|
|
from bl_ui.space_properties import PropertiesAnimationMixin
|
2009-11-14 13:35:44 +00:00
|
|
|
|
2011-09-20 18:29:19 +00:00
|
|
|
|
2015-01-29 15:35:06 +11:00
|
|
|
class CameraButtonsPanel:
|
2009-10-31 19:31:45 +00:00
|
|
|
bl_space_type = 'PROPERTIES'
|
|
|
|
|
bl_region_type = 'WINDOW'
|
|
|
|
|
bl_context = "data"
|
|
|
|
|
|
2010-08-09 01:37:09 +00:00
|
|
|
@classmethod
|
|
|
|
|
def poll(cls, context):
|
2017-10-16 17:15:03 -02:00
|
|
|
engine = context.engine
|
2010-08-09 01:37:09 +00:00
|
|
|
return context.camera and (engine in cls.COMPAT_ENGINES)
|
|
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2019-03-13 12:41:22 +11:00
|
|
|
class CAMERA_PT_presets(PresetPanel, Panel):
|
2011-11-04 14:36:06 +00:00
|
|
|
bl_label = "Camera Presets"
|
|
|
|
|
preset_subdir = "camera"
|
|
|
|
|
preset_operator = "script.execute_preset"
|
2018-04-27 13:50:26 +02:00
|
|
|
preset_add_operator = "camera.preset_add"
|
2023-01-24 17:58:58 +01:00
|
|
|
COMPAT_ENGINES = {
|
|
|
|
|
'BLENDER_RENDER',
|
2025-06-13 12:36:14 +02:00
|
|
|
'BLENDER_EEVEE',
|
2023-09-29 14:32:54 +10:00
|
|
|
'BLENDER_WORKBENCH',
|
|
|
|
|
}
|
2011-11-04 14:36:06 +00:00
|
|
|
|
|
|
|
|
|
2023-01-20 14:42:51 +11:00
|
|
|
class CAMERA_PT_safe_areas_presets(PresetPanel, Panel):
|
2015-01-19 16:30:35 +11:00
|
|
|
bl_label = "Camera Presets"
|
|
|
|
|
preset_subdir = "safe_areas"
|
|
|
|
|
preset_operator = "script.execute_preset"
|
2023-01-20 14:42:51 +11:00
|
|
|
preset_add_operator = "camera.safe_areas_preset_add"
|
2023-01-24 17:58:58 +01:00
|
|
|
COMPAT_ENGINES = {
|
|
|
|
|
'BLENDER_RENDER',
|
2025-06-13 12:36:14 +02:00
|
|
|
'BLENDER_EEVEE',
|
2023-09-29 14:32:54 +10:00
|
|
|
'BLENDER_WORKBENCH',
|
|
|
|
|
}
|
2015-01-19 16:30:35 +11:00
|
|
|
|
|
|
|
|
|
2011-08-12 06:57:00 +00:00
|
|
|
class DATA_PT_context_camera(CameraButtonsPanel, Panel):
|
2009-10-31 19:31:45 +00:00
|
|
|
bl_label = ""
|
2010-08-26 01:05:37 +00:00
|
|
|
bl_options = {'HIDE_HEADER'}
|
2023-01-24 17:58:58 +01:00
|
|
|
COMPAT_ENGINES = {
|
|
|
|
|
'BLENDER_RENDER',
|
2025-06-13 12:36:14 +02:00
|
|
|
'BLENDER_EEVEE',
|
2023-09-29 14:32:54 +10:00
|
|
|
'BLENDER_WORKBENCH',
|
|
|
|
|
}
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
|
|
ob = context.object
|
|
|
|
|
cam = context.camera
|
|
|
|
|
space = context.space_data
|
2010-08-06 15:17:44 +00:00
|
|
|
|
|
|
|
|
if ob:
|
2018-07-15 01:15:32 +02:00
|
|
|
layout.template_ID(ob, "data")
|
2010-08-06 15:17:44 +00:00
|
|
|
elif cam:
|
2018-07-15 01:15:32 +02:00
|
|
|
layout.template_ID(space, "pin_id")
|
UI: Layout Engine
* Buttons are now created first, and after that the layout is computed.
This means the layout engine now works at button level, and makes it
easier to write templates. Otherwise you had to store all info and
create the buttons later.
* Added interface_templates.c as a separate file to put templates in.
These can contain regular buttons, and can be put in a Free layout,
which means you can specify manual coordinates, but still get nested
correct inside other layouts.
* API was changed to allow better nesting. Previously items were added
in the last added layout specifier, i.e. one level up in the layout
hierarchy. This doesn't work well in always, so now when creating things
like rows or columns it always returns a layout which you have to add
the items in. All py scripts were updated to follow this.
* Computing the layout now goes in two passes, first estimating the
required width/height of all nested layouts, and then in the second
pass using the results of that to decide on the actual locations.
* Enum and array buttons now follow the direction of the layout, i.e.
they are vertical or horizontal depending if they are in a column or row.
* Color properties now get a color picker, and only get the additional
RGB sliders with Expand=True.
* File/directory string properties now get a button next to them for
opening the file browse, though this is not implemented yet.
* Layout items can now be aligned, set align=True when creating a column,
row, etc.
* Buttons now get a minimum width of one icon (avoids squashing icon
buttons).
* Moved some more space variables into Style.
2009-05-15 11:19:59 +00:00
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2011-11-04 14:36:06 +00:00
|
|
|
class DATA_PT_lens(CameraButtonsPanel, Panel):
|
2011-09-15 13:20:18 +00:00
|
|
|
bl_label = "Lens"
|
2023-02-23 22:00:57 +01:00
|
|
|
bl_translation_context = i18n_contexts.id_camera
|
2023-01-24 17:58:58 +01:00
|
|
|
COMPAT_ENGINES = {
|
|
|
|
|
'BLENDER_RENDER',
|
2025-06-13 12:36:14 +02:00
|
|
|
'BLENDER_EEVEE',
|
2023-09-29 14:32:54 +10:00
|
|
|
'BLENDER_WORKBENCH',
|
|
|
|
|
}
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
|
layout = self.layout
|
2018-06-01 18:44:06 +02:00
|
|
|
layout.use_property_split = True
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
|
cam = context.camera
|
|
|
|
|
|
2018-06-01 18:44:06 +02:00
|
|
|
layout.prop(cam, "type")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2018-06-01 18:44:06 +02:00
|
|
|
col = layout.column()
|
|
|
|
|
col.separator()
|
2009-11-14 13:35:44 +00:00
|
|
|
|
2009-10-31 19:31:45 +00:00
|
|
|
if cam.type == 'PERSP':
|
|
|
|
|
if cam.lens_unit == 'MILLIMETERS':
|
2018-06-01 18:44:06 +02:00
|
|
|
col.prop(cam, "lens")
|
2012-12-31 14:52:55 +00:00
|
|
|
elif cam.lens_unit == 'FOV':
|
2018-07-26 12:28:12 +02:00
|
|
|
col.prop(cam, "angle")
|
2018-06-01 18:44:06 +02:00
|
|
|
col.prop(cam, "lens_unit")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
|
elif cam.type == 'ORTHO':
|
2009-11-23 00:27:30 +00:00
|
|
|
col.prop(cam, "ortho_scale")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2012-05-04 16:20:51 +00:00
|
|
|
elif cam.type == 'PANO':
|
2017-10-16 17:15:03 -02:00
|
|
|
engine = context.engine
|
2012-11-05 08:19:58 +00:00
|
|
|
if engine == 'CYCLES':
|
2023-08-22 15:49:34 +02:00
|
|
|
col.prop(cam, "panorama_type")
|
|
|
|
|
if cam.panorama_type == 'FISHEYE_EQUIDISTANT':
|
|
|
|
|
col.prop(cam, "fisheye_fov")
|
|
|
|
|
elif cam.panorama_type == 'FISHEYE_EQUISOLID':
|
|
|
|
|
col.prop(cam, "fisheye_lens", text="Lens")
|
|
|
|
|
col.prop(cam, "fisheye_fov")
|
|
|
|
|
elif cam.panorama_type == 'EQUIRECTANGULAR':
|
2018-06-01 18:44:06 +02:00
|
|
|
sub = col.column(align=True)
|
2023-08-22 15:49:34 +02:00
|
|
|
sub.prop(cam, "latitude_min", text="Latitude Min")
|
|
|
|
|
sub.prop(cam, "latitude_max", text="Max")
|
2018-06-01 18:44:06 +02:00
|
|
|
sub = col.column(align=True)
|
2023-08-22 15:49:34 +02:00
|
|
|
sub.prop(cam, "longitude_min", text="Longitude Min")
|
|
|
|
|
sub.prop(cam, "longitude_max", text="Max")
|
|
|
|
|
elif cam.panorama_type == 'FISHEYE_LENS_POLYNOMIAL':
|
|
|
|
|
col.prop(cam, "fisheye_fov")
|
|
|
|
|
col.prop(cam, "fisheye_polynomial_k0", text="K0")
|
|
|
|
|
col.prop(cam, "fisheye_polynomial_k1", text="K1")
|
|
|
|
|
col.prop(cam, "fisheye_polynomial_k2", text="K2")
|
|
|
|
|
col.prop(cam, "fisheye_polynomial_k3", text="K3")
|
|
|
|
|
col.prop(cam, "fisheye_polynomial_k4", text="K4")
|
2024-07-29 15:03:57 +02:00
|
|
|
elif cam.panorama_type == 'CENTRAL_CYLINDRICAL':
|
|
|
|
|
sub = col.column(align=True)
|
|
|
|
|
sub.prop(cam, "central_cylindrical_range_v_min", text="Height Min")
|
|
|
|
|
sub.prop(cam, "central_cylindrical_range_v_max", text="Max")
|
|
|
|
|
sub = col.column(align=True)
|
|
|
|
|
sub.prop(cam, "central_cylindrical_range_u_min", text="Longitude Min")
|
|
|
|
|
sub.prop(cam, "central_cylindrical_range_u_max", text="Max")
|
|
|
|
|
sub = col.column(align=True)
|
2025-05-30 20:59:20 +02:00
|
|
|
sub.prop(cam, "central_cylindrical_radius", text="Cylinder Radius")
|
2021-12-07 18:54:36 +01:00
|
|
|
|
2025-06-13 12:36:14 +02:00
|
|
|
elif engine in {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH'}:
|
2012-11-05 08:19:58 +00:00
|
|
|
if cam.lens_unit == 'MILLIMETERS':
|
2018-06-01 18:44:06 +02:00
|
|
|
col.prop(cam, "lens")
|
2014-03-10 19:42:10 +09:00
|
|
|
elif cam.lens_unit == 'FOV':
|
2018-06-01 18:44:06 +02:00
|
|
|
col.prop(cam, "angle")
|
|
|
|
|
col.prop(cam, "lens_unit")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2025-04-25 19:27:30 +02:00
|
|
|
elif cam.type == 'CUSTOM':
|
|
|
|
|
engine = context.engine
|
|
|
|
|
if engine == 'CYCLES':
|
|
|
|
|
sub = col.row()
|
|
|
|
|
sub.prop(cam, "custom_mode", text=" ", expand=True)
|
|
|
|
|
|
|
|
|
|
sub = col.row(align=True)
|
|
|
|
|
if cam.custom_mode == 'EXTERNAL':
|
|
|
|
|
sub.prop(cam, "custom_filepath", text=" ")
|
|
|
|
|
else:
|
|
|
|
|
sub.prop(cam, "custom_shader", text=" ")
|
|
|
|
|
sub.operator("object.camera_custom_update", icon='FILE_REFRESH', text="")
|
|
|
|
|
|
2018-06-01 18:44:06 +02:00
|
|
|
col = layout.column()
|
|
|
|
|
col.separator()
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2018-06-01 18:44:06 +02:00
|
|
|
sub = col.column(align=True)
|
|
|
|
|
sub.prop(cam, "shift_x", text="Shift X")
|
|
|
|
|
sub.prop(cam, "shift_y", text="Y")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2018-06-02 11:22:41 +02:00
|
|
|
col.separator()
|
|
|
|
|
sub = col.column(align=True)
|
2018-06-01 18:44:06 +02:00
|
|
|
sub.prop(cam, "clip_start", text="Clip Start")
|
2024-12-26 12:33:26 +01:00
|
|
|
sub.prop(cam, "clip_end", text="End", text_ctxt=i18n_contexts.id_camera)
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2011-11-08 01:32:34 +00:00
|
|
|
|
2015-04-06 10:40:12 -03:00
|
|
|
class DATA_PT_camera_stereoscopy(CameraButtonsPanel, Panel):
|
|
|
|
|
bl_label = "Stereoscopy"
|
2023-01-24 17:58:58 +01:00
|
|
|
COMPAT_ENGINES = {
|
|
|
|
|
'BLENDER_RENDER',
|
2025-06-13 12:36:14 +02:00
|
|
|
'BLENDER_EEVEE',
|
2023-09-29 14:32:54 +10:00
|
|
|
'BLENDER_WORKBENCH',
|
|
|
|
|
}
|
2015-04-06 10:40:12 -03:00
|
|
|
|
|
|
|
|
@classmethod
|
|
|
|
|
def poll(cls, context):
|
|
|
|
|
render = context.scene.render
|
2024-03-15 10:04:03 +11:00
|
|
|
return (super().poll(context) and render.use_multiview and render.views_format == 'STEREO_3D')
|
2015-04-06 10:40:12 -03:00
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
|
layout = self.layout
|
2018-06-01 18:44:06 +02:00
|
|
|
layout.use_property_split = True
|
|
|
|
|
|
2018-04-17 13:35:05 +02:00
|
|
|
render = context.scene.render
|
2015-04-06 10:40:12 -03:00
|
|
|
st = context.camera.stereo
|
Multi-View: Cycles - Spherical Stereo support (VR Panoramas)
This is a new option for panorama cameras to render
stereo that can be used in virtual reality devices
The option is available under the camera panel when Multi-View is enabled (Views option in the Render Layers panel)
Known limitations:
------------------
* Parallel convergence is not supported (you need to set a convergence distance really high to simulate this effect).
* Pivot was not supposed to affect the render but it does, this has to be looked at, but for now set it to CENTER
* Derivatives in perspective camera need to be pre-computed or we shuld get rid of kcam->dx/dy (Sergey words, I don't fully grasp the implication shere)
* This works in perspective mode and in panorama mode. However, for fully benefit from this effect in perspective mode you need to render a cube map. (there is an addon for this, developed separately, perhaps we could include it in master).
* We have no support for "neck distance" at the moment. This is supposed to help with objects at short distances.
* We have no support to rotate the "Up Axis" of the stereo plane. Meaning, we hardcode 0,0,1 as UP, and create the stereo pair related to that. (although we could take the camera local UP when rendering panoramas, this wouldn't work for perspective cameras.
* We have no support for interocular distance attenuation based on the proximity of the poles (which helps to reduce the pole rotation effect/artifact).
THIS NEEDS DOCS - both in 2.78 release log and the Blender manual.
Meanwhile you can read about it here: http://code.blender.org/2015/03/1451
This patch specifically dates from March 2015, as you can see in the code.blender.org post. Many thanks to all the reviewers, testers and minor sponsors who helped me maintain spherical-stereo for 1 year.
All that said, have fun with this. This feature was what got me started with Multi-View development (at the time what I was looking for was Fulldome stereo support, but the implementation is the same). In order to make this into Blender I had to make it aiming at a less-specic user-case Thus Multi-View started. (this was December 2012, during Siggraph Asia and a chat I had with Paul Bourke during the conference). I don't have the original patch anymore, but you can find a re-based version of it from March 2013, right before I start with the Multi-View project https://developer.blender.org/P332
Reviewers: sergey, dingto
Subscribers: #cycles
Differential Revision: https://developer.blender.org/D1223
2016-03-10 09:28:29 -03:00
|
|
|
cam = context.camera
|
|
|
|
|
|
2018-04-17 13:35:05 +02:00
|
|
|
is_spherical_stereo = cam.type != 'ORTHO' and render.use_spherical_stereo
|
Multi-View: Cycles - Spherical Stereo support (VR Panoramas)
This is a new option for panorama cameras to render
stereo that can be used in virtual reality devices
The option is available under the camera panel when Multi-View is enabled (Views option in the Render Layers panel)
Known limitations:
------------------
* Parallel convergence is not supported (you need to set a convergence distance really high to simulate this effect).
* Pivot was not supposed to affect the render but it does, this has to be looked at, but for now set it to CENTER
* Derivatives in perspective camera need to be pre-computed or we shuld get rid of kcam->dx/dy (Sergey words, I don't fully grasp the implication shere)
* This works in perspective mode and in panorama mode. However, for fully benefit from this effect in perspective mode you need to render a cube map. (there is an addon for this, developed separately, perhaps we could include it in master).
* We have no support for "neck distance" at the moment. This is supposed to help with objects at short distances.
* We have no support to rotate the "Up Axis" of the stereo plane. Meaning, we hardcode 0,0,1 as UP, and create the stereo pair related to that. (although we could take the camera local UP when rendering panoramas, this wouldn't work for perspective cameras.
* We have no support for interocular distance attenuation based on the proximity of the poles (which helps to reduce the pole rotation effect/artifact).
THIS NEEDS DOCS - both in 2.78 release log and the Blender manual.
Meanwhile you can read about it here: http://code.blender.org/2015/03/1451
This patch specifically dates from March 2015, as you can see in the code.blender.org post. Many thanks to all the reviewers, testers and minor sponsors who helped me maintain spherical-stereo for 1 year.
All that said, have fun with this. This feature was what got me started with Multi-View development (at the time what I was looking for was Fulldome stereo support, but the implementation is the same). In order to make this into Blender I had to make it aiming at a less-specic user-case Thus Multi-View started. (this was December 2012, during Siggraph Asia and a chat I had with Paul Bourke during the conference). I don't have the original patch anymore, but you can find a re-based version of it from March 2013, right before I start with the Multi-View project https://developer.blender.org/P332
Reviewers: sergey, dingto
Subscribers: #cycles
Differential Revision: https://developer.blender.org/D1223
2016-03-10 09:28:29 -03:00
|
|
|
use_spherical_stereo = is_spherical_stereo and st.use_spherical_stereo
|
2015-04-06 10:40:12 -03:00
|
|
|
|
2018-06-01 18:44:06 +02:00
|
|
|
layout.prop(st, "convergence_mode")
|
2015-04-06 10:40:12 -03:00
|
|
|
|
2018-06-01 18:44:06 +02:00
|
|
|
col = layout.column()
|
2015-06-29 10:24:25 -03:00
|
|
|
sub = col.column()
|
2015-07-03 01:10:56 -03:00
|
|
|
sub.active = st.convergence_mode != 'PARALLEL'
|
2015-06-29 10:24:25 -03:00
|
|
|
sub.prop(st, "convergence_distance")
|
2015-04-06 10:40:12 -03:00
|
|
|
|
|
|
|
|
col.prop(st, "interocular_distance")
|
|
|
|
|
|
Multi-View: Cycles - Spherical Stereo support (VR Panoramas)
This is a new option for panorama cameras to render
stereo that can be used in virtual reality devices
The option is available under the camera panel when Multi-View is enabled (Views option in the Render Layers panel)
Known limitations:
------------------
* Parallel convergence is not supported (you need to set a convergence distance really high to simulate this effect).
* Pivot was not supposed to affect the render but it does, this has to be looked at, but for now set it to CENTER
* Derivatives in perspective camera need to be pre-computed or we shuld get rid of kcam->dx/dy (Sergey words, I don't fully grasp the implication shere)
* This works in perspective mode and in panorama mode. However, for fully benefit from this effect in perspective mode you need to render a cube map. (there is an addon for this, developed separately, perhaps we could include it in master).
* We have no support for "neck distance" at the moment. This is supposed to help with objects at short distances.
* We have no support to rotate the "Up Axis" of the stereo plane. Meaning, we hardcode 0,0,1 as UP, and create the stereo pair related to that. (although we could take the camera local UP when rendering panoramas, this wouldn't work for perspective cameras.
* We have no support for interocular distance attenuation based on the proximity of the poles (which helps to reduce the pole rotation effect/artifact).
THIS NEEDS DOCS - both in 2.78 release log and the Blender manual.
Meanwhile you can read about it here: http://code.blender.org/2015/03/1451
This patch specifically dates from March 2015, as you can see in the code.blender.org post. Many thanks to all the reviewers, testers and minor sponsors who helped me maintain spherical-stereo for 1 year.
All that said, have fun with this. This feature was what got me started with Multi-View development (at the time what I was looking for was Fulldome stereo support, but the implementation is the same). In order to make this into Blender I had to make it aiming at a less-specic user-case Thus Multi-View started. (this was December 2012, during Siggraph Asia and a chat I had with Paul Bourke during the conference). I don't have the original patch anymore, but you can find a re-based version of it from March 2013, right before I start with the Multi-View project https://developer.blender.org/P332
Reviewers: sergey, dingto
Subscribers: #cycles
Differential Revision: https://developer.blender.org/D1223
2016-03-10 09:28:29 -03:00
|
|
|
if is_spherical_stereo:
|
|
|
|
|
col.separator()
|
2018-06-01 18:44:06 +02:00
|
|
|
col.prop(st, "use_spherical_stereo")
|
|
|
|
|
sub = col.column()
|
2016-05-17 14:12:29 +02:00
|
|
|
sub.active = st.use_spherical_stereo
|
|
|
|
|
sub.prop(st, "use_pole_merge")
|
Multi-View: Cycles - Spherical Stereo support (VR Panoramas)
This is a new option for panorama cameras to render
stereo that can be used in virtual reality devices
The option is available under the camera panel when Multi-View is enabled (Views option in the Render Layers panel)
Known limitations:
------------------
* Parallel convergence is not supported (you need to set a convergence distance really high to simulate this effect).
* Pivot was not supposed to affect the render but it does, this has to be looked at, but for now set it to CENTER
* Derivatives in perspective camera need to be pre-computed or we shuld get rid of kcam->dx/dy (Sergey words, I don't fully grasp the implication shere)
* This works in perspective mode and in panorama mode. However, for fully benefit from this effect in perspective mode you need to render a cube map. (there is an addon for this, developed separately, perhaps we could include it in master).
* We have no support for "neck distance" at the moment. This is supposed to help with objects at short distances.
* We have no support to rotate the "Up Axis" of the stereo plane. Meaning, we hardcode 0,0,1 as UP, and create the stereo pair related to that. (although we could take the camera local UP when rendering panoramas, this wouldn't work for perspective cameras.
* We have no support for interocular distance attenuation based on the proximity of the poles (which helps to reduce the pole rotation effect/artifact).
THIS NEEDS DOCS - both in 2.78 release log and the Blender manual.
Meanwhile you can read about it here: http://code.blender.org/2015/03/1451
This patch specifically dates from March 2015, as you can see in the code.blender.org post. Many thanks to all the reviewers, testers and minor sponsors who helped me maintain spherical-stereo for 1 year.
All that said, have fun with this. This feature was what got me started with Multi-View development (at the time what I was looking for was Fulldome stereo support, but the implementation is the same). In order to make this into Blender I had to make it aiming at a less-specic user-case Thus Multi-View started. (this was December 2012, during Siggraph Asia and a chat I had with Paul Bourke during the conference). I don't have the original patch anymore, but you can find a re-based version of it from March 2013, right before I start with the Multi-View project https://developer.blender.org/P332
Reviewers: sergey, dingto
Subscribers: #cycles
Differential Revision: https://developer.blender.org/D1223
2016-03-10 09:28:29 -03:00
|
|
|
|
2018-06-01 18:44:06 +02:00
|
|
|
sub = col.column(align=True)
|
|
|
|
|
sub.active = st.use_pole_merge
|
|
|
|
|
sub.prop(st, "pole_merge_angle_from", text="Pole Merge Angle Start")
|
|
|
|
|
sub.prop(st, "pole_merge_angle_to", text="End")
|
|
|
|
|
|
|
|
|
|
col = layout.column()
|
|
|
|
|
col.active = not use_spherical_stereo
|
|
|
|
|
col.separator()
|
|
|
|
|
col.prop(st, "pivot")
|
2015-04-06 10:40:12 -03:00
|
|
|
|
|
|
|
|
|
2011-11-04 14:36:06 +00:00
|
|
|
class DATA_PT_camera(CameraButtonsPanel, Panel):
|
|
|
|
|
bl_label = "Camera"
|
2018-10-18 12:13:06 +02:00
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
2023-01-24 17:58:58 +01:00
|
|
|
COMPAT_ENGINES = {
|
|
|
|
|
'BLENDER_RENDER',
|
2025-06-13 12:36:14 +02:00
|
|
|
'BLENDER_EEVEE',
|
2023-09-29 14:32:54 +10:00
|
|
|
'BLENDER_WORKBENCH',
|
|
|
|
|
}
|
2011-11-04 14:36:06 +00:00
|
|
|
|
2019-04-19 07:32:24 +02:00
|
|
|
def draw_header_preset(self, _context):
|
2018-06-20 16:32:31 +02:00
|
|
|
CAMERA_PT_presets.draw_panel_header(self.layout)
|
2018-04-27 13:50:26 +02:00
|
|
|
|
2011-11-04 14:36:06 +00:00
|
|
|
def draw(self, context):
|
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
|
|
cam = context.camera
|
|
|
|
|
|
2018-06-01 18:44:06 +02:00
|
|
|
layout.use_property_split = True
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2018-06-01 18:44:06 +02:00
|
|
|
col = layout.column()
|
|
|
|
|
col.prop(cam, "sensor_fit")
|
2009-11-14 13:35:44 +00:00
|
|
|
|
2011-11-04 14:36:06 +00:00
|
|
|
if cam.sensor_fit == 'AUTO':
|
2019-03-23 12:29:49 +11:00
|
|
|
col.prop(cam, "sensor_width", text="Size")
|
2011-11-04 14:36:06 +00:00
|
|
|
else:
|
2013-08-23 20:41:21 +00:00
|
|
|
sub = col.column(align=True)
|
2012-11-21 19:08:27 +00:00
|
|
|
sub.active = cam.sensor_fit == 'HORIZONTAL'
|
|
|
|
|
sub.prop(cam, "sensor_width", text="Width")
|
2018-06-01 18:44:06 +02:00
|
|
|
|
2013-08-23 20:41:21 +00:00
|
|
|
sub = col.column(align=True)
|
2012-11-21 19:08:27 +00:00
|
|
|
sub.active = cam.sensor_fit == 'VERTICAL'
|
|
|
|
|
sub.prop(cam, "sensor_height", text="Height")
|
2010-08-06 15:17:44 +00:00
|
|
|
|
2011-11-08 01:32:34 +00:00
|
|
|
|
2011-11-04 18:10:50 +00:00
|
|
|
class DATA_PT_camera_dof(CameraButtonsPanel, Panel):
|
|
|
|
|
bl_label = "Depth of Field"
|
2018-06-01 18:44:06 +02:00
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
2024-10-30 13:20:01 +11:00
|
|
|
COMPAT_ENGINES = {
|
2025-06-13 12:36:14 +02:00
|
|
|
'BLENDER_EEVEE',
|
2024-10-30 13:20:01 +11:00
|
|
|
'BLENDER_WORKBENCH',
|
|
|
|
|
}
|
2019-05-17 16:57:31 +02:00
|
|
|
|
|
|
|
|
def draw_header(self, context):
|
|
|
|
|
cam = context.camera
|
|
|
|
|
dof = cam.dof
|
|
|
|
|
self.layout.prop(dof, "use_dof", text="")
|
|
|
|
|
|
2011-11-04 18:10:50 +00:00
|
|
|
def draw(self, context):
|
|
|
|
|
layout = self.layout
|
2018-06-01 18:44:06 +02:00
|
|
|
layout.use_property_split = True
|
2011-11-04 18:10:50 +00:00
|
|
|
|
|
|
|
|
cam = context.camera
|
2019-05-17 16:57:31 +02:00
|
|
|
dof = cam.dof
|
|
|
|
|
layout.active = dof.use_dof
|
2011-11-04 18:10:50 +00:00
|
|
|
|
2018-06-01 18:44:06 +02:00
|
|
|
col = layout.column()
|
2019-05-17 16:57:31 +02:00
|
|
|
col.prop(dof, "focus_object", text="Focus on Object")
|
2022-07-15 13:30:57 +02:00
|
|
|
if dof.focus_object and dof.focus_object.type == 'ARMATURE':
|
|
|
|
|
col.prop_search(dof, "focus_subtarget", dof.focus_object.data, "bones", text="Focus on Bone")
|
2024-05-13 11:01:57 +02:00
|
|
|
|
2015-02-12 19:35:32 +01:00
|
|
|
sub = col.column()
|
2019-05-17 16:57:31 +02:00
|
|
|
sub.active = (dof.focus_object is None)
|
2024-05-13 11:01:57 +02:00
|
|
|
row = sub.row(align=True)
|
|
|
|
|
row.prop(dof, "focus_distance", text="Focus Distance")
|
|
|
|
|
row.operator(
|
|
|
|
|
"ui.eyedropper_depth",
|
|
|
|
|
icon='EYEDROPPER',
|
2025-01-14 12:46:40 +11:00
|
|
|
text="",
|
|
|
|
|
).prop_data_path = "scene.camera.data.dof.focus_distance"
|
2018-06-01 18:44:06 +02:00
|
|
|
|
2018-06-10 21:06:49 +02:00
|
|
|
|
|
|
|
|
class DATA_PT_camera_dof_aperture(CameraButtonsPanel, Panel):
|
|
|
|
|
bl_label = "Aperture"
|
|
|
|
|
bl_parent_id = "DATA_PT_camera_dof"
|
2024-10-30 13:20:01 +11:00
|
|
|
COMPAT_ENGINES = {
|
2025-06-13 12:36:14 +02:00
|
|
|
'BLENDER_EEVEE',
|
2024-10-30 13:20:01 +11:00
|
|
|
'BLENDER_WORKBENCH',
|
|
|
|
|
}
|
2018-06-10 21:06:49 +02:00
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
|
layout = self.layout
|
|
|
|
|
layout.use_property_split = True
|
|
|
|
|
|
|
|
|
|
cam = context.camera
|
2019-05-17 16:57:31 +02:00
|
|
|
dof = cam.dof
|
|
|
|
|
layout.active = dof.use_dof
|
2018-06-10 21:06:49 +02:00
|
|
|
|
2018-07-01 09:23:51 +02:00
|
|
|
flow = layout.grid_flow(row_major=True, columns=0, even_columns=True, even_rows=False, align=False)
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2019-02-11 22:45:36 +11:00
|
|
|
col = flow.column()
|
2019-05-17 16:57:31 +02:00
|
|
|
col.prop(dof, "aperture_fstop")
|
2018-06-10 21:06:49 +02:00
|
|
|
|
2019-02-11 22:45:36 +11:00
|
|
|
col = flow.column()
|
2019-05-17 16:57:31 +02:00
|
|
|
col.prop(dof, "aperture_blades")
|
|
|
|
|
col.prop(dof, "aperture_rotation")
|
|
|
|
|
col.prop(dof, "aperture_ratio")
|
2015-03-20 04:00:05 +11:00
|
|
|
|
2011-11-08 01:32:34 +00:00
|
|
|
|
2017-10-26 21:40:37 +11:00
|
|
|
class DATA_PT_camera_background_image(CameraButtonsPanel, Panel):
|
|
|
|
|
bl_label = "Background Images"
|
|
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
2023-01-24 17:58:58 +01:00
|
|
|
COMPAT_ENGINES = {
|
|
|
|
|
'BLENDER_RENDER',
|
2025-06-13 12:36:14 +02:00
|
|
|
'BLENDER_EEVEE',
|
2023-09-29 14:32:54 +10:00
|
|
|
'BLENDER_WORKBENCH',
|
|
|
|
|
}
|
2017-10-26 21:40:37 +11:00
|
|
|
|
|
|
|
|
def draw_header(self, context):
|
|
|
|
|
cam = context.camera
|
|
|
|
|
|
|
|
|
|
self.layout.prop(cam, "show_background_images", text="")
|
|
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
|
layout = self.layout
|
2018-09-27 12:37:18 +02:00
|
|
|
layout.use_property_split = True
|
|
|
|
|
layout.use_property_decorate = False
|
2017-10-26 21:40:37 +11:00
|
|
|
|
|
|
|
|
cam = context.camera
|
|
|
|
|
use_multiview = context.scene.render.use_multiview
|
|
|
|
|
|
|
|
|
|
col = layout.column()
|
2024-03-11 16:18:25 +01:00
|
|
|
col.operator("view3d.camera_background_image_add", text="Add Image")
|
2017-10-26 21:40:37 +11:00
|
|
|
|
|
|
|
|
for i, bg in enumerate(cam.background_images):
|
|
|
|
|
layout.active = cam.show_background_images
|
|
|
|
|
box = layout.box()
|
|
|
|
|
row = box.row(align=True)
|
|
|
|
|
row.prop(bg, "show_expanded", text="", emboss=False)
|
|
|
|
|
if bg.source == 'IMAGE' and bg.image:
|
|
|
|
|
row.prop(bg.image, "name", text="", emboss=False)
|
|
|
|
|
elif bg.source == 'MOVIE_CLIP' and bg.clip:
|
|
|
|
|
row.prop(bg.clip, "name", text="", emboss=False)
|
2018-08-15 17:08:40 -03:00
|
|
|
elif bg.source and bg.use_camera_clip:
|
2019-09-05 09:22:20 +02:00
|
|
|
row.label(text="Active Clip")
|
2017-10-26 21:40:37 +11:00
|
|
|
else:
|
|
|
|
|
row.label(text="Not Set")
|
|
|
|
|
|
2018-08-30 13:47:27 +10:00
|
|
|
row.prop(
|
|
|
|
|
bg,
|
|
|
|
|
"show_background_image",
|
|
|
|
|
text="",
|
|
|
|
|
emboss=False,
|
|
|
|
|
icon='RESTRICT_VIEW_OFF' if bg.show_background_image else 'RESTRICT_VIEW_ON',
|
|
|
|
|
)
|
2017-10-26 21:40:37 +11:00
|
|
|
|
2024-03-11 16:18:25 +01:00
|
|
|
row.operator("view3d.camera_background_image_remove", text="", emboss=False, icon='X').index = i
|
2017-10-26 21:40:37 +11:00
|
|
|
|
|
|
|
|
if bg.show_expanded:
|
|
|
|
|
row = box.row()
|
|
|
|
|
row.prop(bg, "source", expand=True)
|
|
|
|
|
|
|
|
|
|
has_bg = False
|
|
|
|
|
if bg.source == 'IMAGE':
|
|
|
|
|
row = box.row()
|
|
|
|
|
row.template_ID(bg, "image", open="image.open")
|
|
|
|
|
if bg.image is not None:
|
|
|
|
|
box.template_image(bg, "image", bg.image_user, compact=True)
|
|
|
|
|
has_bg = True
|
|
|
|
|
|
2018-12-20 11:27:51 +01:00
|
|
|
if use_multiview:
|
2017-10-26 21:40:37 +11:00
|
|
|
box.prop(bg.image, "use_multiview")
|
|
|
|
|
|
|
|
|
|
column = box.column()
|
|
|
|
|
column.active = bg.image.use_multiview
|
|
|
|
|
|
|
|
|
|
column.label(text="Views Format:")
|
|
|
|
|
column.row().prop(bg.image, "views_format", expand=True)
|
|
|
|
|
|
|
|
|
|
sub = column.box()
|
|
|
|
|
sub.active = bg.image.views_format == 'STEREO_3D'
|
|
|
|
|
sub.template_image_stereo_3d(bg.image.stereo_3d_format)
|
|
|
|
|
|
|
|
|
|
elif bg.source == 'MOVIE_CLIP':
|
2019-09-05 09:22:20 +02:00
|
|
|
box.prop(bg, "use_camera_clip", text="Active Clip")
|
2017-10-26 21:40:37 +11:00
|
|
|
|
|
|
|
|
column = box.column()
|
|
|
|
|
column.active = not bg.use_camera_clip
|
|
|
|
|
column.template_ID(bg, "clip", open="clip.open")
|
|
|
|
|
|
|
|
|
|
if bg.clip:
|
|
|
|
|
column.template_movieclip(bg, "clip", compact=True)
|
|
|
|
|
|
|
|
|
|
if bg.use_camera_clip or bg.clip:
|
|
|
|
|
has_bg = True
|
|
|
|
|
|
|
|
|
|
column = box.column()
|
|
|
|
|
column.active = has_bg
|
|
|
|
|
column.prop(bg.clip_user, "use_render_undistorted")
|
2018-09-27 12:37:18 +02:00
|
|
|
column.prop(bg.clip_user, "proxy_render_size")
|
2017-10-26 21:40:37 +11:00
|
|
|
|
|
|
|
|
if has_bg:
|
|
|
|
|
col = box.column()
|
2024-01-03 01:09:23 +01:00
|
|
|
if bg.image is not None:
|
|
|
|
|
col.prop(bg.image, "use_view_as_render")
|
2024-02-05 12:20:16 -05:00
|
|
|
col.prop(bg, "alpha")
|
2018-09-03 18:58:41 +02:00
|
|
|
col.row().prop(bg, "display_depth", expand=True)
|
2017-10-26 21:40:37 +11:00
|
|
|
|
|
|
|
|
col.row().prop(bg, "frame_method", expand=True)
|
|
|
|
|
|
|
|
|
|
row = box.row()
|
|
|
|
|
row.prop(bg, "offset")
|
|
|
|
|
|
2018-09-27 12:37:18 +02:00
|
|
|
col = box.column()
|
|
|
|
|
col.prop(bg, "rotation")
|
|
|
|
|
col.prop(bg, "scale")
|
2017-10-26 21:40:37 +11:00
|
|
|
|
I18n: disambiguate a few messages
- "Front"/"Back": 'put something at the front/back' or 'the front/back
face of something'. (e. g. the Empty Image options, Depth and Side
option, both use the same strings as enum, which should be avoided
in some languages).
- "Flip": invert, as in normals, or mirror, as in an image.
- "Path": a path to a resource, in general a file but sometimes a
datablock, as opposed to a trajectory in space.
- "Join": disambiguate for the Grease Pencil operator, which may use a
different word as that for meshes.
- "Wave": an ondulating motion, as opposed to a fluid dynamics motion.
- "Step": can mean the distance between two things, or a number of
times to do something. In this case it is better to use the plural.
- "Edge": generally the edges of a mesh, but can also mean edge
detection. Additionally, it was used for the option to enable
Freestyle. This was changed to "Use Freestyle".
- "Boundary": the limit of a grease pencil drawing for filling
purposes, as opposed to the external limit of a (non-manifold) mesh.
- "Rotations": can be translated to something like "Turns", in the
context of a spiral.
Pull Request: https://projects.blender.org/blender/blender/pulls/108213
2023-05-16 19:16:02 +02:00
|
|
|
col = box.column(heading="Flip", heading_ctxt=i18n_contexts.id_image)
|
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.prop(bg, "use_flip_x", text="X")
|
|
|
|
|
col.prop(bg, "use_flip_y", text="Y")
|
2017-10-26 21:40:37 +11:00
|
|
|
|
|
|
|
|
|
2011-08-12 06:57:00 +00:00
|
|
|
class DATA_PT_camera_display(CameraButtonsPanel, Panel):
|
2018-07-15 02:35:33 +02:00
|
|
|
bl_label = "Viewport Display"
|
2018-06-01 18:44:06 +02:00
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
2023-01-24 17:58:58 +01:00
|
|
|
COMPAT_ENGINES = {
|
|
|
|
|
'BLENDER_RENDER',
|
2025-06-13 12:36:14 +02:00
|
|
|
'BLENDER_EEVEE',
|
2023-09-29 14:32:54 +10:00
|
|
|
'BLENDER_WORKBENCH',
|
|
|
|
|
}
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
|
layout = self.layout
|
2018-06-01 18:44:06 +02:00
|
|
|
layout.use_property_split = True
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
|
cam = context.camera
|
|
|
|
|
|
2018-06-01 18:44:06 +02:00
|
|
|
col = layout.column(align=True)
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2018-09-03 18:58:41 +02:00
|
|
|
col.prop(cam, "display_size", text="Size")
|
2009-09-27 11:00:35 +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(heading="Show")
|
2019-03-21 16:24:02 +01:00
|
|
|
col.prop(cam, "show_limits", text="Limits")
|
|
|
|
|
col.prop(cam, "show_mist", text="Mist")
|
|
|
|
|
col.prop(cam, "show_sensor", text="Sensor")
|
|
|
|
|
col.prop(cam, "show_name", text="Name")
|
2019-03-21 15:01:07 +01:00
|
|
|
|
2020-08-22 21:53:16 +02:00
|
|
|
col = layout.column(align=False, heading="Passepartout")
|
|
|
|
|
col.use_property_decorate = False
|
|
|
|
|
row = col.row(align=True)
|
|
|
|
|
sub = row.row(align=True)
|
|
|
|
|
sub.prop(cam, "show_passepartout", text="")
|
|
|
|
|
sub = sub.row(align=True)
|
|
|
|
|
sub.active = cam.show_passepartout
|
|
|
|
|
sub.prop(cam, "passepartout_alpha", text="")
|
|
|
|
|
row.prop_decorator(cam, "passepartout_alpha")
|
2019-04-09 23:16:11 +10:00
|
|
|
|
2020-10-02 10:10:01 +10:00
|
|
|
|
2019-03-21 15:01:07 +01:00
|
|
|
class DATA_PT_camera_display_composition_guides(CameraButtonsPanel, Panel):
|
|
|
|
|
bl_label = "Composition Guides"
|
|
|
|
|
bl_parent_id = "DATA_PT_camera_display"
|
|
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
2023-01-24 17:58:58 +01:00
|
|
|
COMPAT_ENGINES = {
|
|
|
|
|
'BLENDER_RENDER',
|
2025-06-13 12:36:14 +02:00
|
|
|
'BLENDER_EEVEE',
|
2023-09-29 14:32:54 +10:00
|
|
|
'BLENDER_WORKBENCH',
|
|
|
|
|
}
|
2019-03-21 15:01:07 +01:00
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
|
layout = self.layout
|
|
|
|
|
layout.use_property_split = True
|
|
|
|
|
|
|
|
|
|
cam = context.camera
|
|
|
|
|
|
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
|
|
|
layout.prop(cam, "show_composition_thirds")
|
2019-03-21 15:01:07 +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(heading="Center", align=True)
|
2019-03-21 18:25:01 +01:00
|
|
|
col.prop(cam, "show_composition_center")
|
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.prop(cam, "show_composition_center_diagonal", text="Diagonal")
|
|
|
|
|
|
|
|
|
|
col = layout.column(heading="Golden", align=True)
|
|
|
|
|
col.prop(cam, "show_composition_golden", text="Ratio")
|
|
|
|
|
col.prop(cam, "show_composition_golden_tria_a", text="Triangle A")
|
|
|
|
|
col.prop(cam, "show_composition_golden_tria_b", text="Triangle B")
|
|
|
|
|
|
|
|
|
|
col = layout.column(heading="Harmony", align=True)
|
|
|
|
|
col.prop(cam, "show_composition_harmony_tri_a", text="Triangle A")
|
|
|
|
|
col.prop(cam, "show_composition_harmony_tri_b", text="Triangle B")
|
2018-06-01 18:44:06 +02:00
|
|
|
|
UI: Per-camera composition guide colors
Currently cameras composition guide colors are defined in theme, and not even by an individual
property. They follow 3D Viewport -> View Overlay color, which also defines many other things,
such as world origin cursor. By default it's black and it's difficult to change, because then other
things stand out. But using default black for composition guides is impossible.
This PR, instead, adds new Composition Guide Color property on camera, and uses it in camera view.
This not only fixes the issue mentioned above, but also allows different cameras in one scene to
have different overlay colors. This is very handy when you have, for example, two cameras, one of
which looks at the black corner, and another at the lit-up white one. Using a single black or white color
in this case makes the other one more difficult to see. Now, each camera can have its own color.
This PR only changes color for Composition Guides, and NOT for Safe Areas and sensor. Reasons are:
- It's important to differentiate between different concepts, having everything one color is distracting
- Safe areas are per-scene and shared with Sequencer preview. The camera shouldn't dictate color there.
I have separate plans about handling safe areas in the future.
Images in the PR.
Pull Request: https://projects.blender.org/blender/blender/pulls/143788
2025-09-27 13:25:34 +02:00
|
|
|
col = layout.column()
|
|
|
|
|
col.prop(cam, "composition_guide_color", text="Color")
|
|
|
|
|
|
2010-01-08 08:54:41 +00:00
|
|
|
|
2015-01-19 16:30:35 +11:00
|
|
|
class DATA_PT_camera_safe_areas(CameraButtonsPanel, Panel):
|
|
|
|
|
bl_label = "Safe Areas"
|
|
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
2023-01-24 17:58:58 +01:00
|
|
|
COMPAT_ENGINES = {
|
|
|
|
|
'BLENDER_RENDER',
|
2025-06-13 12:36:14 +02:00
|
|
|
'BLENDER_EEVEE',
|
2023-09-29 14:32:54 +10:00
|
|
|
'BLENDER_WORKBENCH',
|
|
|
|
|
}
|
2015-01-19 16:30:35 +11:00
|
|
|
|
|
|
|
|
def draw_header(self, context):
|
|
|
|
|
cam = context.camera
|
|
|
|
|
|
|
|
|
|
self.layout.prop(cam, "show_safe_areas", text="")
|
|
|
|
|
|
2019-04-19 07:32:24 +02:00
|
|
|
def draw_header_preset(self, _context):
|
2023-01-20 14:42:51 +11:00
|
|
|
CAMERA_PT_safe_areas_presets.draw_panel_header(self.layout)
|
2018-04-27 13:50:26 +02:00
|
|
|
|
2015-01-19 16:30:35 +11:00
|
|
|
def draw(self, context):
|
|
|
|
|
layout = self.layout
|
2015-01-27 17:46:07 +11:00
|
|
|
safe_data = context.scene.safe_areas
|
|
|
|
|
camera = context.camera
|
2015-01-19 16:30:35 +11:00
|
|
|
|
2019-02-28 22:54:06 +01:00
|
|
|
layout.use_property_split = True
|
|
|
|
|
|
|
|
|
|
layout.active = camera.show_safe_areas
|
|
|
|
|
|
|
|
|
|
col = layout.column()
|
|
|
|
|
|
|
|
|
|
sub = col.column()
|
|
|
|
|
sub.prop(safe_data, "title", slider=True)
|
|
|
|
|
sub.prop(safe_data, "action", slider=True)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class DATA_PT_camera_safe_areas_center_cut(CameraButtonsPanel, Panel):
|
|
|
|
|
bl_label = "Center-Cut Safe Areas"
|
|
|
|
|
bl_parent_id = "DATA_PT_camera_safe_areas"
|
|
|
|
|
bl_options = {'DEFAULT_CLOSED'}
|
2023-01-24 17:58:58 +01:00
|
|
|
COMPAT_ENGINES = {
|
|
|
|
|
'BLENDER_RENDER',
|
2025-06-13 12:36:14 +02:00
|
|
|
'BLENDER_EEVEE',
|
2023-09-29 14:32:54 +10:00
|
|
|
'BLENDER_WORKBENCH',
|
|
|
|
|
}
|
2019-02-28 22:54:06 +01:00
|
|
|
|
|
|
|
|
def draw_header(self, context):
|
|
|
|
|
cam = context.camera
|
|
|
|
|
|
|
|
|
|
layout = self.layout
|
|
|
|
|
layout.active = cam.show_safe_areas
|
|
|
|
|
layout.prop(cam, "show_safe_center", text="")
|
|
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
|
layout = self.layout
|
|
|
|
|
safe_data = context.scene.safe_areas
|
|
|
|
|
camera = context.camera
|
|
|
|
|
|
|
|
|
|
layout.use_property_split = True
|
|
|
|
|
|
|
|
|
|
layout.active = camera.show_safe_areas and camera.show_safe_center
|
|
|
|
|
|
|
|
|
|
col = layout.column()
|
|
|
|
|
col.prop(safe_data, "title_center", slider=True)
|
2020-01-17 19:27:05 +11:00
|
|
|
col.prop(safe_data, "action_center", slider=True)
|
2015-01-19 16:30:35 +11:00
|
|
|
|
|
|
|
|
|
2024-07-30 11:59:54 +02:00
|
|
|
class DATA_PT_camera_animation(CameraButtonsPanel, PropertiesAnimationMixin, PropertyPanel, Panel):
|
|
|
|
|
COMPAT_ENGINES = {
|
|
|
|
|
'BLENDER_RENDER',
|
2025-06-13 12:36:14 +02:00
|
|
|
'BLENDER_EEVEE',
|
2024-07-30 11:59:54 +02:00
|
|
|
'BLENDER_WORKBENCH',
|
|
|
|
|
}
|
2024-09-03 21:22:34 +10:00
|
|
|
_animated_id_context_property = "camera"
|
2024-07-30 11:59:54 +02:00
|
|
|
|
|
|
|
|
|
2011-08-12 06:57:00 +00:00
|
|
|
class DATA_PT_custom_props_camera(CameraButtonsPanel, PropertyPanel, Panel):
|
2023-01-24 17:58:58 +01:00
|
|
|
COMPAT_ENGINES = {
|
|
|
|
|
'BLENDER_RENDER',
|
2025-06-13 12:36:14 +02:00
|
|
|
'BLENDER_EEVEE',
|
2023-09-29 14:32:54 +10:00
|
|
|
'BLENDER_WORKBENCH',
|
|
|
|
|
}
|
2010-08-12 19:36:10 +00:00
|
|
|
_context_path = "object.data"
|
2010-12-17 10:33:28 +00:00
|
|
|
_property_type = bpy.types.Camera
|
2011-04-04 10:13:04 +00:00
|
|
|
|
2015-01-19 16:30:35 +11:00
|
|
|
|
2017-03-18 20:03:24 +11:00
|
|
|
classes = (
|
2018-06-20 16:32:31 +02:00
|
|
|
CAMERA_PT_presets,
|
2023-01-20 14:42:51 +11:00
|
|
|
CAMERA_PT_safe_areas_presets,
|
2017-03-20 02:34:32 +11:00
|
|
|
DATA_PT_context_camera,
|
|
|
|
|
DATA_PT_lens,
|
2017-03-18 20:03:24 +11:00
|
|
|
DATA_PT_camera_dof,
|
2018-06-10 21:06:49 +02:00
|
|
|
DATA_PT_camera_dof_aperture,
|
2018-11-03 03:25:51 +01:00
|
|
|
DATA_PT_camera,
|
|
|
|
|
DATA_PT_camera_stereoscopy,
|
2017-03-18 20:03:24 +11:00
|
|
|
DATA_PT_camera_safe_areas,
|
2019-02-28 22:54:06 +01:00
|
|
|
DATA_PT_camera_safe_areas_center_cut,
|
2018-06-01 18:44:06 +02:00
|
|
|
DATA_PT_camera_background_image,
|
2018-11-03 03:25:51 +01:00
|
|
|
DATA_PT_camera_display,
|
2019-03-21 15:01:07 +01:00
|
|
|
DATA_PT_camera_display_composition_guides,
|
2024-07-30 11:59:54 +02:00
|
|
|
DATA_PT_camera_animation,
|
2017-03-18 20:03:24 +11:00
|
|
|
DATA_PT_custom_props_camera,
|
|
|
|
|
)
|
|
|
|
|
|
2011-04-04 10:13:04 +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)
|