Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLukas Stockner <lukas.stockner@freenet.de>2022-10-30 00:41:21 +0300
committerLukas Stockner <lukas.stockner@freenet.de>2022-10-30 01:14:59 +0300
commitbc37e8d8399eef686b71341aa90eced9bc117786 (patch)
tree92e4af388150209df9bc44e2cba6f2f303aa7baf /source/blender/editors/space_clip/space_clip.c
parent552abb838c76d44a0d7d1226b59a1ab381e88386 (diff)
parentd1d2f002c7caaf4ab457ec27bbc44666d7aac624 (diff)
Merge remote-tracking branch 'origin/master' into principled-v2
Diffstat (limited to 'source/blender/editors/space_clip/space_clip.c')
-rw-r--r--source/blender/editors/space_clip/space_clip.c42
1 files changed, 34 insertions, 8 deletions
diff --git a/source/blender/editors/space_clip/space_clip.c b/source/blender/editors/space_clip/space_clip.c
index ce6409a7784..3631a1740f7 100644
--- a/source/blender/editors/space_clip/space_clip.c
+++ b/source/blender/editors/space_clip/space_clip.c
@@ -49,6 +49,8 @@
#include "UI_resources.h"
#include "UI_view2d.h"
+#include "BLO_read_write.h"
+
#include "RNA_access.h"
#include "clip_intern.h" /* own include */
@@ -314,7 +316,7 @@ static SpaceLink *clip_duplicate(SpaceLink *sl)
static void clip_listener(const wmSpaceTypeListenerParams *params)
{
ScrArea *area = params->area;
- wmNotifier *wmn = params->notifier;
+ const wmNotifier *wmn = params->notifier;
const Scene *scene = params->scene;
/* context changes */
@@ -811,8 +813,8 @@ static void clip_main_region_draw(const bContext *C, ARegion *region)
int width, height;
bool show_cursor = false;
- /* if tracking is in progress, we should synchronize framenr from clipuser
- * so latest tracked frame would be shown */
+ /* If tracking is in progress, we should synchronize the frame from the clip-user
+ * (#MovieClipUser.framenr) so latest tracked frame would be shown. */
if (clip && clip->tracking_context) {
BKE_autotrack_context_sync_user(clip->tracking_context, &sc->user);
}
@@ -919,7 +921,7 @@ static void clip_main_region_draw(const bContext *C, ARegion *region)
static void clip_main_region_listener(const wmRegionListenerParams *params)
{
ARegion *region = params->region;
- wmNotifier *wmn = params->notifier;
+ const wmNotifier *wmn = params->notifier;
/* context changes */
switch (wmn->category) {
@@ -1118,7 +1120,7 @@ static void clip_header_region_draw(const bContext *C, ARegion *region)
static void clip_header_region_listener(const wmRegionListenerParams *params)
{
ARegion *region = params->region;
- wmNotifier *wmn = params->notifier;
+ const wmNotifier *wmn = params->notifier;
/* context changes */
switch (wmn->category) {
@@ -1160,7 +1162,7 @@ static void clip_tools_region_draw(const bContext *C, ARegion *region)
static void clip_props_region_listener(const wmRegionListenerParams *params)
{
ARegion *region = params->region;
- wmNotifier *wmn = params->notifier;
+ const wmNotifier *wmn = params->notifier;
/* context changes */
switch (wmn->category) {
@@ -1212,7 +1214,7 @@ static void clip_properties_region_draw(const bContext *C, ARegion *region)
static void clip_properties_region_listener(const wmRegionListenerParams *params)
{
ARegion *region = params->region;
- wmNotifier *wmn = params->notifier;
+ const wmNotifier *wmn = params->notifier;
/* context changes */
switch (wmn->category) {
@@ -1245,13 +1247,34 @@ static void clip_id_remap(ScrArea *UNUSED(area),
BKE_id_remapper_apply(mappings, (ID **)&sclip->mask_info.mask, ID_REMAP_APPLY_ENSURE_REAL);
}
+static void clip_blend_read_data(BlendDataReader *UNUSED(reader), SpaceLink *sl)
+{
+ SpaceClip *sclip = (SpaceClip *)sl;
+
+ sclip->scopes.track_search = NULL;
+ sclip->scopes.track_preview = NULL;
+ sclip->scopes.ok = 0;
+}
+
+static void clip_blend_read_lib(BlendLibReader *reader, ID *parent_id, SpaceLink *sl)
+{
+ SpaceClip *sclip = (SpaceClip *)sl;
+ BLO_read_id_address(reader, parent_id->lib, &sclip->clip);
+ BLO_read_id_address(reader, parent_id->lib, &sclip->mask_info.mask);
+}
+
+static void clip_blend_write(BlendWriter *writer, SpaceLink *sl)
+{
+ BLO_write_struct(writer, SpaceClip, sl);
+}
+
void ED_spacetype_clip(void)
{
SpaceType *st = MEM_callocN(sizeof(SpaceType), "spacetype clip");
ARegionType *art;
st->spaceid = SPACE_CLIP;
- strncpy(st->name, "Clip", BKE_ST_MAXNAME);
+ STRNCPY(st->name, "Clip");
st->create = clip_create;
st->free = clip_free;
@@ -1265,6 +1288,9 @@ void ED_spacetype_clip(void)
st->dropboxes = clip_dropboxes;
st->refresh = clip_refresh;
st->id_remap = clip_id_remap;
+ st->blend_read_data = clip_blend_read_data;
+ st->blend_read_lib = clip_blend_read_lib;
+ st->blend_write = clip_blend_write;
/* regions: main window */
art = MEM_callocN(sizeof(ARegionType), "spacetype clip region");