Cleanup: Remove unused "Simulation" data-block

This data-block was originally added in eb4e3bbe68.
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.
This commit is contained in:
Hans Goudey 2023-07-11 10:53:15 -04:00
parent 4d54e3b6e1
commit f3f05daf11
54 changed files with 7 additions and 678 deletions

View File

@ -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

View File

@ -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. */

View File

@ -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

View File

@ -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);

View File

@ -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

View File

@ -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

View File

@ -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);
}

View File

@ -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

View File

@ -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);

View File

@ -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;
}

View File

@ -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);

View File

@ -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:

View File

@ -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;

View File

@ -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<Scene *>(id)->nodetree;
case ID_LS:
return &reinterpret_cast<FreestyleLineStyle *>(id)->nodetree;
case ID_SIM:
return &reinterpret_cast<Simulation *>(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<FreestyleLineStyle *>(ntreeiter->linestyle->id.next);
}
else if (ntreeiter->simulation) {
*r_nodetree = reinterpret_cast<bNodeTree *>(ntreeiter->simulation->nodetree);
*r_id = &ntreeiter->simulation->id;
ntreeiter->simulation = reinterpret_cast<Simulation *>(ntreeiter->simulation->id.next);
}
else {
return false;
}

View File

@ -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"

View File

@ -1,192 +0,0 @@
/* SPDX-FileCopyrightText: 2023 Blender Foundation
*
* SPDX-License-Identifier: GPL-2.0-or-later */
/** \file
* \ingroup bke
*/
#include <iostream>
#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<bNodeTree *>(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*/)
{
}

View File

@ -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";
}

View File

@ -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);

View File

@ -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)) {

View File

@ -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);

View File

@ -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;

View File

@ -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);

View File

@ -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);

View File

@ -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)

View File

@ -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<deg::Depsgraph *>(depsgraph);

View File

@ -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)

View File

@ -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:

View File

@ -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. */

View File

@ -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);
}

View File

@ -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";

View File

@ -199,9 +199,6 @@ enum class OperationCode {
/* Duplication/instancing system. --------------------------------------- */
DUPLI,
/* Simulation. ---------------------------------------------------------- */
SIMULATION_EVAL,
};
const char *operationCodeAsString(OperationCode opcode);

View File

@ -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 */

View File

@ -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<ID *>(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<ID *>(data));
break;
}
case ANIMTYPE_DSSKEY: {
Key *key = (Key *)data;
AnimData *adt = key->adt;

View File

@ -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)))

View File

@ -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;

View File

@ -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

View File

@ -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: */

View File

@ -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;
}

View File

@ -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, \

View File

@ -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;

View File

@ -85,7 +85,6 @@ std::unique_ptr<TreeElementID> 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:

View File

@ -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. */

View File

@ -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;

View File

@ -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

View File

@ -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),

View File

@ -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()

View File

@ -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},

View File

@ -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:

View File

@ -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:

View File

@ -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 */

View File

@ -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},
};

View File

@ -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<Simulation *>(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

View File

@ -1,46 +0,0 @@
/* SPDX-FileCopyrightText: 2023 Blender Foundation
*
* SPDX-License-Identifier: GPL-2.0-or-later */
/** \file
* \ingroup RNA
*/
#include <stdlib.h>
#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

View File

@ -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"