diff options
author | Richard Antalik <richardantalik@gmail.com> | 2021-01-26 19:51:51 +0300 |
---|---|---|
committer | Richard Antalik <richardantalik@gmail.com> | 2021-01-26 19:51:51 +0300 |
commit | ae5c15bb4349426c5db276d7d73d750c43cc0346 (patch) | |
tree | ea8f7afa1901ff5186e6aa3b846f07945ecb19ad | |
parent | ff7a557c67096fc8de870e5fb43caa17b649c538 (diff) | |
parent | 6d40d7218971b558074eb418afd244ab13ab8fbf (diff) |
Merge branch 'blender-v2.92-release'
21 files changed, 146 insertions, 66 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index d00b89ef3ed..035cf81e1b3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1763,8 +1763,20 @@ if(WITH_BLENDER) # internal and external library information first, for test linking add_subdirectory(source) elseif(WITH_CYCLES_STANDALONE) + add_subdirectory(intern/glew-mx) + add_subdirectory(intern/guardedalloc) + add_subdirectory(intern/libc_compat) + add_subdirectory(intern/numaapi) + add_subdirectory(intern/sky) + add_subdirectory(intern/cycles) add_subdirectory(extern/clew) + if(WITH_CYCLES_LOGGING) + if(NOT WITH_SYSTEM_GFLAGS) + add_subdirectory(extern/gflags) + endif() + add_subdirectory(extern/glog) + endif() if(WITH_CUDA_DYNLOAD) add_subdirectory(extern/cuew) endif() @@ -1845,6 +1857,8 @@ if(FIRST_RUN) info_cfg_option(WITH_OPENCOLORIO) info_cfg_option(WITH_OPENIMAGEDENOISE) info_cfg_option(WITH_OPENVDB) + info_cfg_option(WITH_POTRACE) + info_cfg_option(WITH_PUGIXML) info_cfg_option(WITH_QUADRIFLOW) info_cfg_option(WITH_TBB) info_cfg_option(WITH_USD) diff --git a/build_files/cmake/config/blender_full.cmake b/build_files/cmake/config/blender_full.cmake index 08065ec0276..aab997ab453 100644 --- a/build_files/cmake/config/blender_full.cmake +++ b/build_files/cmake/config/blender_full.cmake @@ -44,6 +44,8 @@ set(WITH_OPENMP ON CACHE BOOL "" FORCE) set(WITH_OPENSUBDIV ON CACHE BOOL "" FORCE) set(WITH_OPENVDB ON CACHE BOOL "" FORCE) set(WITH_OPENVDB_BLOSC ON CACHE BOOL "" FORCE) +set(WITH_POTRACE ON CACHE BOOL "" FORCE) +set(WITH_PUGIXML ON CACHE BOOL "" FORCE) set(WITH_NANOVDB ON CACHE BOOL "" FORCE) set(WITH_POTRACE ON CACHE BOOL "" FORCE) set(WITH_PYTHON_INSTALL ON CACHE BOOL "" FORCE) diff --git a/build_files/cmake/config/blender_lite.cmake b/build_files/cmake/config/blender_lite.cmake index 4150094e9f5..480548abca7 100644 --- a/build_files/cmake/config/blender_lite.cmake +++ b/build_files/cmake/config/blender_lite.cmake @@ -51,6 +51,8 @@ set(WITH_OPENIMAGEIO OFF CACHE BOOL "" FORCE) set(WITH_OPENMP OFF CACHE BOOL "" FORCE) set(WITH_OPENSUBDIV OFF CACHE BOOL "" FORCE) set(WITH_OPENVDB OFF CACHE BOOL "" FORCE) +set(WITH_POTRACE OFF CACHE BOOL "" FORCE) +set(WITH_PUGIXML OFF CACHE BOOL "" FORCE) set(WITH_NANOVDB OFF CACHE BOOL "" FORCE) set(WITH_QUADRIFLOW OFF CACHE BOOL "" FORCE) set(WITH_SDL OFF CACHE BOOL "" FORCE) diff --git a/build_files/cmake/config/blender_release.cmake b/build_files/cmake/config/blender_release.cmake index fd3225b0287..96101ee7bcc 100644 --- a/build_files/cmake/config/blender_release.cmake +++ b/build_files/cmake/config/blender_release.cmake @@ -45,6 +45,8 @@ set(WITH_OPENMP ON CACHE BOOL "" FORCE) set(WITH_OPENSUBDIV ON CACHE BOOL "" FORCE) set(WITH_OPENVDB ON CACHE BOOL "" FORCE) set(WITH_OPENVDB_BLOSC ON CACHE BOOL "" FORCE) +set(WITH_POTRACE ON CACHE BOOL "" FORCE) +set(WITH_PUGIXML ON CACHE BOOL "" FORCE) set(WITH_NANOVDB ON CACHE BOOL "" FORCE) set(WITH_POTRACE ON CACHE BOOL "" FORCE) set(WITH_PYTHON_INSTALL ON CACHE BOOL "" FORCE) diff --git a/build_files/cmake/platform/platform_unix.cmake b/build_files/cmake/platform/platform_unix.cmake index abacd0500e5..a2448829206 100644 --- a/build_files/cmake/platform/platform_unix.cmake +++ b/build_files/cmake/platform/platform_unix.cmake @@ -352,6 +352,11 @@ endif() if(WITH_PUGIXML) find_package_wrapper(PugiXML) + + if (NOT PUGIXML_FOUND) + set(WITH_PUGIXML OFF) + message(STATUS "PugiXML not found, disabling WITH_PUGIXML") + endif() endif() if(WITH_OPENIMAGEIO) diff --git a/intern/cycles/CMakeLists.txt b/intern/cycles/CMakeLists.txt index 8167576a177..2a28d905144 100644 --- a/intern/cycles/CMakeLists.txt +++ b/intern/cycles/CMakeLists.txt @@ -14,7 +14,7 @@ # Standalone or with Blender if(NOT WITH_BLENDER AND WITH_CYCLES_STANDALONE) - set(CYCLES_INSTALL_PATH "") + set(CYCLES_INSTALL_PATH ${CMAKE_INSTALL_PREFIX}) else() set(WITH_CYCLES_BLENDER ON) # WINDOWS_PYTHON_DEBUG needs to write into the user addons folder since it will diff --git a/intern/cycles/app/cycles_standalone.cpp b/intern/cycles/app/cycles_standalone.cpp index f057ce7a2f0..6b3513b065a 100644 --- a/intern/cycles/app/cycles_standalone.cpp +++ b/intern/cycles/app/cycles_standalone.cpp @@ -133,12 +133,12 @@ static void scene_init() /* Camera width/height override? */ if (!(options.width == 0 || options.height == 0)) { - options.scene->camera->width = options.width; - options.scene->camera->height = options.height; + options.scene->camera->set_full_width(options.width); + options.scene->camera->set_full_height(options.height); } else { - options.width = options.scene->camera->width; - options.height = options.scene->camera->height; + options.width = options.scene->camera->get_full_width(); + options.height = options.scene->camera->get_full_height(); } /* Calculate Viewplane */ @@ -233,7 +233,7 @@ static void display() static void motion(int x, int y, int button) { if (options.interactive) { - Transform matrix = options.session->scene->camera->matrix; + Transform matrix = options.session->scene->camera->get_matrix(); /* Translate */ if (button == 0) { @@ -251,8 +251,8 @@ static void motion(int x, int y, int button) } /* Update and Reset */ - options.session->scene->camera->matrix = matrix; - options.session->scene->camera->need_update = true; + options.session->scene->camera->set_matrix(matrix); + options.session->scene->camera->need_flags_update = true; options.session->scene->camera->need_device_update = true; options.session->reset(session_buffer_params(), options.session_params.samples); @@ -266,10 +266,10 @@ static void resize(int width, int height) if (options.session) { /* Update camera */ - options.session->scene->camera->width = width; - options.session->scene->camera->height = height; + options.session->scene->camera->set_full_width(options.width); + options.session->scene->camera->set_full_height(options.height); options.session->scene->camera->compute_auto_viewplane(); - options.session->scene->camera->need_update = true; + options.session->scene->camera->need_flags_update = true; options.session->scene->camera->need_device_update = true; options.session->reset(session_buffer_params(), options.session_params.samples); @@ -302,7 +302,7 @@ static void keyboard(unsigned char key) /* Navigation */ else if (options.interactive && (key == 'w' || key == 'a' || key == 's' || key == 'd')) { - Transform matrix = options.session->scene->camera->matrix; + Transform matrix = options.session->scene->camera->get_matrix(); float3 translate; if (key == 'w') @@ -317,8 +317,8 @@ static void keyboard(unsigned char key) matrix = matrix * transform_translate(translate); /* Update and Reset */ - options.session->scene->camera->matrix = matrix; - options.session->scene->camera->need_update = true; + options.session->scene->camera->set_matrix(matrix); + options.session->scene->camera->need_flags_update = true; options.session->scene->camera->need_device_update = true; options.session->reset(session_buffer_params(), options.session_params.samples); @@ -345,10 +345,7 @@ static void keyboard(unsigned char key) break; } - options.session->scene->integrator->max_bounce = bounce; - - /* Update and Reset */ - options.session->scene->integrator->need_update = true; + options.session->scene->integrator->set_max_bounce(bounce); options.session->reset(session_buffer_params(), options.session_params.samples); } diff --git a/intern/cycles/app/cycles_xml.cpp b/intern/cycles/app/cycles_xml.cpp index a86e06f92d1..272d509585e 100644 --- a/intern/cycles/app/cycles_xml.cpp +++ b/intern/cycles/app/cycles_xml.cpp @@ -190,17 +190,18 @@ static void xml_read_camera(XMLReadState &state, xml_node node) { Camera *cam = state.scene->camera; - xml_read_int(&cam->width, node, "width"); - xml_read_int(&cam->height, node, "height"); + int width = -1, height = -1; + xml_read_int(&width, node, "width"); + xml_read_int(&height, node, "height"); - cam->full_width = cam->width; - cam->full_height = cam->height; + cam->set_full_width(width); + cam->set_full_height(height); xml_read_node(state, cam, node); - cam->matrix = state.tfm; + cam->set_matrix(state.tfm); - cam->need_update = true; + cam->need_flags_update = true; cam->update(state.scene); } @@ -338,11 +339,13 @@ static void xml_read_shader_graph(XMLReadState &state, Shader *shader, xml_node if (node_name == "image_texture") { ImageTextureNode *img = (ImageTextureNode *)snode; - img->filename = path_join(state.base, img->filename.string()); + ustring filename(path_join(state.base, img->get_filename().string())); + img->set_filename(filename); } else if (node_name == "environment_texture") { EnvironmentTextureNode *env = (EnvironmentTextureNode *)snode; - env->filename = path_join(state.base, env->filename.string()); + ustring filename(path_join(state.base, env->get_filename().string())); + env->set_filename(filename); } if (snode) { @@ -384,8 +387,8 @@ static Mesh *xml_add_mesh(Scene *scene, const Transform &tfm) /* create object*/ Object *object = new Object(); - object->geometry = mesh; - object->tfm = tfm; + object->set_geometry(mesh); + object->set_tfm(tfm); scene->objects.push_back(object); return mesh; @@ -395,7 +398,9 @@ static void xml_read_mesh(const XMLReadState &state, xml_node node) { /* add mesh */ Mesh *mesh = xml_add_mesh(state.scene, state.tfm); - mesh->used_shaders.push_back(state.shader); + array<Node *> used_shaders = mesh->get_used_shaders(); + used_shaders.push_back_slow(state.shader); + mesh->set_used_shaders(used_shaders); /* read state */ int shader = 0; @@ -411,20 +416,24 @@ static void xml_read_mesh(const XMLReadState &state, xml_node node) xml_read_int_array(nverts, node, "nverts"); if (xml_equal_string(node, "subdivision", "catmull-clark")) { - mesh->subdivision_type = Mesh::SUBDIVISION_CATMULL_CLARK; + mesh->set_subdivision_type(Mesh::SUBDIVISION_CATMULL_CLARK); } else if (xml_equal_string(node, "subdivision", "linear")) { - mesh->subdivision_type = Mesh::SUBDIVISION_LINEAR; + mesh->set_subdivision_type(Mesh::SUBDIVISION_LINEAR); } - if (mesh->subdivision_type == Mesh::SUBDIVISION_NONE) { + array<float3> P_array; + P_array = P; + + if (mesh->get_subdivision_type() == Mesh::SUBDIVISION_NONE) { /* create vertices */ - mesh->verts = P; + + mesh->set_verts(P_array); size_t num_triangles = 0; for (size_t i = 0; i < nverts.size(); i++) num_triangles += nverts[i] - 2; - mesh->reserve_mesh(mesh->verts.size(), num_triangles); + mesh->reserve_mesh(mesh->get_verts().size(), num_triangles); /* create triangles */ int index_offset = 0; @@ -474,7 +483,7 @@ static void xml_read_mesh(const XMLReadState &state, xml_node node) } else { /* create vertices */ - mesh->verts = P; + mesh->set_verts(P_array); size_t num_ngons = 0; size_t num_corners = 0; @@ -513,23 +522,20 @@ static void xml_read_mesh(const XMLReadState &state, xml_node node) } /* setup subd params */ - if (!mesh->subd_params) { - mesh->subd_params = new SubdParams(mesh); - } - SubdParams &sdparams = *mesh->subd_params; - - sdparams.dicing_rate = state.dicing_rate; - xml_read_float(&sdparams.dicing_rate, node, "dicing_rate"); - sdparams.dicing_rate = std::max(0.1f, sdparams.dicing_rate); + float dicing_rate = state.dicing_rate; + xml_read_float(&dicing_rate, node, "dicing_rate"); + dicing_rate = std::max(0.1f, dicing_rate); - sdparams.objecttoworld = state.tfm; + mesh->set_subd_dicing_rate(dicing_rate); + mesh->set_subd_objecttoworld(state.tfm); } /* we don't yet support arbitrary attributes, for now add vertex * coordinates as generated coordinates if requested */ if (mesh->need_attribute(state.scene, ATTR_STD_GENERATED)) { Attribute *attr = mesh->attributes.add(ATTR_STD_GENERATED); - memcpy(attr->data_float3(), mesh->verts.data(), sizeof(float3) * mesh->verts.size()); + memcpy( + attr->data_float3(), mesh->get_verts().data(), sizeof(float3) * mesh->get_verts().size()); } } @@ -539,7 +545,7 @@ static void xml_read_light(XMLReadState &state, xml_node node) { Light *light = new Light(); - light->shader = state.shader; + light->set_shader(state.shader); xml_read_node(state, light, node); state.scene->lights.push_back(light); diff --git a/intern/cycles/render/camera.cpp b/intern/cycles/render/camera.cpp index 92cf712d32a..3beb3d1d4d3 100644 --- a/intern/cycles/render/camera.cpp +++ b/intern/cycles/render/camera.cpp @@ -212,8 +212,8 @@ void Camera::compute_auto_viewplane() viewplane.top = 1.0f; } else { - float aspect = (float)width / (float)height; - if (width >= height) { + float aspect = (float)full_width / (float)full_height; + if (full_width >= full_height) { viewplane.left = -aspect; viewplane.right = aspect; viewplane.bottom = -1.0f; diff --git a/source/blender/blenkernel/intern/customdata.c b/source/blender/blenkernel/intern/customdata.c index 42f59a710c1..37e9c810123 100644 --- a/source/blender/blenkernel/intern/customdata.c +++ b/source/blender/blenkernel/intern/customdata.c @@ -5167,7 +5167,7 @@ void CustomData_blend_read(BlendDataReader *reader, CustomData *data, int count) if (CustomData_verify_versions(data, i)) { BLO_read_data_address(reader, &layer->data); - if (layer->data == NULL) { + if (layer->data == NULL && count > 0 && layer->type == CD_PROP_BOOL) { /* Usually this should never happen, except when a custom data layer has not been written * to a file correctly. */ CLOG_WARN(&LOG, "Reallocating custom data layer that was not saved correctly."); diff --git a/source/blender/compositor/operations/COM_RenderLayersProg.h b/source/blender/compositor/operations/COM_RenderLayersProg.h index ec98969b223..a0d5bc2953b 100644 --- a/source/blender/compositor/operations/COM_RenderLayersProg.h +++ b/source/blender/compositor/operations/COM_RenderLayersProg.h @@ -68,7 +68,8 @@ class RenderLayersProg : public NodeOperation { /** * Determine the output resolution. The resolution is retrieved from the Renderer */ - void determineResolution(unsigned int resolution[2], unsigned int preferredResolution[2]); + void determineResolution(unsigned int resolution[2], + unsigned int preferredResolution[2]) override; /** * retrieve the reference to the float buffer of the renderer. @@ -118,9 +119,9 @@ class RenderLayersProg : public NodeOperation { { return this->m_viewName; } - void initExecution(); - void deinitExecution(); - void executePixelSampled(float output[4], float x, float y, PixelSampler sampler); + void initExecution() override; + void deinitExecution() override; + void executePixelSampled(float output[4], float x, float y, PixelSampler sampler) override; std::unique_ptr<MetaData> getMetaData() const override; }; diff --git a/source/blender/compositor/operations/COM_SocketProxyOperation.h b/source/blender/compositor/operations/COM_SocketProxyOperation.h index 435083f5008..712347a8ea2 100644 --- a/source/blender/compositor/operations/COM_SocketProxyOperation.h +++ b/source/blender/compositor/operations/COM_SocketProxyOperation.h @@ -24,11 +24,11 @@ class SocketProxyOperation : public NodeOperation { public: SocketProxyOperation(DataType type, bool use_conversion); - bool isProxyOperation() const + bool isProxyOperation() const override { return true; } - bool useDatatypeConversion() const + bool useDatatypeConversion() const override { return m_use_conversion; } diff --git a/source/blender/draw/engines/workbench/workbench_data.c b/source/blender/draw/engines/workbench/workbench_data.c index c566b35cd34..4f689fd55a5 100644 --- a/source/blender/draw/engines/workbench/workbench_data.c +++ b/source/blender/draw/engines/workbench/workbench_data.c @@ -137,6 +137,15 @@ static void workbench_studiolight_data_update(WORKBENCH_PrivateData *wpd, WORKBE wd->use_specular = workbench_is_specular_highlight_enabled(wpd); } +void workbench_private_data_alloc(WORKBENCH_StorageList *stl) +{ + if (!stl->wpd) { + stl->wpd = MEM_callocN(sizeof(*stl->wpd), __func__); + stl->wpd->taa_sample_len_previous = -1; + stl->wpd->view_updated = true; + } +} + void workbench_private_data_init(WORKBENCH_PrivateData *wpd) { const DRWContextState *draw_ctx = DRW_context_state_get(); diff --git a/source/blender/draw/engines/workbench/workbench_effect_dof.c b/source/blender/draw/engines/workbench/workbench_effect_dof.c index fcee8c270dd..73cd501190f 100644 --- a/source/blender/draw/engines/workbench/workbench_effect_dof.c +++ b/source/blender/draw/engines/workbench/workbench_effect_dof.c @@ -133,14 +133,14 @@ void workbench_dof_engine_init(WORKBENCH_Data *vedata) const DRWContextState *draw_ctx = DRW_context_state_get(); RegionView3D *rv3d = draw_ctx->rv3d; View3D *v3d = draw_ctx->v3d; - Scene *scene = draw_ctx->scene; + Object *camera; if (v3d && rv3d) { camera = (rv3d->persp == RV3D_CAMOB) ? v3d->camera : NULL; } else { - camera = scene->camera; + camera = wpd->cam_original_ob; } Camera *cam = camera != NULL ? camera->data : NULL; diff --git a/source/blender/draw/engines/workbench/workbench_engine.c b/source/blender/draw/engines/workbench/workbench_engine.c index 37dbfe4d2a6..bd5b61b26e9 100644 --- a/source/blender/draw/engines/workbench/workbench_engine.c +++ b/source/blender/draw/engines/workbench/workbench_engine.c @@ -53,12 +53,7 @@ void workbench_engine_init(void *ved) workbench_shader_library_ensure(); - if (!stl->wpd) { - stl->wpd = MEM_callocN(sizeof(*stl->wpd), __func__); - stl->wpd->taa_sample_len_previous = -1; - stl->wpd->view_updated = true; - } - + workbench_private_data_alloc(stl); WORKBENCH_PrivateData *wpd = stl->wpd; workbench_private_data_init(wpd); workbench_update_world_ubo(wpd); diff --git a/source/blender/draw/engines/workbench/workbench_private.h b/source/blender/draw/engines/workbench/workbench_private.h index f3ff0616668..d157c260fbd 100644 --- a/source/blender/draw/engines/workbench/workbench_private.h +++ b/source/blender/draw/engines/workbench/workbench_private.h @@ -70,6 +70,7 @@ extern struct DrawEngineType draw_engine_workbench; #define OBJECT_ID_PASS_ENABLED(wpd) (OBJECT_OUTLINE_ENABLED(wpd) || CURVATURE_ENABLED(wpd)) #define NORMAL_ENCODING_ENABLED() (true) +struct Object; struct RenderEngine; struct RenderLayer; struct rcti; @@ -351,6 +352,9 @@ typedef struct WORKBENCH_PrivateData { float dof_rotation; float dof_ratio; + /* Camera override for rendering. */ + struct Object *cam_original_ob; + /** True if any volume needs to be rendered. */ bool volumes_do; /** Convenience boolean. */ @@ -504,6 +508,7 @@ DRWShadingGroup *workbench_image_setup_ex(WORKBENCH_PrivateData *wpd, workbench_image_setup_ex(wpd, ob, mat_nr, ima, iuser, interp, WORKBENCH_DATATYPE_HAIR) /* workbench_data.c */ +void workbench_private_data_alloc(WORKBENCH_StorageList *stl); void workbench_private_data_init(WORKBENCH_PrivateData *wpd); void workbench_update_world_ubo(WORKBENCH_PrivateData *wpd); void workbench_update_material_ubos(WORKBENCH_PrivateData *wpd); diff --git a/source/blender/draw/engines/workbench/workbench_render.c b/source/blender/draw/engines/workbench/workbench_render.c index 2c3b5a5f935..cec372ba732 100644 --- a/source/blender/draw/engines/workbench/workbench_render.c +++ b/source/blender/draw/engines/workbench/workbench_render.c @@ -175,6 +175,8 @@ void workbench_render(void *ved, RenderEngine *engine, RenderLayer *render_layer return; } + workbench_private_data_alloc(data->stl); + data->stl->wpd->cam_original_ob = DEG_get_evaluated_object(depsgraph, RE_GetCamera(engine->re)); workbench_engine_init(data); workbench_cache_init(data); diff --git a/source/blender/editors/space_sequencer/sequencer_edit.c b/source/blender/editors/space_sequencer/sequencer_edit.c index f470d1913dc..7474f8034de 100644 --- a/source/blender/editors/space_sequencer/sequencer_edit.c +++ b/source/blender/editors/space_sequencer/sequencer_edit.c @@ -1395,6 +1395,10 @@ static int sequencer_split_exec(bContext *C, wmOperator *op) SEQ_prefetch_stop(scene); + LISTBASE_FOREACH (Sequence *, seq, ed->seqbasep) { + seq->tmp = NULL; + } + LISTBASE_FOREACH_BACKWARD (Sequence *, seq, ed->seqbasep) { if (use_cursor_position && seq->machine != split_channel) { continue; diff --git a/source/blender/editors/space_sequencer/sequencer_proxy.c b/source/blender/editors/space_sequencer/sequencer_proxy.c index b208f320591..b9698492aa5 100644 --- a/source/blender/editors/space_sequencer/sequencer_proxy.c +++ b/source/blender/editors/space_sequencer/sequencer_proxy.c @@ -168,13 +168,13 @@ static void seq_proxy_build_job(const bContext *C, ReportList *reports) } SEQ_CURRENT_END; + BLI_gset_free(file_list, MEM_freeN); + if (!selected) { BKE_reportf(reports, RPT_WARNING, "Select movie or image strips"); return; } - BLI_gset_free(file_list, MEM_freeN); - if (selected && !WM_jobs_is_running(wm_job)) { G.is_break = false; WM_jobs_start(CTX_wm_manager(C), wm_job); diff --git a/source/blender/makesrna/intern/rna_sequencer.c b/source/blender/makesrna/intern/rna_sequencer.c index 217321b4991..01b083dc3c8 100644 --- a/source/blender/makesrna/intern/rna_sequencer.c +++ b/source/blender/makesrna/intern/rna_sequencer.c @@ -927,9 +927,10 @@ static void rna_Sequence_filepath_update(Main *bmain, Scene *UNUSED(scene), Poin rna_Sequence_invalidate_raw_update(bmain, scene, ptr); } -static void rna_Sequence_sound_update(Main *UNUSED(bmain), Scene *scene, PointerRNA *UNUSED(ptr)) +static void rna_Sequence_sound_update(Main *bmain, Scene *scene, PointerRNA *UNUSED(ptr)) { DEG_id_tag_update(&scene->id, ID_RECALC_SEQUENCER_STRIPS | ID_RECALC_AUDIO); + DEG_relations_tag_update(bmain); } static int seqproxy_seq_cmp_fn(Sequence *seq, void *arg_pt) diff --git a/source/blender/sequencer/intern/strip_relations.c b/source/blender/sequencer/intern/strip_relations.c index 18ae21e3a65..1a2ff08bd08 100644 --- a/source/blender/sequencer/intern/strip_relations.c +++ b/source/blender/sequencer/intern/strip_relations.c @@ -127,17 +127,49 @@ static void sequence_invalidate_cache(Scene *scene, SEQ_prefetch_stop(scene); } +/* Find metastrips that contain invalidated_seq and invalidate them. */ +static bool seq_relations_find_and_invalidate_metas(Scene *scene, + Sequence *invalidated_seq, + Sequence *meta_seq) +{ + ListBase *seqbase; + + if (meta_seq == NULL) { + Editing *ed = SEQ_editing_get(scene, false); + seqbase = &ed->seqbase; + } + else { + seqbase = &meta_seq->seqbase; + } + + LISTBASE_FOREACH (Sequence *, seq, seqbase) { + if (seq->type == SEQ_TYPE_META) { + if (seq_relations_find_and_invalidate_metas(scene, invalidated_seq, seq)) { + sequence_invalidate_cache(scene, seq, true, SEQ_CACHE_ALL_TYPES); + return true; + } + } + if (seq == invalidated_seq && meta_seq != NULL) { + sequence_invalidate_cache(scene, meta_seq, true, SEQ_CACHE_ALL_TYPES); + return true; + } + } + return false; +} + void SEQ_relations_invalidate_cache_in_range(Scene *scene, Sequence *seq, Sequence *range_mask, int invalidate_types) { seq_cache_cleanup_sequence(scene, seq, range_mask, invalidate_types, true); + seq_relations_find_and_invalidate_metas(scene, seq, NULL); } void SEQ_relations_invalidate_cache_raw(Scene *scene, Sequence *seq) { sequence_invalidate_cache(scene, seq, true, SEQ_CACHE_ALL_TYPES); + seq_relations_find_and_invalidate_metas(scene, seq, NULL); } void SEQ_relations_invalidate_cache_preprocessed(Scene *scene, Sequence *seq) @@ -147,6 +179,7 @@ void SEQ_relations_invalidate_cache_preprocessed(Scene *scene, Sequence *seq) true, SEQ_CACHE_STORE_PREPROCESSED | SEQ_CACHE_STORE_COMPOSITE | SEQ_CACHE_STORE_FINAL_OUT); + seq_relations_find_and_invalidate_metas(scene, seq, NULL); } void SEQ_relations_invalidate_cache_composite(Scene *scene, Sequence *seq) @@ -157,6 +190,7 @@ void SEQ_relations_invalidate_cache_composite(Scene *scene, Sequence *seq) sequence_invalidate_cache( scene, seq, true, SEQ_CACHE_STORE_COMPOSITE | SEQ_CACHE_STORE_FINAL_OUT); + seq_relations_find_and_invalidate_metas(scene, seq, NULL); } void SEQ_relations_invalidate_dependent(Scene *scene, Sequence *seq) @@ -167,6 +201,7 @@ void SEQ_relations_invalidate_dependent(Scene *scene, Sequence *seq) sequence_invalidate_cache( scene, seq, false, SEQ_CACHE_STORE_COMPOSITE | SEQ_CACHE_STORE_FINAL_OUT); + seq_relations_find_and_invalidate_metas(scene, seq, NULL); } static void invalidate_scene_strips(Scene *scene, Scene *scene_target, ListBase *seqbase) |