Fix #32686: MovieClip background initialisaton error
Undistorted rendering with original footage settings does not require proxies to be enabled.
This commit is contained in:
@@ -790,42 +790,45 @@ class CLIP_PT_proxy(CLIP_PT_clip_view_panel, Panel):
|
|||||||
sc = context.space_data
|
sc = context.space_data
|
||||||
clip = sc.clip
|
clip = sc.clip
|
||||||
|
|
||||||
layout.active = clip.use_proxy
|
col = layout.column()
|
||||||
|
col.active = clip.use_proxy
|
||||||
|
|
||||||
layout.label(text="Build Original:")
|
col.label(text="Build Original:")
|
||||||
|
|
||||||
row = layout.row(align=True)
|
row = col.row(align=True)
|
||||||
row.prop(clip.proxy, "build_25", toggle=True)
|
row.prop(clip.proxy, "build_25", toggle=True)
|
||||||
row.prop(clip.proxy, "build_50", toggle=True)
|
row.prop(clip.proxy, "build_50", toggle=True)
|
||||||
row.prop(clip.proxy, "build_75", toggle=True)
|
row.prop(clip.proxy, "build_75", toggle=True)
|
||||||
row.prop(clip.proxy, "build_100", toggle=True)
|
row.prop(clip.proxy, "build_100", toggle=True)
|
||||||
|
|
||||||
layout.label(text="Build Undistorted:")
|
col.label(text="Build Undistorted:")
|
||||||
|
|
||||||
row = layout.row(align=True)
|
row = col.row(align=True)
|
||||||
row.prop(clip.proxy, "build_undistorted_25", toggle=True)
|
row.prop(clip.proxy, "build_undistorted_25", toggle=True)
|
||||||
row.prop(clip.proxy, "build_undistorted_50", toggle=True)
|
row.prop(clip.proxy, "build_undistorted_50", toggle=True)
|
||||||
row.prop(clip.proxy, "build_undistorted_75", toggle=True)
|
row.prop(clip.proxy, "build_undistorted_75", toggle=True)
|
||||||
row.prop(clip.proxy, "build_undistorted_100", toggle=True)
|
row.prop(clip.proxy, "build_undistorted_100", toggle=True)
|
||||||
|
|
||||||
layout.prop(clip.proxy, "quality")
|
col.prop(clip.proxy, "quality")
|
||||||
|
|
||||||
layout.prop(clip, "use_proxy_custom_directory")
|
col.prop(clip, "use_proxy_custom_directory")
|
||||||
if clip.use_proxy_custom_directory:
|
if clip.use_proxy_custom_directory:
|
||||||
layout.prop(clip.proxy, "directory")
|
col.prop(clip.proxy, "directory")
|
||||||
|
|
||||||
layout.operator("clip.rebuild_proxy", text="Build Proxy")
|
col.operator("clip.rebuild_proxy", text="Build Proxy")
|
||||||
|
|
||||||
if clip.source == 'MOVIE':
|
if clip.source == 'MOVIE':
|
||||||
col = layout.column()
|
col2 = col.column()
|
||||||
|
|
||||||
col.label(text="Use timecode index:")
|
col2.label(text="Use timecode index:")
|
||||||
col.prop(clip.proxy, "timecode", text="")
|
col2.prop(clip.proxy, "timecode", text="")
|
||||||
|
|
||||||
col = layout.column()
|
col2 = col.column()
|
||||||
col.label(text="Proxy render size:")
|
col2.label(text="Proxy render size:")
|
||||||
|
|
||||||
col.prop(sc.clip_user, "proxy_render_size", text="")
|
col.prop(sc.clip_user, "proxy_render_size", text="")
|
||||||
|
|
||||||
|
col = layout.column()
|
||||||
col.prop(sc.clip_user, "use_render_undistorted")
|
col.prop(sc.clip_user, "use_render_undistorted")
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -626,24 +626,22 @@ static ImBuf *get_undistorted_ibuf(MovieClip *clip, struct MovieDistortion *dist
|
|||||||
return undistibuf;
|
return undistibuf;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int need_undistortion_postprocess(MovieClipUser *user, int flag)
|
static int need_undistortion_postprocess(MovieClipUser *user)
|
||||||
{
|
{
|
||||||
int result = 0;
|
int result = 0;
|
||||||
|
|
||||||
/* only full undistorted render can be used as on-fly undistorting image */
|
/* only full undistorted render can be used as on-fly undistorting image */
|
||||||
if (flag & MCLIP_USE_PROXY) {
|
|
||||||
result |= (user->render_size == MCLIP_PROXY_RENDER_SIZE_FULL) &&
|
result |= (user->render_size == MCLIP_PROXY_RENDER_SIZE_FULL) &&
|
||||||
(user->render_flag & MCLIP_PROXY_RENDER_UNDISTORT) != 0;
|
(user->render_flag & MCLIP_PROXY_RENDER_UNDISTORT) != 0;
|
||||||
}
|
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int need_postprocessed_frame(MovieClipUser *user, int flag, int postprocess_flag)
|
static int need_postprocessed_frame(MovieClipUser *user, int postprocess_flag)
|
||||||
{
|
{
|
||||||
int result = postprocess_flag;
|
int result = postprocess_flag;
|
||||||
|
|
||||||
result |= need_undistortion_postprocess(user, flag);
|
result |= need_undistortion_postprocess(user);
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@@ -690,7 +688,7 @@ static ImBuf *get_postprocessed_cached_frame(MovieClip *clip, MovieClipUser *use
|
|||||||
if (cache->postprocessed.flag != postprocess_flag)
|
if (cache->postprocessed.flag != postprocess_flag)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
if (need_undistortion_postprocess(user, flag)) {
|
if (need_undistortion_postprocess(user)) {
|
||||||
if (!check_undistortion_cache_flags(clip))
|
if (!check_undistortion_cache_flags(clip))
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
@@ -721,7 +719,7 @@ static ImBuf *put_postprocessed_frame_to_cache(MovieClip *clip, MovieClipUser *u
|
|||||||
cache->postprocessed.render_flag = 0;
|
cache->postprocessed.render_flag = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (need_undistortion_postprocess(user, flag)) {
|
if (need_undistortion_postprocess(user)) {
|
||||||
copy_v2_v2(cache->postprocessed.principal, camera->principal);
|
copy_v2_v2(cache->postprocessed.principal, camera->principal);
|
||||||
copy_v3_v3(&cache->postprocessed.k1, &camera->k1);
|
copy_v3_v3(&cache->postprocessed.k1, &camera->k1);
|
||||||
cache->postprocessed.undistortion_used = TRUE;
|
cache->postprocessed.undistortion_used = TRUE;
|
||||||
@@ -765,7 +763,7 @@ static ImBuf *movieclip_get_postprocessed_ibuf(MovieClip *clip, MovieClipUser *u
|
|||||||
BLI_lock_thread(LOCK_MOVIECLIP);
|
BLI_lock_thread(LOCK_MOVIECLIP);
|
||||||
|
|
||||||
/* try to obtain cached postprocessed frame first */
|
/* try to obtain cached postprocessed frame first */
|
||||||
if (need_postprocessed_frame(user, flag, postprocess_flag)) {
|
if (need_postprocessed_frame(user, postprocess_flag)) {
|
||||||
ibuf = get_postprocessed_cached_frame(clip, user, flag, postprocess_flag);
|
ibuf = get_postprocessed_cached_frame(clip, user, flag, postprocess_flag);
|
||||||
|
|
||||||
if (!ibuf)
|
if (!ibuf)
|
||||||
|
|||||||
Reference in New Issue
Block a user