[Bf-blender-cvs] [1f1f1b018e0] temp-test-point-cloud-simulation-depsgraph-integration: add cmake option for simulation data block
Jacques Lucke
noreply at git.blender.org
Wed Apr 15 18:27:06 CEST 2020
Commit: 1f1f1b018e0523a2d7a4b69b9baf6c95a522a058
Author: Jacques Lucke
Date: Tue Mar 24 14:16:10 2020 +0100
Branches: temp-test-point-cloud-simulation-depsgraph-integration
https://developer.blender.org/rB1f1f1b018e0523a2d7a4b69b9baf6c95a522a058
add cmake option for simulation data block
===================================================================
M CMakeLists.txt
M source/blender/makesrna/intern/CMakeLists.txt
M source/blender/makesrna/intern/makesrna.c
M source/blender/makesrna/intern/rna_ID.c
M source/blender/makesrna/intern/rna_main.c
M source/blender/makesrna/intern/rna_main_api.c
M source/blender/makesrna/intern/rna_space.c
===================================================================
diff --git a/CMakeLists.txt b/CMakeLists.txt
index a781488002a..20f8a66b9c3 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -323,6 +323,10 @@ option(WITH_FREESTYLE "Enable Freestyle (advanced edges rendering)" ON)
option(WITH_NEW_OBJECT_TYPES "Enable new hair and pointcloud objects (use for development only, don't save in files)" OFF)
mark_as_advanced(WITH_NEW_OBJECT_TYPES)
+# New simulation data block
+option(WITH_SIMULATION_DATA_BLOCK_RNA "Enable simulation data block (use for development only, don't save in files)" OFF)
+mark_as_advanced(WITH_SIMULATION_DATA_BLOCK_RNA)
+
# Misc
if(WIN32)
option(WITH_INPUT_IME "Enable Input Method Editor (IME) for complex Asian character input" ON)
diff --git a/source/blender/makesrna/intern/CMakeLists.txt b/source/blender/makesrna/intern/CMakeLists.txt
index e55d55539ef..e81f0dab082 100644
--- a/source/blender/makesrna/intern/CMakeLists.txt
+++ b/source/blender/makesrna/intern/CMakeLists.txt
@@ -77,7 +77,6 @@ set(DEFSRC
rna_sculpt_paint.c
rna_sequencer.c
rna_shader_fx.c
- rna_simulation.c
rna_sound.c
rna_space.c
rna_speaker.c
@@ -104,6 +103,13 @@ if(WITH_NEW_OBJECT_TYPES)
)
endif()
+if (WITH_SIMULATION_DATA_BLOCK_RNA)
+ list(APPEND DEFSRC
+ rna_simulation.c
+ )
+endif()
+
+
set(APISRC
rna_action_api.c
rna_animation_api.c
@@ -343,6 +349,11 @@ if(WITH_NEW_OBJECT_TYPES)
add_definitions(-DWITH_NEW_OBJECT_TYPES)
endif()
+if (WITH_SIMULATION_DATA_BLOCK_RNA)
+ add_definitions(-DWITH_SIMULATION_DATA_BLOCK_RNA)
+endif()
+
+
# Build makesrna executable
blender_include_dirs(
.
diff --git a/source/blender/makesrna/intern/makesrna.c b/source/blender/makesrna/intern/makesrna.c
index fcded460e83..8e9db0f2f28 100644
--- a/source/blender/makesrna/intern/makesrna.c
+++ b/source/blender/makesrna/intern/makesrna.c
@@ -4302,7 +4302,9 @@ static RNAProcessItem PROCESS_ITEMS[] = {
{"rna_screen.c", NULL, RNA_def_screen},
{"rna_sculpt_paint.c", NULL, RNA_def_sculpt_paint},
{"rna_sequencer.c", "rna_sequencer_api.c", RNA_def_sequencer},
+#ifdef WITH_SIMULATION_DATA_BLOCK_RNA
{"rna_simulation.c", NULL, RNA_def_simulation},
+#endif
{"rna_space.c", "rna_space_api.c", RNA_def_space},
{"rna_speaker.c", 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 16ecd809a35..cac05917fd3 100644
--- a/source/blender/makesrna/intern/rna_ID.c
+++ b/source/blender/makesrna/intern/rna_ID.c
@@ -71,7 +71,9 @@ const EnumPropertyItem rna_enum_id_type_items[] = {
{ID_PA, "PARTICLE", ICON_PARTICLE_DATA, "Particle", ""},
{ID_LP, "LIGHT_PROBE", ICON_LIGHTPROBE_CUBEMAP, "Light Probe", ""},
{ID_SCE, "SCENE", ICON_SCENE_DATA, "Scene", ""},
+#ifdef WITH_SIMULATION_DATA_BLOCK_RNA
{ID_SI, "SIMULATION", ICON_PHYSICS, "Simulation", ""}, /* TODO: Use correct icon. */
+#endif
{ID_SO, "SOUND", ICON_SOUND, "Sound", ""},
{ID_SPK, "SPEAKER", ICON_SPEAKER, "Speaker", ""},
{ID_TXT, "TEXT", ICON_TEXT, "Text", ""},
@@ -304,9 +306,11 @@ short RNA_type_to_ID_code(const StructRNA *type)
if (base_type == &RNA_Screen) {
return ID_SCR;
}
+# ifdef WITH_SIMULATION_DATA_BLOCK_RNA
if (base_type == &RNA_Simulation) {
return ID_SI;
}
+# endif
if (base_type == &RNA_Sound) {
return ID_SO;
}
@@ -410,7 +414,11 @@ StructRNA *ID_code_to_RNA_type(short idcode)
case ID_SCR:
return &RNA_Screen;
case ID_SI:
+# ifdef WITH_SIMULATION_DATA_BLOCK_RNA
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_main.c b/source/blender/makesrna/intern/rna_main.c
index 5b8dd6dc14f..18f8aca148f 100644
--- a/source/blender/makesrna/intern/rna_main.c
+++ b/source/blender/makesrna/intern/rna_main.c
@@ -134,7 +134,9 @@ 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_DATA_BLOCK_RNA
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)
@@ -403,12 +405,14 @@ void RNA_def_main(BlenderRNA *brna)
"Volumes",
"Volume data-blocks",
RNA_def_main_volumes},
+# ifdef WITH_SIMULATION_DATA_BLOCK_RNA
{"simulations",
"Simulation",
"rna_Main_simulations_begin",
"Simulations",
"Simulation data-blocks",
RNA_def_main_simulations},
+# endif
{NULL, NULL, NULL, NULL, NULL, NULL},
};
diff --git a/source/blender/makesrna/intern/rna_main_api.c b/source/blender/makesrna/intern/rna_main_api.c
index 4f0e358bd70..490963617d6 100644
--- a/source/blender/makesrna/intern/rna_main_api.c
+++ b/source/blender/makesrna/intern/rna_main_api.c
@@ -740,6 +740,7 @@ static Volume *rna_Main_volumes_new(Main *bmain, const char *name)
return volume;
}
+# ifdef WITH_SIMULATION_DATA_BLOCK_RNA
static Simulation *rna_Main_simulations_new(Main *bmain, const char *name)
{
char safe_name[MAX_ID_NAME - 2];
@@ -749,6 +750,7 @@ static Simulation *rna_Main_simulations_new(Main *bmain, const char *name)
id_us_min(&simulation->id);
return simulation;
}
+# endif
/* tag functions, all the same */
# define RNA_MAIN_ID_TAG_FUNCS_DEF(_func_name, _listbase_name, _id_type) \
@@ -797,7 +799,9 @@ RNA_MAIN_ID_TAG_FUNCS_DEF(hairs, hairs, ID_HA)
RNA_MAIN_ID_TAG_FUNCS_DEF(pointclouds, pointclouds, ID_PT)
# endif
RNA_MAIN_ID_TAG_FUNCS_DEF(volumes, volumes, ID_VO)
+# ifdef WITH_SIMULATION_DATA_BLOCK_RNA
RNA_MAIN_ID_TAG_FUNCS_DEF(simulations, simulations, ID_SI)
+# endif
# undef RNA_MAIN_ID_TAG_FUNCS_DEF
diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c
index 64f3c3adddb..a0e9561fe58 100644
--- a/source/blender/makesrna/intern/rna_space.c
+++ b/source/blender/makesrna/intern/rna_space.c
@@ -5493,11 +5493,13 @@ static void rna_def_fileselect_idfilter(BlenderRNA *brna)
"Show/hide Point Cloud data-blocks"},
# endif
{FILTER_ID_SCE, "filter_scene", ICON_SCENE_DATA, "Scenes", "Show Scene data-blocks"},
+# ifdef WITH_SIMULATION_DATA_BLOCK_RNA
{FILTER_ID_SI,
"filter_simulation",
ICON_PHYSICS,
"Simulations",
"Show Simulation data-blocks"}, /* TODO: Use correct icon. */
+# endif
{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"},
More information about the Bf-blender-cvs
mailing list