From f3f05daf11b6be97202750c0251060dc2f5a18f3 Mon Sep 17 00:00:00 2001 From: Hans Goudey Date: Tue, 11 Jul 2023 10:53:15 -0400 Subject: [PATCH] Cleanup: Remove unused "Simulation" data-block This data-block was originally added in eb4e3bbe68c8fb1d717d. However, that original plan wasn't fully implemented, with simulations now integrated with geometry nodes and modifiers instead of a separate data-block. We kept the data-block around anyway since we have the loose plan of using a similar data-block to make global simulations connected between multiple objects. But it may be a while before we implement that, and in the meantime having this just causes confusion. --- source/blender/CMakeLists.txt | 2 - source/blender/blenkernel/BKE_idtype.h | 1 - source/blender/blenkernel/BKE_main.h | 1 - source/blender/blenkernel/BKE_node.h | 1 - source/blender/blenkernel/BKE_simulation.h | 24 --- source/blender/blenkernel/CMakeLists.txt | 2 - source/blender/blenkernel/intern/anim_data.c | 6 - source/blender/blenkernel/intern/anim_sys.c | 3 - source/blender/blenkernel/intern/idtype.c | 5 - source/blender/blenkernel/intern/image.cc | 6 - .../blender/blenkernel/intern/lib_override.cc | 7 +- source/blender/blenkernel/intern/lib_query.c | 2 - source/blender/blenkernel/intern/main.c | 3 - source/blender/blenkernel/intern/node.cc | 9 - source/blender/blenkernel/intern/pointcache.c | 1 - .../blender/blenkernel/intern/simulation.cc | 192 ------------------ source/blender/blenloader/intern/readfile.cc | 2 - .../blender/depsgraph/DEG_depsgraph_build.h | 4 - .../intern/builder/deg_builder_nodes.cc | 27 --- .../intern/builder/deg_builder_nodes.h | 2 - .../intern/builder/deg_builder_relations.cc | 29 --- .../intern/builder/deg_builder_relations.h | 2 - .../debug/deg_debug_relations_graphviz.cc | 3 +- .../depsgraph/intern/depsgraph_build.cc | 11 - .../blender/depsgraph/intern/depsgraph_tag.cc | 1 - .../intern/eval/deg_eval_copy_on_write.cc | 6 - .../blender/depsgraph/intern/node/deg_node.cc | 4 - .../blender/depsgraph/intern/node/deg_node.h | 2 - .../intern/node/deg_node_component.cc | 2 - .../intern/node/deg_node_operation.cc | 2 - .../intern/node/deg_node_operation.h | 3 - .../animation/anim_channels_defines.cc | 80 -------- .../blender/editors/animation/anim_filter.cc | 13 -- source/blender/editors/include/ED_anim_api.h | 2 - .../editors/interface/interface_icons.cc | 3 - .../editors/interface/interface_templates.cc | 5 +- .../blender/editors/render/render_opengl.cc | 1 - .../editors/space_outliner/outliner_draw.cc | 3 - .../editors/space_outliner/outliner_intern.hh | 1 - .../editors/space_outliner/outliner_tools.cc | 2 - .../space_outliner/tree/tree_element_id.cc | 1 - source/blender/makesdna/DNA_ID.h | 1 - source/blender/makesdna/DNA_ID_enums.h | 1 - .../blender/makesdna/DNA_simulation_types.h | 38 ---- source/blender/makesdna/intern/dna_defaults.c | 8 - source/blender/makesrna/intern/CMakeLists.txt | 1 - source/blender/makesrna/intern/makesrna.c | 3 - source/blender/makesrna/intern/rna_ID.c | 17 -- source/blender/makesrna/intern/rna_ID.cc | 17 -- source/blender/makesrna/intern/rna_internal.h | 3 - source/blender/makesrna/intern/rna_main.cc | 11 - .../blender/makesrna/intern/rna_main_api.cc | 62 ------ .../blender/makesrna/intern/rna_simulation.cc | 46 ----- source/blender/modifiers/intern/MOD_nodes.cc | 1 - 54 files changed, 7 insertions(+), 678 deletions(-) delete mode 100644 source/blender/blenkernel/BKE_simulation.h delete mode 100644 source/blender/blenkernel/intern/simulation.cc delete mode 100644 source/blender/makesdna/DNA_simulation_types.h delete mode 100644 source/blender/makesrna/intern/rna_simulation.cc diff --git a/source/blender/CMakeLists.txt b/source/blender/CMakeLists.txt index 3f0fc409a44..b8c18d6929a 100644 --- a/source/blender/CMakeLists.txt +++ b/source/blender/CMakeLists.txt @@ -70,7 +70,6 @@ set(SRC_DNA_INC ${CMAKE_CURRENT_SOURCE_DIR}/makesdna/DNA_sequence_types.h ${CMAKE_CURRENT_SOURCE_DIR}/makesdna/DNA_session_uuid_types.h ${CMAKE_CURRENT_SOURCE_DIR}/makesdna/DNA_shader_fx_types.h - ${CMAKE_CURRENT_SOURCE_DIR}/makesdna/DNA_simulation_types.h ${CMAKE_CURRENT_SOURCE_DIR}/makesdna/DNA_sound_types.h ${CMAKE_CURRENT_SOURCE_DIR}/makesdna/DNA_space_types.h ${CMAKE_CURRENT_SOURCE_DIR}/makesdna/DNA_speaker_types.h @@ -119,7 +118,6 @@ set(SRC_DNA_DEFAULTS_INC ${CMAKE_CURRENT_SOURCE_DIR}/makesdna/DNA_particle_defaults.h ${CMAKE_CURRENT_SOURCE_DIR}/makesdna/DNA_pointcloud_defaults.h ${CMAKE_CURRENT_SOURCE_DIR}/makesdna/DNA_scene_defaults.h - ${CMAKE_CURRENT_SOURCE_DIR}/makesdna/DNA_simulation_defaults.h ${CMAKE_CURRENT_SOURCE_DIR}/makesdna/DNA_space_defaults.h ${CMAKE_CURRENT_SOURCE_DIR}/makesdna/DNA_speaker_defaults.h ${CMAKE_CURRENT_SOURCE_DIR}/makesdna/DNA_texture_defaults.h diff --git a/source/blender/blenkernel/BKE_idtype.h b/source/blender/blenkernel/BKE_idtype.h index e7f0c137678..6e0d14e695e 100644 --- a/source/blender/blenkernel/BKE_idtype.h +++ b/source/blender/blenkernel/BKE_idtype.h @@ -277,7 +277,6 @@ extern IDTypeInfo IDType_ID_LP; extern IDTypeInfo IDType_ID_CV; extern IDTypeInfo IDType_ID_PT; extern IDTypeInfo IDType_ID_VO; -extern IDTypeInfo IDType_ID_SIM; extern IDTypeInfo IDType_ID_GP; /** Empty shell mostly, but needed for read code. */ diff --git a/source/blender/blenkernel/BKE_main.h b/source/blender/blenkernel/BKE_main.h index fcea5e67d59..c75d16ac7c6 100644 --- a/source/blender/blenkernel/BKE_main.h +++ b/source/blender/blenkernel/BKE_main.h @@ -225,7 +225,6 @@ typedef struct Main { ListBase hair_curves; ListBase pointclouds; ListBase volumes; - ListBase simulations; /** * Must be generated, used and freed by same code - never assume this is valid data unless you diff --git a/source/blender/blenkernel/BKE_node.h b/source/blender/blenkernel/BKE_node.h index 9853ac05dcf..2fdb19299aa 100644 --- a/source/blender/blenkernel/BKE_node.h +++ b/source/blender/blenkernel/BKE_node.h @@ -880,7 +880,6 @@ struct NodeTreeIterStore { struct Light *light; struct World *world; struct FreestyleLineStyle *linestyle; - struct Simulation *simulation; }; void BKE_node_tree_iter_init(struct NodeTreeIterStore *ntreeiter, struct Main *bmain); diff --git a/source/blender/blenkernel/BKE_simulation.h b/source/blender/blenkernel/BKE_simulation.h deleted file mode 100644 index 489c4288ec9..00000000000 --- a/source/blender/blenkernel/BKE_simulation.h +++ /dev/null @@ -1,24 +0,0 @@ -/* SPDX-FileCopyrightText: 2023 Blender Foundation - * - * SPDX-License-Identifier: GPL-2.0-or-later */ - -#pragma once - -#ifdef __cplusplus -extern "C" { -#endif - -struct Depsgraph; -struct Main; -struct Scene; -struct Simulation; - -void *BKE_simulation_add(struct Main *bmain, const char *name); - -void BKE_simulation_data_update(struct Depsgraph *depsgraph, - struct Scene *scene, - struct Simulation *simulation); - -#ifdef __cplusplus -} -#endif diff --git a/source/blender/blenkernel/CMakeLists.txt b/source/blender/blenkernel/CMakeLists.txt index d010733a435..28be13ceb1a 100644 --- a/source/blender/blenkernel/CMakeLists.txt +++ b/source/blender/blenkernel/CMakeLists.txt @@ -264,7 +264,6 @@ set(SRC intern/screen.c intern/shader_fx.c intern/shrinkwrap.cc - intern/simulation.cc intern/simulation_state.cc intern/simulation_state_serialize.cc intern/softbody.c @@ -471,7 +470,6 @@ set(SRC BKE_sequencer_offscreen.h BKE_shader_fx.h BKE_shrinkwrap.h - BKE_simulation.h BKE_simulation_state.hh BKE_simulation_state_serialize.hh BKE_softbody.h diff --git a/source/blender/blenkernel/intern/anim_data.c b/source/blender/blenkernel/intern/anim_data.c index 384ec4078b1..fa0ed56acf4 100644 --- a/source/blender/blenkernel/intern/anim_data.c +++ b/source/blender/blenkernel/intern/anim_data.c @@ -1313,9 +1313,6 @@ void BKE_animdata_main_cb(Main *bmain, ID_AnimData_Edit_Callback func, void *use /* volumes */ ANIMDATA_IDS_CB(bmain->volumes.first); - - /* simulations */ - ANIMDATA_IDS_CB(bmain->simulations.first); } void BKE_animdata_fix_paths_rename_all(ID *ref_id, @@ -1443,9 +1440,6 @@ void BKE_animdata_fix_paths_rename_all_ex(Main *bmain, /* volumes */ RENAMEFIX_ANIM_IDS(bmain->volumes.first); - /* simulations */ - RENAMEFIX_ANIM_IDS(bmain->simulations.first); - /* scenes */ RENAMEFIX_ANIM_NODETREE_IDS(bmain->scenes.first, Scene); } diff --git a/source/blender/blenkernel/intern/anim_sys.c b/source/blender/blenkernel/intern/anim_sys.c index f6f5f065de2..17b8d8f1325 100644 --- a/source/blender/blenkernel/intern/anim_sys.c +++ b/source/blender/blenkernel/intern/anim_sys.c @@ -4103,9 +4103,6 @@ void BKE_animsys_evaluate_all_animation(Main *main, Depsgraph *depsgraph, float /* volumes */ EVAL_ANIM_IDS(main->volumes.first, ADT_RECALC_ANIM); - /* simulations */ - EVAL_ANIM_IDS(main->simulations.first, ADT_RECALC_ANIM); - /* objects */ /* ADT_RECALC_ANIM doesn't need to be supplied here, since object AnimData gets * this tagged by Depsgraph on frame-change. This optimization means that objects diff --git a/source/blender/blenkernel/intern/idtype.c b/source/blender/blenkernel/intern/idtype.c index fbd94172bae..c19eed5a941 100644 --- a/source/blender/blenkernel/intern/idtype.c +++ b/source/blender/blenkernel/intern/idtype.c @@ -95,7 +95,6 @@ static void id_type_init(void) INIT_TYPE(ID_CV); INIT_TYPE(ID_PT); INIT_TYPE(ID_VO); - INIT_TYPE(ID_SIM); INIT_TYPE(ID_GP); /* Special naughty boy... */ @@ -248,7 +247,6 @@ uint64_t BKE_idtype_idcode_to_idfilter(const short idcode) CASE_IDFILTER(PT); CASE_IDFILTER(SCE); CASE_IDFILTER(SCR); - CASE_IDFILTER(SIM); CASE_IDFILTER(SO); CASE_IDFILTER(SPK); CASE_IDFILTER(TE); @@ -307,7 +305,6 @@ short BKE_idtype_idcode_from_idfilter(const uint64_t idfilter) CASE_IDFILTER(PT); CASE_IDFILTER(SCE); CASE_IDFILTER(SCR); - CASE_IDFILTER(SIM); CASE_IDFILTER(SO); CASE_IDFILTER(SPK); CASE_IDFILTER(TE); @@ -364,7 +361,6 @@ int BKE_idtype_idcode_to_index(const short idcode) CASE_IDINDEX(LP); CASE_IDINDEX(SCE); CASE_IDINDEX(SCR); - CASE_IDINDEX(SIM); CASE_IDINDEX(SPK); CASE_IDINDEX(SO); CASE_IDINDEX(TE); @@ -424,7 +420,6 @@ short BKE_idtype_idcode_from_index(const int index) CASE_IDCODE(LP); CASE_IDCODE(SCE); CASE_IDCODE(SCR); - CASE_IDCODE(SIM); CASE_IDCODE(SPK); CASE_IDCODE(SO); CASE_IDCODE(TE); diff --git a/source/blender/blenkernel/intern/image.cc b/source/blender/blenkernel/intern/image.cc index 3850c11b371..c3ab70a2b1b 100644 --- a/source/blender/blenkernel/intern/image.cc +++ b/source/blender/blenkernel/intern/image.cc @@ -49,7 +49,6 @@ #include "DNA_packedFile_types.h" #include "DNA_scene_types.h" #include "DNA_sequence_types.h" -#include "DNA_simulation_types.h" #include "DNA_world_types.h" #include "BLI_blenlib.h" @@ -2881,11 +2880,6 @@ static void image_walk_id_all_users( } break; } - case ID_SIM: { - Simulation *simulation = (Simulation *)id; - image_walk_ntree_all_users(simulation->nodetree, &simulation->id, customdata, callback); - break; - } default: break; } diff --git a/source/blender/blenkernel/intern/lib_override.cc b/source/blender/blenkernel/intern/lib_override.cc index e93b2773a75..ac72d8701cc 100644 --- a/source/blender/blenkernel/intern/lib_override.cc +++ b/source/blender/blenkernel/intern/lib_override.cc @@ -276,9 +276,12 @@ static ID *lib_override_library_create_from(Main *bmain, LIB_ID_COPY_DEFAULT | LIB_ID_COPY_NO_LIB_OVERRIDE | lib_id_copy_flags); - /* Incase we could not get an override ID with the exact same name as its linked reference, ensure we at least get a uniquely named override ID over the whole current Main data, to reduce potential name collisions with other reference IDs. + /* Incase we could not get an override ID with the exact same name as its linked reference, + * ensure we at least get a uniquely named override ID over the whole current Main data, to + * reduce potential name collisions with other reference IDs. * - * While in normal cases this would not be an issue, when files start to get heavily broken and not sound, such conflicts can become a source of problems. */ + * While in normal cases this would not be an issue, when files start to get heavily broken and + * not sound, such conflicts can become a source of problems. */ if (!STREQ(local_id->name + 2, reference_id->name + 2)) { BLI_strncpy(local_id->name + 2, reference_id->name + 2, MAX_ID_NAME - 2); BKE_main_namemap_get_name(bmain, local_id, local_id->name + 2, true); diff --git a/source/blender/blenkernel/intern/lib_query.c b/source/blender/blenkernel/intern/lib_query.c index 1e677e10942..476e598928a 100644 --- a/source/blender/blenkernel/intern/lib_query.c +++ b/source/blender/blenkernel/intern/lib_query.c @@ -475,8 +475,6 @@ uint64_t BKE_library_id_can_use_filter_id(const ID *owner_id, const bool include return FILTER_ID_MA; case ID_VO: return FILTER_ID_MA; - case ID_SIM: - return FILTER_ID_OB | FILTER_ID_IM; case ID_WM: return FILTER_ID_SCE | FILTER_ID_WS; case ID_IM: diff --git a/source/blender/blenkernel/intern/main.c b/source/blender/blenkernel/intern/main.c index a2dd0b99b0b..7e3741a9d2f 100644 --- a/source/blender/blenkernel/intern/main.c +++ b/source/blender/blenkernel/intern/main.c @@ -597,8 +597,6 @@ ListBase *which_libbase(Main *bmain, short type) return &(bmain->pointclouds); case ID_VO: return &(bmain->volumes); - case ID_SIM: - return &(bmain->simulations); } return NULL; } @@ -664,7 +662,6 @@ int set_listbasepointers(Main *bmain, ListBase *lb[/*INDEX_ID_MAX*/]) lb[INDEX_ID_WS] = &(bmain->workspaces); /* before wm, so it's freed after it! */ lb[INDEX_ID_WM] = &(bmain->wm); lb[INDEX_ID_MSK] = &(bmain->masks); - lb[INDEX_ID_SIM] = &(bmain->simulations); lb[INDEX_ID_NULL] = NULL; diff --git a/source/blender/blenkernel/intern/node.cc b/source/blender/blenkernel/intern/node.cc index 38e343f8894..e1d337e3055 100644 --- a/source/blender/blenkernel/intern/node.cc +++ b/source/blender/blenkernel/intern/node.cc @@ -28,7 +28,6 @@ #include "DNA_modifier_types.h" #include "DNA_node_types.h" #include "DNA_scene_types.h" -#include "DNA_simulation_types.h" #include "DNA_texture_types.h" #include "DNA_world_types.h" @@ -3594,8 +3593,6 @@ bNodeTree **BKE_ntree_ptr_from_id(ID *id) return &reinterpret_cast(id)->nodetree; case ID_LS: return &reinterpret_cast(id)->nodetree; - case ID_SIM: - return &reinterpret_cast(id)->nodetree; default: return nullptr; } @@ -4726,7 +4723,6 @@ void BKE_node_tree_iter_init(NodeTreeIterStore *ntreeiter, Main *bmain) ntreeiter->light = (Light *)bmain->lights.first; ntreeiter->world = (World *)bmain->worlds.first; ntreeiter->linestyle = (FreestyleLineStyle *)bmain->linestyles.first; - ntreeiter->simulation = (Simulation *)bmain->simulations.first; } bool BKE_node_tree_iter_step(NodeTreeIterStore *ntreeiter, bNodeTree **r_nodetree, ID **r_id) { @@ -4766,11 +4762,6 @@ bool BKE_node_tree_iter_step(NodeTreeIterStore *ntreeiter, bNodeTree **r_nodetre *r_id = &ntreeiter->linestyle->id; ntreeiter->linestyle = reinterpret_cast(ntreeiter->linestyle->id.next); } - else if (ntreeiter->simulation) { - *r_nodetree = reinterpret_cast(ntreeiter->simulation->nodetree); - *r_id = &ntreeiter->simulation->id; - ntreeiter->simulation = reinterpret_cast(ntreeiter->simulation->id.next); - } else { return false; } diff --git a/source/blender/blenkernel/intern/pointcache.c b/source/blender/blenkernel/intern/pointcache.c index a29ca367931..b81b66541db 100644 --- a/source/blender/blenkernel/intern/pointcache.c +++ b/source/blender/blenkernel/intern/pointcache.c @@ -26,7 +26,6 @@ #include "DNA_particle_types.h" #include "DNA_rigidbody_types.h" #include "DNA_scene_types.h" -#include "DNA_simulation_types.h" #include "BLI_blenlib.h" #include "BLI_endian_switch.h" diff --git a/source/blender/blenkernel/intern/simulation.cc b/source/blender/blenkernel/intern/simulation.cc deleted file mode 100644 index 3372aae1a61..00000000000 --- a/source/blender/blenkernel/intern/simulation.cc +++ /dev/null @@ -1,192 +0,0 @@ -/* SPDX-FileCopyrightText: 2023 Blender Foundation - * - * SPDX-License-Identifier: GPL-2.0-or-later */ - -/** \file - * \ingroup bke - */ - -#include - -#include "MEM_guardedalloc.h" - -#include "DNA_ID.h" -#include "DNA_defaults.h" -#include "DNA_modifier_types.h" -#include "DNA_scene_types.h" -#include "DNA_simulation_types.h" - -#include "BLI_compiler_compat.h" -#include "BLI_listbase.h" -#include "BLI_math.h" -#include "BLI_math_vector_types.hh" -#include "BLI_rand.h" -#include "BLI_span.hh" -#include "BLI_string.h" -#include "BLI_utildefines.h" - -#include "BKE_anim_data.h" -#include "BKE_animsys.h" -#include "BKE_collection.h" -#include "BKE_customdata.h" -#include "BKE_idtype.h" -#include "BKE_lib_id.h" -#include "BKE_lib_query.h" -#include "BKE_lib_remap.h" -#include "BKE_main.h" -#include "BKE_modifier.h" -#include "BKE_node.hh" -#include "BKE_pointcache.h" -#include "BKE_simulation.h" -#include "BKE_simulation_state.hh" - -#include "NOD_geometry.hh" - -#include "BLI_map.hh" -#include "BLT_translation.h" - -#include "DEG_depsgraph.h" -#include "DEG_depsgraph_query.h" - -#include "MOD_nodes.hh" - -#include "BLO_read_write.h" - -static void simulation_init_data(ID *id) -{ - Simulation *simulation = (Simulation *)id; - BLI_assert(MEMCMP_STRUCT_AFTER_IS_ZERO(simulation, id)); - - MEMCPY_STRUCT_AFTER(simulation, DNA_struct_default_get(Simulation), id); - - blender::bke::ntreeAddTreeEmbedded(nullptr, id, "Geometry Nodetree", ntreeType_Geometry->idname); -} - -static void simulation_copy_data(Main *bmain, ID *id_dst, const ID *id_src, const int flag) -{ - Simulation *simulation_dst = (Simulation *)id_dst; - const Simulation *simulation_src = (const Simulation *)id_src; - - /* We always need allocation of our private ID data. */ - const int flag_private_id_data = flag & ~LIB_ID_CREATE_NO_ALLOCATE; - - if (simulation_src->nodetree) { - BKE_id_copy_ex(bmain, - (ID *)simulation_src->nodetree, - (ID **)&simulation_dst->nodetree, - flag_private_id_data); - simulation_dst->nodetree->owner_id = &simulation_dst->id; - } -} - -static void simulation_free_data(ID *id) -{ - Simulation *simulation = (Simulation *)id; - - BKE_animdata_free(&simulation->id, false); - - if (simulation->nodetree) { - ntreeFreeEmbeddedTree(simulation->nodetree); - MEM_freeN(simulation->nodetree); - simulation->nodetree = nullptr; - } -} - -static void simulation_foreach_id(ID *id, LibraryForeachIDData *data) -{ - Simulation *simulation = (Simulation *)id; - if (simulation->nodetree) { - /* nodetree **are owned by IDs**, treat them as mere sub-data and not real ID! */ - BKE_LIB_FOREACHID_PROCESS_FUNCTION_CALL( - data, BKE_library_foreach_ID_embedded(data, (ID **)&simulation->nodetree)); - } -} - -static void simulation_blend_write(BlendWriter *writer, ID *id, const void *id_address) -{ - Simulation *simulation = (Simulation *)id; - - BLO_write_id_struct(writer, Simulation, id_address, &simulation->id); - BKE_id_blend_write(writer, &simulation->id); - - if (simulation->adt) { - BKE_animdata_blend_write(writer, simulation->adt); - } - - /* nodetree is integral part of simulation, no libdata */ - if (simulation->nodetree) { - BLO_Write_IDBuffer *temp_embedded_id_buffer = BLO_write_allocate_id_buffer(); - BLO_write_init_id_buffer_from_id( - temp_embedded_id_buffer, &simulation->nodetree->id, BLO_write_is_undo(writer)); - BLO_write_struct_at_address(writer, - bNodeTree, - simulation->nodetree, - BLO_write_get_id_buffer_temp_id(temp_embedded_id_buffer)); - ntreeBlendWrite( - writer, - reinterpret_cast(BLO_write_get_id_buffer_temp_id(temp_embedded_id_buffer))); - BLO_write_destroy_id_buffer(&temp_embedded_id_buffer); - } -} - -static void simulation_blend_read_data(BlendDataReader *reader, ID *id) -{ - Simulation *simulation = (Simulation *)id; - BLO_read_data_address(reader, &simulation->adt); - BKE_animdata_blend_read_data(reader, simulation->adt); -} - -static void simulation_blend_read_lib(BlendLibReader *reader, ID *id) -{ - Simulation *simulation = (Simulation *)id; - UNUSED_VARS(simulation, reader); -} - -static void simulation_blend_read_expand(BlendExpander *expander, ID *id) -{ - Simulation *simulation = (Simulation *)id; - UNUSED_VARS(simulation, expander); -} - -IDTypeInfo IDType_ID_SIM = { - /*id_code*/ ID_SIM, - /*id_filter*/ FILTER_ID_SIM, - /*main_listbase_index*/ INDEX_ID_SIM, - /*struct_size*/ sizeof(Simulation), - /*name*/ "Simulation", - /*name_plural*/ "simulations", - /*translation_context*/ BLT_I18NCONTEXT_ID_SIMULATION, - /*flags*/ IDTYPE_FLAGS_APPEND_IS_REUSABLE, - /*asset_type_info*/ nullptr, - - /*init_data*/ simulation_init_data, - /*copy_data*/ simulation_copy_data, - /*free_data*/ simulation_free_data, - /*make_local*/ nullptr, - /*foreach_id*/ simulation_foreach_id, - /*foreach_cache*/ nullptr, - /*foreach_path*/ nullptr, - /*owner_pointer_get*/ nullptr, - - /*blend_write*/ simulation_blend_write, - /*blend_read_data*/ simulation_blend_read_data, - /*blend_read_lib*/ simulation_blend_read_lib, - /*blend_read_expand*/ simulation_blend_read_expand, - - /*blend_read_undo_preserve*/ nullptr, - - /*lib_override_apply_post*/ nullptr, -}; - -void *BKE_simulation_add(Main *bmain, const char *name) -{ - Simulation *simulation = (Simulation *)BKE_id_new(bmain, ID_SIM, name); - return simulation; -} - -void BKE_simulation_data_update(Depsgraph * /*depsgraph*/, - Scene * /*scene*/, - Simulation * /*simulation*/) -{ -} - diff --git a/source/blender/blenloader/intern/readfile.cc b/source/blender/blenloader/intern/readfile.cc index 2354c174fa4..9daf90a09ee 100644 --- a/source/blender/blenloader/intern/readfile.cc +++ b/source/blender/blenloader/intern/readfile.cc @@ -2397,8 +2397,6 @@ static const char *dataname(short id_code) return "Data from PT"; case ID_VO: return "Data from VO"; - case ID_SIM: - return "Data from SIM"; case ID_GP: return "Data from GP"; } diff --git a/source/blender/depsgraph/DEG_depsgraph_build.h b/source/blender/depsgraph/DEG_depsgraph_build.h index f0e2c750ffc..0660d42a87a 100644 --- a/source/blender/depsgraph/DEG_depsgraph_build.h +++ b/source/blender/depsgraph/DEG_depsgraph_build.h @@ -24,7 +24,6 @@ struct ID; struct Main; struct Object; struct Scene; -struct Simulation; struct bNodeTree; #include "BLI_sys_types.h" @@ -135,9 +134,6 @@ void DEG_add_collection_geometry_relation(struct DepsNodeHandle *node_handle, void DEG_add_collection_geometry_customdata_mask(struct DepsNodeHandle *node_handle, struct Collection *collection, const struct CustomData_MeshMasks *masks); -void DEG_add_simulation_relation(struct DepsNodeHandle *node_handle, - struct Simulation *simulation, - const char *description); void DEG_add_node_tree_output_relation(struct DepsNodeHandle *node_handle, struct bNodeTree *node_tree, const char *description); diff --git a/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc b/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc index cffa7e087a2..7e965a2e14e 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc @@ -45,7 +45,6 @@ #include "DNA_rigidbody_types.h" #include "DNA_scene_types.h" #include "DNA_sequence_types.h" -#include "DNA_simulation_types.h" #include "DNA_sound_types.h" #include "DNA_speaker_types.h" #include "DNA_texture_types.h" @@ -88,7 +87,6 @@ #include "BKE_rigidbody.h" #include "BKE_scene.h" #include "BKE_shader_fx.h" -#include "BKE_simulation.h" #include "BKE_simulation_state.hh" #include "BKE_sound.h" #include "BKE_tracking.h" @@ -638,9 +636,6 @@ void DepsgraphNodeBuilder::build_id(ID *id) case ID_SCE: build_scene_parameters((Scene *)id); break; - case ID_SIM: - build_simulation((Simulation *)id); - break; case ID_PA: build_particle_settings((ParticleSettings *)id); break; @@ -2148,28 +2143,6 @@ void DepsgraphNodeBuilder::build_sound(bSound *sound) build_parameters(&sound->id); } -void DepsgraphNodeBuilder::build_simulation(Simulation *simulation) -{ - if (built_map_.checkIsBuiltAndTag(simulation)) { - return; - } - add_id_node(&simulation->id); - build_idproperties(simulation->id.properties); - build_animdata(&simulation->id); - build_parameters(&simulation->id); - build_nodetree(simulation->nodetree); - - Simulation *simulation_cow = get_cow_datablock(simulation); - Scene *scene_cow = get_cow_datablock(scene_); - - add_operation_node(&simulation->id, - NodeType::SIMULATION, - OperationCode::SIMULATION_EVAL, - [scene_cow, simulation_cow](::Depsgraph *depsgraph) { - BKE_simulation_data_update(depsgraph, scene_cow, simulation_cow); - }); -} - void DepsgraphNodeBuilder::build_vfont(VFont *vfont) { if (built_map_.checkIsBuiltAndTag(vfont)) { diff --git a/source/blender/depsgraph/intern/builder/deg_builder_nodes.h b/source/blender/depsgraph/intern/builder/deg_builder_nodes.h index 6d6896e9633..b90c60e5c05 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_nodes.h +++ b/source/blender/depsgraph/intern/builder/deg_builder_nodes.h @@ -38,7 +38,6 @@ struct MovieClip; struct Object; struct ParticleSettings; struct Scene; -struct Simulation; struct Speaker; struct Tex; struct VFont; @@ -263,7 +262,6 @@ class DepsgraphNodeBuilder : public DepsgraphBuilder { virtual void build_lightprobe(LightProbe *probe); virtual void build_speaker(Speaker *speaker); virtual void build_sound(bSound *sound); - virtual void build_simulation(Simulation *simulation); virtual void build_scene_sequencer(Scene *scene); virtual void build_scene_audio(Scene *scene); virtual void build_scene_speakers(Scene *scene, ViewLayer *view_layer); diff --git a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc index 9cbbfe9b802..9dfef815264 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc @@ -47,7 +47,6 @@ #include "DNA_rigidbody_types.h" #include "DNA_scene_types.h" #include "DNA_sequence_types.h" -#include "DNA_simulation_types.h" #include "DNA_sound_types.h" #include "DNA_speaker_types.h" #include "DNA_texture_types.h" @@ -583,9 +582,6 @@ void DepsgraphRelationBuilder::build_id(ID *id) case ID_SCE: build_scene_parameters((Scene *)id); break; - case ID_SIM: - build_simulation((Simulation *)id); - break; case ID_PA: build_particle_settings((ParticleSettings *)id); break; @@ -3147,31 +3143,6 @@ void DepsgraphRelationBuilder::build_sound(bSound *sound) add_relation(parameters_key, audio_key, "Parameters -> Audio"); } -void DepsgraphRelationBuilder::build_simulation(Simulation *simulation) -{ - if (built_map_.checkIsBuiltAndTag(simulation)) { - return; - } - - const BuilderStack::ScopedEntry stack_entry = stack_.trace(simulation->id); - - build_idproperties(simulation->id.properties); - build_animdata(&simulation->id); - build_parameters(&simulation->id); - - build_nodetree(simulation->nodetree); - build_nested_nodetree(&simulation->id, simulation->nodetree); - - OperationKey simulation_eval_key( - &simulation->id, NodeType::SIMULATION, OperationCode::SIMULATION_EVAL); - TimeSourceKey time_src_key; - add_relation(time_src_key, simulation_eval_key, "TimeSrc -> Simulation"); - - OperationKey nodetree_key( - &simulation->nodetree->id, NodeType::PARAMETERS, OperationCode::PARAMETERS_EXIT); - add_relation(nodetree_key, simulation_eval_key, "NodeTree -> Simulation", 0); -} - using Seq_build_prop_cb_data = struct Seq_build_prop_cb_data { DepsgraphRelationBuilder *builder; ComponentKey sequencer_key; diff --git a/source/blender/depsgraph/intern/builder/deg_builder_relations.h b/source/blender/depsgraph/intern/builder/deg_builder_relations.h index 861cc2fbe28..513ce4d988f 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_relations.h +++ b/source/blender/depsgraph/intern/builder/deg_builder_relations.h @@ -54,7 +54,6 @@ struct Object; struct ParticleSettings; struct ParticleSystem; struct Scene; -struct Simulation; struct Speaker; struct Tex; struct VFont; @@ -232,7 +231,6 @@ class DepsgraphRelationBuilder : public DepsgraphBuilder { virtual void build_lightprobe(LightProbe *probe); virtual void build_speaker(Speaker *speaker); virtual void build_sound(bSound *sound); - virtual void build_simulation(Simulation *simulation); virtual void build_scene_sequencer(Scene *scene); virtual void build_scene_audio(Scene *scene); virtual void build_scene_speakers(Scene *scene, ViewLayer *view_layer); diff --git a/source/blender/depsgraph/intern/debug/deg_debug_relations_graphviz.cc b/source/blender/depsgraph/intern/debug/deg_debug_relations_graphviz.cc index 2c594f578f9..9da2c3c4080 100644 --- a/source/blender/depsgraph/intern/debug/deg_debug_relations_graphviz.cc +++ b/source/blender/depsgraph/intern/debug/deg_debug_relations_graphviz.cc @@ -410,8 +410,7 @@ static void deg_debug_graphviz_node(DotExportContext &ctx, case NodeType::GENERIC_DATABLOCK: case NodeType::VISIBILITY: case NodeType::NTREE_OUTPUT: - case NodeType::NTREE_GEOMETRY_PREPROCESS: - case NodeType::SIMULATION: { + case NodeType::NTREE_GEOMETRY_PREPROCESS: { ComponentNode *comp_node = (ComponentNode *)node; if (comp_node->operations.is_empty()) { deg_debug_graphviz_node_single(ctx, node, parent_cluster); diff --git a/source/blender/depsgraph/intern/depsgraph_build.cc b/source/blender/depsgraph/intern/depsgraph_build.cc index 76481c870d8..6c07fc4c294 100644 --- a/source/blender/depsgraph/intern/depsgraph_build.cc +++ b/source/blender/depsgraph/intern/depsgraph_build.cc @@ -21,7 +21,6 @@ #include "DNA_node_types.h" #include "DNA_object_types.h" #include "DNA_scene_types.h" -#include "DNA_simulation_types.h" #include "BKE_collection.h" #include "BKE_main.h" @@ -123,16 +122,6 @@ void DEG_add_collection_geometry_customdata_mask(DepsNodeHandle *node_handle, FOREACH_COLLECTION_OBJECT_RECURSIVE_END; } -void DEG_add_simulation_relation(DepsNodeHandle *node_handle, - Simulation *simulation, - const char *description) -{ - deg::OperationKey operation_key( - &simulation->id, deg::NodeType::SIMULATION, deg::OperationCode::SIMULATION_EVAL); - deg::DepsNodeHandle *deg_node_handle = get_node_handle(node_handle); - deg_node_handle->builder->add_node_handle_relation(operation_key, deg_node_handle, description); -} - void DEG_add_node_tree_output_relation(DepsNodeHandle *node_handle, bNodeTree *node_tree, const char *description) diff --git a/source/blender/depsgraph/intern/depsgraph_tag.cc b/source/blender/depsgraph/intern/depsgraph_tag.cc index 943766132ae..3afa06b8a20 100644 --- a/source/blender/depsgraph/intern/depsgraph_tag.cc +++ b/source/blender/depsgraph/intern/depsgraph_tag.cc @@ -819,7 +819,6 @@ void DEG_graph_id_type_tag(Depsgraph *depsgraph, short id_type) DEG_graph_id_type_tag(depsgraph, ID_LA); DEG_graph_id_type_tag(depsgraph, ID_WO); DEG_graph_id_type_tag(depsgraph, ID_SCE); - DEG_graph_id_type_tag(depsgraph, ID_SIM); } const int id_type_index = BKE_idtype_idcode_to_index(id_type); deg::Depsgraph *deg_graph = reinterpret_cast(depsgraph); diff --git a/source/blender/depsgraph/intern/eval/deg_eval_copy_on_write.cc b/source/blender/depsgraph/intern/eval/deg_eval_copy_on_write.cc index 73ecf3f7bc6..adf5bb627a8 100644 --- a/source/blender/depsgraph/intern/eval/deg_eval_copy_on_write.cc +++ b/source/blender/depsgraph/intern/eval/deg_eval_copy_on_write.cc @@ -50,7 +50,6 @@ #include "DNA_rigidbody_types.h" #include "DNA_scene_types.h" #include "DNA_sequence_types.h" -#include "DNA_simulation_types.h" #include "DNA_sound_types.h" #include "DRW_engine.h" @@ -107,7 +106,6 @@ union NestedIDHackTempStorage { Scene scene; Tex tex; World world; - Simulation simulation; }; /* Set nested owned ID pointers to nullptr. */ @@ -125,7 +123,6 @@ void nested_id_hack_discard_pointers(ID *id_cow) SPECIAL_CASE(ID_MA, Material, nodetree) SPECIAL_CASE(ID_TE, Tex, nodetree) SPECIAL_CASE(ID_WO, World, nodetree) - SPECIAL_CASE(ID_SIM, Simulation, nodetree) SPECIAL_CASE(ID_CU_LEGACY, Curve, key) SPECIAL_CASE(ID_LT, Lattice, key) @@ -174,7 +171,6 @@ const ID *nested_id_hack_get_discarded_pointers(NestedIDHackTempStorage *storage SPECIAL_CASE(ID_MA, Material, nodetree, material) SPECIAL_CASE(ID_TE, Tex, nodetree, tex) SPECIAL_CASE(ID_WO, World, nodetree, world) - SPECIAL_CASE(ID_SIM, Simulation, nodetree, simulation) SPECIAL_CASE(ID_CU_LEGACY, Curve, key, curve) SPECIAL_CASE(ID_LT, Lattice, key, lattice) @@ -214,7 +210,6 @@ void nested_id_hack_restore_pointers(const ID *old_id, ID *new_id) SPECIAL_CASE(ID_SCE, Scene, nodetree) SPECIAL_CASE(ID_TE, Tex, nodetree) SPECIAL_CASE(ID_WO, World, nodetree) - SPECIAL_CASE(ID_SIM, Simulation, nodetree) SPECIAL_CASE(ID_CU_LEGACY, Curve, key) SPECIAL_CASE(ID_LT, Lattice, key) @@ -252,7 +247,6 @@ void ntree_hack_remap_pointers(const Depsgraph *depsgraph, ID *id_cow) SPECIAL_CASE(ID_SCE, Scene, nodetree, bNodeTree) SPECIAL_CASE(ID_TE, Tex, nodetree, bNodeTree) SPECIAL_CASE(ID_WO, World, nodetree, bNodeTree) - SPECIAL_CASE(ID_SIM, Simulation, nodetree, bNodeTree) SPECIAL_CASE(ID_CU_LEGACY, Curve, key, Key) SPECIAL_CASE(ID_LT, Lattice, key, Key) diff --git a/source/blender/depsgraph/intern/node/deg_node.cc b/source/blender/depsgraph/intern/node/deg_node.cc index 29c6b7ee725..0a844d574c1 100644 --- a/source/blender/depsgraph/intern/node/deg_node.cc +++ b/source/blender/depsgraph/intern/node/deg_node.cc @@ -99,8 +99,6 @@ const char *nodeTypeAsString(NodeType type) return "GENERIC_DATABLOCK"; case NodeType::VISIBILITY: return "VISIBILITY"; - case NodeType::SIMULATION: - return "SIMULATION"; case NodeType::NTREE_OUTPUT: return "NTREE_OUTPUT"; case NodeType::NTREE_GEOMETRY_PREPROCESS: @@ -162,7 +160,6 @@ eDepsSceneComponentType nodeTypeToSceneComponent(NodeType type) case NodeType::BONE: case NodeType::SHADING: case NodeType::CACHE: - case NodeType::SIMULATION: case NodeType::NTREE_OUTPUT: case NodeType::NTREE_GEOMETRY_PREPROCESS: return DEG_SCENE_COMP_PARAMETERS; @@ -238,7 +235,6 @@ eDepsObjectComponentType nodeTypeToObjectComponent(NodeType type) case NodeType::BATCH_CACHE: case NodeType::DUPLI: case NodeType::SYNCHRONIZATION: - case NodeType::SIMULATION: case NodeType::NTREE_OUTPUT: case NodeType::NTREE_GEOMETRY_PREPROCESS: case NodeType::UNDEFINED: diff --git a/source/blender/depsgraph/intern/node/deg_node.h b/source/blender/depsgraph/intern/node/deg_node.h index c2180e99d06..eb5f27e4795 100644 --- a/source/blender/depsgraph/intern/node/deg_node.h +++ b/source/blender/depsgraph/intern/node/deg_node.h @@ -129,8 +129,6 @@ enum class NodeType { DUPLI, /* Synchronization back to original datablock. */ SYNCHRONIZATION, - /* Simulation component. */ - SIMULATION, /* Node tree output component. */ NTREE_OUTPUT, /* Preprocessing for geometry node trees before they can be evaluated. */ diff --git a/source/blender/depsgraph/intern/node/deg_node_component.cc b/source/blender/depsgraph/intern/node/deg_node_component.cc index 31d57a877bc..1b4df9decbe 100644 --- a/source/blender/depsgraph/intern/node/deg_node_component.cc +++ b/source/blender/depsgraph/intern/node/deg_node_component.cc @@ -339,7 +339,6 @@ DEG_COMPONENT_NODE_DEFINE(Audio, AUDIO, 0); DEG_COMPONENT_NODE_DEFINE(Armature, ARMATURE, 0); DEG_COMPONENT_NODE_DEFINE(GenericDatablock, GENERIC_DATABLOCK, 0); DEG_COMPONENT_NODE_DEFINE(Visibility, VISIBILITY, 0); -DEG_COMPONENT_NODE_DEFINE(Simulation, SIMULATION, 0); DEG_COMPONENT_NODE_DEFINE(NTreeOutput, NTREE_OUTPUT, ID_RECALC_NTREE_OUTPUT); DEG_COMPONENT_NODE_DEFINE(NTreeGeometryPreprocess, NTREE_GEOMETRY_PREPROCESS, 0); @@ -375,7 +374,6 @@ void deg_register_component_depsnodes() register_node_typeinfo(&DNTI_ARMATURE); register_node_typeinfo(&DNTI_GENERIC_DATABLOCK); register_node_typeinfo(&DNTI_VISIBILITY); - register_node_typeinfo(&DNTI_SIMULATION); register_node_typeinfo(&DNTI_NTREE_OUTPUT); register_node_typeinfo(&DNTI_NTREE_GEOMETRY_PREPROCESS); } diff --git a/source/blender/depsgraph/intern/node/deg_node_operation.cc b/source/blender/depsgraph/intern/node/deg_node_operation.cc index 590999b9593..f03c8b08eb6 100644 --- a/source/blender/depsgraph/intern/node/deg_node_operation.cc +++ b/source/blender/depsgraph/intern/node/deg_node_operation.cc @@ -200,8 +200,6 @@ const char *operationCodeAsString(OperationCode opcode) /* instancing/duplication. */ case OperationCode::DUPLI: return "DUPLI"; - case OperationCode::SIMULATION_EVAL: - return "SIMULATION_EVAL"; } BLI_assert_msg(0, "Unhandled operation code, should never happen."); return "UNKNOWN"; diff --git a/source/blender/depsgraph/intern/node/deg_node_operation.h b/source/blender/depsgraph/intern/node/deg_node_operation.h index 60681037b95..e243fc4353c 100644 --- a/source/blender/depsgraph/intern/node/deg_node_operation.h +++ b/source/blender/depsgraph/intern/node/deg_node_operation.h @@ -199,9 +199,6 @@ enum class OperationCode { /* Duplication/instancing system. --------------------------------------- */ DUPLI, - - /* Simulation. ---------------------------------------------------------- */ - SIMULATION_EVAL, }; const char *operationCodeAsString(OperationCode opcode); diff --git a/source/blender/editors/animation/anim_channels_defines.cc b/source/blender/editors/animation/anim_channels_defines.cc index d7ec7a8f5e5..e68a96b8ddf 100644 --- a/source/blender/editors/animation/anim_channels_defines.cc +++ b/source/blender/editors/animation/anim_channels_defines.cc @@ -36,7 +36,6 @@ #include "DNA_pointcloud_types.h" #include "DNA_scene_types.h" #include "DNA_screen_types.h" -#include "DNA_simulation_types.h" #include "DNA_space_types.h" #include "DNA_speaker_types.h" #include "DNA_userdef_types.h" @@ -3043,84 +3042,6 @@ static bAnimChannelType ACF_DSVOLUME = { /*setting_flag*/ acf_dsvolume_setting_flag, /*setting_ptr*/ acf_dsvolume_setting_ptr}; -/* Simulation Expander ----------------------------------------- */ - -static int acf_dssimulation_icon(bAnimListElem * /*ale*/) -{ - /* TODO: Use correct icon. */ - return ICON_PHYSICS; -} - -static int acf_dssimulation_setting_flag(bAnimContext * /*ac*/, - eAnimChannel_Settings setting, - bool *r_neg) -{ - /* Clear extra return data first. */ - *r_neg = false; - - switch (setting) { - case ACHANNEL_SETTING_EXPAND: /* expanded */ - return SIM_DS_EXPAND; - - case ACHANNEL_SETTING_MUTE: /* mute (only in NLA) */ - return ADT_NLA_EVAL_OFF; - - case ACHANNEL_SETTING_VISIBLE: /* visible (only in Graph Editor) */ - *r_neg = true; - return ADT_CURVES_NOT_VISIBLE; - - case ACHANNEL_SETTING_SELECT: /* selected */ - return ADT_UI_SELECTED; - - default: /* unsupported */ - return 0; - } -} - -static void *acf_dssimulation_setting_ptr(bAnimListElem *ale, - eAnimChannel_Settings setting, - short *r_type) -{ - Simulation *simulation = (Simulation *)ale->data; - - /* Clear extra return data first. */ - *r_type = 0; - - switch (setting) { - case ACHANNEL_SETTING_EXPAND: /* expanded */ - return GET_ACF_FLAG_PTR(simulation->flag, r_type); - - case ACHANNEL_SETTING_SELECT: /* selected */ - case ACHANNEL_SETTING_MUTE: /* muted (for NLA only) */ - case ACHANNEL_SETTING_VISIBLE: /* visible (for Graph Editor only) */ - if (simulation->adt) { - return GET_ACF_FLAG_PTR(simulation->adt->flag, r_type); - } - return nullptr; - - default: /* unsupported */ - return nullptr; - } -} - -/** Simulation expander type define. */ -static bAnimChannelType ACF_DSSIMULATION = { - /*channel_type_name*/ "Simulation Expander", - /*channel_role*/ ACHANNEL_ROLE_EXPANDER, - - /*get_backdrop_color*/ acf_generic_dataexpand_color, - /*draw_backdrop*/ acf_generic_dataexpand_backdrop, - /*get_indent_level*/ acf_generic_indentation_1, - /*get_offset*/ acf_generic_basic_offset, - - /*name*/ acf_generic_idblock_name, - /*name_prop*/ acf_generic_idblock_name_prop, - /*icon*/ acf_dssimulation_icon, - - /*has_setting*/ acf_generic_dataexpand_setting_valid, - /*setting_flag*/ acf_dssimulation_setting_flag, - /*setting_ptr*/ acf_dssimulation_setting_ptr}; - /* GPencil Expander ------------------------------------------- */ /* TODO: just get this from RNA? */ @@ -4132,7 +4053,6 @@ static void ANIM_init_channel_typeinfo_data() animchannelTypeInfo[type++] = &ACF_DSCURVES; /* Curves Channel */ animchannelTypeInfo[type++] = &ACF_DSPOINTCLOUD; /* PointCloud Channel */ animchannelTypeInfo[type++] = &ACF_DSVOLUME; /* Volume Channel */ - animchannelTypeInfo[type++] = &ACF_DSSIMULATION; /* Simulation Channel */ animchannelTypeInfo[type++] = &ACF_SHAPEKEY; /* ShapeKey */ diff --git a/source/blender/editors/animation/anim_filter.cc b/source/blender/editors/animation/anim_filter.cc index 09004341c1e..f6730dcbbf9 100644 --- a/source/blender/editors/animation/anim_filter.cc +++ b/source/blender/editors/animation/anim_filter.cc @@ -52,7 +52,6 @@ #include "DNA_scene_types.h" #include "DNA_screen_types.h" #include "DNA_sequence_types.h" -#include "DNA_simulation_types.h" #include "DNA_space_types.h" #include "DNA_speaker_types.h" #include "DNA_userdef_types.h" @@ -797,18 +796,6 @@ static bAnimListElem *make_new_animlistelem(void *data, ale->adt = BKE_animdata_from_id(static_cast(data)); break; } - case ANIMTYPE_DSSIMULATION: { - Simulation *simulation = (Simulation *)data; - AnimData *adt = simulation->adt; - - ale->flag = FILTER_SIMULATION_OBJD(simulation); - - ale->key_data = (adt) ? adt->action : nullptr; - ale->datatype = ALE_ACT; - - ale->adt = BKE_animdata_from_id(static_cast(data)); - break; - } case ANIMTYPE_DSSKEY: { Key *key = (Key *)data; AnimData *adt = key->adt; diff --git a/source/blender/editors/include/ED_anim_api.h b/source/blender/editors/include/ED_anim_api.h index 005f17c7096..3f1135bd162 100644 --- a/source/blender/editors/include/ED_anim_api.h +++ b/source/blender/editors/include/ED_anim_api.h @@ -372,8 +372,6 @@ ENUM_OPERATORS(eAnimFilter_Flags, ANIMFILTER_TMP_IGNORE_ONLYSEL); #define FILTER_CURVES_OBJD(ha) (CHECK_TYPE_INLINE(ha, Curves *), ((ha->flag & HA_DS_EXPAND))) #define FILTER_POINTS_OBJD(pt) (CHECK_TYPE_INLINE(pt, PointCloud *), ((pt->flag & PT_DS_EXPAND))) #define FILTER_VOLUME_OBJD(vo) (CHECK_TYPE_INLINE(vo, Volume *), ((vo->flag & VO_DS_EXPAND))) -#define FILTER_SIMULATION_OBJD(sim) \ - (CHECK_TYPE_INLINE(sim, Simulation *), ((sim->flag & SIM_DS_EXPAND))) /* Variable use expanders */ #define FILTER_NTREE_DATA(ntree) \ (CHECK_TYPE_INLINE(ntree, bNodeTree *), (((ntree)->flag & NTREE_DS_EXPAND))) diff --git a/source/blender/editors/interface/interface_icons.cc b/source/blender/editors/interface/interface_icons.cc index c68241fc578..90c05adb420 100644 --- a/source/blender/editors/interface/interface_icons.cc +++ b/source/blender/editors/interface/interface_icons.cc @@ -2457,9 +2457,6 @@ int UI_icon_from_idcode(const int idcode) return ICON_WORLD_DATA; case ID_WS: return ICON_WORKSPACE; - case ID_SIM: - /* TODO: Use correct icon. */ - return ICON_PHYSICS; case ID_GP: return ICON_OUTLINER_DATA_GREASEPENCIL; diff --git a/source/blender/editors/interface/interface_templates.cc b/source/blender/editors/interface/interface_templates.cc index fdd7a3897a9..bbfb337e630 100644 --- a/source/blender/editors/interface/interface_templates.cc +++ b/source/blender/editors/interface/interface_templates.cc @@ -1136,8 +1136,6 @@ static const char *template_id_browse_tip(const StructRNA *type) return N_("Browse Point Cloud Data to be linked"); case ID_VO: return N_("Browse Volume Data to be linked"); - case ID_SIM: - return N_("Browse Simulation to be linked"); case ID_GP: return N_("Browse Grease Pencil Data to be linked"); @@ -1236,8 +1234,7 @@ static uiBut *template_id_def_new_but(uiBlock *block, BLT_I18NCONTEXT_ID_LIGHTPROBE, BLT_I18NCONTEXT_ID_CURVES, BLT_I18NCONTEXT_ID_POINTCLOUD, - BLT_I18NCONTEXT_ID_VOLUME, - BLT_I18NCONTEXT_ID_SIMULATION, ); + BLT_I18NCONTEXT_ID_VOLUME, ); BLT_I18N_MSGID_MULTI_CTXT("New", BLT_I18NCONTEXT_ID_PAINTCURVE, ); /* NOTE: BLT_I18N_MSGID_MULTI_CTXT takes a maximum number of parameters, * check the definition to see if a new call must be added when the limit diff --git a/source/blender/editors/render/render_opengl.cc b/source/blender/editors/render/render_opengl.cc index a7b8f278556..9607065fdf3 100644 --- a/source/blender/editors/render/render_opengl.cc +++ b/source/blender/editors/render/render_opengl.cc @@ -602,7 +602,6 @@ static int gather_frames_to_render_for_id(LibraryIDLinkCallbackData *cb_data) case ID_CV: /* Curves */ case ID_PT: /* PointCloud */ case ID_VO: /* Volume */ - case ID_SIM: /* Simulation */ break; /* Blacklist: */ diff --git a/source/blender/editors/space_outliner/outliner_draw.cc b/source/blender/editors/space_outliner/outliner_draw.cc index ce9651118a5..7f1a34bebe1 100644 --- a/source/blender/editors/space_outliner/outliner_draw.cc +++ b/source/blender/editors/space_outliner/outliner_draw.cc @@ -2499,9 +2499,6 @@ static BIFIconID tree_element_get_icon_from_id(const ID *id) return ICON_SEQUENCE; case ID_PC: return ICON_CURVE_BEZCURVE; - case ID_SIM: - /* TODO: Use correct icon. */ - return ICON_PHYSICS; default: return ICON_NONE; } diff --git a/source/blender/editors/space_outliner/outliner_intern.hh b/source/blender/editors/space_outliner/outliner_intern.hh index 5ab885e524d..ab9629603bb 100644 --- a/source/blender/editors/space_outliner/outliner_intern.hh +++ b/source/blender/editors/space_outliner/outliner_intern.hh @@ -135,7 +135,6 @@ struct TreeElementIcon { ID_CV, \ ID_PT, \ ID_VO, \ - ID_SIM, \ ID_GP) || /* Only in 'blendfile' mode ... :/ */ \ ELEM(GS((_id)->name), \ ID_SCR, \ diff --git a/source/blender/editors/space_outliner/outliner_tools.cc b/source/blender/editors/space_outliner/outliner_tools.cc index ce770eed397..d4226382fb6 100644 --- a/source/blender/editors/space_outliner/outliner_tools.cc +++ b/source/blender/editors/space_outliner/outliner_tools.cc @@ -26,7 +26,6 @@ #include "DNA_pointcloud_types.h" #include "DNA_scene_types.h" #include "DNA_sequence_types.h" -#include "DNA_simulation_types.h" #include "DNA_volume_types.h" #include "DNA_world_types.h" @@ -165,7 +164,6 @@ static void get_element_operation_type( case ID_CV: case ID_PT: case ID_VO: - case ID_SIM: case ID_GP: is_standard_id = true; break; diff --git a/source/blender/editors/space_outliner/tree/tree_element_id.cc b/source/blender/editors/space_outliner/tree/tree_element_id.cc index 64a7e59ac70..577f37dcd2e 100644 --- a/source/blender/editors/space_outliner/tree/tree_element_id.cc +++ b/source/blender/editors/space_outliner/tree/tree_element_id.cc @@ -85,7 +85,6 @@ std::unique_ptr TreeElementID::createFromID(TreeElement &legacy_t case ID_CV: case ID_PT: case ID_VO: - case ID_SIM: case ID_WM: case ID_IM: case ID_VF: diff --git a/source/blender/makesdna/DNA_ID.h b/source/blender/makesdna/DNA_ID.h index dda24c1aa56..2ed7307389d 100644 --- a/source/blender/makesdna/DNA_ID.h +++ b/source/blender/makesdna/DNA_ID.h @@ -1253,7 +1253,6 @@ typedef enum eID_Index { /* Simulation-related types. */ INDEX_ID_CF, - INDEX_ID_SIM, INDEX_ID_PA, /* Shape Keys snow-flake, can be used by several obdata types. */ diff --git a/source/blender/makesdna/DNA_ID_enums.h b/source/blender/makesdna/DNA_ID_enums.h index d43e9cab6e9..4f6e3d5fb3c 100644 --- a/source/blender/makesdna/DNA_ID_enums.h +++ b/source/blender/makesdna/DNA_ID_enums.h @@ -83,7 +83,6 @@ typedef enum ID_Type { ID_CV = MAKE_ID2('C', 'V'), /* Curves */ ID_PT = MAKE_ID2('P', 'T'), /* PointCloud */ ID_VO = MAKE_ID2('V', 'O'), /* Volume */ - ID_SIM = MAKE_ID2('S', 'I'), /* Simulation (geometry node groups) */ ID_GP = MAKE_ID2('G', 'P'), /* Grease Pencil */ } ID_Type; diff --git a/source/blender/makesdna/DNA_simulation_types.h b/source/blender/makesdna/DNA_simulation_types.h deleted file mode 100644 index 8ccb9ff4948..00000000000 --- a/source/blender/makesdna/DNA_simulation_types.h +++ /dev/null @@ -1,38 +0,0 @@ -/* SPDX-FileCopyrightText: 2023 Blender Foundation - * - * SPDX-License-Identifier: GPL-2.0-or-later */ - -/** \file - * \ingroup DNA - */ - -#pragma once - -#include "DNA_ID.h" -#include "DNA_customdata_types.h" - -#ifdef __cplusplus -extern "C" { -#endif - -typedef struct Simulation { - DNA_DEFINE_CXX_METHODS(Simulation) - - ID id; - struct AnimData *adt; /* animation data (must be immediately after id) */ - - /* This nodetree is embedded into the data block. */ - struct bNodeTree *nodetree; - - uint32_t flag; - char _pad[4]; -} Simulation; - -/** #Simulation.flag */ -enum { - SIM_DS_EXPAND = (1 << 0), -}; - -#ifdef __cplusplus -} -#endif diff --git a/source/blender/makesdna/intern/dna_defaults.c b/source/blender/makesdna/intern/dna_defaults.c index d76b30e9506..d29e4973b94 100644 --- a/source/blender/makesdna/intern/dna_defaults.c +++ b/source/blender/makesdna/intern/dna_defaults.c @@ -99,7 +99,6 @@ #include "DNA_particle_types.h" #include "DNA_pointcloud_types.h" #include "DNA_scene_types.h" -#include "DNA_simulation_types.h" #include "DNA_space_types.h" #include "DNA_speaker_types.h" #include "DNA_texture_types.h" @@ -130,7 +129,6 @@ #include "DNA_particle_defaults.h" #include "DNA_pointcloud_defaults.h" #include "DNA_scene_defaults.h" -#include "DNA_simulation_defaults.h" #include "DNA_space_defaults.h" #include "DNA_speaker_defaults.h" #include "DNA_texture_defaults.h" @@ -213,9 +211,6 @@ SDNA_DEFAULT_DECL_STRUCT(PointCloud); SDNA_DEFAULT_DECL_STRUCT(Scene); SDNA_DEFAULT_DECL_STRUCT(ToolSettings); -/* DNA_simulation_defaults.h */ -SDNA_DEFAULT_DECL_STRUCT(Simulation); - /* DNA_space_defaults.h */ SDNA_DEFAULT_DECL_STRUCT(SpaceClip); @@ -451,9 +446,6 @@ const void *DNA_default_table[SDNA_TYPE_MAX] = { SDNA_DEFAULT_DECL_EX(GP_Sculpt_Settings, ToolSettings.gp_sculpt), SDNA_DEFAULT_DECL_EX(GP_Sculpt_Guide, ToolSettings.gp_sculpt.guide), - /* DNA_simulation_defaults.h */ - SDNA_DEFAULT_DECL(Simulation), - /* DNA_speaker_defaults.h */ SDNA_DEFAULT_DECL(Speaker), diff --git a/source/blender/makesrna/intern/CMakeLists.txt b/source/blender/makesrna/intern/CMakeLists.txt index 108c9289eef..5e0d2c20789 100644 --- a/source/blender/makesrna/intern/CMakeLists.txt +++ b/source/blender/makesrna/intern/CMakeLists.txt @@ -94,7 +94,6 @@ if(WITH_EXPERIMENTAL_FEATURES) add_definitions(-DWITH_GREASE_PENCIL_V3) list(APPEND DEFSRC rna_grease_pencil.cc - rna_simulation.cc ) endif() diff --git a/source/blender/makesrna/intern/makesrna.c b/source/blender/makesrna/intern/makesrna.c index 8e39a4d2b45..fb693734421 100644 --- a/source/blender/makesrna/intern/makesrna.c +++ b/source/blender/makesrna/intern/makesrna.c @@ -4622,9 +4622,6 @@ static RNAProcessItem PROCESS_ITEMS[] = { {"rna_screen.cc", NULL, RNA_def_screen}, {"rna_sculpt_paint.cc", NULL, RNA_def_sculpt_paint}, {"rna_sequencer.cc", "rna_sequencer_api.cc", RNA_def_sequencer}, -#ifdef WITH_SIMULATION_DATABLOCK - {"rna_simulation.cc", NULL, RNA_def_simulation}, -#endif {"rna_space.cc", "rna_space_api.cc", RNA_def_space}, {"rna_speaker.cc", NULL, RNA_def_speaker}, {"rna_test.c", NULL, RNA_def_test}, diff --git a/source/blender/makesrna/intern/rna_ID.c b/source/blender/makesrna/intern/rna_ID.c index 3376ff15e58..240868bff2f 100644 --- a/source/blender/makesrna/intern/rna_ID.c +++ b/source/blender/makesrna/intern/rna_ID.c @@ -63,7 +63,6 @@ const EnumPropertyItem rna_enum_id_type_items[] = { {ID_PA, "PARTICLE", ICON_PARTICLE_DATA, "Particle", ""}, {ID_PT, "POINTCLOUD", ICON_POINTCLOUD_DATA, "Point Cloud", ""}, {ID_SCE, "SCENE", ICON_SCENE_DATA, "Scene", ""}, - {ID_SIM, "SIMULATION", ICON_PHYSICS, "Simulation", ""}, /* TODO: Use correct icon. */ {ID_SO, "SOUND", ICON_SOUND, "Sound", ""}, {ID_SPK, "SPEAKER", ICON_SPEAKER, "Speaker", ""}, {ID_TXT, "TEXT", ICON_TEXT, "Text", ""}, @@ -191,11 +190,6 @@ const struct IDFilterEnumPropertyItem rna_enum_id_type_filter_items[] = { "Point Clouds", "Show/hide Point Cloud data-blocks"}, {FILTER_ID_SCE, "filter_scene", ICON_SCENE_DATA, "Scenes", "Show Scene data-blocks"}, - {FILTER_ID_SIM, - "filter_simulation", - ICON_PHYSICS, - "Simulations", - "Show Simulation data-blocks"}, /* TODO: Use correct icon. */ {FILTER_ID_SPK, "filter_speaker", ICON_SPEAKER, "Speakers", "Show Speaker data-blocks"}, {FILTER_ID_SO, "filter_sound", ICON_SOUND, "Sounds", "Show Sound data-blocks"}, {FILTER_ID_TE, "filter_texture", ICON_TEXTURE_DATA, "Textures", "Show Texture data-blocks"}, @@ -432,11 +426,6 @@ short RNA_type_to_ID_code(const StructRNA *type) if (base_type == &RNA_Screen) { return ID_SCR; } -# ifdef WITH_SIMULATION_DATABLOCK - if (base_type == &RNA_Simulation) { - return ID_SIM; - } -# endif if (base_type == &RNA_Sound) { return ID_SO; } @@ -534,12 +523,6 @@ StructRNA *ID_code_to_RNA_type(short idcode) return &RNA_Scene; case ID_SCR: return &RNA_Screen; - case ID_SIM: -# ifdef WITH_SIMULATION_DATABLOCK - return &RNA_Simulation; -# else - return &RNA_ID; -# endif case ID_SO: return &RNA_Sound; case ID_SPK: diff --git a/source/blender/makesrna/intern/rna_ID.cc b/source/blender/makesrna/intern/rna_ID.cc index 87598c717b8..e448e815d42 100644 --- a/source/blender/makesrna/intern/rna_ID.cc +++ b/source/blender/makesrna/intern/rna_ID.cc @@ -63,7 +63,6 @@ const EnumPropertyItem rna_enum_id_type_items[] = { {ID_PA, "PARTICLE", ICON_PARTICLE_DATA, "Particle", ""}, {ID_PT, "POINTCLOUD", ICON_POINTCLOUD_DATA, "Point Cloud", ""}, {ID_SCE, "SCENE", ICON_SCENE_DATA, "Scene", ""}, - {ID_SIM, "SIMULATION", ICON_PHYSICS, "Simulation", ""}, /* TODO: Use correct icon. */ {ID_SO, "SOUND", ICON_SOUND, "Sound", ""}, {ID_SPK, "SPEAKER", ICON_SPEAKER, "Speaker", ""}, {ID_TXT, "TEXT", ICON_TEXT, "Text", ""}, @@ -191,11 +190,6 @@ const IDFilterEnumPropertyItem rna_enum_id_type_filter_items[] = { "Point Clouds", "Show/hide Point Cloud data-blocks"}, {FILTER_ID_SCE, "filter_scene", ICON_SCENE_DATA, "Scenes", "Show Scene data-blocks"}, - {FILTER_ID_SIM, - "filter_simulation", - ICON_PHYSICS, - "Simulations", - "Show Simulation data-blocks"}, /* TODO: Use correct icon. */ {FILTER_ID_SPK, "filter_speaker", ICON_SPEAKER, "Speakers", "Show Speaker data-blocks"}, {FILTER_ID_SO, "filter_sound", ICON_SOUND, "Sounds", "Show Sound data-blocks"}, {FILTER_ID_TE, "filter_texture", ICON_TEXTURE_DATA, "Textures", "Show Texture data-blocks"}, @@ -432,11 +426,6 @@ short RNA_type_to_ID_code(const StructRNA *type) if (base_type == &RNA_Screen) { return ID_SCR; } -# ifdef WITH_SIMULATION_DATABLOCK - if (base_type == &RNA_Simulation) { - return ID_SIM; - } -# endif if (base_type == &RNA_Sound) { return ID_SO; } @@ -534,12 +523,6 @@ StructRNA *ID_code_to_RNA_type(short idcode) return &RNA_Scene; case ID_SCR: return &RNA_Screen; - case ID_SIM: -# ifdef WITH_SIMULATION_DATABLOCK - return &RNA_Simulation; -# else - return &RNA_ID; -# endif case ID_SO: return &RNA_Sound; case ID_SPK: diff --git a/source/blender/makesrna/intern/rna_internal.h b/source/blender/makesrna/intern/rna_internal.h index 119a0256ebc..22d84d3c509 100644 --- a/source/blender/makesrna/intern/rna_internal.h +++ b/source/blender/makesrna/intern/rna_internal.h @@ -516,9 +516,6 @@ void RNA_def_main_lightprobes(BlenderRNA *brna, PropertyRNA *cprop); void RNA_def_main_hair_curves(BlenderRNA *brna, PropertyRNA *cprop); void RNA_def_main_pointclouds(BlenderRNA *brna, PropertyRNA *cprop); void RNA_def_main_volumes(BlenderRNA *brna, PropertyRNA *cprop); -#ifdef WITH_SIMULATION_DATABLOCK -void RNA_def_main_simulations(BlenderRNA *brna, PropertyRNA *cprop); -#endif /* ID Properties */ diff --git a/source/blender/makesrna/intern/rna_main.cc b/source/blender/makesrna/intern/rna_main.cc index 2ae91d2d039..72081bad9d5 100644 --- a/source/blender/makesrna/intern/rna_main.cc +++ b/source/blender/makesrna/intern/rna_main.cc @@ -120,9 +120,6 @@ RNA_MAIN_LISTBASE_FUNCS_DEF(pointclouds) RNA_MAIN_LISTBASE_FUNCS_DEF(scenes) RNA_MAIN_LISTBASE_FUNCS_DEF(screens) RNA_MAIN_LISTBASE_FUNCS_DEF(shapekeys) -# ifdef WITH_SIMULATION_DATABLOCK -RNA_MAIN_LISTBASE_FUNCS_DEF(simulations) -# endif RNA_MAIN_LISTBASE_FUNCS_DEF(sounds) RNA_MAIN_LISTBASE_FUNCS_DEF(speakers) RNA_MAIN_LISTBASE_FUNCS_DEF(texts) @@ -408,14 +405,6 @@ void RNA_def_main(BlenderRNA *brna) "Volumes", "Volume data-blocks", RNA_def_main_volumes}, -# ifdef WITH_SIMULATION_DATABLOCK - {"simulations", - "Simulation", - "rna_Main_simulations_begin", - "Simulations", - "Simulation data-blocks", - RNA_def_main_simulations}, -# endif {nullptr, nullptr, nullptr, nullptr, nullptr, nullptr}, }; diff --git a/source/blender/makesrna/intern/rna_main_api.cc b/source/blender/makesrna/intern/rna_main_api.cc index 68f095023ee..8635c26470d 100644 --- a/source/blender/makesrna/intern/rna_main_api.cc +++ b/source/blender/makesrna/intern/rna_main_api.cc @@ -53,7 +53,6 @@ # include "BKE_particle.h" # include "BKE_pointcloud.h" # include "BKE_scene.h" -# include "BKE_simulation.h" # include "BKE_sound.h" # include "BKE_speaker.h" # include "BKE_text.h" @@ -84,7 +83,6 @@ # include "DNA_node_types.h" # include "DNA_particle_types.h" # include "DNA_pointcloud_types.h" -# include "DNA_simulation_types.h" # include "DNA_sound_types.h" # include "DNA_speaker_types.h" # include "DNA_text_types.h" @@ -791,21 +789,6 @@ static Volume *rna_Main_volumes_new(Main *bmain, const char *name) return volume; } -# ifdef WITH_SIMULATION_DATABLOCK -static Simulation *rna_Main_simulations_new(Main *bmain, const char *name) -{ - char safe_name[MAX_ID_NAME - 2]; - rna_idname_validate(name, safe_name); - - Simulation *simulation = static_cast(BKE_simulation_add(bmain, safe_name)); - id_us_min(&simulation->id); - - WM_main_add_notifier(NC_ID | NA_ADDED, nullptr); - - return simulation; -} -# endif - /* tag functions, all the same */ # define RNA_MAIN_ID_TAG_FUNCS_DEF(_func_name, _listbase_name, _id_type) \ static void rna_Main_##_func_name##_tag(Main *bmain, bool value) \ @@ -851,9 +834,6 @@ RNA_MAIN_ID_TAG_FUNCS_DEF(lightprobes, lightprobes, ID_LP) RNA_MAIN_ID_TAG_FUNCS_DEF(hair_curves, hair_curves, ID_CV) RNA_MAIN_ID_TAG_FUNCS_DEF(pointclouds, pointclouds, ID_PT) RNA_MAIN_ID_TAG_FUNCS_DEF(volumes, volumes, ID_VO) -# ifdef WITH_SIMULATION_DATABLOCK -RNA_MAIN_ID_TAG_FUNCS_DEF(simulations, simulations, ID_SIM) -# endif # undef RNA_MAIN_ID_TAG_FUNCS_DEF @@ -2399,46 +2379,4 @@ void RNA_def_main_volumes(BlenderRNA *brna, PropertyRNA *cprop) RNA_def_parameter_flags(parm, PropertyFlag(0), PARM_REQUIRED); } -# ifdef WITH_SIMULATION_DATABLOCK -void RNA_def_main_simulations(BlenderRNA *brna, PropertyRNA *cprop) -{ - StructRNA *srna; - FunctionRNA *func; - PropertyRNA *parm; - - RNA_def_property_srna(cprop, "BlendDataSimulations"); - srna = RNA_def_struct(brna, "BlendDataSimulations", nullptr); - RNA_def_struct_sdna(srna, "Main"); - RNA_def_struct_ui_text(srna, "Main Simulations", "Collection of simulations"); - - func = RNA_def_function(srna, "new", "rna_Main_simulations_new"); - RNA_def_function_ui_description(func, "Add a new simulation to the main database"); - parm = RNA_def_string(func, "name", "Simulation", 0, "", "New name for the data-block"); - RNA_def_parameter_flags(parm, PropertyFlag(0), PARM_REQUIRED); - /* return type */ - parm = RNA_def_pointer(func, "simulation", "Simulation", "", "New simulation data-block"); - RNA_def_function_return(func, parm); - - func = RNA_def_function(srna, "remove", "rna_Main_ID_remove"); - RNA_def_function_flag(func, FUNC_USE_REPORTS); - RNA_def_function_ui_description(func, "Remove a simulation from the current blendfile"); - parm = RNA_def_pointer(func, "simulation", "Simulation", "", "Simulation to remove"); - RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED | PARM_RNAPTR); - RNA_def_parameter_clear_flags(parm, PROP_THICK_WRAP, ParameterFlag(0)); - RNA_def_boolean( - func, "do_unlink", true, "", "Unlink all usages of this simulation before deleting it"); - RNA_def_boolean(func, - "do_id_user", - true, - "", - "Decrement user counter of all datablocks used by this simulation data"); - RNA_def_boolean( - func, "do_ui_user", true, "", "Make sure interface does not reference this simulation data"); - - func = RNA_def_function(srna, "tag", "rna_Main_simulations_tag"); - parm = RNA_def_boolean(func, "value", 0, "Value", ""); - RNA_def_parameter_flags(parm, PropertyFlag(0), PARM_REQUIRED); -} -# endif - #endif diff --git a/source/blender/makesrna/intern/rna_simulation.cc b/source/blender/makesrna/intern/rna_simulation.cc deleted file mode 100644 index 82a41ada7b3..00000000000 --- a/source/blender/makesrna/intern/rna_simulation.cc +++ /dev/null @@ -1,46 +0,0 @@ -/* SPDX-FileCopyrightText: 2023 Blender Foundation - * - * SPDX-License-Identifier: GPL-2.0-or-later */ - -/** \file - * \ingroup RNA - */ - -#include - -#include "RNA_define.h" -#include "RNA_enum_types.h" - -#include "DNA_simulation_types.h" - -#include "rna_internal.h" - -#ifdef RNA_RUNTIME - -#else - -static void rna_def_simulation(BlenderRNA *brna) -{ - StructRNA *srna; - PropertyRNA *prop; - - srna = RNA_def_struct(brna, "Simulation", "ID"); - RNA_def_struct_ui_text(srna, "Simulation", "Simulation data-block"); - RNA_def_struct_ui_icon(srna, ICON_PHYSICS); /* TODO: Use correct icon. */ - - prop = RNA_def_property(srna, "node_tree", PROP_POINTER, PROP_NONE); - RNA_def_property_pointer_sdna(prop, nullptr, "nodetree"); - RNA_def_property_clear_flag(prop, PROP_PTR_NO_OWNERSHIP); - RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY); - RNA_def_property_ui_text(prop, "Node Tree", "Node tree defining the simulation"); - - /* common */ - rna_def_animdata_common(srna); -} - -void RNA_def_simulation(BlenderRNA *brna) -{ - rna_def_simulation(brna); -} - -#endif diff --git a/source/blender/modifiers/intern/MOD_nodes.cc b/source/blender/modifiers/intern/MOD_nodes.cc index 04a272aaf14..f0aa23e99e1 100644 --- a/source/blender/modifiers/intern/MOD_nodes.cc +++ b/source/blender/modifiers/intern/MOD_nodes.cc @@ -55,7 +55,6 @@ #include "BKE_object.h" #include "BKE_pointcloud.h" #include "BKE_screen.h" -#include "BKE_simulation.h" #include "BKE_simulation_state.hh" #include "BKE_simulation_state_serialize.hh" #include "BKE_workspace.h"