mirror of
https://github.com/blender/blender
synced 2026-09-29 04:37:17 +03:00
Fix: invalid absolute paths for sequence strips from libraries
The wrong relative base for absolute paths was passed to BLI_path_abs for the media checking operator & thumbnail cache. Resolves #148688. Ref !148690
This commit is contained in:
parent
3706afdbdd
commit
0a916b792d
7 changed files with 15 additions and 21 deletions
|
|
@ -1786,7 +1786,7 @@ static wmOperatorStatus sequencer_add_image_strip_exec(bContext *C, wmOperator *
|
|||
* is set, every frame between `offset` and `max_framenr` . */
|
||||
sequencer_add_image_strip_load_files(op, scene, strip, &load_data, range);
|
||||
|
||||
seq::add_image_init_alpha_mode(strip);
|
||||
seq::add_image_init_alpha_mode(bmain, scene, strip);
|
||||
|
||||
/* Adjust starting length of strip.
|
||||
* Note that this length differs from `strip->len`, which is always 1 for single images. */
|
||||
|
|
|
|||
|
|
@ -279,7 +279,7 @@ static Strip *rna_Strips_new_image(ID *id,
|
|||
BLI_path_split_dir_file(file, dirpath, sizeof(dirpath), filename, sizeof(filename));
|
||||
blender::seq::add_image_set_directory(strip, dirpath);
|
||||
blender::seq::add_image_load_file(scene, strip, 0, filename);
|
||||
blender::seq::add_image_init_alpha_mode(strip);
|
||||
blender::seq::add_image_init_alpha_mode(bmain, scene, strip);
|
||||
|
||||
DEG_relations_tag_update(bmain);
|
||||
DEG_id_tag_update(&scene->id, ID_RECALC_SEQUENCER_STRIPS);
|
||||
|
|
|
|||
|
|
@ -182,7 +182,7 @@ void add_image_load_file(Scene *scene, Strip *strip, size_t strip_frame, const c
|
|||
*
|
||||
* \param strip: image strip to be changed
|
||||
*/
|
||||
void add_image_init_alpha_mode(Strip *strip);
|
||||
void add_image_init_alpha_mode(Main *bmain, Scene *scene, Strip *strip);
|
||||
void add_reload_new_file(Main *bmain, Scene *scene, Strip *strip, bool lock_range);
|
||||
void add_movie_reload_if_needed(
|
||||
Main *bmain, Scene *scene, Strip *strip, bool *r_was_reloaded, bool *r_can_produce_frames);
|
||||
|
|
|
|||
|
|
@ -547,8 +547,7 @@ void thumbnail_cache_invalidate_strip(Scene *scene, const Strip *strip)
|
|||
paths_count = int(MEM_allocN_len(elem) / sizeof(*elem));
|
||||
}
|
||||
char filepath[FILE_MAX];
|
||||
const char *basepath = strip->scene ? ID_BLEND_PATH_FROM_GLOBAL(&strip->scene->id) :
|
||||
BKE_main_blendfile_path_from_global();
|
||||
const char *basepath = ID_BLEND_PATH_FROM_GLOBAL(&scene->id);
|
||||
for (int i = 0; i < paths_count; i++, elem++) {
|
||||
BLI_path_join(filepath, sizeof(filepath), strip->data->dirpath, elem->filename);
|
||||
BLI_path_abs(filepath, basepath);
|
||||
|
|
|
|||
|
|
@ -26,12 +26,6 @@ namespace blender::seq {
|
|||
|
||||
static blender::Mutex presence_lock;
|
||||
|
||||
static const char *strip_base_path_get(const Strip *strip)
|
||||
{
|
||||
return strip->scene ? ID_BLEND_PATH_FROM_GLOBAL(&strip->scene->id) :
|
||||
BKE_main_blendfile_path_from_global();
|
||||
}
|
||||
|
||||
static bool check_sound_media_missing(const bSound *sound)
|
||||
{
|
||||
if (sound == nullptr) {
|
||||
|
|
@ -44,7 +38,7 @@ static bool check_sound_media_missing(const bSound *sound)
|
|||
return !BLI_exists(filepath);
|
||||
}
|
||||
|
||||
static bool check_media_missing(const Strip *strip)
|
||||
static bool check_media_missing(const Scene *scene, const Strip *strip)
|
||||
{
|
||||
if (strip == nullptr || strip->data == nullptr) {
|
||||
return false;
|
||||
|
|
@ -60,7 +54,7 @@ static bool check_media_missing(const Strip *strip)
|
|||
paths_count = int(MEM_allocN_len(elem) / sizeof(*elem));
|
||||
}
|
||||
char filepath[FILE_MAX];
|
||||
const char *basepath = strip_base_path_get(strip);
|
||||
const char *basepath = ID_BLEND_PATH_FROM_GLOBAL(&scene->id);
|
||||
for (int i = 0; i < paths_count; i++, elem++) {
|
||||
BLI_path_join(filepath, sizeof(filepath), strip->data->dirpath, elem->filename);
|
||||
BLI_path_abs(filepath, basepath);
|
||||
|
|
@ -74,7 +68,7 @@ static bool check_media_missing(const Strip *strip)
|
|||
/* Recurse into meta strips. */
|
||||
if (strip->type == STRIP_TYPE_META) {
|
||||
LISTBASE_FOREACH (Strip *, strip_n, &strip->seqbase) {
|
||||
if (check_media_missing(strip_n)) {
|
||||
if (check_media_missing(scene, strip_n)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
@ -131,7 +125,7 @@ bool media_presence_is_missing(Scene *scene, const Strip *strip)
|
|||
missing = *val;
|
||||
}
|
||||
else {
|
||||
missing = check_media_missing(strip);
|
||||
missing = check_media_missing(scene, strip);
|
||||
presence->map_seq.add_new(strip, missing);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -361,7 +361,7 @@ static bool seq_proxy_multiview_context_invalid(Strip *strip,
|
|||
char filepath[FILE_MAX];
|
||||
BLI_path_join(
|
||||
filepath, sizeof(filepath), strip->data->dirpath, strip->data->stripdata->filename);
|
||||
BLI_path_abs(filepath, BKE_main_blendfile_path_from_global());
|
||||
BLI_path_abs(filepath, ID_BLEND_PATH_FROM_GLOBAL(&scene->id));
|
||||
BKE_scene_multiview_view_prefix_get(scene, filepath, prefix_vars->prefix, &prefix_vars->ext);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -205,7 +205,7 @@ void add_image_load_file(Scene *scene, Strip *strip, size_t strip_frame, const c
|
|||
STRNCPY(se->filename, filename);
|
||||
}
|
||||
|
||||
void add_image_init_alpha_mode(Strip *strip)
|
||||
void add_image_init_alpha_mode(Main *bmain, Scene *scene, Strip *strip)
|
||||
{
|
||||
if (strip->data && strip->data->stripdata) {
|
||||
char filepath[FILE_MAX];
|
||||
|
|
@ -213,7 +213,7 @@ void add_image_init_alpha_mode(Strip *strip)
|
|||
|
||||
BLI_path_join(
|
||||
filepath, sizeof(filepath), strip->data->dirpath, strip->data->stripdata->filename);
|
||||
BLI_path_abs(filepath, BKE_main_blendfile_path_from_global());
|
||||
BLI_path_abs(filepath, ID_BLEND_PATH(bmain, &scene->id));
|
||||
|
||||
/* Initialize input color space. */
|
||||
if (strip->type == STRIP_TYPE_IMAGE) {
|
||||
|
|
@ -261,7 +261,8 @@ Strip *add_image_strip(Main *bmain, Scene *scene, ListBase *seqbase, LoadData *l
|
|||
/* Set initial scale based on load_data->fit_method. */
|
||||
char file_path[FILE_MAX];
|
||||
STRNCPY(file_path, load_data->path);
|
||||
BLI_path_abs(file_path, BKE_main_blendfile_path(bmain));
|
||||
BLI_path_abs(file_path, ID_BLEND_PATH(bmain, &scene->id));
|
||||
|
||||
ImBuf *ibuf = IMB_load_image_from_filepath(
|
||||
file_path, IB_byte_data | IB_multilayer, strip->data->colorspace_settings.name);
|
||||
if (ibuf != nullptr) {
|
||||
|
|
@ -401,7 +402,7 @@ Strip *add_movie_strip(Main *bmain, Scene *scene, ListBase *seqbase, LoadData *l
|
|||
{
|
||||
char filepath[sizeof(load_data->path)];
|
||||
STRNCPY(filepath, load_data->path);
|
||||
BLI_path_abs(filepath, BKE_main_blendfile_path(bmain));
|
||||
BLI_path_abs(filepath, ID_BLEND_PATH(bmain, &scene->id));
|
||||
|
||||
char colorspace[/*MAX_COLORSPACE_NAME*/ 64] = "\0";
|
||||
bool is_multiview_loaded = false;
|
||||
|
|
@ -577,7 +578,7 @@ void add_reload_new_file(Main *bmain, Scene *scene, Strip *strip, const bool loc
|
|||
|
||||
BLI_path_join(
|
||||
filepath, sizeof(filepath), strip->data->dirpath, strip->data->stripdata->filename);
|
||||
BLI_path_abs(filepath, BKE_main_blendfile_path_from_global());
|
||||
BLI_path_abs(filepath, ID_BLEND_PATH(bmain, &scene->id));
|
||||
|
||||
relations_strip_free_anim(strip);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue