2023-05-31 16:19:06 +02:00
|
|
|
/* SPDX-FileCopyrightText: 2008 Blender Foundation
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: GPL-2.0-or-later */
|
2008-12-14 15:43:08 +01:00
|
|
|
|
2019-02-17 22:08:12 +01:00
|
|
|
/** \file
|
|
|
|
* \ingroup spseq
|
2011-02-27 21:29:51 +01:00
|
|
|
*/
|
|
|
|
|
2023-06-14 18:36:17 +02:00
|
|
|
#include <cmath>
|
|
|
|
#include <cstdio>
|
|
|
|
#include <cstring>
|
2008-12-14 15:43:08 +01:00
|
|
|
|
2012-06-07 21:24:49 +02:00
|
|
|
#include "DNA_mask_types.h"
|
2020-03-19 09:33:03 +01:00
|
|
|
#include "DNA_scene_types.h"
|
2008-12-14 15:43:08 +01:00
|
|
|
|
|
|
|
#include "MEM_guardedalloc.h"
|
|
|
|
|
|
|
|
#include "BLI_blenlib.h"
|
2021-09-21 10:38:15 +02:00
|
|
|
#include "BLI_ghash.h"
|
2022-04-28 16:07:57 +02:00
|
|
|
#include "BLI_math_base.h"
|
2008-12-14 15:43:08 +01:00
|
|
|
|
2018-11-07 18:00:24 +01:00
|
|
|
#include "BKE_global.h"
|
2022-01-25 14:51:35 +01:00
|
|
|
#include "BKE_lib_remap.h"
|
2008-12-14 15:43:08 +01:00
|
|
|
#include "BKE_screen.h"
|
2020-03-06 12:08:03 +01:00
|
|
|
#include "BKE_sequencer_offscreen.h"
|
2008-12-14 15:43:08 +01:00
|
|
|
|
2021-10-07 03:32:04 +02:00
|
|
|
#include "GPU_state.h"
|
|
|
|
|
2023-08-05 02:57:52 +02:00
|
|
|
#include "ED_markers.hh"
|
2023-08-04 23:11:22 +02:00
|
|
|
#include "ED_screen.hh"
|
2023-08-05 02:57:52 +02:00
|
|
|
#include "ED_space_api.hh"
|
|
|
|
#include "ED_time_scrub_ui.hh"
|
|
|
|
#include "ED_transform.hh"
|
|
|
|
#include "ED_view3d.hh"
|
|
|
|
#include "ED_view3d_offscreen.hh" /* Only for sequencer view3d drawing callback. */
|
2008-12-14 15:43:08 +01:00
|
|
|
|
2023-08-04 23:11:22 +02:00
|
|
|
#include "WM_api.hh"
|
|
|
|
#include "WM_message.hh"
|
2008-12-14 15:43:08 +01:00
|
|
|
|
2022-04-28 16:07:57 +02:00
|
|
|
#include "SEQ_sequencer.h"
|
|
|
|
#include "SEQ_time.h"
|
2021-10-07 03:32:04 +02:00
|
|
|
#include "SEQ_transform.h"
|
2020-12-19 06:44:57 +01:00
|
|
|
#include "SEQ_utils.h"
|
2020-11-01 21:03:31 +01:00
|
|
|
|
2023-08-05 02:57:52 +02:00
|
|
|
#include "UI_interface.hh"
|
|
|
|
#include "UI_view2d.hh"
|
2008-12-14 15:43:08 +01:00
|
|
|
|
2022-09-28 11:52:22 +02:00
|
|
|
#include "BLO_read_write.h"
|
|
|
|
|
Color Management, Stage 2: Switch color pipeline to use OpenColorIO
Replace old color pipeline which was supporting linear/sRGB color spaces
only with OpenColorIO-based pipeline.
This introduces two configurable color spaces:
- Input color space for images and movie clips. This space is used to convert
images/movies from color space in which file is saved to Blender's linear
space (for float images, byte images are not internally converted, only input
space is stored for such images and used later).
This setting could be found in image/clip data block settings.
- Display color space which defines space in which particular display is working.
This settings could be found in scene's Color Management panel.
When render result is being displayed on the screen, apart from converting image
to display space, some additional conversions could happen.
This conversions are:
- View, which defines tone curve applying before display transformation.
These are different ways to view the image on the same display device.
For example it could be used to emulate film view on sRGB display.
- Exposure affects on image exposure before tone map is applied.
- Gamma is post-display gamma correction, could be used to match particular
display gamma.
- RGB curves are user-defined curves which are applying before display
transformation, could be used for different purposes.
All this settings by default are only applying on render result and does not
affect on other images. If some particular image needs to be affected by this
transformation, "View as Render" setting of image data block should be set to
truth. Movie clips are always affected by all display transformations.
This commit also introduces configurable color space in which sequencer is
working. This setting could be found in scene's Color Management panel and
it should be used if such stuff as grading needs to be done in color space
different from sRGB (i.e. when Film view on sRGB display is use, using VD16
space as sequencer's internal space would make grading working in space
which is close to the space using for display).
Some technical notes:
- Image buffer's float buffer is now always in linear space, even if it was
created from 16bit byte images.
- Space of byte buffer is stored in image buffer's rect_colorspace property.
- Profile of image buffer was removed since it's not longer meaningful.
- OpenGL and GLSL is supposed to always work in sRGB space. It is possible
to support other spaces, but it's quite large project which isn't so
much important.
- Legacy Color Management option disabled is emulated by using None display.
It could have some regressions, but there's no clear way to avoid them.
- If OpenColorIO is disabled on build time, it should make blender behaving
in the same way as previous release with color management enabled.
More details could be found at this page (more details would be added soon):
http://wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.64/Color_Management
--
Thanks to Xavier Thomas, Lukas Toene for initial work on OpenColorIO
integration and to Brecht van Lommel for some further development and code/
usecase review!
2012-09-15 12:05:07 +02:00
|
|
|
#include "IMB_imbuf.h"
|
|
|
|
|
2021-10-07 03:32:04 +02:00
|
|
|
/* Only for cursor drawing. */
|
|
|
|
#include "DRW_engine.h"
|
|
|
|
|
2020-04-05 23:55:51 +02:00
|
|
|
/* Own include. */
|
|
|
|
#include "sequencer_intern.h"
|
2008-12-14 15:43:08 +01:00
|
|
|
|
Color Management, Stage 2: Switch color pipeline to use OpenColorIO
Replace old color pipeline which was supporting linear/sRGB color spaces
only with OpenColorIO-based pipeline.
This introduces two configurable color spaces:
- Input color space for images and movie clips. This space is used to convert
images/movies from color space in which file is saved to Blender's linear
space (for float images, byte images are not internally converted, only input
space is stored for such images and used later).
This setting could be found in image/clip data block settings.
- Display color space which defines space in which particular display is working.
This settings could be found in scene's Color Management panel.
When render result is being displayed on the screen, apart from converting image
to display space, some additional conversions could happen.
This conversions are:
- View, which defines tone curve applying before display transformation.
These are different ways to view the image on the same display device.
For example it could be used to emulate film view on sRGB display.
- Exposure affects on image exposure before tone map is applied.
- Gamma is post-display gamma correction, could be used to match particular
display gamma.
- RGB curves are user-defined curves which are applying before display
transformation, could be used for different purposes.
All this settings by default are only applying on render result and does not
affect on other images. If some particular image needs to be affected by this
transformation, "View as Render" setting of image data block should be set to
truth. Movie clips are always affected by all display transformations.
This commit also introduces configurable color space in which sequencer is
working. This setting could be found in scene's Color Management panel and
it should be used if such stuff as grading needs to be done in color space
different from sRGB (i.e. when Film view on sRGB display is use, using VD16
space as sequencer's internal space would make grading working in space
which is close to the space using for display).
Some technical notes:
- Image buffer's float buffer is now always in linear space, even if it was
created from 16bit byte images.
- Space of byte buffer is stored in image buffer's rect_colorspace property.
- Profile of image buffer was removed since it's not longer meaningful.
- OpenGL and GLSL is supposed to always work in sRGB space. It is possible
to support other spaces, but it's quite large project which isn't so
much important.
- Legacy Color Management option disabled is emulated by using None display.
It could have some regressions, but there's no clear way to avoid them.
- If OpenColorIO is disabled on build time, it should make blender behaving
in the same way as previous release with color management enabled.
More details could be found at this page (more details would be added soon):
http://wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.64/Color_Management
--
Thanks to Xavier Thomas, Lukas Toene for initial work on OpenColorIO
integration and to Brecht van Lommel for some further development and code/
usecase review!
2012-09-15 12:05:07 +02:00
|
|
|
/**************************** common state *****************************/
|
|
|
|
|
2020-04-03 13:25:03 +02:00
|
|
|
static void sequencer_scopes_tag_refresh(ScrArea *area)
|
Color Management, Stage 2: Switch color pipeline to use OpenColorIO
Replace old color pipeline which was supporting linear/sRGB color spaces
only with OpenColorIO-based pipeline.
This introduces two configurable color spaces:
- Input color space for images and movie clips. This space is used to convert
images/movies from color space in which file is saved to Blender's linear
space (for float images, byte images are not internally converted, only input
space is stored for such images and used later).
This setting could be found in image/clip data block settings.
- Display color space which defines space in which particular display is working.
This settings could be found in scene's Color Management panel.
When render result is being displayed on the screen, apart from converting image
to display space, some additional conversions could happen.
This conversions are:
- View, which defines tone curve applying before display transformation.
These are different ways to view the image on the same display device.
For example it could be used to emulate film view on sRGB display.
- Exposure affects on image exposure before tone map is applied.
- Gamma is post-display gamma correction, could be used to match particular
display gamma.
- RGB curves are user-defined curves which are applying before display
transformation, could be used for different purposes.
All this settings by default are only applying on render result and does not
affect on other images. If some particular image needs to be affected by this
transformation, "View as Render" setting of image data block should be set to
truth. Movie clips are always affected by all display transformations.
This commit also introduces configurable color space in which sequencer is
working. This setting could be found in scene's Color Management panel and
it should be used if such stuff as grading needs to be done in color space
different from sRGB (i.e. when Film view on sRGB display is use, using VD16
space as sequencer's internal space would make grading working in space
which is close to the space using for display).
Some technical notes:
- Image buffer's float buffer is now always in linear space, even if it was
created from 16bit byte images.
- Space of byte buffer is stored in image buffer's rect_colorspace property.
- Profile of image buffer was removed since it's not longer meaningful.
- OpenGL and GLSL is supposed to always work in sRGB space. It is possible
to support other spaces, but it's quite large project which isn't so
much important.
- Legacy Color Management option disabled is emulated by using None display.
It could have some regressions, but there's no clear way to avoid them.
- If OpenColorIO is disabled on build time, it should make blender behaving
in the same way as previous release with color management enabled.
More details could be found at this page (more details would be added soon):
http://wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.64/Color_Management
--
Thanks to Xavier Thomas, Lukas Toene for initial work on OpenColorIO
integration and to Brecht van Lommel for some further development and code/
usecase review!
2012-09-15 12:05:07 +02:00
|
|
|
{
|
2020-04-03 13:25:03 +02:00
|
|
|
SpaceSeq *sseq = (SpaceSeq *)area->spacedata.first;
|
Color Management, Stage 2: Switch color pipeline to use OpenColorIO
Replace old color pipeline which was supporting linear/sRGB color spaces
only with OpenColorIO-based pipeline.
This introduces two configurable color spaces:
- Input color space for images and movie clips. This space is used to convert
images/movies from color space in which file is saved to Blender's linear
space (for float images, byte images are not internally converted, only input
space is stored for such images and used later).
This setting could be found in image/clip data block settings.
- Display color space which defines space in which particular display is working.
This settings could be found in scene's Color Management panel.
When render result is being displayed on the screen, apart from converting image
to display space, some additional conversions could happen.
This conversions are:
- View, which defines tone curve applying before display transformation.
These are different ways to view the image on the same display device.
For example it could be used to emulate film view on sRGB display.
- Exposure affects on image exposure before tone map is applied.
- Gamma is post-display gamma correction, could be used to match particular
display gamma.
- RGB curves are user-defined curves which are applying before display
transformation, could be used for different purposes.
All this settings by default are only applying on render result and does not
affect on other images. If some particular image needs to be affected by this
transformation, "View as Render" setting of image data block should be set to
truth. Movie clips are always affected by all display transformations.
This commit also introduces configurable color space in which sequencer is
working. This setting could be found in scene's Color Management panel and
it should be used if such stuff as grading needs to be done in color space
different from sRGB (i.e. when Film view on sRGB display is use, using VD16
space as sequencer's internal space would make grading working in space
which is close to the space using for display).
Some technical notes:
- Image buffer's float buffer is now always in linear space, even if it was
created from 16bit byte images.
- Space of byte buffer is stored in image buffer's rect_colorspace property.
- Profile of image buffer was removed since it's not longer meaningful.
- OpenGL and GLSL is supposed to always work in sRGB space. It is possible
to support other spaces, but it's quite large project which isn't so
much important.
- Legacy Color Management option disabled is emulated by using None display.
It could have some regressions, but there's no clear way to avoid them.
- If OpenColorIO is disabled on build time, it should make blender behaving
in the same way as previous release with color management enabled.
More details could be found at this page (more details would be added soon):
http://wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.64/Color_Management
--
Thanks to Xavier Thomas, Lukas Toene for initial work on OpenColorIO
integration and to Brecht van Lommel for some further development and code/
usecase review!
2012-09-15 12:05:07 +02:00
|
|
|
|
2023-06-14 18:36:17 +02:00
|
|
|
sseq->scopes.reference_ibuf = nullptr;
|
Color Management, Stage 2: Switch color pipeline to use OpenColorIO
Replace old color pipeline which was supporting linear/sRGB color spaces
only with OpenColorIO-based pipeline.
This introduces two configurable color spaces:
- Input color space for images and movie clips. This space is used to convert
images/movies from color space in which file is saved to Blender's linear
space (for float images, byte images are not internally converted, only input
space is stored for such images and used later).
This setting could be found in image/clip data block settings.
- Display color space which defines space in which particular display is working.
This settings could be found in scene's Color Management panel.
When render result is being displayed on the screen, apart from converting image
to display space, some additional conversions could happen.
This conversions are:
- View, which defines tone curve applying before display transformation.
These are different ways to view the image on the same display device.
For example it could be used to emulate film view on sRGB display.
- Exposure affects on image exposure before tone map is applied.
- Gamma is post-display gamma correction, could be used to match particular
display gamma.
- RGB curves are user-defined curves which are applying before display
transformation, could be used for different purposes.
All this settings by default are only applying on render result and does not
affect on other images. If some particular image needs to be affected by this
transformation, "View as Render" setting of image data block should be set to
truth. Movie clips are always affected by all display transformations.
This commit also introduces configurable color space in which sequencer is
working. This setting could be found in scene's Color Management panel and
it should be used if such stuff as grading needs to be done in color space
different from sRGB (i.e. when Film view on sRGB display is use, using VD16
space as sequencer's internal space would make grading working in space
which is close to the space using for display).
Some technical notes:
- Image buffer's float buffer is now always in linear space, even if it was
created from 16bit byte images.
- Space of byte buffer is stored in image buffer's rect_colorspace property.
- Profile of image buffer was removed since it's not longer meaningful.
- OpenGL and GLSL is supposed to always work in sRGB space. It is possible
to support other spaces, but it's quite large project which isn't so
much important.
- Legacy Color Management option disabled is emulated by using None display.
It could have some regressions, but there's no clear way to avoid them.
- If OpenColorIO is disabled on build time, it should make blender behaving
in the same way as previous release with color management enabled.
More details could be found at this page (more details would be added soon):
http://wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.64/Color_Management
--
Thanks to Xavier Thomas, Lukas Toene for initial work on OpenColorIO
integration and to Brecht van Lommel for some further development and code/
usecase review!
2012-09-15 12:05:07 +02:00
|
|
|
}
|
|
|
|
|
2009-06-08 12:38:28 +02:00
|
|
|
/* ******************** manage regions ********************* */
|
|
|
|
|
2020-04-03 13:25:03 +02:00
|
|
|
static ARegion *sequencer_find_region(ScrArea *area, short type)
|
2009-12-14 22:42:25 +01:00
|
|
|
{
|
2018-06-04 09:31:30 +02:00
|
|
|
|
2023-06-14 18:36:17 +02:00
|
|
|
LISTBASE_FOREACH (ARegion *, region, &area->regionbase) {
|
2020-03-06 16:56:42 +01:00
|
|
|
if (region->regiontype == type) {
|
|
|
|
return region;
|
2019-03-26 11:16:47 +01:00
|
|
|
}
|
|
|
|
}
|
2023-06-14 18:36:17 +02:00
|
|
|
return nullptr;
|
2009-12-14 22:42:25 +01:00
|
|
|
}
|
|
|
|
|
2008-12-14 15:43:08 +01:00
|
|
|
/* ******************** default callbacks for sequencer space ***************** */
|
|
|
|
|
2023-06-14 18:36:17 +02:00
|
|
|
static SpaceLink *sequencer_create(const ScrArea * /*area*/, const Scene *scene)
|
2008-12-14 15:43:08 +01:00
|
|
|
{
|
2020-03-06 16:56:42 +01:00
|
|
|
ARegion *region;
|
2008-12-14 15:43:08 +01:00
|
|
|
SpaceSeq *sseq;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2023-06-14 18:36:17 +02:00
|
|
|
sseq = MEM_cnew<SpaceSeq>("initsequencer");
|
2012-03-30 00:26:11 +02:00
|
|
|
sseq->spacetype = SPACE_SEQ;
|
2008-12-14 15:43:08 +01:00
|
|
|
sseq->chanshown = 0;
|
2009-12-14 22:42:25 +01:00
|
|
|
sseq->view = SEQ_VIEW_SEQUENCE;
|
|
|
|
sseq->mainb = SEQ_DRAW_IMG_IMBUF;
|
2021-09-21 09:38:30 +02:00
|
|
|
sseq->flag = SEQ_USE_ALPHA | SEQ_SHOW_MARKERS | SEQ_ZOOM_TO_FIT | SEQ_SHOW_OVERLAY;
|
|
|
|
sseq->preview_overlay.flag = SEQ_PREVIEW_SHOW_GPENCIL | SEQ_PREVIEW_SHOW_OUTLINE_SELECTED;
|
|
|
|
sseq->timeline_overlay.flag = SEQ_TIMELINE_SHOW_STRIP_NAME | SEQ_TIMELINE_SHOW_STRIP_SOURCE |
|
|
|
|
SEQ_TIMELINE_SHOW_STRIP_DURATION | SEQ_TIMELINE_SHOW_GRID |
|
2021-09-29 14:29:32 +02:00
|
|
|
SEQ_TIMELINE_SHOW_FCURVES | SEQ_TIMELINE_SHOW_STRIP_COLOR_TAG;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2021-09-21 10:38:15 +02:00
|
|
|
BLI_rctf_init(&sseq->runtime.last_thumbnail_area, 0.0f, 0.0f, 0.0f, 0.0f);
|
2023-06-14 18:36:17 +02:00
|
|
|
sseq->runtime.last_displayed_thumbnails = nullptr;
|
2021-09-21 10:38:15 +02:00
|
|
|
|
2021-09-28 06:44:36 +02:00
|
|
|
/* Header. */
|
2023-06-14 18:36:17 +02:00
|
|
|
region = MEM_cnew<ARegion>("header for sequencer");
|
2020-01-27 11:19:50 +01:00
|
|
|
|
2023-06-14 18:36:17 +02:00
|
|
|
BLI_addtail(&sseq->regionbase, static_cast<void *>(region));
|
2021-09-28 06:44:36 +02:00
|
|
|
region->regiontype = RGN_TYPE_HEADER;
|
2020-03-06 16:56:42 +01:00
|
|
|
region->alignment = (U.uiflag & USER_HEADER_BOTTOM) ? RGN_ALIGN_BOTTOM : RGN_ALIGN_TOP;
|
2020-01-27 11:19:50 +01:00
|
|
|
|
2021-09-28 06:44:36 +02:00
|
|
|
/* Tool header. */
|
2023-06-14 18:36:17 +02:00
|
|
|
region = MEM_cnew<ARegion>("tool header for sequencer");
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2023-06-14 18:36:17 +02:00
|
|
|
BLI_addtail(&sseq->regionbase, static_cast<void *>(region));
|
2021-09-28 06:44:36 +02:00
|
|
|
region->regiontype = RGN_TYPE_TOOL_HEADER;
|
2020-03-06 16:56:42 +01:00
|
|
|
region->alignment = (U.uiflag & USER_HEADER_BOTTOM) ? RGN_ALIGN_BOTTOM : RGN_ALIGN_TOP;
|
2021-09-28 06:44:36 +02:00
|
|
|
region->flag = RGN_FLAG_HIDDEN | RGN_FLAG_HIDDEN_BY_USER;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2020-04-05 23:55:51 +02:00
|
|
|
/* Buttons/list view. */
|
2023-06-14 18:36:17 +02:00
|
|
|
region = MEM_cnew<ARegion>("buttons for sequencer");
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2023-06-14 18:36:17 +02:00
|
|
|
BLI_addtail(&sseq->regionbase, static_cast<void *>(region));
|
2020-03-06 16:56:42 +01:00
|
|
|
region->regiontype = RGN_TYPE_UI;
|
|
|
|
region->alignment = RGN_ALIGN_RIGHT;
|
|
|
|
region->flag = RGN_FLAG_HIDDEN;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2020-04-05 23:55:51 +02:00
|
|
|
/* Toolbar. */
|
2023-06-14 18:36:17 +02:00
|
|
|
region = MEM_cnew<ARegion>("tools for sequencer");
|
2020-01-22 14:54:44 +01:00
|
|
|
|
2023-06-14 18:36:17 +02:00
|
|
|
BLI_addtail(&sseq->regionbase, static_cast<void *>(region));
|
2020-03-06 16:56:42 +01:00
|
|
|
region->regiontype = RGN_TYPE_TOOLS;
|
|
|
|
region->alignment = RGN_ALIGN_LEFT;
|
|
|
|
region->flag = RGN_FLAG_HIDDEN;
|
2022-04-04 12:52:48 +02:00
|
|
|
|
|
|
|
/* Channels. */
|
2023-06-14 18:36:17 +02:00
|
|
|
region = MEM_cnew<ARegion>("channels for sequencer");
|
2022-04-04 12:52:48 +02:00
|
|
|
|
2023-06-14 18:36:17 +02:00
|
|
|
BLI_addtail(&sseq->regionbase, static_cast<void *>(region));
|
2022-04-04 12:52:48 +02:00
|
|
|
region->regiontype = RGN_TYPE_CHANNELS;
|
|
|
|
region->alignment = RGN_ALIGN_LEFT;
|
2022-10-19 19:49:15 +02:00
|
|
|
region->v2d.flag |= V2D_VIEWSYNC_AREA_VERTICAL;
|
2020-01-22 14:54:44 +01:00
|
|
|
|
2020-04-05 23:55:51 +02:00
|
|
|
/* Preview region. */
|
|
|
|
/* NOTE: if you change values here, also change them in sequencer_init_preview_region. */
|
2023-06-14 18:36:17 +02:00
|
|
|
region = MEM_cnew<ARegion>("preview region for sequencer");
|
|
|
|
BLI_addtail(&sseq->regionbase, static_cast<void *>(region));
|
2020-03-06 16:56:42 +01:00
|
|
|
region->regiontype = RGN_TYPE_PREVIEW;
|
|
|
|
region->alignment = RGN_ALIGN_TOP;
|
2020-04-05 23:55:51 +02:00
|
|
|
/* For now, aspect ratio should be maintained, and zoom is clamped within sane default limits. */
|
2020-03-06 16:56:42 +01:00
|
|
|
region->v2d.keepzoom = V2D_KEEPASPECT | V2D_KEEPZOOM | V2D_LIMITZOOM;
|
|
|
|
region->v2d.minzoom = 0.001f;
|
|
|
|
region->v2d.maxzoom = 1000.0f;
|
2020-04-05 23:55:51 +02:00
|
|
|
region->v2d.tot.xmin = -960.0f; /* 1920 width centered. */
|
|
|
|
region->v2d.tot.ymin = -540.0f; /* 1080 height centered. */
|
2020-03-06 16:56:42 +01:00
|
|
|
region->v2d.tot.xmax = 960.0f;
|
|
|
|
region->v2d.tot.ymax = 540.0f;
|
|
|
|
region->v2d.min[0] = 0.0f;
|
|
|
|
region->v2d.min[1] = 0.0f;
|
|
|
|
region->v2d.max[0] = 12000.0f;
|
|
|
|
region->v2d.max[1] = 12000.0f;
|
|
|
|
region->v2d.cur = region->v2d.tot;
|
|
|
|
region->v2d.align = V2D_ALIGN_FREE;
|
|
|
|
region->v2d.keeptot = V2D_KEEPTOT_FREE;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2020-04-05 23:55:51 +02:00
|
|
|
/* Main region. */
|
2023-06-14 18:36:17 +02:00
|
|
|
region = MEM_cnew<ARegion>("main region for sequencer");
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2023-06-14 18:36:17 +02:00
|
|
|
BLI_addtail(&sseq->regionbase, static_cast<void *>(region));
|
2020-03-06 16:56:42 +01:00
|
|
|
region->regiontype = RGN_TYPE_WINDOW;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2020-04-05 23:55:51 +02:00
|
|
|
/* Seq space goes from (0,8) to (0, efra). */
|
2020-03-06 16:56:42 +01:00
|
|
|
region->v2d.tot.xmin = 0.0f;
|
|
|
|
region->v2d.tot.ymin = 0.0f;
|
|
|
|
region->v2d.tot.xmax = scene->r.efra;
|
2022-04-28 16:07:57 +02:00
|
|
|
region->v2d.tot.ymax = 8.5f;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2020-03-06 16:56:42 +01:00
|
|
|
region->v2d.cur = region->v2d.tot;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2020-03-06 16:56:42 +01:00
|
|
|
region->v2d.min[0] = 10.0f;
|
2021-11-17 02:44:47 +01:00
|
|
|
region->v2d.min[1] = 1.0f;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2020-03-06 16:56:42 +01:00
|
|
|
region->v2d.max[0] = MAXFRAMEF;
|
|
|
|
region->v2d.max[1] = MAXSEQ;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2020-03-06 16:56:42 +01:00
|
|
|
region->v2d.minzoom = 0.01f;
|
|
|
|
region->v2d.maxzoom = 100.0f;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2020-03-06 16:56:42 +01:00
|
|
|
region->v2d.scroll |= (V2D_SCROLL_BOTTOM | V2D_SCROLL_HORIZONTAL_HANDLES);
|
|
|
|
region->v2d.scroll |= (V2D_SCROLL_RIGHT | V2D_SCROLL_VERTICAL_HANDLES);
|
|
|
|
region->v2d.keepzoom = 0;
|
|
|
|
region->v2d.keeptot = 0;
|
2022-04-04 12:52:48 +02:00
|
|
|
region->v2d.flag |= V2D_VIEWSYNC_AREA_VERTICAL;
|
2020-03-06 16:56:42 +01:00
|
|
|
region->v2d.align = V2D_ALIGN_NO_NEG_Y;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2023-06-14 18:36:17 +02:00
|
|
|
sseq->runtime.last_displayed_thumbnails = nullptr;
|
2021-09-21 10:38:15 +02:00
|
|
|
|
2008-12-14 15:43:08 +01:00
|
|
|
return (SpaceLink *)sseq;
|
|
|
|
}
|
|
|
|
|
2020-04-05 23:55:51 +02:00
|
|
|
/* Not spacelink itself. */
|
Color Management, Stage 2: Switch color pipeline to use OpenColorIO
Replace old color pipeline which was supporting linear/sRGB color spaces
only with OpenColorIO-based pipeline.
This introduces two configurable color spaces:
- Input color space for images and movie clips. This space is used to convert
images/movies from color space in which file is saved to Blender's linear
space (for float images, byte images are not internally converted, only input
space is stored for such images and used later).
This setting could be found in image/clip data block settings.
- Display color space which defines space in which particular display is working.
This settings could be found in scene's Color Management panel.
When render result is being displayed on the screen, apart from converting image
to display space, some additional conversions could happen.
This conversions are:
- View, which defines tone curve applying before display transformation.
These are different ways to view the image on the same display device.
For example it could be used to emulate film view on sRGB display.
- Exposure affects on image exposure before tone map is applied.
- Gamma is post-display gamma correction, could be used to match particular
display gamma.
- RGB curves are user-defined curves which are applying before display
transformation, could be used for different purposes.
All this settings by default are only applying on render result and does not
affect on other images. If some particular image needs to be affected by this
transformation, "View as Render" setting of image data block should be set to
truth. Movie clips are always affected by all display transformations.
This commit also introduces configurable color space in which sequencer is
working. This setting could be found in scene's Color Management panel and
it should be used if such stuff as grading needs to be done in color space
different from sRGB (i.e. when Film view on sRGB display is use, using VD16
space as sequencer's internal space would make grading working in space
which is close to the space using for display).
Some technical notes:
- Image buffer's float buffer is now always in linear space, even if it was
created from 16bit byte images.
- Space of byte buffer is stored in image buffer's rect_colorspace property.
- Profile of image buffer was removed since it's not longer meaningful.
- OpenGL and GLSL is supposed to always work in sRGB space. It is possible
to support other spaces, but it's quite large project which isn't so
much important.
- Legacy Color Management option disabled is emulated by using None display.
It could have some regressions, but there's no clear way to avoid them.
- If OpenColorIO is disabled on build time, it should make blender behaving
in the same way as previous release with color management enabled.
More details could be found at this page (more details would be added soon):
http://wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.64/Color_Management
--
Thanks to Xavier Thomas, Lukas Toene for initial work on OpenColorIO
integration and to Brecht van Lommel for some further development and code/
usecase review!
2012-09-15 12:05:07 +02:00
|
|
|
static void sequencer_free(SpaceLink *sl)
|
2018-06-04 09:31:30 +02:00
|
|
|
{
|
2012-09-26 22:26:31 +02:00
|
|
|
SpaceSeq *sseq = (SpaceSeq *)sl;
|
Color Management, Stage 2: Switch color pipeline to use OpenColorIO
Replace old color pipeline which was supporting linear/sRGB color spaces
only with OpenColorIO-based pipeline.
This introduces two configurable color spaces:
- Input color space for images and movie clips. This space is used to convert
images/movies from color space in which file is saved to Blender's linear
space (for float images, byte images are not internally converted, only input
space is stored for such images and used later).
This setting could be found in image/clip data block settings.
- Display color space which defines space in which particular display is working.
This settings could be found in scene's Color Management panel.
When render result is being displayed on the screen, apart from converting image
to display space, some additional conversions could happen.
This conversions are:
- View, which defines tone curve applying before display transformation.
These are different ways to view the image on the same display device.
For example it could be used to emulate film view on sRGB display.
- Exposure affects on image exposure before tone map is applied.
- Gamma is post-display gamma correction, could be used to match particular
display gamma.
- RGB curves are user-defined curves which are applying before display
transformation, could be used for different purposes.
All this settings by default are only applying on render result and does not
affect on other images. If some particular image needs to be affected by this
transformation, "View as Render" setting of image data block should be set to
truth. Movie clips are always affected by all display transformations.
This commit also introduces configurable color space in which sequencer is
working. This setting could be found in scene's Color Management panel and
it should be used if such stuff as grading needs to be done in color space
different from sRGB (i.e. when Film view on sRGB display is use, using VD16
space as sequencer's internal space would make grading working in space
which is close to the space using for display).
Some technical notes:
- Image buffer's float buffer is now always in linear space, even if it was
created from 16bit byte images.
- Space of byte buffer is stored in image buffer's rect_colorspace property.
- Profile of image buffer was removed since it's not longer meaningful.
- OpenGL and GLSL is supposed to always work in sRGB space. It is possible
to support other spaces, but it's quite large project which isn't so
much important.
- Legacy Color Management option disabled is emulated by using None display.
It could have some regressions, but there's no clear way to avoid them.
- If OpenColorIO is disabled on build time, it should make blender behaving
in the same way as previous release with color management enabled.
More details could be found at this page (more details would be added soon):
http://wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.64/Color_Management
--
Thanks to Xavier Thomas, Lukas Toene for initial work on OpenColorIO
integration and to Brecht van Lommel for some further development and code/
usecase review!
2012-09-15 12:05:07 +02:00
|
|
|
SequencerScopes *scopes = &sseq->scopes;
|
|
|
|
|
2021-08-20 08:35:35 +02:00
|
|
|
/* XXX if (sseq->gpd) BKE_gpencil_free_data(sseq->gpd); */
|
2008-12-14 15:43:08 +01:00
|
|
|
|
2019-03-26 11:16:47 +01:00
|
|
|
if (scopes->zebra_ibuf) {
|
Color Management, Stage 2: Switch color pipeline to use OpenColorIO
Replace old color pipeline which was supporting linear/sRGB color spaces
only with OpenColorIO-based pipeline.
This introduces two configurable color spaces:
- Input color space for images and movie clips. This space is used to convert
images/movies from color space in which file is saved to Blender's linear
space (for float images, byte images are not internally converted, only input
space is stored for such images and used later).
This setting could be found in image/clip data block settings.
- Display color space which defines space in which particular display is working.
This settings could be found in scene's Color Management panel.
When render result is being displayed on the screen, apart from converting image
to display space, some additional conversions could happen.
This conversions are:
- View, which defines tone curve applying before display transformation.
These are different ways to view the image on the same display device.
For example it could be used to emulate film view on sRGB display.
- Exposure affects on image exposure before tone map is applied.
- Gamma is post-display gamma correction, could be used to match particular
display gamma.
- RGB curves are user-defined curves which are applying before display
transformation, could be used for different purposes.
All this settings by default are only applying on render result and does not
affect on other images. If some particular image needs to be affected by this
transformation, "View as Render" setting of image data block should be set to
truth. Movie clips are always affected by all display transformations.
This commit also introduces configurable color space in which sequencer is
working. This setting could be found in scene's Color Management panel and
it should be used if such stuff as grading needs to be done in color space
different from sRGB (i.e. when Film view on sRGB display is use, using VD16
space as sequencer's internal space would make grading working in space
which is close to the space using for display).
Some technical notes:
- Image buffer's float buffer is now always in linear space, even if it was
created from 16bit byte images.
- Space of byte buffer is stored in image buffer's rect_colorspace property.
- Profile of image buffer was removed since it's not longer meaningful.
- OpenGL and GLSL is supposed to always work in sRGB space. It is possible
to support other spaces, but it's quite large project which isn't so
much important.
- Legacy Color Management option disabled is emulated by using None display.
It could have some regressions, but there's no clear way to avoid them.
- If OpenColorIO is disabled on build time, it should make blender behaving
in the same way as previous release with color management enabled.
More details could be found at this page (more details would be added soon):
http://wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.64/Color_Management
--
Thanks to Xavier Thomas, Lukas Toene for initial work on OpenColorIO
integration and to Brecht van Lommel for some further development and code/
usecase review!
2012-09-15 12:05:07 +02:00
|
|
|
IMB_freeImBuf(scopes->zebra_ibuf);
|
2019-03-26 11:16:47 +01:00
|
|
|
}
|
Color Management, Stage 2: Switch color pipeline to use OpenColorIO
Replace old color pipeline which was supporting linear/sRGB color spaces
only with OpenColorIO-based pipeline.
This introduces two configurable color spaces:
- Input color space for images and movie clips. This space is used to convert
images/movies from color space in which file is saved to Blender's linear
space (for float images, byte images are not internally converted, only input
space is stored for such images and used later).
This setting could be found in image/clip data block settings.
- Display color space which defines space in which particular display is working.
This settings could be found in scene's Color Management panel.
When render result is being displayed on the screen, apart from converting image
to display space, some additional conversions could happen.
This conversions are:
- View, which defines tone curve applying before display transformation.
These are different ways to view the image on the same display device.
For example it could be used to emulate film view on sRGB display.
- Exposure affects on image exposure before tone map is applied.
- Gamma is post-display gamma correction, could be used to match particular
display gamma.
- RGB curves are user-defined curves which are applying before display
transformation, could be used for different purposes.
All this settings by default are only applying on render result and does not
affect on other images. If some particular image needs to be affected by this
transformation, "View as Render" setting of image data block should be set to
truth. Movie clips are always affected by all display transformations.
This commit also introduces configurable color space in which sequencer is
working. This setting could be found in scene's Color Management panel and
it should be used if such stuff as grading needs to be done in color space
different from sRGB (i.e. when Film view on sRGB display is use, using VD16
space as sequencer's internal space would make grading working in space
which is close to the space using for display).
Some technical notes:
- Image buffer's float buffer is now always in linear space, even if it was
created from 16bit byte images.
- Space of byte buffer is stored in image buffer's rect_colorspace property.
- Profile of image buffer was removed since it's not longer meaningful.
- OpenGL and GLSL is supposed to always work in sRGB space. It is possible
to support other spaces, but it's quite large project which isn't so
much important.
- Legacy Color Management option disabled is emulated by using None display.
It could have some regressions, but there's no clear way to avoid them.
- If OpenColorIO is disabled on build time, it should make blender behaving
in the same way as previous release with color management enabled.
More details could be found at this page (more details would be added soon):
http://wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.64/Color_Management
--
Thanks to Xavier Thomas, Lukas Toene for initial work on OpenColorIO
integration and to Brecht van Lommel for some further development and code/
usecase review!
2012-09-15 12:05:07 +02:00
|
|
|
|
2019-03-26 11:16:47 +01:00
|
|
|
if (scopes->waveform_ibuf) {
|
Color Management, Stage 2: Switch color pipeline to use OpenColorIO
Replace old color pipeline which was supporting linear/sRGB color spaces
only with OpenColorIO-based pipeline.
This introduces two configurable color spaces:
- Input color space for images and movie clips. This space is used to convert
images/movies from color space in which file is saved to Blender's linear
space (for float images, byte images are not internally converted, only input
space is stored for such images and used later).
This setting could be found in image/clip data block settings.
- Display color space which defines space in which particular display is working.
This settings could be found in scene's Color Management panel.
When render result is being displayed on the screen, apart from converting image
to display space, some additional conversions could happen.
This conversions are:
- View, which defines tone curve applying before display transformation.
These are different ways to view the image on the same display device.
For example it could be used to emulate film view on sRGB display.
- Exposure affects on image exposure before tone map is applied.
- Gamma is post-display gamma correction, could be used to match particular
display gamma.
- RGB curves are user-defined curves which are applying before display
transformation, could be used for different purposes.
All this settings by default are only applying on render result and does not
affect on other images. If some particular image needs to be affected by this
transformation, "View as Render" setting of image data block should be set to
truth. Movie clips are always affected by all display transformations.
This commit also introduces configurable color space in which sequencer is
working. This setting could be found in scene's Color Management panel and
it should be used if such stuff as grading needs to be done in color space
different from sRGB (i.e. when Film view on sRGB display is use, using VD16
space as sequencer's internal space would make grading working in space
which is close to the space using for display).
Some technical notes:
- Image buffer's float buffer is now always in linear space, even if it was
created from 16bit byte images.
- Space of byte buffer is stored in image buffer's rect_colorspace property.
- Profile of image buffer was removed since it's not longer meaningful.
- OpenGL and GLSL is supposed to always work in sRGB space. It is possible
to support other spaces, but it's quite large project which isn't so
much important.
- Legacy Color Management option disabled is emulated by using None display.
It could have some regressions, but there's no clear way to avoid them.
- If OpenColorIO is disabled on build time, it should make blender behaving
in the same way as previous release with color management enabled.
More details could be found at this page (more details would be added soon):
http://wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.64/Color_Management
--
Thanks to Xavier Thomas, Lukas Toene for initial work on OpenColorIO
integration and to Brecht van Lommel for some further development and code/
usecase review!
2012-09-15 12:05:07 +02:00
|
|
|
IMB_freeImBuf(scopes->waveform_ibuf);
|
2019-03-26 11:16:47 +01:00
|
|
|
}
|
Color Management, Stage 2: Switch color pipeline to use OpenColorIO
Replace old color pipeline which was supporting linear/sRGB color spaces
only with OpenColorIO-based pipeline.
This introduces two configurable color spaces:
- Input color space for images and movie clips. This space is used to convert
images/movies from color space in which file is saved to Blender's linear
space (for float images, byte images are not internally converted, only input
space is stored for such images and used later).
This setting could be found in image/clip data block settings.
- Display color space which defines space in which particular display is working.
This settings could be found in scene's Color Management panel.
When render result is being displayed on the screen, apart from converting image
to display space, some additional conversions could happen.
This conversions are:
- View, which defines tone curve applying before display transformation.
These are different ways to view the image on the same display device.
For example it could be used to emulate film view on sRGB display.
- Exposure affects on image exposure before tone map is applied.
- Gamma is post-display gamma correction, could be used to match particular
display gamma.
- RGB curves are user-defined curves which are applying before display
transformation, could be used for different purposes.
All this settings by default are only applying on render result and does not
affect on other images. If some particular image needs to be affected by this
transformation, "View as Render" setting of image data block should be set to
truth. Movie clips are always affected by all display transformations.
This commit also introduces configurable color space in which sequencer is
working. This setting could be found in scene's Color Management panel and
it should be used if such stuff as grading needs to be done in color space
different from sRGB (i.e. when Film view on sRGB display is use, using VD16
space as sequencer's internal space would make grading working in space
which is close to the space using for display).
Some technical notes:
- Image buffer's float buffer is now always in linear space, even if it was
created from 16bit byte images.
- Space of byte buffer is stored in image buffer's rect_colorspace property.
- Profile of image buffer was removed since it's not longer meaningful.
- OpenGL and GLSL is supposed to always work in sRGB space. It is possible
to support other spaces, but it's quite large project which isn't so
much important.
- Legacy Color Management option disabled is emulated by using None display.
It could have some regressions, but there's no clear way to avoid them.
- If OpenColorIO is disabled on build time, it should make blender behaving
in the same way as previous release with color management enabled.
More details could be found at this page (more details would be added soon):
http://wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.64/Color_Management
--
Thanks to Xavier Thomas, Lukas Toene for initial work on OpenColorIO
integration and to Brecht van Lommel for some further development and code/
usecase review!
2012-09-15 12:05:07 +02:00
|
|
|
|
2019-03-26 11:16:47 +01:00
|
|
|
if (scopes->sep_waveform_ibuf) {
|
Color Management, Stage 2: Switch color pipeline to use OpenColorIO
Replace old color pipeline which was supporting linear/sRGB color spaces
only with OpenColorIO-based pipeline.
This introduces two configurable color spaces:
- Input color space for images and movie clips. This space is used to convert
images/movies from color space in which file is saved to Blender's linear
space (for float images, byte images are not internally converted, only input
space is stored for such images and used later).
This setting could be found in image/clip data block settings.
- Display color space which defines space in which particular display is working.
This settings could be found in scene's Color Management panel.
When render result is being displayed on the screen, apart from converting image
to display space, some additional conversions could happen.
This conversions are:
- View, which defines tone curve applying before display transformation.
These are different ways to view the image on the same display device.
For example it could be used to emulate film view on sRGB display.
- Exposure affects on image exposure before tone map is applied.
- Gamma is post-display gamma correction, could be used to match particular
display gamma.
- RGB curves are user-defined curves which are applying before display
transformation, could be used for different purposes.
All this settings by default are only applying on render result and does not
affect on other images. If some particular image needs to be affected by this
transformation, "View as Render" setting of image data block should be set to
truth. Movie clips are always affected by all display transformations.
This commit also introduces configurable color space in which sequencer is
working. This setting could be found in scene's Color Management panel and
it should be used if such stuff as grading needs to be done in color space
different from sRGB (i.e. when Film view on sRGB display is use, using VD16
space as sequencer's internal space would make grading working in space
which is close to the space using for display).
Some technical notes:
- Image buffer's float buffer is now always in linear space, even if it was
created from 16bit byte images.
- Space of byte buffer is stored in image buffer's rect_colorspace property.
- Profile of image buffer was removed since it's not longer meaningful.
- OpenGL and GLSL is supposed to always work in sRGB space. It is possible
to support other spaces, but it's quite large project which isn't so
much important.
- Legacy Color Management option disabled is emulated by using None display.
It could have some regressions, but there's no clear way to avoid them.
- If OpenColorIO is disabled on build time, it should make blender behaving
in the same way as previous release with color management enabled.
More details could be found at this page (more details would be added soon):
http://wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.64/Color_Management
--
Thanks to Xavier Thomas, Lukas Toene for initial work on OpenColorIO
integration and to Brecht van Lommel for some further development and code/
usecase review!
2012-09-15 12:05:07 +02:00
|
|
|
IMB_freeImBuf(scopes->sep_waveform_ibuf);
|
2019-03-26 11:16:47 +01:00
|
|
|
}
|
Color Management, Stage 2: Switch color pipeline to use OpenColorIO
Replace old color pipeline which was supporting linear/sRGB color spaces
only with OpenColorIO-based pipeline.
This introduces two configurable color spaces:
- Input color space for images and movie clips. This space is used to convert
images/movies from color space in which file is saved to Blender's linear
space (for float images, byte images are not internally converted, only input
space is stored for such images and used later).
This setting could be found in image/clip data block settings.
- Display color space which defines space in which particular display is working.
This settings could be found in scene's Color Management panel.
When render result is being displayed on the screen, apart from converting image
to display space, some additional conversions could happen.
This conversions are:
- View, which defines tone curve applying before display transformation.
These are different ways to view the image on the same display device.
For example it could be used to emulate film view on sRGB display.
- Exposure affects on image exposure before tone map is applied.
- Gamma is post-display gamma correction, could be used to match particular
display gamma.
- RGB curves are user-defined curves which are applying before display
transformation, could be used for different purposes.
All this settings by default are only applying on render result and does not
affect on other images. If some particular image needs to be affected by this
transformation, "View as Render" setting of image data block should be set to
truth. Movie clips are always affected by all display transformations.
This commit also introduces configurable color space in which sequencer is
working. This setting could be found in scene's Color Management panel and
it should be used if such stuff as grading needs to be done in color space
different from sRGB (i.e. when Film view on sRGB display is use, using VD16
space as sequencer's internal space would make grading working in space
which is close to the space using for display).
Some technical notes:
- Image buffer's float buffer is now always in linear space, even if it was
created from 16bit byte images.
- Space of byte buffer is stored in image buffer's rect_colorspace property.
- Profile of image buffer was removed since it's not longer meaningful.
- OpenGL and GLSL is supposed to always work in sRGB space. It is possible
to support other spaces, but it's quite large project which isn't so
much important.
- Legacy Color Management option disabled is emulated by using None display.
It could have some regressions, but there's no clear way to avoid them.
- If OpenColorIO is disabled on build time, it should make blender behaving
in the same way as previous release with color management enabled.
More details could be found at this page (more details would be added soon):
http://wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.64/Color_Management
--
Thanks to Xavier Thomas, Lukas Toene for initial work on OpenColorIO
integration and to Brecht van Lommel for some further development and code/
usecase review!
2012-09-15 12:05:07 +02:00
|
|
|
|
2019-03-26 11:16:47 +01:00
|
|
|
if (scopes->vector_ibuf) {
|
Color Management, Stage 2: Switch color pipeline to use OpenColorIO
Replace old color pipeline which was supporting linear/sRGB color spaces
only with OpenColorIO-based pipeline.
This introduces two configurable color spaces:
- Input color space for images and movie clips. This space is used to convert
images/movies from color space in which file is saved to Blender's linear
space (for float images, byte images are not internally converted, only input
space is stored for such images and used later).
This setting could be found in image/clip data block settings.
- Display color space which defines space in which particular display is working.
This settings could be found in scene's Color Management panel.
When render result is being displayed on the screen, apart from converting image
to display space, some additional conversions could happen.
This conversions are:
- View, which defines tone curve applying before display transformation.
These are different ways to view the image on the same display device.
For example it could be used to emulate film view on sRGB display.
- Exposure affects on image exposure before tone map is applied.
- Gamma is post-display gamma correction, could be used to match particular
display gamma.
- RGB curves are user-defined curves which are applying before display
transformation, could be used for different purposes.
All this settings by default are only applying on render result and does not
affect on other images. If some particular image needs to be affected by this
transformation, "View as Render" setting of image data block should be set to
truth. Movie clips are always affected by all display transformations.
This commit also introduces configurable color space in which sequencer is
working. This setting could be found in scene's Color Management panel and
it should be used if such stuff as grading needs to be done in color space
different from sRGB (i.e. when Film view on sRGB display is use, using VD16
space as sequencer's internal space would make grading working in space
which is close to the space using for display).
Some technical notes:
- Image buffer's float buffer is now always in linear space, even if it was
created from 16bit byte images.
- Space of byte buffer is stored in image buffer's rect_colorspace property.
- Profile of image buffer was removed since it's not longer meaningful.
- OpenGL and GLSL is supposed to always work in sRGB space. It is possible
to support other spaces, but it's quite large project which isn't so
much important.
- Legacy Color Management option disabled is emulated by using None display.
It could have some regressions, but there's no clear way to avoid them.
- If OpenColorIO is disabled on build time, it should make blender behaving
in the same way as previous release with color management enabled.
More details could be found at this page (more details would be added soon):
http://wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.64/Color_Management
--
Thanks to Xavier Thomas, Lukas Toene for initial work on OpenColorIO
integration and to Brecht van Lommel for some further development and code/
usecase review!
2012-09-15 12:05:07 +02:00
|
|
|
IMB_freeImBuf(scopes->vector_ibuf);
|
2019-03-26 11:16:47 +01:00
|
|
|
}
|
Color Management, Stage 2: Switch color pipeline to use OpenColorIO
Replace old color pipeline which was supporting linear/sRGB color spaces
only with OpenColorIO-based pipeline.
This introduces two configurable color spaces:
- Input color space for images and movie clips. This space is used to convert
images/movies from color space in which file is saved to Blender's linear
space (for float images, byte images are not internally converted, only input
space is stored for such images and used later).
This setting could be found in image/clip data block settings.
- Display color space which defines space in which particular display is working.
This settings could be found in scene's Color Management panel.
When render result is being displayed on the screen, apart from converting image
to display space, some additional conversions could happen.
This conversions are:
- View, which defines tone curve applying before display transformation.
These are different ways to view the image on the same display device.
For example it could be used to emulate film view on sRGB display.
- Exposure affects on image exposure before tone map is applied.
- Gamma is post-display gamma correction, could be used to match particular
display gamma.
- RGB curves are user-defined curves which are applying before display
transformation, could be used for different purposes.
All this settings by default are only applying on render result and does not
affect on other images. If some particular image needs to be affected by this
transformation, "View as Render" setting of image data block should be set to
truth. Movie clips are always affected by all display transformations.
This commit also introduces configurable color space in which sequencer is
working. This setting could be found in scene's Color Management panel and
it should be used if such stuff as grading needs to be done in color space
different from sRGB (i.e. when Film view on sRGB display is use, using VD16
space as sequencer's internal space would make grading working in space
which is close to the space using for display).
Some technical notes:
- Image buffer's float buffer is now always in linear space, even if it was
created from 16bit byte images.
- Space of byte buffer is stored in image buffer's rect_colorspace property.
- Profile of image buffer was removed since it's not longer meaningful.
- OpenGL and GLSL is supposed to always work in sRGB space. It is possible
to support other spaces, but it's quite large project which isn't so
much important.
- Legacy Color Management option disabled is emulated by using None display.
It could have some regressions, but there's no clear way to avoid them.
- If OpenColorIO is disabled on build time, it should make blender behaving
in the same way as previous release with color management enabled.
More details could be found at this page (more details would be added soon):
http://wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.64/Color_Management
--
Thanks to Xavier Thomas, Lukas Toene for initial work on OpenColorIO
integration and to Brecht van Lommel for some further development and code/
usecase review!
2012-09-15 12:05:07 +02:00
|
|
|
|
2019-03-26 11:16:47 +01:00
|
|
|
if (scopes->histogram_ibuf) {
|
Color Management, Stage 2: Switch color pipeline to use OpenColorIO
Replace old color pipeline which was supporting linear/sRGB color spaces
only with OpenColorIO-based pipeline.
This introduces two configurable color spaces:
- Input color space for images and movie clips. This space is used to convert
images/movies from color space in which file is saved to Blender's linear
space (for float images, byte images are not internally converted, only input
space is stored for such images and used later).
This setting could be found in image/clip data block settings.
- Display color space which defines space in which particular display is working.
This settings could be found in scene's Color Management panel.
When render result is being displayed on the screen, apart from converting image
to display space, some additional conversions could happen.
This conversions are:
- View, which defines tone curve applying before display transformation.
These are different ways to view the image on the same display device.
For example it could be used to emulate film view on sRGB display.
- Exposure affects on image exposure before tone map is applied.
- Gamma is post-display gamma correction, could be used to match particular
display gamma.
- RGB curves are user-defined curves which are applying before display
transformation, could be used for different purposes.
All this settings by default are only applying on render result and does not
affect on other images. If some particular image needs to be affected by this
transformation, "View as Render" setting of image data block should be set to
truth. Movie clips are always affected by all display transformations.
This commit also introduces configurable color space in which sequencer is
working. This setting could be found in scene's Color Management panel and
it should be used if such stuff as grading needs to be done in color space
different from sRGB (i.e. when Film view on sRGB display is use, using VD16
space as sequencer's internal space would make grading working in space
which is close to the space using for display).
Some technical notes:
- Image buffer's float buffer is now always in linear space, even if it was
created from 16bit byte images.
- Space of byte buffer is stored in image buffer's rect_colorspace property.
- Profile of image buffer was removed since it's not longer meaningful.
- OpenGL and GLSL is supposed to always work in sRGB space. It is possible
to support other spaces, but it's quite large project which isn't so
much important.
- Legacy Color Management option disabled is emulated by using None display.
It could have some regressions, but there's no clear way to avoid them.
- If OpenColorIO is disabled on build time, it should make blender behaving
in the same way as previous release with color management enabled.
More details could be found at this page (more details would be added soon):
http://wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.64/Color_Management
--
Thanks to Xavier Thomas, Lukas Toene for initial work on OpenColorIO
integration and to Brecht van Lommel for some further development and code/
usecase review!
2012-09-15 12:05:07 +02:00
|
|
|
IMB_freeImBuf(scopes->histogram_ibuf);
|
2019-03-26 11:16:47 +01:00
|
|
|
}
|
2021-09-21 10:38:15 +02:00
|
|
|
|
|
|
|
if (sseq->runtime.last_displayed_thumbnails) {
|
|
|
|
BLI_ghash_free(
|
2023-06-14 18:36:17 +02:00
|
|
|
sseq->runtime.last_displayed_thumbnails, nullptr, last_displayed_thumbnails_list_free);
|
|
|
|
sseq->runtime.last_displayed_thumbnails = nullptr;
|
2021-09-21 10:38:15 +02:00
|
|
|
}
|
2008-12-14 15:43:08 +01:00
|
|
|
}
|
|
|
|
|
2022-09-16 10:13:19 +02:00
|
|
|
/* Space-type init callback. */
|
2023-06-14 18:36:17 +02:00
|
|
|
static void sequencer_init(wmWindowManager * /*wm*/, ScrArea * /*area*/) {}
|
2008-12-14 15:43:08 +01:00
|
|
|
|
2020-04-03 13:25:03 +02:00
|
|
|
static void sequencer_refresh(const bContext *C, ScrArea *area)
|
2011-09-05 21:34:27 +02:00
|
|
|
{
|
2012-03-30 00:26:11 +02:00
|
|
|
wmWindowManager *wm = CTX_wm_manager(C);
|
|
|
|
wmWindow *window = CTX_wm_window(C);
|
2020-04-03 13:25:03 +02:00
|
|
|
SpaceSeq *sseq = (SpaceSeq *)area->spacedata.first;
|
|
|
|
ARegion *region_main = sequencer_find_region(area, RGN_TYPE_WINDOW);
|
|
|
|
ARegion *region_preview = sequencer_find_region(area, RGN_TYPE_PREVIEW);
|
2013-11-25 20:39:14 +01:00
|
|
|
bool view_changed = false;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2011-09-05 21:34:27 +02:00
|
|
|
switch (sseq->view) {
|
UI: Region polling support
Introduces *ARegionType.poll()* as a way to dynamically add/remove a region. The region is still there internally, but is not accessible to the user.
Previously editors would to this manually, by either removing/adding regions altogether, or hiding them, unsetting their alignment (so no AZones are added I assume) and removing their event handlers. Polling makes this much simpler.
We plan to use this in #102879.
This patch refactors multiple editors to use region polling:
- File Browser
- Sequencer
- Clip Editor
- Preferences
Notes:
- Previously, editors would lazy-create some of the regions. Versioning is added here to ensure they are always there. Could be a separate patch.
- Some editors reuse a region in different display modes, and so additional work needs to be done to reinit regions they become available or the mode changes. Typically `V2D_IS_INIT` is unset for that, which isn't great. Could be improved, but not a new issue.
Behavior change:
- When the Preferences are opened as a regular editor, the "execution" region in the preferences that displays the *Save Preferences* button would still be there, but empty with a scrollbar.
This patch makes it disappear entirely.
## Implementation
- Introduces `ARegionType.poll()`
- Before a window is drawn, all contained regions have their poll checked, and the result is stored in a flag (`RGN_FLAG_POLL_FAILED` - runtime-only flag).
- If the result of the poll changes, the area is re-initialized and event handlers are added/removed.
- UI code checks the flag as needed.
Pull Request: https://projects.blender.org/blender/blender/pulls/105088
2023-04-05 15:30:32 +02:00
|
|
|
case SEQ_VIEW_PREVIEW:
|
|
|
|
/* Reset scrolling when preview region just appears. */
|
|
|
|
if (!(region_preview->v2d.flag & V2D_IS_INIT)) {
|
|
|
|
region_preview->v2d.cur = region_preview->v2d.tot;
|
|
|
|
/* Only redraw, don't re-init. */
|
|
|
|
ED_area_tag_redraw(area);
|
2011-09-05 21:34:27 +02:00
|
|
|
}
|
UI: Region polling support
Introduces *ARegionType.poll()* as a way to dynamically add/remove a region. The region is still there internally, but is not accessible to the user.
Previously editors would to this manually, by either removing/adding regions altogether, or hiding them, unsetting their alignment (so no AZones are added I assume) and removing their event handlers. Polling makes this much simpler.
We plan to use this in #102879.
This patch refactors multiple editors to use region polling:
- File Browser
- Sequencer
- Clip Editor
- Preferences
Notes:
- Previously, editors would lazy-create some of the regions. Versioning is added here to ensure they are always there. Could be a separate patch.
- Some editors reuse a region in different display modes, and so additional work needs to be done to reinit regions they become available or the mode changes. Typically `V2D_IS_INIT` is unset for that, which isn't great. Could be improved, but not a new issue.
Behavior change:
- When the Preferences are opened as a regular editor, the "execution" region in the preferences that displays the *Save Preferences* button would still be there, but empty with a scrollbar.
This patch makes it disappear entirely.
## Implementation
- Introduces `ARegionType.poll()`
- Before a window is drawn, all contained regions have their poll checked, and the result is stored in a flag (`RGN_FLAG_POLL_FAILED` - runtime-only flag).
- If the result of the poll changes, the area is re-initialized and event handlers are added/removed.
- UI code checks the flag as needed.
Pull Request: https://projects.blender.org/blender/blender/pulls/105088
2023-04-05 15:30:32 +02:00
|
|
|
if (region_preview->alignment != RGN_ALIGN_NONE) {
|
2020-04-03 12:51:03 +02:00
|
|
|
region_preview->alignment = RGN_ALIGN_NONE;
|
2013-11-25 20:39:14 +01:00
|
|
|
view_changed = true;
|
2011-09-05 21:34:27 +02:00
|
|
|
}
|
|
|
|
break;
|
UI: Region polling support
Introduces *ARegionType.poll()* as a way to dynamically add/remove a region. The region is still there internally, but is not accessible to the user.
Previously editors would to this manually, by either removing/adding regions altogether, or hiding them, unsetting their alignment (so no AZones are added I assume) and removing their event handlers. Polling makes this much simpler.
We plan to use this in #102879.
This patch refactors multiple editors to use region polling:
- File Browser
- Sequencer
- Clip Editor
- Preferences
Notes:
- Previously, editors would lazy-create some of the regions. Versioning is added here to ensure they are always there. Could be a separate patch.
- Some editors reuse a region in different display modes, and so additional work needs to be done to reinit regions they become available or the mode changes. Typically `V2D_IS_INIT` is unset for that, which isn't great. Could be improved, but not a new issue.
Behavior change:
- When the Preferences are opened as a regular editor, the "execution" region in the preferences that displays the *Save Preferences* button would still be there, but empty with a scrollbar.
This patch makes it disappear entirely.
## Implementation
- Introduces `ARegionType.poll()`
- Before a window is drawn, all contained regions have their poll checked, and the result is stored in a flag (`RGN_FLAG_POLL_FAILED` - runtime-only flag).
- If the result of the poll changes, the area is re-initialized and event handlers are added/removed.
- UI code checks the flag as needed.
Pull Request: https://projects.blender.org/blender/blender/pulls/105088
2023-04-05 15:30:32 +02:00
|
|
|
case SEQ_VIEW_SEQUENCE_PREVIEW: {
|
|
|
|
/* Get available height (without DPI correction). */
|
|
|
|
const float height = (area->winy - ED_area_headersize()) / UI_SCALE_FAC;
|
|
|
|
|
|
|
|
/* We reuse hidden region's size, allows to find same layout as before if we just switch
|
|
|
|
* between one 'full window' view and the combined one. This gets lost if we switch to both
|
|
|
|
* 'full window' views before, though... Better than nothing. */
|
|
|
|
if (!(region_preview->v2d.flag & V2D_IS_INIT)) {
|
2020-04-03 12:51:03 +02:00
|
|
|
region_preview->v2d.cur = region_preview->v2d.tot;
|
2023-07-14 04:23:37 +02:00
|
|
|
region_main->sizey = int(height - region_preview->sizey);
|
|
|
|
region_preview->sizey = int(height - region_main->sizey);
|
2013-11-25 20:39:14 +01:00
|
|
|
view_changed = true;
|
2011-09-05 21:34:27 +02:00
|
|
|
}
|
UI: Region polling support
Introduces *ARegionType.poll()* as a way to dynamically add/remove a region. The region is still there internally, but is not accessible to the user.
Previously editors would to this manually, by either removing/adding regions altogether, or hiding them, unsetting their alignment (so no AZones are added I assume) and removing their event handlers. Polling makes this much simpler.
We plan to use this in #102879.
This patch refactors multiple editors to use region polling:
- File Browser
- Sequencer
- Clip Editor
- Preferences
Notes:
- Previously, editors would lazy-create some of the regions. Versioning is added here to ensure they are always there. Could be a separate patch.
- Some editors reuse a region in different display modes, and so additional work needs to be done to reinit regions they become available or the mode changes. Typically `V2D_IS_INIT` is unset for that, which isn't great. Could be improved, but not a new issue.
Behavior change:
- When the Preferences are opened as a regular editor, the "execution" region in the preferences that displays the *Save Preferences* button would still be there, but empty with a scrollbar.
This patch makes it disappear entirely.
## Implementation
- Introduces `ARegionType.poll()`
- Before a window is drawn, all contained regions have their poll checked, and the result is stored in a flag (`RGN_FLAG_POLL_FAILED` - runtime-only flag).
- If the result of the poll changes, the area is re-initialized and event handlers are added/removed.
- UI code checks the flag as needed.
Pull Request: https://projects.blender.org/blender/blender/pulls/105088
2023-04-05 15:30:32 +02:00
|
|
|
if (region_preview->alignment != RGN_ALIGN_TOP) {
|
|
|
|
region_preview->alignment = RGN_ALIGN_TOP;
|
2013-11-25 20:39:14 +01:00
|
|
|
view_changed = true;
|
2011-09-05 21:34:27 +02:00
|
|
|
}
|
UI: Region polling support
Introduces *ARegionType.poll()* as a way to dynamically add/remove a region. The region is still there internally, but is not accessible to the user.
Previously editors would to this manually, by either removing/adding regions altogether, or hiding them, unsetting their alignment (so no AZones are added I assume) and removing their event handlers. Polling makes this much simpler.
We plan to use this in #102879.
This patch refactors multiple editors to use region polling:
- File Browser
- Sequencer
- Clip Editor
- Preferences
Notes:
- Previously, editors would lazy-create some of the regions. Versioning is added here to ensure they are always there. Could be a separate patch.
- Some editors reuse a region in different display modes, and so additional work needs to be done to reinit regions they become available or the mode changes. Typically `V2D_IS_INIT` is unset for that, which isn't great. Could be improved, but not a new issue.
Behavior change:
- When the Preferences are opened as a regular editor, the "execution" region in the preferences that displays the *Save Preferences* button would still be there, but empty with a scrollbar.
This patch makes it disappear entirely.
## Implementation
- Introduces `ARegionType.poll()`
- Before a window is drawn, all contained regions have their poll checked, and the result is stored in a flag (`RGN_FLAG_POLL_FAILED` - runtime-only flag).
- If the result of the poll changes, the area is re-initialized and event handlers are added/removed.
- UI code checks the flag as needed.
Pull Request: https://projects.blender.org/blender/blender/pulls/105088
2023-04-05 15:30:32 +02:00
|
|
|
/* Final check that both preview and main height are reasonable. */
|
|
|
|
if (region_preview->sizey < 10 || region_main->sizey < 10 ||
|
|
|
|
region_preview->sizey + region_main->sizey > height)
|
|
|
|
{
|
|
|
|
region_preview->sizey = roundf(height * 0.4f);
|
2023-07-14 04:23:37 +02:00
|
|
|
region_main->sizey = int(height - region_preview->sizey);
|
2013-11-25 20:39:14 +01:00
|
|
|
view_changed = true;
|
2011-09-05 21:34:27 +02:00
|
|
|
}
|
|
|
|
break;
|
2022-04-22 02:48:51 +02:00
|
|
|
}
|
UI: Region polling support
Introduces *ARegionType.poll()* as a way to dynamically add/remove a region. The region is still there internally, but is not accessible to the user.
Previously editors would to this manually, by either removing/adding regions altogether, or hiding them, unsetting their alignment (so no AZones are added I assume) and removing their event handlers. Polling makes this much simpler.
We plan to use this in #102879.
This patch refactors multiple editors to use region polling:
- File Browser
- Sequencer
- Clip Editor
- Preferences
Notes:
- Previously, editors would lazy-create some of the regions. Versioning is added here to ensure they are always there. Could be a separate patch.
- Some editors reuse a region in different display modes, and so additional work needs to be done to reinit regions they become available or the mode changes. Typically `V2D_IS_INIT` is unset for that, which isn't great. Could be improved, but not a new issue.
Behavior change:
- When the Preferences are opened as a regular editor, the "execution" region in the preferences that displays the *Save Preferences* button would still be there, but empty with a scrollbar.
This patch makes it disappear entirely.
## Implementation
- Introduces `ARegionType.poll()`
- Before a window is drawn, all contained regions have their poll checked, and the result is stored in a flag (`RGN_FLAG_POLL_FAILED` - runtime-only flag).
- If the result of the poll changes, the area is re-initialized and event handlers are added/removed.
- UI code checks the flag as needed.
Pull Request: https://projects.blender.org/blender/blender/pulls/105088
2023-04-05 15:30:32 +02:00
|
|
|
case SEQ_VIEW_SEQUENCE:
|
|
|
|
break;
|
2022-04-22 02:48:51 +02:00
|
|
|
}
|
|
|
|
|
2012-03-24 07:38:07 +01:00
|
|
|
if (view_changed) {
|
2020-08-01 05:02:21 +02:00
|
|
|
ED_area_init(wm, window, area);
|
2020-04-03 13:25:03 +02:00
|
|
|
ED_area_tag_redraw(area);
|
2011-09-05 21:34:27 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-12-18 02:52:18 +01:00
|
|
|
static SpaceLink *sequencer_duplicate(SpaceLink *sl)
|
|
|
|
{
|
2023-06-14 18:36:17 +02:00
|
|
|
SpaceSeq *sseqn = static_cast<SpaceSeq *>(MEM_dupallocN(sl));
|
2018-06-04 09:31:30 +02:00
|
|
|
|
2020-04-05 23:55:51 +02:00
|
|
|
/* Clear or remove stuff from old. */
|
|
|
|
/* XXX sseq->gpd = gpencil_data_duplicate(sseq->gpd, false); */
|
2008-12-14 15:43:08 +01:00
|
|
|
|
2014-01-02 12:43:47 +01:00
|
|
|
memset(&sseqn->scopes, 0, sizeof(sseqn->scopes));
|
2021-09-22 09:37:10 +02:00
|
|
|
memset(&sseqn->runtime, 0, sizeof(sseqn->runtime));
|
2014-01-02 12:43:47 +01:00
|
|
|
|
2008-12-14 15:43:08 +01:00
|
|
|
return (SpaceLink *)sseqn;
|
|
|
|
}
|
|
|
|
|
2021-01-19 02:59:00 +01:00
|
|
|
static void sequencer_listener(const wmSpaceTypeListenerParams *params)
|
Color Management, Stage 2: Switch color pipeline to use OpenColorIO
Replace old color pipeline which was supporting linear/sRGB color spaces
only with OpenColorIO-based pipeline.
This introduces two configurable color spaces:
- Input color space for images and movie clips. This space is used to convert
images/movies from color space in which file is saved to Blender's linear
space (for float images, byte images are not internally converted, only input
space is stored for such images and used later).
This setting could be found in image/clip data block settings.
- Display color space which defines space in which particular display is working.
This settings could be found in scene's Color Management panel.
When render result is being displayed on the screen, apart from converting image
to display space, some additional conversions could happen.
This conversions are:
- View, which defines tone curve applying before display transformation.
These are different ways to view the image on the same display device.
For example it could be used to emulate film view on sRGB display.
- Exposure affects on image exposure before tone map is applied.
- Gamma is post-display gamma correction, could be used to match particular
display gamma.
- RGB curves are user-defined curves which are applying before display
transformation, could be used for different purposes.
All this settings by default are only applying on render result and does not
affect on other images. If some particular image needs to be affected by this
transformation, "View as Render" setting of image data block should be set to
truth. Movie clips are always affected by all display transformations.
This commit also introduces configurable color space in which sequencer is
working. This setting could be found in scene's Color Management panel and
it should be used if such stuff as grading needs to be done in color space
different from sRGB (i.e. when Film view on sRGB display is use, using VD16
space as sequencer's internal space would make grading working in space
which is close to the space using for display).
Some technical notes:
- Image buffer's float buffer is now always in linear space, even if it was
created from 16bit byte images.
- Space of byte buffer is stored in image buffer's rect_colorspace property.
- Profile of image buffer was removed since it's not longer meaningful.
- OpenGL and GLSL is supposed to always work in sRGB space. It is possible
to support other spaces, but it's quite large project which isn't so
much important.
- Legacy Color Management option disabled is emulated by using None display.
It could have some regressions, but there's no clear way to avoid them.
- If OpenColorIO is disabled on build time, it should make blender behaving
in the same way as previous release with color management enabled.
More details could be found at this page (more details would be added soon):
http://wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.64/Color_Management
--
Thanks to Xavier Thomas, Lukas Toene for initial work on OpenColorIO
integration and to Brecht van Lommel for some further development and code/
usecase review!
2012-09-15 12:05:07 +02:00
|
|
|
{
|
2021-01-19 00:28:47 +01:00
|
|
|
ScrArea *area = params->area;
|
2022-08-27 04:50:43 +02:00
|
|
|
const wmNotifier *wmn = params->notifier;
|
2021-01-19 00:28:47 +01:00
|
|
|
|
2020-04-05 23:55:51 +02:00
|
|
|
/* Context changes. */
|
Color Management, Stage 2: Switch color pipeline to use OpenColorIO
Replace old color pipeline which was supporting linear/sRGB color spaces
only with OpenColorIO-based pipeline.
This introduces two configurable color spaces:
- Input color space for images and movie clips. This space is used to convert
images/movies from color space in which file is saved to Blender's linear
space (for float images, byte images are not internally converted, only input
space is stored for such images and used later).
This setting could be found in image/clip data block settings.
- Display color space which defines space in which particular display is working.
This settings could be found in scene's Color Management panel.
When render result is being displayed on the screen, apart from converting image
to display space, some additional conversions could happen.
This conversions are:
- View, which defines tone curve applying before display transformation.
These are different ways to view the image on the same display device.
For example it could be used to emulate film view on sRGB display.
- Exposure affects on image exposure before tone map is applied.
- Gamma is post-display gamma correction, could be used to match particular
display gamma.
- RGB curves are user-defined curves which are applying before display
transformation, could be used for different purposes.
All this settings by default are only applying on render result and does not
affect on other images. If some particular image needs to be affected by this
transformation, "View as Render" setting of image data block should be set to
truth. Movie clips are always affected by all display transformations.
This commit also introduces configurable color space in which sequencer is
working. This setting could be found in scene's Color Management panel and
it should be used if such stuff as grading needs to be done in color space
different from sRGB (i.e. when Film view on sRGB display is use, using VD16
space as sequencer's internal space would make grading working in space
which is close to the space using for display).
Some technical notes:
- Image buffer's float buffer is now always in linear space, even if it was
created from 16bit byte images.
- Space of byte buffer is stored in image buffer's rect_colorspace property.
- Profile of image buffer was removed since it's not longer meaningful.
- OpenGL and GLSL is supposed to always work in sRGB space. It is possible
to support other spaces, but it's quite large project which isn't so
much important.
- Legacy Color Management option disabled is emulated by using None display.
It could have some regressions, but there's no clear way to avoid them.
- If OpenColorIO is disabled on build time, it should make blender behaving
in the same way as previous release with color management enabled.
More details could be found at this page (more details would be added soon):
http://wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.64/Color_Management
--
Thanks to Xavier Thomas, Lukas Toene for initial work on OpenColorIO
integration and to Brecht van Lommel for some further development and code/
usecase review!
2012-09-15 12:05:07 +02:00
|
|
|
switch (wmn->category) {
|
|
|
|
case NC_SCENE:
|
|
|
|
switch (wmn->data) {
|
|
|
|
case ND_FRAME:
|
|
|
|
case ND_SEQUENCER:
|
2020-04-03 13:25:03 +02:00
|
|
|
sequencer_scopes_tag_refresh(area);
|
Color Management, Stage 2: Switch color pipeline to use OpenColorIO
Replace old color pipeline which was supporting linear/sRGB color spaces
only with OpenColorIO-based pipeline.
This introduces two configurable color spaces:
- Input color space for images and movie clips. This space is used to convert
images/movies from color space in which file is saved to Blender's linear
space (for float images, byte images are not internally converted, only input
space is stored for such images and used later).
This setting could be found in image/clip data block settings.
- Display color space which defines space in which particular display is working.
This settings could be found in scene's Color Management panel.
When render result is being displayed on the screen, apart from converting image
to display space, some additional conversions could happen.
This conversions are:
- View, which defines tone curve applying before display transformation.
These are different ways to view the image on the same display device.
For example it could be used to emulate film view on sRGB display.
- Exposure affects on image exposure before tone map is applied.
- Gamma is post-display gamma correction, could be used to match particular
display gamma.
- RGB curves are user-defined curves which are applying before display
transformation, could be used for different purposes.
All this settings by default are only applying on render result and does not
affect on other images. If some particular image needs to be affected by this
transformation, "View as Render" setting of image data block should be set to
truth. Movie clips are always affected by all display transformations.
This commit also introduces configurable color space in which sequencer is
working. This setting could be found in scene's Color Management panel and
it should be used if such stuff as grading needs to be done in color space
different from sRGB (i.e. when Film view on sRGB display is use, using VD16
space as sequencer's internal space would make grading working in space
which is close to the space using for display).
Some technical notes:
- Image buffer's float buffer is now always in linear space, even if it was
created from 16bit byte images.
- Space of byte buffer is stored in image buffer's rect_colorspace property.
- Profile of image buffer was removed since it's not longer meaningful.
- OpenGL and GLSL is supposed to always work in sRGB space. It is possible
to support other spaces, but it's quite large project which isn't so
much important.
- Legacy Color Management option disabled is emulated by using None display.
It could have some regressions, but there's no clear way to avoid them.
- If OpenColorIO is disabled on build time, it should make blender behaving
in the same way as previous release with color management enabled.
More details could be found at this page (more details would be added soon):
http://wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.64/Color_Management
--
Thanks to Xavier Thomas, Lukas Toene for initial work on OpenColorIO
integration and to Brecht van Lommel for some further development and code/
usecase review!
2012-09-15 12:05:07 +02:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
break;
|
2013-04-02 14:41:11 +02:00
|
|
|
case NC_WINDOW:
|
Color Management, Stage 2: Switch color pipeline to use OpenColorIO
Replace old color pipeline which was supporting linear/sRGB color spaces
only with OpenColorIO-based pipeline.
This introduces two configurable color spaces:
- Input color space for images and movie clips. This space is used to convert
images/movies from color space in which file is saved to Blender's linear
space (for float images, byte images are not internally converted, only input
space is stored for such images and used later).
This setting could be found in image/clip data block settings.
- Display color space which defines space in which particular display is working.
This settings could be found in scene's Color Management panel.
When render result is being displayed on the screen, apart from converting image
to display space, some additional conversions could happen.
This conversions are:
- View, which defines tone curve applying before display transformation.
These are different ways to view the image on the same display device.
For example it could be used to emulate film view on sRGB display.
- Exposure affects on image exposure before tone map is applied.
- Gamma is post-display gamma correction, could be used to match particular
display gamma.
- RGB curves are user-defined curves which are applying before display
transformation, could be used for different purposes.
All this settings by default are only applying on render result and does not
affect on other images. If some particular image needs to be affected by this
transformation, "View as Render" setting of image data block should be set to
truth. Movie clips are always affected by all display transformations.
This commit also introduces configurable color space in which sequencer is
working. This setting could be found in scene's Color Management panel and
it should be used if such stuff as grading needs to be done in color space
different from sRGB (i.e. when Film view on sRGB display is use, using VD16
space as sequencer's internal space would make grading working in space
which is close to the space using for display).
Some technical notes:
- Image buffer's float buffer is now always in linear space, even if it was
created from 16bit byte images.
- Space of byte buffer is stored in image buffer's rect_colorspace property.
- Profile of image buffer was removed since it's not longer meaningful.
- OpenGL and GLSL is supposed to always work in sRGB space. It is possible
to support other spaces, but it's quite large project which isn't so
much important.
- Legacy Color Management option disabled is emulated by using None display.
It could have some regressions, but there's no clear way to avoid them.
- If OpenColorIO is disabled on build time, it should make blender behaving
in the same way as previous release with color management enabled.
More details could be found at this page (more details would be added soon):
http://wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.64/Color_Management
--
Thanks to Xavier Thomas, Lukas Toene for initial work on OpenColorIO
integration and to Brecht van Lommel for some further development and code/
usecase review!
2012-09-15 12:05:07 +02:00
|
|
|
case NC_SPACE:
|
2019-03-26 11:16:47 +01:00
|
|
|
if (wmn->data == ND_SPACE_SEQUENCER) {
|
2020-04-03 13:25:03 +02:00
|
|
|
sequencer_scopes_tag_refresh(area);
|
2019-03-26 11:16:47 +01:00
|
|
|
}
|
Color Management, Stage 2: Switch color pipeline to use OpenColorIO
Replace old color pipeline which was supporting linear/sRGB color spaces
only with OpenColorIO-based pipeline.
This introduces two configurable color spaces:
- Input color space for images and movie clips. This space is used to convert
images/movies from color space in which file is saved to Blender's linear
space (for float images, byte images are not internally converted, only input
space is stored for such images and used later).
This setting could be found in image/clip data block settings.
- Display color space which defines space in which particular display is working.
This settings could be found in scene's Color Management panel.
When render result is being displayed on the screen, apart from converting image
to display space, some additional conversions could happen.
This conversions are:
- View, which defines tone curve applying before display transformation.
These are different ways to view the image on the same display device.
For example it could be used to emulate film view on sRGB display.
- Exposure affects on image exposure before tone map is applied.
- Gamma is post-display gamma correction, could be used to match particular
display gamma.
- RGB curves are user-defined curves which are applying before display
transformation, could be used for different purposes.
All this settings by default are only applying on render result and does not
affect on other images. If some particular image needs to be affected by this
transformation, "View as Render" setting of image data block should be set to
truth. Movie clips are always affected by all display transformations.
This commit also introduces configurable color space in which sequencer is
working. This setting could be found in scene's Color Management panel and
it should be used if such stuff as grading needs to be done in color space
different from sRGB (i.e. when Film view on sRGB display is use, using VD16
space as sequencer's internal space would make grading working in space
which is close to the space using for display).
Some technical notes:
- Image buffer's float buffer is now always in linear space, even if it was
created from 16bit byte images.
- Space of byte buffer is stored in image buffer's rect_colorspace property.
- Profile of image buffer was removed since it's not longer meaningful.
- OpenGL and GLSL is supposed to always work in sRGB space. It is possible
to support other spaces, but it's quite large project which isn't so
much important.
- Legacy Color Management option disabled is emulated by using None display.
It could have some regressions, but there's no clear way to avoid them.
- If OpenColorIO is disabled on build time, it should make blender behaving
in the same way as previous release with color management enabled.
More details could be found at this page (more details would be added soon):
http://wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.64/Color_Management
--
Thanks to Xavier Thomas, Lukas Toene for initial work on OpenColorIO
integration and to Brecht van Lommel for some further development and code/
usecase review!
2012-09-15 12:05:07 +02:00
|
|
|
break;
|
Grease Pencil - Storyboarding Features (merge from GPencil_EditStrokes branch)
This merge-commit brings in a number of new features and workflow/UI improvements for
working with Grease Pencil. While these were originally targetted at improving
the workflow for creating 3D storyboards in Blender using the Grease Pencil,
many of these changes should also prove useful in other workflows too.
The main highlights here are:
1) It is now possible to edit Grease Pencil strokes
- Use D Tab, or toggle the "Enable Editing" toggles in the Toolbar/Properties regions
to enter "Stroke Edit Mode". In this mode, many common editing tools will
operate on Grease Pencil stroke points instead.
- Tools implemented include Select, Select All/Border/Circle/Linked/More/Less,
Grab, Rotate, Scale, Bend, Shear, To Sphere, Mirror, Duplicate, Delete.
- Proportional Editing works when using the transform tools
2) Grease Pencil stroke settings can now be animated
NOTE: Currently drivers don't work, but if time allows, this may still be
added before the release.
3) Strokes can be drawn with "filled" interiors, using a separate set of
colour/opacity settings to the ones used for the lines themselves.
This makes use of OpenGL filled polys, which has the limitation of only
being able to fill convex shapes. Some artifacts may be visible on concave
shapes (e.g. pacman's mouth will be overdrawn)
4) "Volumetric Strokes" - An alternative drawing technique for stroke drawing
has been added which draws strokes as a series of screen-aligned discs.
While this was originally a partial experimental technique at getting better
quality 3D lines, the effects possible using this technique were interesting
enough to warrant making this a dedicated feature. Best results when partial
opacity and large stroke widths are used.
5) Improved Onion Skinning Support
- Different colours can be selected for the before/after ghosts. To do so,
enable the "colour wheel" toggle beside the Onion Skinning toggle, and set
the colours accordingly.
- Different numbers of ghosts can be shown before/after the current frame
6) Grease Pencil datablocks are now attached to the scene by default instead of
the active object.
- For a long time, the object-attachment has proved to be quite problematic
for users to keep track of. Now that this is done at scene level, it is
easier for most users to use.
- An exception for old files (and for any addons which may benefit from object
attachment instead), is that if the active object has a Grease Pencil datablock,
that will be used instead.
- It is not currently possible to choose object-attachment from the UI, but
it is simple to do this from the console instead, by doing:
context.active_object.grease_pencil = bpy.data.grease_pencil["blah"]
7) Various UI Cleanups
- The layers UI has been cleaned up to use a list instead of the nested-panels
design. Apart from saving space, this is also much nicer to look at now.
- The UI code is now all defined in Python. To support this, it has been necessary
to add some new context properties to make it easier to access these settings.
e.g. "gpencil_data" for the datablock
"active_gpencil_layer" and "active_gpencil_frame" for active data,
"editable_gpencil_strokes" for the strokes that can be edited
- The "stroke placement/alignment" settings (previously "Drawing Settings" at the
bottom of the Grease Pencil panel in the Properties Region) is now located in
the toolbar. These were more toolsettings than properties for how GPencil got drawn.
- "Use Sketching Sessions" has been renamed "Continuous Drawing", as per a
suggestion for an earlier discussion on developer.blender.org
- By default, the painting operator will wait for a mouse button to be pressed
before it starts creating the stroke. This is to make it easier to include
this operator in various toolbars/menus/etc. To get it immediately starting
(as when you hold down DKEy to draw), set "wait_for_input" to False.
- GPencil Layers can be rearranged in the "Grease Pencil" mode of the Action Editor
- Toolbar panels have been added to all the other editors which support these.
8) Pie menus for quick-access to tools
A set of experimental pie menus has been included for quick access to many
tools and settings. It is not necessary to use these to get things done,
but they have been designed to help make certain common tasks easier.
- Ctrl-D = The main pie menu. Reveals tools in a context sensitive and
spatially stable manner.
- D Q = "Quick Settings" pie. This allows quick access to the active
layer's settings. Notably, colours, thickness, and turning
onion skinning on/off.
2014-11-30 13:52:06 +01:00
|
|
|
case NC_GPENCIL:
|
2019-03-26 11:16:47 +01:00
|
|
|
if (wmn->data & ND_GPENCIL_EDITMODE) {
|
2020-04-03 13:25:03 +02:00
|
|
|
ED_area_tag_redraw(area);
|
2019-03-26 11:16:47 +01:00
|
|
|
}
|
Grease Pencil - Storyboarding Features (merge from GPencil_EditStrokes branch)
This merge-commit brings in a number of new features and workflow/UI improvements for
working with Grease Pencil. While these were originally targetted at improving
the workflow for creating 3D storyboards in Blender using the Grease Pencil,
many of these changes should also prove useful in other workflows too.
The main highlights here are:
1) It is now possible to edit Grease Pencil strokes
- Use D Tab, or toggle the "Enable Editing" toggles in the Toolbar/Properties regions
to enter "Stroke Edit Mode". In this mode, many common editing tools will
operate on Grease Pencil stroke points instead.
- Tools implemented include Select, Select All/Border/Circle/Linked/More/Less,
Grab, Rotate, Scale, Bend, Shear, To Sphere, Mirror, Duplicate, Delete.
- Proportional Editing works when using the transform tools
2) Grease Pencil stroke settings can now be animated
NOTE: Currently drivers don't work, but if time allows, this may still be
added before the release.
3) Strokes can be drawn with "filled" interiors, using a separate set of
colour/opacity settings to the ones used for the lines themselves.
This makes use of OpenGL filled polys, which has the limitation of only
being able to fill convex shapes. Some artifacts may be visible on concave
shapes (e.g. pacman's mouth will be overdrawn)
4) "Volumetric Strokes" - An alternative drawing technique for stroke drawing
has been added which draws strokes as a series of screen-aligned discs.
While this was originally a partial experimental technique at getting better
quality 3D lines, the effects possible using this technique were interesting
enough to warrant making this a dedicated feature. Best results when partial
opacity and large stroke widths are used.
5) Improved Onion Skinning Support
- Different colours can be selected for the before/after ghosts. To do so,
enable the "colour wheel" toggle beside the Onion Skinning toggle, and set
the colours accordingly.
- Different numbers of ghosts can be shown before/after the current frame
6) Grease Pencil datablocks are now attached to the scene by default instead of
the active object.
- For a long time, the object-attachment has proved to be quite problematic
for users to keep track of. Now that this is done at scene level, it is
easier for most users to use.
- An exception for old files (and for any addons which may benefit from object
attachment instead), is that if the active object has a Grease Pencil datablock,
that will be used instead.
- It is not currently possible to choose object-attachment from the UI, but
it is simple to do this from the console instead, by doing:
context.active_object.grease_pencil = bpy.data.grease_pencil["blah"]
7) Various UI Cleanups
- The layers UI has been cleaned up to use a list instead of the nested-panels
design. Apart from saving space, this is also much nicer to look at now.
- The UI code is now all defined in Python. To support this, it has been necessary
to add some new context properties to make it easier to access these settings.
e.g. "gpencil_data" for the datablock
"active_gpencil_layer" and "active_gpencil_frame" for active data,
"editable_gpencil_strokes" for the strokes that can be edited
- The "stroke placement/alignment" settings (previously "Drawing Settings" at the
bottom of the Grease Pencil panel in the Properties Region) is now located in
the toolbar. These were more toolsettings than properties for how GPencil got drawn.
- "Use Sketching Sessions" has been renamed "Continuous Drawing", as per a
suggestion for an earlier discussion on developer.blender.org
- By default, the painting operator will wait for a mouse button to be pressed
before it starts creating the stroke. This is to make it easier to include
this operator in various toolbars/menus/etc. To get it immediately starting
(as when you hold down DKEy to draw), set "wait_for_input" to False.
- GPencil Layers can be rearranged in the "Grease Pencil" mode of the Action Editor
- Toolbar panels have been added to all the other editors which support these.
8) Pie menus for quick-access to tools
A set of experimental pie menus has been included for quick access to many
tools and settings. It is not necessary to use these to get things done,
but they have been designed to help make certain common tasks easier.
- Ctrl-D = The main pie menu. Reveals tools in a context sensitive and
spatially stable manner.
- D Q = "Quick Settings" pie. This allows quick access to the active
layer's settings. Notably, colours, thickness, and turning
onion skinning on/off.
2014-11-30 13:52:06 +01:00
|
|
|
break;
|
Color Management, Stage 2: Switch color pipeline to use OpenColorIO
Replace old color pipeline which was supporting linear/sRGB color spaces
only with OpenColorIO-based pipeline.
This introduces two configurable color spaces:
- Input color space for images and movie clips. This space is used to convert
images/movies from color space in which file is saved to Blender's linear
space (for float images, byte images are not internally converted, only input
space is stored for such images and used later).
This setting could be found in image/clip data block settings.
- Display color space which defines space in which particular display is working.
This settings could be found in scene's Color Management panel.
When render result is being displayed on the screen, apart from converting image
to display space, some additional conversions could happen.
This conversions are:
- View, which defines tone curve applying before display transformation.
These are different ways to view the image on the same display device.
For example it could be used to emulate film view on sRGB display.
- Exposure affects on image exposure before tone map is applied.
- Gamma is post-display gamma correction, could be used to match particular
display gamma.
- RGB curves are user-defined curves which are applying before display
transformation, could be used for different purposes.
All this settings by default are only applying on render result and does not
affect on other images. If some particular image needs to be affected by this
transformation, "View as Render" setting of image data block should be set to
truth. Movie clips are always affected by all display transformations.
This commit also introduces configurable color space in which sequencer is
working. This setting could be found in scene's Color Management panel and
it should be used if such stuff as grading needs to be done in color space
different from sRGB (i.e. when Film view on sRGB display is use, using VD16
space as sequencer's internal space would make grading working in space
which is close to the space using for display).
Some technical notes:
- Image buffer's float buffer is now always in linear space, even if it was
created from 16bit byte images.
- Space of byte buffer is stored in image buffer's rect_colorspace property.
- Profile of image buffer was removed since it's not longer meaningful.
- OpenGL and GLSL is supposed to always work in sRGB space. It is possible
to support other spaces, but it's quite large project which isn't so
much important.
- Legacy Color Management option disabled is emulated by using None display.
It could have some regressions, but there's no clear way to avoid them.
- If OpenColorIO is disabled on build time, it should make blender behaving
in the same way as previous release with color management enabled.
More details could be found at this page (more details would be added soon):
http://wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.64/Color_Management
--
Thanks to Xavier Thomas, Lukas Toene for initial work on OpenColorIO
integration and to Brecht van Lommel for some further development and code/
usecase review!
2012-09-15 12:05:07 +02:00
|
|
|
}
|
|
|
|
}
|
Drag and drop 2.5 integration! Finally, slashdot regulars can use
Blender too now! :)
** Drag works as follows:
- drag-able items are defined by the standard interface ui toolkit
- each button can get this feature, via uiButSetDragXXX(but, ...).
There are calls to define drag-able images, ID blocks, RNA paths,
file paths, and so on. By default you drag an icon, exceptionally
an ImBuf
- Drag items are registered centrally in the WM, it allows more drag
items simultaneous too, but not implemented
** Drop works as follows:
- On mouse release, and if drag items exist in the WM, it converts
the mouse event to an EVT_DROP type. This event then gets the full
drag info as customdata
- drop regions are defined with WM_dropbox_add(), similar to keymaps
you can make a "drop map" this way, which become 'drop map handlers'
in the queues.
- next to that the UI kit handles some common button types (like
accepting ID or names) to be catching a drop event too.
- Every "drop box" has two callbacks:
- poll() = check if the event drag data is relevant for this box
- copy() = fill in custom properties in the dropbox to initialize
an operator
- The dropbox handler then calls its standard Operator with its
dropbox properties.
** Currently implemented
Drag items:
- ID icons in browse buttons
- ID icons in context menu of properties region
- ID icons in outliner and rna viewer
- FileBrowser icons
- FileBrowser preview images
Drag-able icons are subtly visualized by making them brighter a bit
on mouse-over. In case the icon is a button or UI element too (most
cases), the drag-able feature will make the item react to
mouse-release instead of mouse-press.
Drop options:
- UI buttons: ID and text buttons (paste name)
- View3d: Object ID drop copies object
- View3d: Material ID drop assigns to object under cursor
- View3d: Image ID drop assigns to object UV texture under cursor
- Sequencer: Path drop will add either Image or Movie strip
- Image window: Path drop will open image
** Drag and drop Notes:
- Dropping into another Blender window (from same application) works
too. I've added code that passes on mousemoves and clicks to other
windows, without activating them though. This does make using multi-window
Blender a bit friendler.
- Dropping a file path to an image, is not the same as dropping an
Image ID... keep this in mind. Sequencer for example wants paths to
be dropped, textures in 3d window wants an Image ID.
- Although drop boxes could be defined via Python, I suggest they're
part of the UI and editor design (= how we want an editor to work), and
not default offered configurable like keymaps.
- At the moment only one item can be dragged at a time. This is for
several reasons.... For one, Blender doesn't have a well defined
uniform way to define "what is selected" (files, outliner items, etc).
Secondly there's potential conflicts on what todo when you drop mixed
drag sets on spots. All undefined stuff... nice for later.
- Example to bypass the above: a collection of images that form a strip,
should be represented in filewindow as a single sequence anyway.
This then will fit well and gets handled neatly by design.
- Another option to check is to allow multiple options per drop... it
could show the operator as a sort of menu, allowing arrow or scrollwheel
to choose. For time being I'd prefer to try to design a singular drop
though, just offer only one drop action per data type on given spots.
- What does work already, but a tad slow, is to use a function that
detects an object (type) under cursor, so a drag item's option can be
further refined (like drop object on object = parent). (disabled)
** More notes
- Added saving for Region layouts (like split points for toolbar)
- Label buttons now handle mouse over
- File list: added full path entry for drop feature.
- Filesel bugfix: wm_operator_exec() got called there and fully handled,
while WM event code tried same. Added new OPERATOR_HANDLED flag for this.
Maybe python needs it too?
- Cocoa: added window move event, so multi-win setups work OK (didnt save).
- Interface_handlers.c: removed win->active
- Severe area copy bug: area handlers were not set to NULL
- Filesel bugfix: next/prev folder list was not copied on area copies
** Leftover todos
- Cocoa windows seem to hang on cases still... needs check
- Cocoa 'draw overlap' swap doesn't work
- Cocoa window loses focus permanently on using Spotlight
(for these reasons, makefile building has Carbon as default atm)
- ListView templates in UI cannot become dragged yet, needs review...
it consists of two overlapping UI elements, preventing handling icon clicks.
- There's already Ghost library code to handle dropping from OS
into Blender window. I've noticed this code is unfinished for Macs, but
seems to be complete for Windows. Needs test... currently, an external
drop event will print in console when succesfully delivered to Blender's WM.
2010-01-26 19:18:21 +01:00
|
|
|
|
2017-08-06 17:35:41 +02:00
|
|
|
/* DO NOT make this static, this hides the symbol and breaks API generation script. */
|
2023-06-14 18:36:17 +02:00
|
|
|
extern "C" const char *sequencer_context_dir[]; /* Quiet warning. */
|
|
|
|
const char *sequencer_context_dir[] = {"edit_mask", nullptr};
|
2012-06-07 21:24:49 +02:00
|
|
|
|
Cleanup: Use enum for return values in context callbacks
Define enum `eContextResult` and use its values for returns, instead of
just returning 1, 0, or -1 (and always having some comment that explains
what -1 means).
This also cleans up the mixup between returning `0` and `false`, and `1`
and `true`. An inconsistency was discovered during this cleanup, and
marked with `TODO(sybren)`. It's not fixed here, as it would consititute
a functional change.
The enum isn't used everywhere, as enums in C and C++ can have different
storage sizes. To prevent issues, callback functions are still declared
as returning`int`. To at least make things easier to understand for
humans, I marked those with `int /*eContextResult*/`.
This is a followup of D9090, and is intended to unify how context
callbacks return values. This will make it easier to extend the approach
in D9090 to those functions.
No functional changes.
Differential Revision: https://developer.blender.org/D9095
2020-10-02 18:56:25 +02:00
|
|
|
static int /*eContextResult*/ sequencer_context(const bContext *C,
|
|
|
|
const char *member,
|
|
|
|
bContextDataResult *result)
|
2012-06-07 21:24:49 +02:00
|
|
|
{
|
|
|
|
Scene *scene = CTX_data_scene(C);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-06-07 21:24:49 +02:00
|
|
|
if (CTX_data_dir(member)) {
|
|
|
|
CTX_data_dir_set(result, sequencer_context_dir);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
Cleanup: Use enum for return values in context callbacks
Define enum `eContextResult` and use its values for returns, instead of
just returning 1, 0, or -1 (and always having some comment that explains
what -1 means).
This also cleans up the mixup between returning `0` and `false`, and `1`
and `true`. An inconsistency was discovered during this cleanup, and
marked with `TODO(sybren)`. It's not fixed here, as it would consititute
a functional change.
The enum isn't used everywhere, as enums in C and C++ can have different
storage sizes. To prevent issues, callback functions are still declared
as returning`int`. To at least make things easier to understand for
humans, I marked those with `int /*eContextResult*/`.
This is a followup of D9090, and is intended to unify how context
callbacks return values. This will make it easier to extend the approach
in D9090 to those functions.
No functional changes.
Differential Revision: https://developer.blender.org/D9095
2020-10-02 18:56:25 +02:00
|
|
|
return CTX_RESULT_OK;
|
2012-06-07 21:24:49 +02:00
|
|
|
}
|
2020-07-03 17:20:58 +02:00
|
|
|
if (CTX_data_equals(member, "edit_mask")) {
|
2020-12-19 05:57:27 +01:00
|
|
|
Mask *mask = SEQ_active_mask_get(scene);
|
2012-07-24 11:53:29 +02:00
|
|
|
if (mask) {
|
|
|
|
CTX_data_id_pointer_set(result, &mask->id);
|
2012-06-07 21:24:49 +02:00
|
|
|
}
|
Cleanup: Use enum for return values in context callbacks
Define enum `eContextResult` and use its values for returns, instead of
just returning 1, 0, or -1 (and always having some comment that explains
what -1 means).
This also cleans up the mixup between returning `0` and `false`, and `1`
and `true`. An inconsistency was discovered during this cleanup, and
marked with `TODO(sybren)`. It's not fixed here, as it would consititute
a functional change.
The enum isn't used everywhere, as enums in C and C++ can have different
storage sizes. To prevent issues, callback functions are still declared
as returning`int`. To at least make things easier to understand for
humans, I marked those with `int /*eContextResult*/`.
This is a followup of D9090, and is intended to unify how context
callbacks return values. This will make it easier to extend the approach
in D9090 to those functions.
No functional changes.
Differential Revision: https://developer.blender.org/D9095
2020-10-02 18:56:25 +02:00
|
|
|
return CTX_RESULT_OK;
|
2012-06-07 21:24:49 +02:00
|
|
|
}
|
2019-04-17 06:17:24 +02:00
|
|
|
|
Cleanup: Use enum for return values in context callbacks
Define enum `eContextResult` and use its values for returns, instead of
just returning 1, 0, or -1 (and always having some comment that explains
what -1 means).
This also cleans up the mixup between returning `0` and `false`, and `1`
and `true`. An inconsistency was discovered during this cleanup, and
marked with `TODO(sybren)`. It's not fixed here, as it would consititute
a functional change.
The enum isn't used everywhere, as enums in C and C++ can have different
storage sizes. To prevent issues, callback functions are still declared
as returning`int`. To at least make things easier to understand for
humans, I marked those with `int /*eContextResult*/`.
This is a followup of D9090, and is intended to unify how context
callbacks return values. This will make it easier to extend the approach
in D9090 to those functions.
No functional changes.
Differential Revision: https://developer.blender.org/D9095
2020-10-02 18:56:25 +02:00
|
|
|
return CTX_RESULT_MEMBER_NOT_FOUND;
|
2012-06-07 21:24:49 +02:00
|
|
|
}
|
|
|
|
|
2019-05-31 13:45:28 +02:00
|
|
|
static void SEQUENCER_GGT_navigate(wmGizmoGroupType *gzgt)
|
|
|
|
{
|
|
|
|
VIEW2D_GGT_navigate_impl(gzgt, "SEQUENCER_GGT_navigate");
|
|
|
|
}
|
|
|
|
|
2021-09-21 09:38:30 +02:00
|
|
|
static void SEQUENCER_GGT_gizmo2d(wmGizmoGroupType *gzgt)
|
|
|
|
{
|
|
|
|
gzgt->name = "Sequencer Transform Gizmo";
|
|
|
|
gzgt->idname = "SEQUENCER_GGT_gizmo2d";
|
|
|
|
|
|
|
|
gzgt->flag |= (WM_GIZMOGROUPTYPE_TOOL_FALLBACK_KEYMAP |
|
|
|
|
WM_GIZMOGROUPTYPE_DELAY_REFRESH_FOR_TWEAK);
|
|
|
|
|
|
|
|
gzgt->gzmap_params.spaceid = SPACE_SEQ;
|
|
|
|
gzgt->gzmap_params.regionid = RGN_TYPE_PREVIEW;
|
|
|
|
|
|
|
|
ED_widgetgroup_gizmo2d_xform_callbacks_set(gzgt);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void SEQUENCER_GGT_gizmo2d_translate(wmGizmoGroupType *gzgt)
|
|
|
|
{
|
|
|
|
gzgt->name = "Sequencer Translate Gizmo";
|
|
|
|
gzgt->idname = "SEQUENCER_GGT_gizmo2d_translate";
|
|
|
|
|
|
|
|
gzgt->flag |= (WM_GIZMOGROUPTYPE_TOOL_FALLBACK_KEYMAP |
|
|
|
|
WM_GIZMOGROUPTYPE_DELAY_REFRESH_FOR_TWEAK);
|
|
|
|
|
|
|
|
gzgt->gzmap_params.spaceid = SPACE_SEQ;
|
|
|
|
gzgt->gzmap_params.regionid = RGN_TYPE_PREVIEW;
|
|
|
|
|
|
|
|
ED_widgetgroup_gizmo2d_xform_no_cage_callbacks_set(gzgt);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void SEQUENCER_GGT_gizmo2d_resize(wmGizmoGroupType *gzgt)
|
|
|
|
{
|
|
|
|
gzgt->name = "Sequencer Transform Gizmo Resize";
|
|
|
|
gzgt->idname = "SEQUENCER_GGT_gizmo2d_resize";
|
|
|
|
|
|
|
|
gzgt->flag |= (WM_GIZMOGROUPTYPE_TOOL_FALLBACK_KEYMAP |
|
|
|
|
WM_GIZMOGROUPTYPE_DELAY_REFRESH_FOR_TWEAK);
|
|
|
|
|
|
|
|
gzgt->gzmap_params.spaceid = SPACE_SEQ;
|
|
|
|
gzgt->gzmap_params.regionid = RGN_TYPE_PREVIEW;
|
|
|
|
|
|
|
|
ED_widgetgroup_gizmo2d_resize_callbacks_set(gzgt);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void SEQUENCER_GGT_gizmo2d_rotate(wmGizmoGroupType *gzgt)
|
|
|
|
{
|
|
|
|
gzgt->name = "Sequencer Transform Gizmo Resize";
|
|
|
|
gzgt->idname = "SEQUENCER_GGT_gizmo2d_rotate";
|
|
|
|
|
|
|
|
gzgt->flag |= (WM_GIZMOGROUPTYPE_TOOL_FALLBACK_KEYMAP |
|
|
|
|
WM_GIZMOGROUPTYPE_DELAY_REFRESH_FOR_TWEAK);
|
|
|
|
|
|
|
|
gzgt->gzmap_params.spaceid = SPACE_SEQ;
|
|
|
|
gzgt->gzmap_params.regionid = RGN_TYPE_PREVIEW;
|
|
|
|
|
|
|
|
ED_widgetgroup_gizmo2d_rotate_callbacks_set(gzgt);
|
|
|
|
}
|
|
|
|
|
2023-07-02 11:37:22 +02:00
|
|
|
static void sequencer_gizmos()
|
2019-05-31 13:45:28 +02:00
|
|
|
{
|
2023-06-14 18:36:17 +02:00
|
|
|
const wmGizmoMapType_Params params = {SPACE_SEQ, RGN_TYPE_PREVIEW};
|
|
|
|
wmGizmoMapType *gzmap_type = WM_gizmomaptype_ensure(¶ms);
|
2019-05-31 13:45:28 +02:00
|
|
|
|
2023-06-14 04:47:53 +02:00
|
|
|
WM_gizmotype_append(GIZMO_GT_retime_handle_add);
|
|
|
|
WM_gizmotype_append(GIZMO_GT_retime_handle);
|
|
|
|
WM_gizmotype_append(GIZMO_GT_retime_remove);
|
|
|
|
WM_gizmotype_append(GIZMO_GT_speed_set_remove);
|
|
|
|
|
2021-09-21 09:38:30 +02:00
|
|
|
WM_gizmogrouptype_append(SEQUENCER_GGT_gizmo2d);
|
|
|
|
WM_gizmogrouptype_append(SEQUENCER_GGT_gizmo2d_translate);
|
|
|
|
WM_gizmogrouptype_append(SEQUENCER_GGT_gizmo2d_resize);
|
|
|
|
WM_gizmogrouptype_append(SEQUENCER_GGT_gizmo2d_rotate);
|
2023-06-14 04:47:53 +02:00
|
|
|
WM_gizmogrouptype_append(SEQUENCER_GGT_gizmo_retime);
|
2021-09-21 09:38:30 +02:00
|
|
|
|
2019-05-31 13:45:28 +02:00
|
|
|
WM_gizmogrouptype_append_and_link(gzmap_type, SEQUENCER_GGT_navigate);
|
|
|
|
}
|
|
|
|
|
2014-08-06 17:14:55 +02:00
|
|
|
/* *********************** sequencer (main) region ************************ */
|
UI: Region polling support
Introduces *ARegionType.poll()* as a way to dynamically add/remove a region. The region is still there internally, but is not accessible to the user.
Previously editors would to this manually, by either removing/adding regions altogether, or hiding them, unsetting their alignment (so no AZones are added I assume) and removing their event handlers. Polling makes this much simpler.
We plan to use this in #102879.
This patch refactors multiple editors to use region polling:
- File Browser
- Sequencer
- Clip Editor
- Preferences
Notes:
- Previously, editors would lazy-create some of the regions. Versioning is added here to ensure they are always there. Could be a separate patch.
- Some editors reuse a region in different display modes, and so additional work needs to be done to reinit regions they become available or the mode changes. Typically `V2D_IS_INIT` is unset for that, which isn't great. Could be improved, but not a new issue.
Behavior change:
- When the Preferences are opened as a regular editor, the "execution" region in the preferences that displays the *Save Preferences* button would still be there, but empty with a scrollbar.
This patch makes it disappear entirely.
## Implementation
- Introduces `ARegionType.poll()`
- Before a window is drawn, all contained regions have their poll checked, and the result is stored in a flag (`RGN_FLAG_POLL_FAILED` - runtime-only flag).
- If the result of the poll changes, the area is re-initialized and event handlers are added/removed.
- UI code checks the flag as needed.
Pull Request: https://projects.blender.org/blender/blender/pulls/105088
2023-04-05 15:30:32 +02:00
|
|
|
|
|
|
|
static bool sequencer_main_region_poll(const RegionPollParams *params)
|
|
|
|
{
|
|
|
|
const SpaceSeq *sseq = (SpaceSeq *)params->area->spacedata.first;
|
|
|
|
return ELEM(sseq->view, SEQ_VIEW_SEQUENCE, SEQ_VIEW_SEQUENCE_PREVIEW);
|
|
|
|
}
|
|
|
|
|
2020-04-05 23:55:51 +02:00
|
|
|
/* Add handlers, stuff you only do once or on area/region changes. */
|
2020-03-06 16:56:42 +01:00
|
|
|
static void sequencer_main_region_init(wmWindowManager *wm, ARegion *region)
|
2008-12-14 15:43:08 +01:00
|
|
|
{
|
2014-08-06 17:14:55 +02:00
|
|
|
wmKeyMap *keymap;
|
|
|
|
ListBase *lb;
|
|
|
|
|
2020-03-06 16:56:42 +01:00
|
|
|
UI_view2d_region_reinit(®ion->v2d, V2D_COMMONVIEW_CUSTOM, region->winx, region->winy);
|
2014-08-06 17:14:55 +02:00
|
|
|
|
|
|
|
#if 0
|
2018-08-31 05:36:14 +02:00
|
|
|
keymap = WM_keymap_ensure(wm->defaultconf, "Mask Editing", 0, 0);
|
2020-03-06 16:56:42 +01:00
|
|
|
WM_event_add_keymap_handler_v2d_mask(®ion->handlers, keymap);
|
2014-08-06 17:14:55 +02:00
|
|
|
#endif
|
|
|
|
|
2018-08-31 05:36:14 +02:00
|
|
|
keymap = WM_keymap_ensure(wm->defaultconf, "SequencerCommon", SPACE_SEQ, 0);
|
2020-03-06 16:56:42 +01:00
|
|
|
WM_event_add_keymap_handler_v2d_mask(®ion->handlers, keymap);
|
2014-08-06 17:14:55 +02:00
|
|
|
|
2020-04-05 23:55:51 +02:00
|
|
|
/* Own keymap. */
|
2018-08-31 05:36:14 +02:00
|
|
|
keymap = WM_keymap_ensure(wm->defaultconf, "Sequencer", SPACE_SEQ, 0);
|
2020-03-06 16:56:42 +01:00
|
|
|
WM_event_add_keymap_handler_v2d_mask(®ion->handlers, keymap);
|
2014-08-06 17:14:55 +02:00
|
|
|
|
2020-04-05 23:55:51 +02:00
|
|
|
/* Add drop boxes. */
|
2014-08-06 17:14:55 +02:00
|
|
|
lb = WM_dropboxmap_find("Sequencer", SPACE_SEQ, RGN_TYPE_WINDOW);
|
|
|
|
|
2020-03-06 16:56:42 +01:00
|
|
|
WM_event_add_dropbox_handler(®ion->handlers, lb);
|
2008-12-14 15:43:08 +01:00
|
|
|
}
|
|
|
|
|
2020-04-05 23:55:51 +02:00
|
|
|
/* Strip editing timeline. */
|
2020-03-06 16:56:42 +01:00
|
|
|
static void sequencer_main_region_draw(const bContext *C, ARegion *region)
|
2008-12-14 15:43:08 +01:00
|
|
|
{
|
2020-03-06 16:56:42 +01:00
|
|
|
draw_timeline_seq(C, region);
|
2008-12-14 15:43:08 +01:00
|
|
|
}
|
|
|
|
|
2020-06-23 07:59:34 +02:00
|
|
|
/* Strip editing timeline. */
|
|
|
|
static void sequencer_main_region_draw_overlay(const bContext *C, ARegion *region)
|
|
|
|
{
|
|
|
|
draw_timeline_seq_display(C, region);
|
|
|
|
}
|
|
|
|
|
2022-04-28 16:07:57 +02:00
|
|
|
static void sequencer_main_clamp_view(const bContext *C, ARegion *region)
|
|
|
|
{
|
|
|
|
SpaceSeq *sseq = CTX_wm_space_seq(C);
|
|
|
|
|
|
|
|
if ((sseq->flag & SEQ_CLAMP_VIEW) == 0) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
View2D *v2d = ®ion->v2d;
|
2022-06-29 12:45:59 +02:00
|
|
|
Scene *scene = CTX_data_scene(C);
|
|
|
|
Editing *ed = SEQ_editing_get(scene);
|
2022-04-28 16:07:57 +02:00
|
|
|
|
2023-06-14 18:36:17 +02:00
|
|
|
if (ed == nullptr) {
|
2022-05-03 09:46:38 +02:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2022-04-28 16:07:57 +02:00
|
|
|
/* Transformation uses edge panning to move view. Also if smooth view is running, don't apply
|
|
|
|
* clamping to prevent overriding this functionality. */
|
2023-06-14 18:36:17 +02:00
|
|
|
if (G.moving || v2d->smooth_timer != nullptr) {
|
2022-04-28 16:07:57 +02:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Initialize default view with 7 channels, that are visible even if empty. */
|
|
|
|
rctf strip_boundbox;
|
2022-11-29 19:49:40 +01:00
|
|
|
BLI_rctf_init(&strip_boundbox, 0.0f, 0.0f, 1.0f, 6.0f);
|
2022-06-29 12:45:59 +02:00
|
|
|
SEQ_timeline_expand_boundbox(scene, ed->seqbasep, &strip_boundbox);
|
2022-04-28 16:07:57 +02:00
|
|
|
|
|
|
|
/* Clamp Y max. Scrubbing area height must be added, so strips aren't occluded. */
|
|
|
|
rcti scrub_rect;
|
|
|
|
ED_time_scrub_region_rect_get(region, &scrub_rect);
|
|
|
|
const float pixel_view_size_y = BLI_rctf_size_y(&v2d->cur) / BLI_rcti_size_y(&v2d->mask);
|
|
|
|
const float scrub_bar_height = BLI_rcti_size_y(&scrub_rect) * pixel_view_size_y;
|
|
|
|
|
2022-11-29 19:49:40 +01:00
|
|
|
/* Channel n has range of <n, n+1>, +1 for empty channel. */
|
|
|
|
strip_boundbox.ymax += 2.0f + scrub_bar_height;
|
2022-04-28 16:07:57 +02:00
|
|
|
|
|
|
|
/* Clamp Y min. Scroller and marker area height must be added, so strips aren't occluded. */
|
|
|
|
float scroll_bar_height = v2d->hor.ymax * pixel_view_size_y;
|
|
|
|
|
|
|
|
ListBase *markers = ED_context_get_markers(C);
|
2023-06-14 18:36:17 +02:00
|
|
|
if (markers != nullptr && !BLI_listbase_is_empty(markers)) {
|
2022-04-28 16:07:57 +02:00
|
|
|
float markers_size = UI_MARKER_MARGIN_Y * pixel_view_size_y;
|
|
|
|
strip_boundbox.ymin -= markers_size;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
strip_boundbox.ymin -= scroll_bar_height;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* If strip is deleted, don't move view automatically, keep current range until it is changed. */
|
|
|
|
strip_boundbox.ymax = max_ff(sseq->runtime.timeline_clamp_custom_range, strip_boundbox.ymax);
|
|
|
|
|
|
|
|
rctf view_clamped = v2d->cur;
|
|
|
|
|
|
|
|
const float range_y = BLI_rctf_size_y(&view_clamped);
|
|
|
|
if (view_clamped.ymax > strip_boundbox.ymax) {
|
|
|
|
view_clamped.ymax = strip_boundbox.ymax;
|
|
|
|
view_clamped.ymin = max_ff(strip_boundbox.ymin, strip_boundbox.ymax - range_y);
|
|
|
|
}
|
|
|
|
if (view_clamped.ymin < strip_boundbox.ymin) {
|
|
|
|
view_clamped.ymin = strip_boundbox.ymin;
|
|
|
|
view_clamped.ymax = min_ff(strip_boundbox.ymax, strip_boundbox.ymin + range_y);
|
|
|
|
}
|
2022-05-03 10:53:20 +02:00
|
|
|
|
|
|
|
v2d->cur = view_clamped;
|
2022-04-28 16:07:57 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static void sequencer_main_region_clamp_custom_set(const bContext *C, ARegion *region)
|
|
|
|
{
|
|
|
|
SpaceSeq *sseq = CTX_wm_space_seq(C);
|
|
|
|
View2D *v2d = ®ion->v2d;
|
|
|
|
|
|
|
|
if ((v2d->flag & V2D_IS_NAVIGATING) == 0) {
|
|
|
|
sseq->runtime.timeline_clamp_custom_range = v2d->cur.ymax;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void sequencer_main_region_layout(const bContext *C, ARegion *region)
|
|
|
|
{
|
|
|
|
sequencer_main_region_clamp_custom_set(C, region);
|
|
|
|
sequencer_main_clamp_view(C, region);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void sequencer_main_region_view2d_changed(const bContext *C, ARegion *region)
|
|
|
|
{
|
|
|
|
sequencer_main_region_clamp_custom_set(C, region);
|
|
|
|
sequencer_main_clamp_view(C, region);
|
|
|
|
}
|
|
|
|
|
2021-01-19 02:59:00 +01:00
|
|
|
static void sequencer_main_region_listener(const wmRegionListenerParams *params)
|
2008-12-14 15:43:08 +01:00
|
|
|
{
|
2021-01-19 00:28:47 +01:00
|
|
|
ARegion *region = params->region;
|
2022-08-27 04:50:43 +02:00
|
|
|
const wmNotifier *wmn = params->notifier;
|
2021-01-19 00:28:47 +01:00
|
|
|
|
2020-04-05 23:55:51 +02:00
|
|
|
/* Context changes. */
|
2012-03-30 00:26:11 +02:00
|
|
|
switch (wmn->category) {
|
Added back some functionality to the sequencer
- removed static vars _last_seq, last_imagename and last_sounddir, replacing them with with vars in the "Editing" struct. didnt manage to get the active sequence to load so currently thats lost when loading.
- removed flag SEQ_ACTIVE
- Added operators cut, mute, unmute, deselect_all, select_invert, select, select_more, select_less, select_pick_linked, select_linked and borderselect.
2009-01-19 22:42:18 +01:00
|
|
|
case NC_SCENE:
|
2012-03-30 00:26:11 +02:00
|
|
|
switch (wmn->data) {
|
Added back some functionality to the sequencer
- removed static vars _last_seq, last_imagename and last_sounddir, replacing them with with vars in the "Editing" struct. didnt manage to get the active sequence to load so currently thats lost when loading.
- removed flag SEQ_ACTIVE
- Added operators cut, mute, unmute, deselect_all, select_invert, select, select_more, select_less, select_pick_linked, select_linked and borderselect.
2009-01-19 22:42:18 +01:00
|
|
|
case ND_FRAME:
|
2010-06-26 21:17:48 +02:00
|
|
|
case ND_FRAME_RANGE:
|
Added back some functionality to the sequencer
- removed static vars _last_seq, last_imagename and last_sounddir, replacing them with with vars in the "Editing" struct. didnt manage to get the active sequence to load so currently thats lost when loading.
- removed flag SEQ_ACTIVE
- Added operators cut, mute, unmute, deselect_all, select_invert, select, select_more, select_less, select_pick_linked, select_linked and borderselect.
2009-01-19 22:42:18 +01:00
|
|
|
case ND_MARKERS:
|
2020-04-05 23:55:51 +02:00
|
|
|
case ND_RENDER_OPTIONS: /* For FPS and FPS Base. */
|
2009-01-21 08:01:20 +01:00
|
|
|
case ND_SEQUENCER:
|
2013-09-03 18:02:55 +02:00
|
|
|
case ND_RENDER_RESULT:
|
2020-03-06 16:56:42 +01:00
|
|
|
ED_region_tag_redraw(region);
|
2023-06-14 04:47:53 +02:00
|
|
|
WM_gizmomap_tag_refresh(region->gizmo_map);
|
Added back some functionality to the sequencer
- removed static vars _last_seq, last_imagename and last_sounddir, replacing them with with vars in the "Editing" struct. didnt manage to get the active sequence to load so currently thats lost when loading.
- removed flag SEQ_ACTIVE
- Added operators cut, mute, unmute, deselect_all, select_invert, select, select_more, select_less, select_pick_linked, select_linked and borderselect.
2009-01-19 22:42:18 +01:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
break;
|
2015-02-05 11:51:09 +01:00
|
|
|
case NC_ANIMATION:
|
|
|
|
switch (wmn->data) {
|
|
|
|
case ND_KEYFRAME:
|
2020-03-06 16:56:42 +01:00
|
|
|
ED_region_tag_redraw(region);
|
2015-02-05 11:51:09 +01:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
break;
|
2.5
Notifiers
---------
Various fixes for wrong use of notifiers, and some new notifiers
to make things a bit more clear and consistent, with two notable
changes:
* Geometry changes are now done with NC_GEOM, rather than
NC_OBJECT|ND_GEOM_, so an object does need to be available.
* Space data now use NC_SPACE|ND_SPACE_*, instead of data
notifiers or even NC_WINDOW in some cases. Note that NC_SPACE
should only be used for notifying about changes in space data,
we don't want to go back to allqueue(REDRAW..).
Depsgraph
---------
The dependency graph now has a different flush call:
DAG_object_flush_update(scene, ob, flag)
is replaced by:
DAG_id_flush_update(id, flag)
It still works basically the same, one difference is that it now
also accepts object data (e.g. Mesh), again to avoid requiring an
Object to be available. Other ID types will simply do nothing at
the moment.
Docs
----
I made some guidelines for how/when to do which kinds of updates
and notifiers. I can't specify totally exact how to make these
decisions, but these are basically the guidelines I use. So, new
and updated docs are here:
http://wiki.blender.org/index.php/BlenderDev/Blender2.5/NotifiersUpdates
http://wiki.blender.org/index.php/BlenderDev/Blender2.5/DataNotifiers
2009-09-04 22:51:09 +02:00
|
|
|
case NC_SPACE:
|
2019-03-26 11:16:47 +01:00
|
|
|
if (wmn->data == ND_SPACE_SEQUENCER) {
|
2020-03-06 16:56:42 +01:00
|
|
|
ED_region_tag_redraw(region);
|
2023-06-14 04:47:53 +02:00
|
|
|
WM_gizmomap_tag_refresh(region->gizmo_map);
|
2019-03-26 11:16:47 +01:00
|
|
|
}
|
2.5
Notifiers
---------
Various fixes for wrong use of notifiers, and some new notifiers
to make things a bit more clear and consistent, with two notable
changes:
* Geometry changes are now done with NC_GEOM, rather than
NC_OBJECT|ND_GEOM_, so an object does need to be available.
* Space data now use NC_SPACE|ND_SPACE_*, instead of data
notifiers or even NC_WINDOW in some cases. Note that NC_SPACE
should only be used for notifying about changes in space data,
we don't want to go back to allqueue(REDRAW..).
Depsgraph
---------
The dependency graph now has a different flush call:
DAG_object_flush_update(scene, ob, flag)
is replaced by:
DAG_id_flush_update(id, flag)
It still works basically the same, one difference is that it now
also accepts object data (e.g. Mesh), again to avoid requiring an
Object to be available. Other ID types will simply do nothing at
the moment.
Docs
----
I made some guidelines for how/when to do which kinds of updates
and notifiers. I can't specify totally exact how to make these
decisions, but these are basically the guidelines I use. So, new
and updated docs are here:
http://wiki.blender.org/index.php/BlenderDev/Blender2.5/NotifiersUpdates
http://wiki.blender.org/index.php/BlenderDev/Blender2.5/DataNotifiers
2009-09-04 22:51:09 +02:00
|
|
|
break;
|
2009-12-10 10:58:10 +01:00
|
|
|
case NC_ID:
|
2019-03-26 11:16:47 +01:00
|
|
|
if (wmn->action == NA_RENAME) {
|
2020-03-06 16:56:42 +01:00
|
|
|
ED_region_tag_redraw(region);
|
2019-03-26 11:16:47 +01:00
|
|
|
}
|
2009-12-10 10:58:10 +01:00
|
|
|
break;
|
2012-07-03 17:01:54 +02:00
|
|
|
case NC_SCREEN:
|
2019-03-26 11:16:47 +01:00
|
|
|
if (ELEM(wmn->data, ND_ANIMPLAY)) {
|
2020-03-06 16:56:42 +01:00
|
|
|
ED_region_tag_redraw(region);
|
2023-06-14 04:47:53 +02:00
|
|
|
WM_gizmomap_tag_refresh(region->gizmo_map);
|
2019-03-26 11:16:47 +01:00
|
|
|
}
|
2012-07-03 17:01:54 +02:00
|
|
|
break;
|
Added back some functionality to the sequencer
- removed static vars _last_seq, last_imagename and last_sounddir, replacing them with with vars in the "Editing" struct. didnt manage to get the active sequence to load so currently thats lost when loading.
- removed flag SEQ_ACTIVE
- Added operators cut, mute, unmute, deselect_all, select_invert, select, select_more, select_less, select_pick_linked, select_linked and borderselect.
2009-01-19 22:42:18 +01:00
|
|
|
}
|
2008-12-14 15:43:08 +01:00
|
|
|
}
|
|
|
|
|
2021-01-19 02:59:00 +01:00
|
|
|
static void sequencer_main_region_message_subscribe(const wmRegionMessageSubscribeParams *params)
|
2018-04-19 18:44:57 +02:00
|
|
|
{
|
2023-06-14 18:36:17 +02:00
|
|
|
wmMsgBus *mbus = params->message_bus;
|
2021-01-19 00:28:47 +01:00
|
|
|
Scene *scene = params->scene;
|
|
|
|
ARegion *region = params->region;
|
|
|
|
|
2023-06-14 18:36:17 +02:00
|
|
|
wmMsgSubscribeValue msg_sub_value_region_tag_redraw{};
|
|
|
|
msg_sub_value_region_tag_redraw.owner = region;
|
|
|
|
msg_sub_value_region_tag_redraw.user_data = region;
|
|
|
|
msg_sub_value_region_tag_redraw.notify = ED_region_do_msg_notify_tag_redraw;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2018-04-19 18:44:57 +02:00
|
|
|
/* Timeline depends on scene properties. */
|
|
|
|
{
|
|
|
|
bool use_preview = (scene->r.flag & SCER_PRV_RANGE);
|
|
|
|
const PropertyRNA *props[] = {
|
|
|
|
use_preview ? &rna_Scene_frame_preview_start : &rna_Scene_frame_start,
|
|
|
|
use_preview ? &rna_Scene_frame_preview_end : &rna_Scene_frame_end,
|
|
|
|
&rna_Scene_use_preview_range,
|
|
|
|
&rna_Scene_frame_current,
|
|
|
|
};
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2018-04-19 18:44:57 +02:00
|
|
|
PointerRNA idptr;
|
|
|
|
RNA_id_pointer_create(&scene->id, &idptr);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2018-04-19 18:44:57 +02:00
|
|
|
for (int i = 0; i < ARRAY_SIZE(props); i++) {
|
|
|
|
WM_msg_subscribe_rna(mbus, &idptr, props[i], &msg_sub_value_region_tag_redraw, __func__);
|
2019-04-17 06:17:24 +02:00
|
|
|
}
|
2018-04-19 18:44:57 +02:00
|
|
|
}
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2018-10-30 01:14:23 +01:00
|
|
|
{
|
|
|
|
StructRNA *type_array[] = {
|
|
|
|
&RNA_SequenceEditor,
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2018-10-30 01:14:23 +01:00
|
|
|
&RNA_Sequence,
|
|
|
|
/* Members of 'Sequence'. */
|
|
|
|
&RNA_SequenceCrop,
|
|
|
|
&RNA_SequenceTransform,
|
|
|
|
&RNA_SequenceModifier,
|
|
|
|
&RNA_SequenceColorBalanceData,
|
|
|
|
};
|
2023-08-03 11:14:53 +02:00
|
|
|
wmMsgParams_RNA msg_key_params = {{nullptr}};
|
2018-10-30 01:14:23 +01:00
|
|
|
for (int i = 0; i < ARRAY_SIZE(type_array); i++) {
|
|
|
|
msg_key_params.ptr.type = type_array[i];
|
|
|
|
WM_msg_subscribe_rna_params(
|
|
|
|
mbus, &msg_key_params, &msg_sub_value_region_tag_redraw, __func__);
|
|
|
|
}
|
|
|
|
}
|
2018-04-19 18:44:57 +02:00
|
|
|
}
|
|
|
|
|
2014-08-06 17:14:55 +02:00
|
|
|
/* *********************** header region ************************ */
|
2020-04-05 23:55:51 +02:00
|
|
|
/* Add handlers, stuff you only do once or on area/region changes. */
|
2023-06-14 18:36:17 +02:00
|
|
|
static void sequencer_header_region_init(wmWindowManager * /*wm*/, ARegion *region)
|
2014-08-06 17:14:55 +02:00
|
|
|
{
|
2020-03-06 16:56:42 +01:00
|
|
|
ED_region_header_init(region);
|
2014-08-06 17:14:55 +02:00
|
|
|
}
|
|
|
|
|
2020-03-06 16:56:42 +01:00
|
|
|
static void sequencer_header_region_draw(const bContext *C, ARegion *region)
|
2014-08-06 17:14:55 +02:00
|
|
|
{
|
2020-03-06 16:56:42 +01:00
|
|
|
ED_region_header(C, region);
|
2014-08-06 17:14:55 +02:00
|
|
|
}
|
|
|
|
|
2020-01-22 14:54:44 +01:00
|
|
|
/* *********************** toolbar region ************************ */
|
2020-04-05 23:55:51 +02:00
|
|
|
/* Add handlers, stuff you only do once or on area/region changes. */
|
2020-03-06 16:56:42 +01:00
|
|
|
static void sequencer_tools_region_init(wmWindowManager *wm, ARegion *region)
|
2020-01-22 14:54:44 +01:00
|
|
|
{
|
|
|
|
wmKeyMap *keymap;
|
|
|
|
|
2020-03-06 16:56:42 +01:00
|
|
|
region->v2d.scroll = V2D_SCROLL_RIGHT | V2D_SCROLL_VERTICAL_HIDE;
|
|
|
|
ED_region_panels_init(wm, region);
|
2020-01-22 14:54:44 +01:00
|
|
|
|
|
|
|
keymap = WM_keymap_ensure(wm->defaultconf, "SequencerCommon", SPACE_SEQ, 0);
|
2020-03-06 16:56:42 +01:00
|
|
|
WM_event_add_keymap_handler_v2d_mask(®ion->handlers, keymap);
|
2020-01-22 14:54:44 +01:00
|
|
|
}
|
|
|
|
|
2020-03-06 16:56:42 +01:00
|
|
|
static void sequencer_tools_region_draw(const bContext *C, ARegion *region)
|
2020-01-22 14:54:44 +01:00
|
|
|
{
|
2020-03-06 16:56:42 +01:00
|
|
|
ED_region_panels(C, region);
|
2020-01-22 14:54:44 +01:00
|
|
|
}
|
2009-12-14 22:42:25 +01:00
|
|
|
/* *********************** preview region ************************ */
|
UI: Region polling support
Introduces *ARegionType.poll()* as a way to dynamically add/remove a region. The region is still there internally, but is not accessible to the user.
Previously editors would to this manually, by either removing/adding regions altogether, or hiding them, unsetting their alignment (so no AZones are added I assume) and removing their event handlers. Polling makes this much simpler.
We plan to use this in #102879.
This patch refactors multiple editors to use region polling:
- File Browser
- Sequencer
- Clip Editor
- Preferences
Notes:
- Previously, editors would lazy-create some of the regions. Versioning is added here to ensure they are always there. Could be a separate patch.
- Some editors reuse a region in different display modes, and so additional work needs to be done to reinit regions they become available or the mode changes. Typically `V2D_IS_INIT` is unset for that, which isn't great. Could be improved, but not a new issue.
Behavior change:
- When the Preferences are opened as a regular editor, the "execution" region in the preferences that displays the *Save Preferences* button would still be there, but empty with a scrollbar.
This patch makes it disappear entirely.
## Implementation
- Introduces `ARegionType.poll()`
- Before a window is drawn, all contained regions have their poll checked, and the result is stored in a flag (`RGN_FLAG_POLL_FAILED` - runtime-only flag).
- If the result of the poll changes, the area is re-initialized and event handlers are added/removed.
- UI code checks the flag as needed.
Pull Request: https://projects.blender.org/blender/blender/pulls/105088
2023-04-05 15:30:32 +02:00
|
|
|
|
|
|
|
static bool sequencer_preview_region_poll(const RegionPollParams *params)
|
|
|
|
{
|
|
|
|
const SpaceSeq *sseq = (SpaceSeq *)params->area->spacedata.first;
|
|
|
|
return ELEM(sseq->view, SEQ_VIEW_PREVIEW, SEQ_VIEW_SEQUENCE_PREVIEW);
|
|
|
|
}
|
|
|
|
|
2020-03-06 16:56:42 +01:00
|
|
|
static void sequencer_preview_region_init(wmWindowManager *wm, ARegion *region)
|
2009-12-14 22:42:25 +01:00
|
|
|
{
|
|
|
|
wmKeyMap *keymap;
|
2010-02-07 20:07:56 +01:00
|
|
|
|
2020-03-06 16:56:42 +01:00
|
|
|
UI_view2d_region_reinit(®ion->v2d, V2D_COMMONVIEW_CUSTOM, region->winx, region->winy);
|
2014-08-06 17:14:55 +02:00
|
|
|
|
|
|
|
#if 0
|
2018-08-31 05:36:14 +02:00
|
|
|
keymap = WM_keymap_ensure(wm->defaultconf, "Mask Editing", 0, 0);
|
2020-03-06 16:56:42 +01:00
|
|
|
WM_event_add_keymap_handler_v2d_mask(®ion->handlers, keymap);
|
2014-08-06 17:14:55 +02:00
|
|
|
#endif
|
2012-07-24 11:53:29 +02:00
|
|
|
|
2018-08-31 05:36:14 +02:00
|
|
|
keymap = WM_keymap_ensure(wm->defaultconf, "SequencerCommon", SPACE_SEQ, 0);
|
2020-03-06 16:56:42 +01:00
|
|
|
WM_event_add_keymap_handler_v2d_mask(®ion->handlers, keymap);
|
2009-12-14 22:42:25 +01:00
|
|
|
|
2020-04-05 23:55:51 +02:00
|
|
|
/* Own keymap. */
|
2018-08-31 05:36:14 +02:00
|
|
|
keymap = WM_keymap_ensure(wm->defaultconf, "SequencerPreview", SPACE_SEQ, 0);
|
2020-03-06 16:56:42 +01:00
|
|
|
WM_event_add_keymap_handler_v2d_mask(®ion->handlers, keymap);
|
2021-11-23 05:16:49 +01:00
|
|
|
|
|
|
|
ListBase *lb = WM_dropboxmap_find("Sequencer", SPACE_SEQ, RGN_TYPE_PREVIEW);
|
|
|
|
WM_event_add_dropbox_handler(®ion->handlers, lb);
|
2009-12-14 22:42:25 +01:00
|
|
|
}
|
|
|
|
|
2020-08-12 11:05:40 +02:00
|
|
|
static void sequencer_preview_region_layout(const bContext *C, ARegion *region)
|
|
|
|
{
|
|
|
|
SpaceSeq *sseq = CTX_wm_space_seq(C);
|
|
|
|
|
|
|
|
if (sseq->flag & SEQ_ZOOM_TO_FIT) {
|
|
|
|
View2D *v2d = ®ion->v2d;
|
|
|
|
v2d->cur = v2d->tot;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-06-14 18:36:17 +02:00
|
|
|
static void sequencer_preview_region_view2d_changed(const bContext *C, ARegion * /*region*/)
|
2020-08-12 11:05:40 +02:00
|
|
|
{
|
|
|
|
SpaceSeq *sseq = CTX_wm_space_seq(C);
|
|
|
|
sseq->flag &= ~SEQ_ZOOM_TO_FIT;
|
|
|
|
}
|
|
|
|
|
2021-11-02 09:35:17 +01:00
|
|
|
static bool is_cursor_visible(const SpaceSeq *sseq)
|
|
|
|
{
|
|
|
|
if (G.moving & G_TRANSFORM_CURSOR) {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
if ((sseq->flag & SEQ_SHOW_OVERLAY) &&
|
|
|
|
(sseq->preview_overlay.flag & SEQ_PREVIEW_SHOW_2D_CURSOR) != 0)
|
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2020-03-06 16:56:42 +01:00
|
|
|
static void sequencer_preview_region_draw(const bContext *C, ARegion *region)
|
2009-12-14 22:42:25 +01:00
|
|
|
{
|
2020-04-03 13:25:03 +02:00
|
|
|
ScrArea *area = CTX_wm_area(C);
|
2023-06-14 18:36:17 +02:00
|
|
|
SpaceSeq *sseq = static_cast<SpaceSeq *>(area->spacedata.first);
|
2012-03-30 00:26:11 +02:00
|
|
|
Scene *scene = CTX_data_scene(C);
|
2013-10-17 23:17:33 +02:00
|
|
|
wmWindowManager *wm = CTX_wm_manager(C);
|
2021-10-09 08:32:07 +02:00
|
|
|
const bool draw_overlay = sseq->flag & SEQ_SHOW_OVERLAY;
|
2021-10-11 10:10:54 +02:00
|
|
|
const bool draw_frame_overlay = (scene->ed &&
|
2021-10-18 06:47:28 +02:00
|
|
|
(scene->ed->overlay_frame_flag & SEQ_EDIT_OVERLAY_FRAME_SHOW) &&
|
2021-10-09 08:32:07 +02:00
|
|
|
draw_overlay);
|
2021-10-08 09:06:50 +02:00
|
|
|
const bool is_playing = ED_screen_animation_playing(wm);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2021-10-18 06:47:28 +02:00
|
|
|
if (!(draw_frame_overlay && (sseq->overlay_frame_type == SEQ_OVERLAY_FRAME_TYPE_REFERENCE))) {
|
2020-03-06 16:56:42 +01:00
|
|
|
sequencer_draw_preview(C, scene, region, sseq, scene->r.cfra, 0, false, false);
|
2019-03-26 11:16:47 +01:00
|
|
|
}
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2021-10-18 06:47:28 +02:00
|
|
|
if (draw_frame_overlay && sseq->overlay_frame_type != SEQ_OVERLAY_FRAME_TYPE_CURRENT) {
|
2010-07-08 12:03:29 +02:00
|
|
|
int over_cfra;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2021-10-18 06:47:28 +02:00
|
|
|
if (scene->ed->overlay_frame_flag & SEQ_EDIT_OVERLAY_FRAME_ABS) {
|
|
|
|
over_cfra = scene->ed->overlay_frame_abs;
|
2019-03-26 11:16:47 +01:00
|
|
|
}
|
|
|
|
else {
|
2021-10-18 06:47:28 +02:00
|
|
|
over_cfra = scene->r.cfra + scene->ed->overlay_frame_ofs;
|
2019-03-26 11:16:47 +01:00
|
|
|
}
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2021-10-18 06:47:28 +02:00
|
|
|
if ((over_cfra != scene->r.cfra) || (sseq->overlay_frame_type != SEQ_OVERLAY_FRAME_TYPE_RECT))
|
|
|
|
{
|
2019-02-27 22:48:27 +01:00
|
|
|
sequencer_draw_preview(
|
2020-03-06 16:56:42 +01:00
|
|
|
C, scene, region, sseq, scene->r.cfra, over_cfra - scene->r.cfra, true, false);
|
2019-03-26 11:16:47 +01:00
|
|
|
}
|
2010-07-08 12:03:29 +02:00
|
|
|
}
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2021-10-08 04:20:19 +02:00
|
|
|
/* No need to show the cursor for scopes. */
|
2021-11-02 09:35:17 +01:00
|
|
|
if ((is_playing == false) && (sseq->mainb == SEQ_DRAW_IMG_IMBUF) && is_cursor_visible(sseq)) {
|
2021-10-07 03:32:04 +02:00
|
|
|
GPU_color_mask(true, true, true, true);
|
|
|
|
GPU_depth_mask(false);
|
|
|
|
GPU_depth_test(GPU_DEPTH_NONE);
|
|
|
|
|
|
|
|
float cursor_pixel[2];
|
|
|
|
SEQ_image_preview_unit_to_px(scene, sseq->cursor, cursor_pixel);
|
|
|
|
|
|
|
|
DRW_draw_cursor_2d_ex(region, cursor_pixel);
|
|
|
|
}
|
|
|
|
|
2021-10-08 09:06:50 +02:00
|
|
|
if ((is_playing == false) && (sseq->gizmo_flag & SEQ_GIZMO_HIDE) == 0) {
|
2021-10-08 08:07:56 +02:00
|
|
|
WM_gizmomap_draw(region->gizmo_map, C, WM_GIZMOMAP_DRAWSTEP_2D);
|
|
|
|
}
|
2019-05-31 13:45:28 +02:00
|
|
|
|
2015-08-02 00:10:52 +02:00
|
|
|
if ((U.uiflag & USER_SHOW_FPS) && ED_screen_animation_no_scrub(wm)) {
|
2020-03-06 16:56:42 +01:00
|
|
|
const rcti *rect = ED_region_visible_rect(region);
|
2019-08-15 21:41:43 +02:00
|
|
|
int xoffset = rect->xmin + U.widget_unit;
|
|
|
|
int yoffset = rect->ymax;
|
2018-10-25 11:47:37 +02:00
|
|
|
ED_scene_draw_fps(scene, xoffset, &yoffset);
|
2013-10-17 23:17:33 +02:00
|
|
|
}
|
2009-12-14 22:42:25 +01:00
|
|
|
}
|
|
|
|
|
2021-01-19 02:59:00 +01:00
|
|
|
static void sequencer_preview_region_listener(const wmRegionListenerParams *params)
|
2009-12-14 22:42:25 +01:00
|
|
|
{
|
2021-01-19 00:28:47 +01:00
|
|
|
ARegion *region = params->region;
|
2022-08-27 04:50:43 +02:00
|
|
|
const wmNotifier *wmn = params->notifier;
|
2021-01-19 00:28:47 +01:00
|
|
|
|
2021-09-21 09:38:30 +02:00
|
|
|
WM_gizmomap_tag_refresh(region->gizmo_map);
|
|
|
|
|
2020-04-05 23:55:51 +02:00
|
|
|
/* Context changes. */
|
2012-03-30 00:26:11 +02:00
|
|
|
switch (wmn->category) {
|
2012-10-05 21:51:11 +02:00
|
|
|
case NC_GPENCIL:
|
Grease Pencil - Storyboarding Features (merge from GPencil_EditStrokes branch)
This merge-commit brings in a number of new features and workflow/UI improvements for
working with Grease Pencil. While these were originally targetted at improving
the workflow for creating 3D storyboards in Blender using the Grease Pencil,
many of these changes should also prove useful in other workflows too.
The main highlights here are:
1) It is now possible to edit Grease Pencil strokes
- Use D Tab, or toggle the "Enable Editing" toggles in the Toolbar/Properties regions
to enter "Stroke Edit Mode". In this mode, many common editing tools will
operate on Grease Pencil stroke points instead.
- Tools implemented include Select, Select All/Border/Circle/Linked/More/Less,
Grab, Rotate, Scale, Bend, Shear, To Sphere, Mirror, Duplicate, Delete.
- Proportional Editing works when using the transform tools
2) Grease Pencil stroke settings can now be animated
NOTE: Currently drivers don't work, but if time allows, this may still be
added before the release.
3) Strokes can be drawn with "filled" interiors, using a separate set of
colour/opacity settings to the ones used for the lines themselves.
This makes use of OpenGL filled polys, which has the limitation of only
being able to fill convex shapes. Some artifacts may be visible on concave
shapes (e.g. pacman's mouth will be overdrawn)
4) "Volumetric Strokes" - An alternative drawing technique for stroke drawing
has been added which draws strokes as a series of screen-aligned discs.
While this was originally a partial experimental technique at getting better
quality 3D lines, the effects possible using this technique were interesting
enough to warrant making this a dedicated feature. Best results when partial
opacity and large stroke widths are used.
5) Improved Onion Skinning Support
- Different colours can be selected for the before/after ghosts. To do so,
enable the "colour wheel" toggle beside the Onion Skinning toggle, and set
the colours accordingly.
- Different numbers of ghosts can be shown before/after the current frame
6) Grease Pencil datablocks are now attached to the scene by default instead of
the active object.
- For a long time, the object-attachment has proved to be quite problematic
for users to keep track of. Now that this is done at scene level, it is
easier for most users to use.
- An exception for old files (and for any addons which may benefit from object
attachment instead), is that if the active object has a Grease Pencil datablock,
that will be used instead.
- It is not currently possible to choose object-attachment from the UI, but
it is simple to do this from the console instead, by doing:
context.active_object.grease_pencil = bpy.data.grease_pencil["blah"]
7) Various UI Cleanups
- The layers UI has been cleaned up to use a list instead of the nested-panels
design. Apart from saving space, this is also much nicer to look at now.
- The UI code is now all defined in Python. To support this, it has been necessary
to add some new context properties to make it easier to access these settings.
e.g. "gpencil_data" for the datablock
"active_gpencil_layer" and "active_gpencil_frame" for active data,
"editable_gpencil_strokes" for the strokes that can be edited
- The "stroke placement/alignment" settings (previously "Drawing Settings" at the
bottom of the Grease Pencil panel in the Properties Region) is now located in
the toolbar. These were more toolsettings than properties for how GPencil got drawn.
- "Use Sketching Sessions" has been renamed "Continuous Drawing", as per a
suggestion for an earlier discussion on developer.blender.org
- By default, the painting operator will wait for a mouse button to be pressed
before it starts creating the stroke. This is to make it easier to include
this operator in various toolbars/menus/etc. To get it immediately starting
(as when you hold down DKEy to draw), set "wait_for_input" to False.
- GPencil Layers can be rearranged in the "Grease Pencil" mode of the Action Editor
- Toolbar panels have been added to all the other editors which support these.
8) Pie menus for quick-access to tools
A set of experimental pie menus has been included for quick access to many
tools and settings. It is not necessary to use these to get things done,
but they have been designed to help make certain common tasks easier.
- Ctrl-D = The main pie menu. Reveals tools in a context sensitive and
spatially stable manner.
- D Q = "Quick Settings" pie. This allows quick access to the active
layer's settings. Notably, colours, thickness, and turning
onion skinning on/off.
2014-11-30 13:52:06 +01:00
|
|
|
if (ELEM(wmn->action, NA_EDITED, NA_SELECTED)) {
|
2020-03-06 16:56:42 +01:00
|
|
|
ED_region_tag_redraw(region);
|
2012-06-11 02:21:50 +02:00
|
|
|
}
|
|
|
|
break;
|
2009-12-14 22:42:25 +01:00
|
|
|
case NC_SCENE:
|
2012-03-30 00:26:11 +02:00
|
|
|
switch (wmn->data) {
|
2009-12-14 22:42:25 +01:00
|
|
|
case ND_FRAME:
|
|
|
|
case ND_MARKERS:
|
|
|
|
case ND_SEQUENCER:
|
2012-04-30 00:25:31 +02:00
|
|
|
case ND_RENDER_OPTIONS:
|
2015-01-19 06:30:35 +01:00
|
|
|
case ND_DRAW_RENDER_VIEWPORT:
|
2020-03-06 16:56:42 +01:00
|
|
|
ED_region_tag_redraw(region);
|
2009-12-14 22:42:25 +01:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
break;
|
2015-02-05 11:51:09 +01:00
|
|
|
case NC_ANIMATION:
|
|
|
|
switch (wmn->data) {
|
|
|
|
case ND_KEYFRAME:
|
2020-03-06 16:56:42 +01:00
|
|
|
ED_region_tag_redraw(region);
|
2015-02-05 11:51:09 +01:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
break;
|
2009-12-14 22:42:25 +01:00
|
|
|
case NC_SPACE:
|
2019-03-26 11:16:47 +01:00
|
|
|
if (wmn->data == ND_SPACE_SEQUENCER) {
|
2020-03-06 16:56:42 +01:00
|
|
|
ED_region_tag_redraw(region);
|
2019-03-26 11:16:47 +01:00
|
|
|
}
|
2009-12-14 22:42:25 +01:00
|
|
|
break;
|
|
|
|
case NC_ID:
|
2012-03-30 00:26:11 +02:00
|
|
|
switch (wmn->data) {
|
2009-12-14 22:42:25 +01:00
|
|
|
case NA_RENAME:
|
2020-03-06 16:56:42 +01:00
|
|
|
ED_region_tag_redraw(region);
|
2009-12-14 22:42:25 +01:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
break;
|
2012-06-07 20:24:36 +02:00
|
|
|
case NC_MASK:
|
|
|
|
if (wmn->action == NA_EDITED) {
|
2020-03-06 16:56:42 +01:00
|
|
|
ED_region_tag_redraw(region);
|
2012-06-07 20:24:36 +02:00
|
|
|
}
|
|
|
|
break;
|
2009-12-14 22:42:25 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2009-06-08 12:38:28 +02:00
|
|
|
/* *********************** buttons region ************************ */
|
|
|
|
|
2020-04-05 23:55:51 +02:00
|
|
|
/* Add handlers, stuff you only do once or on area/region changes. */
|
2020-03-06 16:56:42 +01:00
|
|
|
static void sequencer_buttons_region_init(wmWindowManager *wm, ARegion *region)
|
2009-06-08 12:38:28 +02:00
|
|
|
{
|
2013-04-28 11:47:11 +02:00
|
|
|
wmKeyMap *keymap;
|
|
|
|
|
2018-08-31 05:36:14 +02:00
|
|
|
keymap = WM_keymap_ensure(wm->defaultconf, "SequencerCommon", SPACE_SEQ, 0);
|
2020-03-06 16:56:42 +01:00
|
|
|
WM_event_add_keymap_handler_v2d_mask(®ion->handlers, keymap);
|
2013-04-28 11:47:11 +02:00
|
|
|
|
2020-03-06 16:56:42 +01:00
|
|
|
UI_panel_category_active_set_default(region, "Strip");
|
|
|
|
ED_region_panels_init(wm, region);
|
2009-06-08 12:38:28 +02:00
|
|
|
}
|
|
|
|
|
2020-03-06 16:56:42 +01:00
|
|
|
static void sequencer_buttons_region_draw(const bContext *C, ARegion *region)
|
2009-06-08 12:38:28 +02:00
|
|
|
{
|
2020-03-06 16:56:42 +01:00
|
|
|
ED_region_panels(C, region);
|
2009-06-08 12:38:28 +02:00
|
|
|
}
|
|
|
|
|
2021-01-19 02:59:00 +01:00
|
|
|
static void sequencer_buttons_region_listener(const wmRegionListenerParams *params)
|
2009-06-08 12:38:28 +02:00
|
|
|
{
|
2021-01-19 00:28:47 +01:00
|
|
|
ARegion *region = params->region;
|
2022-08-27 04:50:43 +02:00
|
|
|
const wmNotifier *wmn = params->notifier;
|
2021-01-19 00:28:47 +01:00
|
|
|
|
2020-04-05 23:55:51 +02:00
|
|
|
/* Context changes. */
|
2012-03-30 00:26:11 +02:00
|
|
|
switch (wmn->category) {
|
2012-10-05 21:51:11 +02:00
|
|
|
case NC_GPENCIL:
|
Grease Pencil - Storyboarding Features (merge from GPencil_EditStrokes branch)
This merge-commit brings in a number of new features and workflow/UI improvements for
working with Grease Pencil. While these were originally targetted at improving
the workflow for creating 3D storyboards in Blender using the Grease Pencil,
many of these changes should also prove useful in other workflows too.
The main highlights here are:
1) It is now possible to edit Grease Pencil strokes
- Use D Tab, or toggle the "Enable Editing" toggles in the Toolbar/Properties regions
to enter "Stroke Edit Mode". In this mode, many common editing tools will
operate on Grease Pencil stroke points instead.
- Tools implemented include Select, Select All/Border/Circle/Linked/More/Less,
Grab, Rotate, Scale, Bend, Shear, To Sphere, Mirror, Duplicate, Delete.
- Proportional Editing works when using the transform tools
2) Grease Pencil stroke settings can now be animated
NOTE: Currently drivers don't work, but if time allows, this may still be
added before the release.
3) Strokes can be drawn with "filled" interiors, using a separate set of
colour/opacity settings to the ones used for the lines themselves.
This makes use of OpenGL filled polys, which has the limitation of only
being able to fill convex shapes. Some artifacts may be visible on concave
shapes (e.g. pacman's mouth will be overdrawn)
4) "Volumetric Strokes" - An alternative drawing technique for stroke drawing
has been added which draws strokes as a series of screen-aligned discs.
While this was originally a partial experimental technique at getting better
quality 3D lines, the effects possible using this technique were interesting
enough to warrant making this a dedicated feature. Best results when partial
opacity and large stroke widths are used.
5) Improved Onion Skinning Support
- Different colours can be selected for the before/after ghosts. To do so,
enable the "colour wheel" toggle beside the Onion Skinning toggle, and set
the colours accordingly.
- Different numbers of ghosts can be shown before/after the current frame
6) Grease Pencil datablocks are now attached to the scene by default instead of
the active object.
- For a long time, the object-attachment has proved to be quite problematic
for users to keep track of. Now that this is done at scene level, it is
easier for most users to use.
- An exception for old files (and for any addons which may benefit from object
attachment instead), is that if the active object has a Grease Pencil datablock,
that will be used instead.
- It is not currently possible to choose object-attachment from the UI, but
it is simple to do this from the console instead, by doing:
context.active_object.grease_pencil = bpy.data.grease_pencil["blah"]
7) Various UI Cleanups
- The layers UI has been cleaned up to use a list instead of the nested-panels
design. Apart from saving space, this is also much nicer to look at now.
- The UI code is now all defined in Python. To support this, it has been necessary
to add some new context properties to make it easier to access these settings.
e.g. "gpencil_data" for the datablock
"active_gpencil_layer" and "active_gpencil_frame" for active data,
"editable_gpencil_strokes" for the strokes that can be edited
- The "stroke placement/alignment" settings (previously "Drawing Settings" at the
bottom of the Grease Pencil panel in the Properties Region) is now located in
the toolbar. These were more toolsettings than properties for how GPencil got drawn.
- "Use Sketching Sessions" has been renamed "Continuous Drawing", as per a
suggestion for an earlier discussion on developer.blender.org
- By default, the painting operator will wait for a mouse button to be pressed
before it starts creating the stroke. This is to make it easier to include
this operator in various toolbars/menus/etc. To get it immediately starting
(as when you hold down DKEy to draw), set "wait_for_input" to False.
- GPencil Layers can be rearranged in the "Grease Pencil" mode of the Action Editor
- Toolbar panels have been added to all the other editors which support these.
8) Pie menus for quick-access to tools
A set of experimental pie menus has been included for quick access to many
tools and settings. It is not necessary to use these to get things done,
but they have been designed to help make certain common tasks easier.
- Ctrl-D = The main pie menu. Reveals tools in a context sensitive and
spatially stable manner.
- D Q = "Quick Settings" pie. This allows quick access to the active
layer's settings. Notably, colours, thickness, and turning
onion skinning on/off.
2014-11-30 13:52:06 +01:00
|
|
|
if (ELEM(wmn->action, NA_EDITED, NA_SELECTED)) {
|
2020-03-06 16:56:42 +01:00
|
|
|
ED_region_tag_redraw(region);
|
2012-06-11 02:21:50 +02:00
|
|
|
}
|
|
|
|
break;
|
2009-10-19 12:07:19 +02:00
|
|
|
case NC_SCENE:
|
2012-03-30 00:26:11 +02:00
|
|
|
switch (wmn->data) {
|
|
|
|
case ND_FRAME:
|
|
|
|
case ND_SEQUENCER:
|
2020-03-06 16:56:42 +01:00
|
|
|
ED_region_tag_redraw(region);
|
2012-03-30 00:26:11 +02:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
break;
|
2.5
Notifiers
---------
Various fixes for wrong use of notifiers, and some new notifiers
to make things a bit more clear and consistent, with two notable
changes:
* Geometry changes are now done with NC_GEOM, rather than
NC_OBJECT|ND_GEOM_, so an object does need to be available.
* Space data now use NC_SPACE|ND_SPACE_*, instead of data
notifiers or even NC_WINDOW in some cases. Note that NC_SPACE
should only be used for notifying about changes in space data,
we don't want to go back to allqueue(REDRAW..).
Depsgraph
---------
The dependency graph now has a different flush call:
DAG_object_flush_update(scene, ob, flag)
is replaced by:
DAG_id_flush_update(id, flag)
It still works basically the same, one difference is that it now
also accepts object data (e.g. Mesh), again to avoid requiring an
Object to be available. Other ID types will simply do nothing at
the moment.
Docs
----
I made some guidelines for how/when to do which kinds of updates
and notifiers. I can't specify totally exact how to make these
decisions, but these are basically the guidelines I use. So, new
and updated docs are here:
http://wiki.blender.org/index.php/BlenderDev/Blender2.5/NotifiersUpdates
http://wiki.blender.org/index.php/BlenderDev/Blender2.5/DataNotifiers
2009-09-04 22:51:09 +02:00
|
|
|
case NC_SPACE:
|
2019-03-26 11:16:47 +01:00
|
|
|
if (wmn->data == ND_SPACE_SEQUENCER) {
|
2020-03-06 16:56:42 +01:00
|
|
|
ED_region_tag_redraw(region);
|
2019-03-26 11:16:47 +01:00
|
|
|
}
|
2.5
Notifiers
---------
Various fixes for wrong use of notifiers, and some new notifiers
to make things a bit more clear and consistent, with two notable
changes:
* Geometry changes are now done with NC_GEOM, rather than
NC_OBJECT|ND_GEOM_, so an object does need to be available.
* Space data now use NC_SPACE|ND_SPACE_*, instead of data
notifiers or even NC_WINDOW in some cases. Note that NC_SPACE
should only be used for notifying about changes in space data,
we don't want to go back to allqueue(REDRAW..).
Depsgraph
---------
The dependency graph now has a different flush call:
DAG_object_flush_update(scene, ob, flag)
is replaced by:
DAG_id_flush_update(id, flag)
It still works basically the same, one difference is that it now
also accepts object data (e.g. Mesh), again to avoid requiring an
Object to be available. Other ID types will simply do nothing at
the moment.
Docs
----
I made some guidelines for how/when to do which kinds of updates
and notifiers. I can't specify totally exact how to make these
decisions, but these are basically the guidelines I use. So, new
and updated docs are here:
http://wiki.blender.org/index.php/BlenderDev/Blender2.5/NotifiersUpdates
http://wiki.blender.org/index.php/BlenderDev/Blender2.5/DataNotifiers
2009-09-04 22:51:09 +02:00
|
|
|
break;
|
2009-12-10 10:58:10 +01:00
|
|
|
case NC_ID:
|
2019-03-26 11:16:47 +01:00
|
|
|
if (wmn->action == NA_RENAME) {
|
2020-03-06 16:56:42 +01:00
|
|
|
ED_region_tag_redraw(region);
|
2019-03-26 11:16:47 +01:00
|
|
|
}
|
2009-12-10 10:58:10 +01:00
|
|
|
break;
|
2009-06-08 12:38:28 +02:00
|
|
|
}
|
|
|
|
}
|
ID-Remap - Step one: core work (cleanup and rework of generic ID datablock handling).
This commit changes a lot of how IDs are handled internally, especially the unlinking/freeing
processes. So far, this was very fuzy, to summarize cleanly deleting or replacing a datablock
was pretty much impossible, except for a few special cases.
Also, unlinking was handled by each datatype, in a rather messy and prone-to-errors way (quite
a few ID usages were missed or wrongly handled that way).
One of the main goal of id-remap branch was to cleanup this, and fatorize ID links handling
by using library_query utils to allow generic handling of those, which is now the case
(now, generic ID links handling is only "knwon" from readfile.c and library_query.c).
This commit also adds backends to allow live replacement and deletion of datablocks in Blender
(so-called 'remapping' process, where we replace all usages of a given ID pointer by a new one,
or NULL one in case of unlinking).
This will allow nice new features, like ability to easily reload or relocate libraries, real immediate
deletion of datablocks in blender, replacement of one datablock by another, etc.
Some of those are for next commits.
A word of warning: this commit is highly risky, because it affects potentially a lot in Blender core.
Though it was tested rather deeply, being totally impossible to check all possible ID usage cases,
it's likely there are some remaining issues and bugs in new code... Please report them! ;)
Review task: D2027 (https://developer.blender.org/D2027).
Reviewed by campbellbarton, thanks a bunch.
2016-06-22 17:29:38 +02:00
|
|
|
|
2023-06-14 18:36:17 +02:00
|
|
|
static void sequencer_id_remap(ScrArea * /*area*/, SpaceLink *slink, const IDRemapper *mappings)
|
ID-Remap - Step one: core work (cleanup and rework of generic ID datablock handling).
This commit changes a lot of how IDs are handled internally, especially the unlinking/freeing
processes. So far, this was very fuzy, to summarize cleanly deleting or replacing a datablock
was pretty much impossible, except for a few special cases.
Also, unlinking was handled by each datatype, in a rather messy and prone-to-errors way (quite
a few ID usages were missed or wrongly handled that way).
One of the main goal of id-remap branch was to cleanup this, and fatorize ID links handling
by using library_query utils to allow generic handling of those, which is now the case
(now, generic ID links handling is only "knwon" from readfile.c and library_query.c).
This commit also adds backends to allow live replacement and deletion of datablocks in Blender
(so-called 'remapping' process, where we replace all usages of a given ID pointer by a new one,
or NULL one in case of unlinking).
This will allow nice new features, like ability to easily reload or relocate libraries, real immediate
deletion of datablocks in blender, replacement of one datablock by another, etc.
Some of those are for next commits.
A word of warning: this commit is highly risky, because it affects potentially a lot in Blender core.
Though it was tested rather deeply, being totally impossible to check all possible ID usage cases,
it's likely there are some remaining issues and bugs in new code... Please report them! ;)
Review task: D2027 (https://developer.blender.org/D2027).
Reviewed by campbellbarton, thanks a bunch.
2016-06-22 17:29:38 +02:00
|
|
|
{
|
|
|
|
SpaceSeq *sseq = (SpaceSeq *)slink;
|
2022-01-25 14:51:35 +01:00
|
|
|
BKE_id_remapper_apply(mappings, (ID **)&sseq->gpd, ID_REMAP_APPLY_DEFAULT);
|
ID-Remap - Step one: core work (cleanup and rework of generic ID datablock handling).
This commit changes a lot of how IDs are handled internally, especially the unlinking/freeing
processes. So far, this was very fuzy, to summarize cleanly deleting or replacing a datablock
was pretty much impossible, except for a few special cases.
Also, unlinking was handled by each datatype, in a rather messy and prone-to-errors way (quite
a few ID usages were missed or wrongly handled that way).
One of the main goal of id-remap branch was to cleanup this, and fatorize ID links handling
by using library_query utils to allow generic handling of those, which is now the case
(now, generic ID links handling is only "knwon" from readfile.c and library_query.c).
This commit also adds backends to allow live replacement and deletion of datablocks in Blender
(so-called 'remapping' process, where we replace all usages of a given ID pointer by a new one,
or NULL one in case of unlinking).
This will allow nice new features, like ability to easily reload or relocate libraries, real immediate
deletion of datablocks in blender, replacement of one datablock by another, etc.
Some of those are for next commits.
A word of warning: this commit is highly risky, because it affects potentially a lot in Blender core.
Though it was tested rather deeply, being totally impossible to check all possible ID usage cases,
it's likely there are some remaining issues and bugs in new code... Please report them! ;)
Review task: D2027 (https://developer.blender.org/D2027).
Reviewed by campbellbarton, thanks a bunch.
2016-06-22 17:29:38 +02:00
|
|
|
}
|
|
|
|
|
2009-06-08 12:38:28 +02:00
|
|
|
/* ************************************* */
|
|
|
|
|
UI: Region polling support
Introduces *ARegionType.poll()* as a way to dynamically add/remove a region. The region is still there internally, but is not accessible to the user.
Previously editors would to this manually, by either removing/adding regions altogether, or hiding them, unsetting their alignment (so no AZones are added I assume) and removing their event handlers. Polling makes this much simpler.
We plan to use this in #102879.
This patch refactors multiple editors to use region polling:
- File Browser
- Sequencer
- Clip Editor
- Preferences
Notes:
- Previously, editors would lazy-create some of the regions. Versioning is added here to ensure they are always there. Could be a separate patch.
- Some editors reuse a region in different display modes, and so additional work needs to be done to reinit regions they become available or the mode changes. Typically `V2D_IS_INIT` is unset for that, which isn't great. Could be improved, but not a new issue.
Behavior change:
- When the Preferences are opened as a regular editor, the "execution" region in the preferences that displays the *Save Preferences* button would still be there, but empty with a scrollbar.
This patch makes it disappear entirely.
## Implementation
- Introduces `ARegionType.poll()`
- Before a window is drawn, all contained regions have their poll checked, and the result is stored in a flag (`RGN_FLAG_POLL_FAILED` - runtime-only flag).
- If the result of the poll changes, the area is re-initialized and event handlers are added/removed.
- UI code checks the flag as needed.
Pull Request: https://projects.blender.org/blender/blender/pulls/105088
2023-04-05 15:30:32 +02:00
|
|
|
static bool sequencer_channel_region_poll(const RegionPollParams *params)
|
|
|
|
{
|
|
|
|
const SpaceSeq *sseq = (SpaceSeq *)params->area->spacedata.first;
|
|
|
|
return ELEM(sseq->view, SEQ_VIEW_SEQUENCE);
|
|
|
|
}
|
|
|
|
|
2022-04-04 12:52:48 +02:00
|
|
|
/* add handlers, stuff you only do once or on area/region changes */
|
|
|
|
static void sequencer_channel_region_init(wmWindowManager *wm, ARegion *region)
|
|
|
|
{
|
|
|
|
wmKeyMap *keymap;
|
|
|
|
|
|
|
|
region->alignment = RGN_ALIGN_LEFT;
|
|
|
|
|
|
|
|
UI_view2d_region_reinit(®ion->v2d, V2D_COMMONVIEW_LIST, region->winx, region->winy);
|
|
|
|
|
|
|
|
keymap = WM_keymap_ensure(wm->defaultconf, "Sequencer Channels", SPACE_SEQ, 0);
|
|
|
|
WM_event_add_keymap_handler_v2d_mask(®ion->handlers, keymap);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void sequencer_channel_region_draw(const bContext *C, ARegion *region)
|
|
|
|
{
|
|
|
|
draw_channels(C, region);
|
|
|
|
}
|
|
|
|
|
2023-06-14 18:36:17 +02:00
|
|
|
static void sequencer_space_blend_read_data(BlendDataReader * /*reader*/, SpaceLink *sl)
|
2022-09-28 11:52:22 +02:00
|
|
|
{
|
|
|
|
SpaceSeq *sseq = (SpaceSeq *)sl;
|
|
|
|
|
|
|
|
/* grease pencil data is not a direct data and can't be linked from direct_link*
|
|
|
|
* functions, it should be linked from lib_link* functions instead
|
|
|
|
*
|
|
|
|
* otherwise it'll lead to lost grease data on open because it'll likely be
|
|
|
|
* read from file after all other users of grease pencil and newdataadr would
|
2023-06-14 18:36:17 +02:00
|
|
|
* simple return nullptr here (sergey)
|
2022-09-28 11:52:22 +02:00
|
|
|
*/
|
|
|
|
#if 0
|
2023-07-12 14:18:59 +02:00
|
|
|
if (sseq->gpd) {
|
|
|
|
sseq->gpd = newdataadr(fd, sseq->gpd);
|
|
|
|
BKE_gpencil_blend_read_data(fd, sseq->gpd);
|
|
|
|
}
|
2022-09-28 11:52:22 +02:00
|
|
|
#endif
|
2023-06-14 18:36:17 +02:00
|
|
|
sseq->scopes.reference_ibuf = nullptr;
|
|
|
|
sseq->scopes.zebra_ibuf = nullptr;
|
|
|
|
sseq->scopes.waveform_ibuf = nullptr;
|
|
|
|
sseq->scopes.sep_waveform_ibuf = nullptr;
|
|
|
|
sseq->scopes.vector_ibuf = nullptr;
|
|
|
|
sseq->scopes.histogram_ibuf = nullptr;
|
2022-09-28 11:52:22 +02:00
|
|
|
memset(&sseq->runtime, 0x0, sizeof(sseq->runtime));
|
|
|
|
}
|
|
|
|
|
2023-04-27 06:42:21 +02:00
|
|
|
static void sequencer_space_blend_read_lib(BlendLibReader *reader, ID *parent_id, SpaceLink *sl)
|
2022-09-28 11:52:22 +02:00
|
|
|
{
|
|
|
|
SpaceSeq *sseq = (SpaceSeq *)sl;
|
|
|
|
|
|
|
|
/* NOTE: pre-2.5, this was local data not lib data, but now we need this as lib data
|
|
|
|
* so fingers crossed this works fine!
|
|
|
|
*/
|
2023-04-24 12:04:22 +02:00
|
|
|
BLO_read_id_address(reader, parent_id, &sseq->gpd);
|
2022-09-28 11:52:22 +02:00
|
|
|
}
|
|
|
|
|
2023-04-27 06:42:21 +02:00
|
|
|
static void sequencer_space_blend_write(BlendWriter *writer, SpaceLink *sl)
|
2022-09-28 11:52:22 +02:00
|
|
|
{
|
|
|
|
BLO_write_struct(writer, SpaceSeq, sl);
|
|
|
|
}
|
|
|
|
|
2023-07-02 11:37:22 +02:00
|
|
|
void ED_spacetype_sequencer()
|
2008-12-14 15:43:08 +01:00
|
|
|
{
|
2023-06-14 18:36:17 +02:00
|
|
|
SpaceType *st = MEM_cnew<SpaceType>("spacetype sequencer");
|
2008-12-14 15:43:08 +01:00
|
|
|
ARegionType *art;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-03-30 00:26:11 +02:00
|
|
|
st->spaceid = SPACE_SEQ;
|
2022-09-10 08:51:15 +02:00
|
|
|
STRNCPY(st->name, "Sequencer");
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2020-08-04 14:39:53 +02:00
|
|
|
st->create = sequencer_create;
|
2012-03-30 00:26:11 +02:00
|
|
|
st->free = sequencer_free;
|
|
|
|
st->init = sequencer_init;
|
|
|
|
st->duplicate = sequencer_duplicate;
|
|
|
|
st->operatortypes = sequencer_operatortypes;
|
|
|
|
st->keymap = sequencer_keymap;
|
2012-06-07 21:24:49 +02:00
|
|
|
st->context = sequencer_context;
|
2019-05-31 13:45:28 +02:00
|
|
|
st->gizmos = sequencer_gizmos;
|
2012-03-30 00:26:11 +02:00
|
|
|
st->dropboxes = sequencer_dropboxes;
|
|
|
|
st->refresh = sequencer_refresh;
|
Color Management, Stage 2: Switch color pipeline to use OpenColorIO
Replace old color pipeline which was supporting linear/sRGB color spaces
only with OpenColorIO-based pipeline.
This introduces two configurable color spaces:
- Input color space for images and movie clips. This space is used to convert
images/movies from color space in which file is saved to Blender's linear
space (for float images, byte images are not internally converted, only input
space is stored for such images and used later).
This setting could be found in image/clip data block settings.
- Display color space which defines space in which particular display is working.
This settings could be found in scene's Color Management panel.
When render result is being displayed on the screen, apart from converting image
to display space, some additional conversions could happen.
This conversions are:
- View, which defines tone curve applying before display transformation.
These are different ways to view the image on the same display device.
For example it could be used to emulate film view on sRGB display.
- Exposure affects on image exposure before tone map is applied.
- Gamma is post-display gamma correction, could be used to match particular
display gamma.
- RGB curves are user-defined curves which are applying before display
transformation, could be used for different purposes.
All this settings by default are only applying on render result and does not
affect on other images. If some particular image needs to be affected by this
transformation, "View as Render" setting of image data block should be set to
truth. Movie clips are always affected by all display transformations.
This commit also introduces configurable color space in which sequencer is
working. This setting could be found in scene's Color Management panel and
it should be used if such stuff as grading needs to be done in color space
different from sRGB (i.e. when Film view on sRGB display is use, using VD16
space as sequencer's internal space would make grading working in space
which is close to the space using for display).
Some technical notes:
- Image buffer's float buffer is now always in linear space, even if it was
created from 16bit byte images.
- Space of byte buffer is stored in image buffer's rect_colorspace property.
- Profile of image buffer was removed since it's not longer meaningful.
- OpenGL and GLSL is supposed to always work in sRGB space. It is possible
to support other spaces, but it's quite large project which isn't so
much important.
- Legacy Color Management option disabled is emulated by using None display.
It could have some regressions, but there's no clear way to avoid them.
- If OpenColorIO is disabled on build time, it should make blender behaving
in the same way as previous release with color management enabled.
More details could be found at this page (more details would be added soon):
http://wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.64/Color_Management
--
Thanks to Xavier Thomas, Lukas Toene for initial work on OpenColorIO
integration and to Brecht van Lommel for some further development and code/
usecase review!
2012-09-15 12:05:07 +02:00
|
|
|
st->listener = sequencer_listener;
|
ID-Remap - Step one: core work (cleanup and rework of generic ID datablock handling).
This commit changes a lot of how IDs are handled internally, especially the unlinking/freeing
processes. So far, this was very fuzy, to summarize cleanly deleting or replacing a datablock
was pretty much impossible, except for a few special cases.
Also, unlinking was handled by each datatype, in a rather messy and prone-to-errors way (quite
a few ID usages were missed or wrongly handled that way).
One of the main goal of id-remap branch was to cleanup this, and fatorize ID links handling
by using library_query utils to allow generic handling of those, which is now the case
(now, generic ID links handling is only "knwon" from readfile.c and library_query.c).
This commit also adds backends to allow live replacement and deletion of datablocks in Blender
(so-called 'remapping' process, where we replace all usages of a given ID pointer by a new one,
or NULL one in case of unlinking).
This will allow nice new features, like ability to easily reload or relocate libraries, real immediate
deletion of datablocks in blender, replacement of one datablock by another, etc.
Some of those are for next commits.
A word of warning: this commit is highly risky, because it affects potentially a lot in Blender core.
Though it was tested rather deeply, being totally impossible to check all possible ID usage cases,
it's likely there are some remaining issues and bugs in new code... Please report them! ;)
Review task: D2027 (https://developer.blender.org/D2027).
Reviewed by campbellbarton, thanks a bunch.
2016-06-22 17:29:38 +02:00
|
|
|
st->id_remap = sequencer_id_remap;
|
2023-04-27 06:42:21 +02:00
|
|
|
st->blend_read_data = sequencer_space_blend_read_data;
|
|
|
|
st->blend_read_lib = sequencer_space_blend_read_lib;
|
|
|
|
st->blend_write = sequencer_space_blend_write;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2020-04-05 23:55:51 +02:00
|
|
|
/* Create regions: */
|
|
|
|
/* Main window. */
|
2023-06-14 18:36:17 +02:00
|
|
|
art = MEM_cnew<ARegionType>("spacetype sequencer region");
|
2008-12-14 15:43:08 +01:00
|
|
|
art->regionid = RGN_TYPE_WINDOW;
|
UI: Region polling support
Introduces *ARegionType.poll()* as a way to dynamically add/remove a region. The region is still there internally, but is not accessible to the user.
Previously editors would to this manually, by either removing/adding regions altogether, or hiding them, unsetting their alignment (so no AZones are added I assume) and removing their event handlers. Polling makes this much simpler.
We plan to use this in #102879.
This patch refactors multiple editors to use region polling:
- File Browser
- Sequencer
- Clip Editor
- Preferences
Notes:
- Previously, editors would lazy-create some of the regions. Versioning is added here to ensure they are always there. Could be a separate patch.
- Some editors reuse a region in different display modes, and so additional work needs to be done to reinit regions they become available or the mode changes. Typically `V2D_IS_INIT` is unset for that, which isn't great. Could be improved, but not a new issue.
Behavior change:
- When the Preferences are opened as a regular editor, the "execution" region in the preferences that displays the *Save Preferences* button would still be there, but empty with a scrollbar.
This patch makes it disappear entirely.
## Implementation
- Introduces `ARegionType.poll()`
- Before a window is drawn, all contained regions have their poll checked, and the result is stored in a flag (`RGN_FLAG_POLL_FAILED` - runtime-only flag).
- If the result of the poll changes, the area is re-initialized and event handlers are added/removed.
- UI code checks the flag as needed.
Pull Request: https://projects.blender.org/blender/blender/pulls/105088
2023-04-05 15:30:32 +02:00
|
|
|
art->poll = sequencer_main_region_poll;
|
2015-11-28 17:14:45 +01:00
|
|
|
art->init = sequencer_main_region_init;
|
|
|
|
art->draw = sequencer_main_region_draw;
|
2020-06-23 07:59:34 +02:00
|
|
|
art->draw_overlay = sequencer_main_region_draw_overlay;
|
2022-04-28 16:07:57 +02:00
|
|
|
art->layout = sequencer_main_region_layout;
|
|
|
|
art->on_view2d_changed = sequencer_main_region_view2d_changed;
|
2015-11-28 17:14:45 +01:00
|
|
|
art->listener = sequencer_main_region_listener;
|
2018-04-19 18:44:57 +02:00
|
|
|
art->message_subscribe = sequencer_main_region_message_subscribe;
|
2021-11-05 05:49:33 +01:00
|
|
|
art->keymapflag = ED_KEYMAP_TOOL | ED_KEYMAP_GIZMO | ED_KEYMAP_VIEW2D | ED_KEYMAP_FRAMES |
|
|
|
|
ED_KEYMAP_ANIMATION;
|
2008-12-14 15:43:08 +01:00
|
|
|
BLI_addhead(&st->regiontypes, art);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2020-04-05 23:55:51 +02:00
|
|
|
/* Preview. */
|
2023-06-14 18:36:17 +02:00
|
|
|
art = MEM_cnew<ARegionType>("spacetype sequencer region");
|
2009-12-14 22:42:25 +01:00
|
|
|
art->regionid = RGN_TYPE_PREVIEW;
|
UI: Region polling support
Introduces *ARegionType.poll()* as a way to dynamically add/remove a region. The region is still there internally, but is not accessible to the user.
Previously editors would to this manually, by either removing/adding regions altogether, or hiding them, unsetting their alignment (so no AZones are added I assume) and removing their event handlers. Polling makes this much simpler.
We plan to use this in #102879.
This patch refactors multiple editors to use region polling:
- File Browser
- Sequencer
- Clip Editor
- Preferences
Notes:
- Previously, editors would lazy-create some of the regions. Versioning is added here to ensure they are always there. Could be a separate patch.
- Some editors reuse a region in different display modes, and so additional work needs to be done to reinit regions they become available or the mode changes. Typically `V2D_IS_INIT` is unset for that, which isn't great. Could be improved, but not a new issue.
Behavior change:
- When the Preferences are opened as a regular editor, the "execution" region in the preferences that displays the *Save Preferences* button would still be there, but empty with a scrollbar.
This patch makes it disappear entirely.
## Implementation
- Introduces `ARegionType.poll()`
- Before a window is drawn, all contained regions have their poll checked, and the result is stored in a flag (`RGN_FLAG_POLL_FAILED` - runtime-only flag).
- If the result of the poll changes, the area is re-initialized and event handlers are added/removed.
- UI code checks the flag as needed.
Pull Request: https://projects.blender.org/blender/blender/pulls/105088
2023-04-05 15:30:32 +02:00
|
|
|
art->poll = sequencer_preview_region_poll;
|
2015-11-28 17:14:45 +01:00
|
|
|
art->init = sequencer_preview_region_init;
|
2020-08-12 11:05:40 +02:00
|
|
|
art->layout = sequencer_preview_region_layout;
|
|
|
|
art->on_view2d_changed = sequencer_preview_region_view2d_changed;
|
2015-11-28 17:14:45 +01:00
|
|
|
art->draw = sequencer_preview_region_draw;
|
|
|
|
art->listener = sequencer_preview_region_listener;
|
2020-01-22 14:54:44 +01:00
|
|
|
art->keymapflag = ED_KEYMAP_TOOL | ED_KEYMAP_GIZMO | ED_KEYMAP_VIEW2D | ED_KEYMAP_FRAMES |
|
|
|
|
ED_KEYMAP_GPENCIL;
|
2009-12-14 22:42:25 +01:00
|
|
|
BLI_addhead(&st->regiontypes, art);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2023-05-24 03:21:18 +02:00
|
|
|
/* List-view/buttons. */
|
2023-06-14 18:36:17 +02:00
|
|
|
art = MEM_cnew<ARegionType>("spacetype sequencer region");
|
2009-06-08 12:38:28 +02:00
|
|
|
art->regionid = RGN_TYPE_UI;
|
2019-06-20 19:00:34 +02:00
|
|
|
art->prefsizex = UI_SIDEBAR_PANEL_WIDTH * 1.3f;
|
2012-03-30 00:26:11 +02:00
|
|
|
art->keymapflag = ED_KEYMAP_UI | ED_KEYMAP_FRAMES;
|
2020-01-22 14:54:44 +01:00
|
|
|
art->message_subscribe = ED_area_do_mgs_subscribe_for_tool_ui;
|
2015-11-28 17:14:45 +01:00
|
|
|
art->listener = sequencer_buttons_region_listener;
|
|
|
|
art->init = sequencer_buttons_region_init;
|
|
|
|
art->draw = sequencer_buttons_region_draw;
|
2009-06-08 12:38:28 +02:00
|
|
|
BLI_addhead(&st->regiontypes, art);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2012-06-11 02:21:50 +02:00
|
|
|
sequencer_buttons_register(art);
|
2020-04-05 23:55:51 +02:00
|
|
|
/* Toolbar. */
|
2023-06-14 18:36:17 +02:00
|
|
|
art = MEM_cnew<ARegionType>("spacetype sequencer tools region");
|
2020-01-22 14:54:44 +01:00
|
|
|
art->regionid = RGN_TYPE_TOOLS;
|
2023-06-16 04:20:31 +02:00
|
|
|
art->prefsizex = int(UI_TOOLBAR_WIDTH);
|
2020-01-22 14:54:44 +01:00
|
|
|
art->prefsizey = 50; /* XXX */
|
|
|
|
art->keymapflag = ED_KEYMAP_UI | ED_KEYMAP_FRAMES;
|
|
|
|
art->message_subscribe = ED_region_generic_tools_region_message_subscribe;
|
|
|
|
art->snap_size = ED_region_generic_tools_region_snap_size;
|
|
|
|
art->init = sequencer_tools_region_init;
|
|
|
|
art->draw = sequencer_tools_region_draw;
|
2023-08-14 04:04:18 +02:00
|
|
|
art->listener = sequencer_main_region_listener;
|
2020-01-22 14:54:44 +01:00
|
|
|
BLI_addhead(&st->regiontypes, art);
|
|
|
|
|
2022-04-04 12:52:48 +02:00
|
|
|
/* Channels. */
|
2023-06-14 18:36:17 +02:00
|
|
|
art = MEM_cnew<ARegionType>("spacetype sequencer channels");
|
2022-04-04 12:52:48 +02:00
|
|
|
art->regionid = RGN_TYPE_CHANNELS;
|
|
|
|
art->prefsizex = UI_COMPACT_PANEL_WIDTH;
|
|
|
|
art->keymapflag = ED_KEYMAP_UI;
|
UI: Region polling support
Introduces *ARegionType.poll()* as a way to dynamically add/remove a region. The region is still there internally, but is not accessible to the user.
Previously editors would to this manually, by either removing/adding regions altogether, or hiding them, unsetting their alignment (so no AZones are added I assume) and removing their event handlers. Polling makes this much simpler.
We plan to use this in #102879.
This patch refactors multiple editors to use region polling:
- File Browser
- Sequencer
- Clip Editor
- Preferences
Notes:
- Previously, editors would lazy-create some of the regions. Versioning is added here to ensure they are always there. Could be a separate patch.
- Some editors reuse a region in different display modes, and so additional work needs to be done to reinit regions they become available or the mode changes. Typically `V2D_IS_INIT` is unset for that, which isn't great. Could be improved, but not a new issue.
Behavior change:
- When the Preferences are opened as a regular editor, the "execution" region in the preferences that displays the *Save Preferences* button would still be there, but empty with a scrollbar.
This patch makes it disappear entirely.
## Implementation
- Introduces `ARegionType.poll()`
- Before a window is drawn, all contained regions have their poll checked, and the result is stored in a flag (`RGN_FLAG_POLL_FAILED` - runtime-only flag).
- If the result of the poll changes, the area is re-initialized and event handlers are added/removed.
- UI code checks the flag as needed.
Pull Request: https://projects.blender.org/blender/blender/pulls/105088
2023-04-05 15:30:32 +02:00
|
|
|
art->poll = sequencer_channel_region_poll;
|
2022-04-04 12:52:48 +02:00
|
|
|
art->init = sequencer_channel_region_init;
|
|
|
|
art->draw = sequencer_channel_region_draw;
|
|
|
|
art->listener = sequencer_main_region_listener;
|
|
|
|
BLI_addhead(&st->regiontypes, art);
|
|
|
|
|
2020-04-05 23:55:51 +02:00
|
|
|
/* Tool header. */
|
2023-06-14 18:36:17 +02:00
|
|
|
art = MEM_cnew<ARegionType>("spacetype sequencer tool header region");
|
2020-01-22 14:54:44 +01:00
|
|
|
art->regionid = RGN_TYPE_TOOL_HEADER;
|
|
|
|
art->prefsizey = HEADERY;
|
|
|
|
art->keymapflag = ED_KEYMAP_UI | ED_KEYMAP_VIEW2D | ED_KEYMAP_FRAMES | ED_KEYMAP_HEADER;
|
|
|
|
art->listener = sequencer_main_region_listener;
|
|
|
|
art->init = sequencer_header_region_init;
|
|
|
|
art->draw = sequencer_header_region_draw;
|
|
|
|
art->message_subscribe = ED_area_do_mgs_subscribe_for_tool_header;
|
|
|
|
BLI_addhead(&st->regiontypes, art);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2020-04-05 23:55:51 +02:00
|
|
|
/* Header. */
|
2023-06-14 18:36:17 +02:00
|
|
|
art = MEM_cnew<ARegionType>("spacetype sequencer region");
|
2008-12-14 15:43:08 +01:00
|
|
|
art->regionid = RGN_TYPE_HEADER;
|
2012-03-30 00:26:11 +02:00
|
|
|
art->prefsizey = HEADERY;
|
|
|
|
art->keymapflag = ED_KEYMAP_UI | ED_KEYMAP_VIEW2D | ED_KEYMAP_FRAMES | ED_KEYMAP_HEADER;
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2015-11-28 17:14:45 +01:00
|
|
|
art->init = sequencer_header_region_init;
|
|
|
|
art->draw = sequencer_header_region_draw;
|
|
|
|
art->listener = sequencer_main_region_listener;
|
2008-12-14 15:43:08 +01:00
|
|
|
BLI_addhead(&st->regiontypes, art);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2021-02-05 06:23:34 +01:00
|
|
|
/* HUD. */
|
2020-01-22 02:07:54 +01:00
|
|
|
art = ED_area_type_hud(st->spaceid);
|
|
|
|
BLI_addhead(&st->regiontypes, art);
|
|
|
|
|
2008-12-14 15:43:08 +01:00
|
|
|
BKE_spacetype_register(st);
|
2019-04-17 06:17:24 +02:00
|
|
|
|
2020-04-05 23:55:51 +02:00
|
|
|
/* Set the sequencer callback when not in background mode. */
|
2012-03-30 00:26:11 +02:00
|
|
|
if (G.background == 0) {
|
2023-06-14 18:36:17 +02:00
|
|
|
sequencer_view3d_fn = reinterpret_cast<SequencerDrawView>(
|
|
|
|
ED_view3d_draw_offscreen_imbuf_simple);
|
2010-03-09 08:41:04 +01:00
|
|
|
}
|
2008-12-14 15:43:08 +01:00
|
|
|
}
|