diff options
author | Dalai Felinto <dalai@blender.org> | 2020-08-18 15:55:44 +0300 |
---|---|---|
committer | Dalai Felinto <dalai@blender.org> | 2020-08-18 15:55:44 +0300 |
commit | 8ab0d0e3990881bf66e9cdd2f62cd2a464015496 (patch) | |
tree | 11dd79c2b6b648eddbb9c4fffe5d66152db52134 /source/blender | |
parent | c526a34fc2fe0d51a81837bd49dbc0b78c8b5224 (diff) | |
parent | 83e3d25bcae37df0139bb93b85d7ae5bf3da553b (diff) |
Merge remote-tracking branch 'origin/blender-v2.90-release'
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/blenkernel/BKE_blender_version.h | 3 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/blender.c | 6 | ||||
-rw-r--r-- | source/blender/blenloader/BLO_readfile.h | 3 | ||||
-rw-r--r-- | source/blender/blenloader/intern/versioning_userdef.c | 20 | ||||
-rw-r--r-- | source/blender/editors/interface/interface.c | 4 | ||||
-rw-r--r-- | source/blender/editors/space_buttons/CMakeLists.txt | 5 | ||||
-rw-r--r-- | source/blender/editors/space_buttons/buttons_context.c | 8 | ||||
-rw-r--r-- | source/blender/makesrna/intern/CMakeLists.txt | 13 | ||||
-rw-r--r-- | source/blender/makesrna/intern/makesrna.c | 6 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_ID.c | 18 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_internal.h | 6 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_main.c | 12 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_main_api.c | 18 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_modifier.c | 8 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_object.c | 8 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_space.c | 4 |
16 files changed, 139 insertions, 3 deletions
diff --git a/source/blender/blenkernel/BKE_blender_version.h b/source/blender/blenkernel/BKE_blender_version.h index 6ea113d8828..231cd0e53c5 100644 --- a/source/blender/blenkernel/BKE_blender_version.h +++ b/source/blender/blenkernel/BKE_blender_version.h @@ -50,6 +50,9 @@ extern "C" { /** User readable version string. */ const char *BKE_blender_version_string(void); +/* Returns true when version cycle is alpha, otherwise (beta, rc) returns false. */ +bool BKE_blender_version_is_alpha(void); + #ifdef __cplusplus } #endif diff --git a/source/blender/blenkernel/intern/blender.c b/source/blender/blenkernel/intern/blender.c index e8aa13a8beb..af502d30145 100644 --- a/source/blender/blenkernel/intern/blender.c +++ b/source/blender/blenkernel/intern/blender.c @@ -135,6 +135,12 @@ const char *BKE_blender_version_string(void) return blender_version_string; } +bool BKE_blender_version_is_alpha(void) +{ + static bool is_alpha = STREQ(STRINGIFY(BLENDER_VERSION_CYCLE), "alpha"); + return is_alpha; +} + void BKE_blender_globals_init(void) { blender_version_init(); diff --git a/source/blender/blenloader/BLO_readfile.h b/source/blender/blenloader/BLO_readfile.h index 97c77ed2e19..580c833d8dc 100644 --- a/source/blender/blenloader/BLO_readfile.h +++ b/source/blender/blenloader/BLO_readfile.h @@ -186,6 +186,9 @@ void BLO_update_defaults_workspace(struct WorkSpace *workspace, const char *app_ /* Version patch user preferences. */ void BLO_version_defaults_userpref_blend(struct Main *mainvar, struct UserDef *userdef); +/* Disable unwanted experimental feature settings on startup. */ +void BLO_sanitize_experimental_features_userpref_blend(struct UserDef *userdef); + struct BlendThumbnail *BLO_thumbnail_from_file(const char *filepath); /* datafiles (generated theme) */ diff --git a/source/blender/blenloader/intern/versioning_userdef.c b/source/blender/blenloader/intern/versioning_userdef.c index e2dc27d7e88..0b116804481 100644 --- a/source/blender/blenloader/intern/versioning_userdef.c +++ b/source/blender/blenloader/intern/versioning_userdef.c @@ -38,6 +38,7 @@ #include "DNA_windowmanager_types.h" #include "BKE_addon.h" +#include "BKE_blender_version.h" #include "BKE_colorband.h" #include "BKE_idprop.h" #include "BKE_keyconfig.h" @@ -784,4 +785,23 @@ void BLO_version_defaults_userpref_blend(Main *bmain, UserDef *userdef) #undef USER_VERSION_ATLEAST } +void BLO_sanitize_experimental_features_userpref_blend(UserDef *userdef) +{ + /* User preference experimental settings are only supported in alpha builds. + * This prevents users corrupting data and relying on API that may change. + * + * If user preferences are saved this will be stored in disk as expected. + * This only starts to take effect when there is a release branch (on beta). + * + * At that time master already has its version bumped so its user preferences + * are not touched by these settings. */ + + if (BKE_blender_version_is_alpha()) { + return; + } + userdef->experimental.use_new_particle_system = false; + userdef->experimental.use_new_hair_type = false; + userdef->experimental.use_sculpt_vertex_colors = false; +} + #undef USER_LMOUSESELECT diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c index 41e7db3a38c..478ef216421 100644 --- a/source/blender/editors/interface/interface.c +++ b/source/blender/editors/interface/interface.c @@ -44,6 +44,8 @@ #include "BLI_utildefines.h" +#include "BLO_readfile.h" + #include "BKE_animsys.h" #include "BKE_context.h" #include "BKE_idprop.h" @@ -6973,6 +6975,8 @@ void UI_init_userdef(Main *bmain) /* fix saved themes */ init_userdef_do_versions(bmain); uiStyleInit(); + + BLO_sanitize_experimental_features_userpref_blend(&U); } void UI_reinit_font(void) diff --git a/source/blender/editors/space_buttons/CMakeLists.txt b/source/blender/editors/space_buttons/CMakeLists.txt index 25ff6bbd098..75d91174470 100644 --- a/source/blender/editors/space_buttons/CMakeLists.txt +++ b/source/blender/editors/space_buttons/CMakeLists.txt @@ -54,4 +54,9 @@ if(WITH_FREESTYLE) add_definitions(-DWITH_FREESTYLE) endif() +if(WITH_EXPERIMENTAL_FEATURES) + add_definitions(-DWITH_PARTICLE_NODES) + add_definitions(-DWITH_HAIR_NODES) +endif() + blender_add_lib(bf_editor_space_buttons "${SRC}" "${INC}" "${INC_SYS}" "${LIB}") diff --git a/source/blender/editors/space_buttons/buttons_context.c b/source/blender/editors/space_buttons/buttons_context.c index 5885d3dcbb0..3976e18d70c 100644 --- a/source/blender/editors/space_buttons/buttons_context.c +++ b/source/blender/editors/space_buttons/buttons_context.c @@ -249,12 +249,16 @@ static bool buttons_context_path_data(ButsContextPath *path, int type) if (RNA_struct_is_a(ptr->type, &RNA_GreasePencil) && (type == -1 || type == OB_GPENCIL)) { return true; } +#ifdef WITH_HAIR_NODES if (RNA_struct_is_a(ptr->type, &RNA_Hair) && (type == -1 || type == OB_HAIR)) { return true; } +#endif +#ifdef WITH_PARTICLE_NODES if (RNA_struct_is_a(ptr->type, &RNA_PointCloud) && (type == -1 || type == OB_POINTCLOUD)) { return true; } +#endif if (RNA_struct_is_a(ptr->type, &RNA_Volume) && (type == -1 || type == OB_VOLUME)) { return true; } @@ -871,14 +875,18 @@ int buttons_context(const bContext *C, const char *member, bContextDataResult *r set_pointer_type(path, result, &RNA_LightProbe); return 1; } +#ifdef WITH_HAIR_NODES if (CTX_data_equals(member, "hair")) { set_pointer_type(path, result, &RNA_Hair); return 1; } +#endif +#ifdef WITH_PARTICLE_NODES if (CTX_data_equals(member, "pointcloud")) { set_pointer_type(path, result, &RNA_PointCloud); return 1; } +#endif if (CTX_data_equals(member, "volume")) { set_pointer_type(path, result, &RNA_Volume); return 1; diff --git a/source/blender/makesrna/intern/CMakeLists.txt b/source/blender/makesrna/intern/CMakeLists.txt index 0b43a5a6653..1896813bdb3 100644 --- a/source/blender/makesrna/intern/CMakeLists.txt +++ b/source/blender/makesrna/intern/CMakeLists.txt @@ -47,7 +47,6 @@ set(DEFSRC rna_fluid.c rna_gpencil.c rna_gpencil_modifier.c - rna_hair.c rna_image.c rna_key.c rna_lattice.c @@ -69,7 +68,6 @@ set(DEFSRC rna_packedfile.c rna_palette.c rna_particle.c - rna_pointcloud.c rna_pose.c rna_render.c rna_rigidbody.c @@ -79,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 @@ -99,6 +96,16 @@ set(DEFSRC rna_xr.c ) +if(WITH_EXPERIMENTAL_FEATURES) + add_definitions(-DWITH_PARTICLE_NODES) + add_definitions(-DWITH_HAIR_NODES) + list(APPEND DEFSRC + rna_pointcloud.c + rna_simulation.c + rna_hair.c + ) +endif() + set(APISRC rna_action_api.c rna_animation_api.c diff --git a/source/blender/makesrna/intern/makesrna.c b/source/blender/makesrna/intern/makesrna.c index 779e4363be0..d34f431c848 100644 --- a/source/blender/makesrna/intern/makesrna.c +++ b/source/blender/makesrna/intern/makesrna.c @@ -4285,7 +4285,9 @@ static RNAProcessItem PROCESS_ITEMS[] = { {"rna_dynamicpaint.c", NULL, RNA_def_dynamic_paint}, {"rna_fcurve.c", "rna_fcurve_api.c", RNA_def_fcurve}, {"rna_gpencil.c", NULL, RNA_def_gpencil}, +#ifdef WITH_HAIR_NODES {"rna_hair.c", NULL, RNA_def_hair}, +#endif {"rna_image.c", "rna_image_api.c", RNA_def_image}, {"rna_key.c", NULL, RNA_def_key}, {"rna_light.c", NULL, RNA_def_light}, @@ -4308,7 +4310,9 @@ static RNAProcessItem PROCESS_ITEMS[] = { {"rna_packedfile.c", NULL, RNA_def_packedfile}, {"rna_palette.c", NULL, RNA_def_palette}, {"rna_particle.c", NULL, RNA_def_particle}, +#ifdef WITH_PARTICLE_NODES {"rna_pointcloud.c", NULL, RNA_def_pointcloud}, +#endif {"rna_pose.c", "rna_pose_api.c", RNA_def_pose}, {"rna_curveprofile.c", NULL, RNA_def_profile}, {"rna_lightprobe.c", NULL, RNA_def_lightprobe}, @@ -4318,7 +4322,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_PARTICLE_NODES {"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 e9ca0d577ce..f1c125fcbb9 100644 --- a/source/blender/makesrna/intern/rna_ID.c +++ b/source/blender/makesrna/intern/rna_ID.c @@ -251,9 +251,11 @@ short RNA_type_to_ID_code(const StructRNA *type) if (base_type == &RNA_FreestyleLineStyle) { return ID_LS; } +# ifdef WITH_HAIR_NODES if (base_type == &RNA_Hair) { return ID_HA; } +# endif if (base_type == &RNA_Lattice) { return ID_LT; } @@ -287,9 +289,11 @@ short RNA_type_to_ID_code(const StructRNA *type) if (base_type == &RNA_PaintCurve) { return ID_PC; } +# ifdef WITH_PARTICLE_NODES if (base_type == &RNA_PointCloud) { return ID_PT; } +# endif if (base_type == &RNA_LightProbe) { return ID_LP; } @@ -299,9 +303,11 @@ short RNA_type_to_ID_code(const StructRNA *type) if (base_type == &RNA_Screen) { return ID_SCR; } +# ifdef WITH_PARTICLE_NODES if (base_type == &RNA_Simulation) { return ID_SIM; } +# endif if (base_type == &RNA_Sound) { return ID_SO; } @@ -355,7 +361,11 @@ StructRNA *ID_code_to_RNA_type(short idcode) case ID_GR: return &RNA_Collection; case ID_HA: +# ifdef WITH_HAIR_NODES return &RNA_Hair; +# else + return &RNA_ID; +# endif case ID_IM: return &RNA_Image; case ID_KE: @@ -389,7 +399,11 @@ StructRNA *ID_code_to_RNA_type(short idcode) case ID_PC: return &RNA_PaintCurve; case ID_PT: +# ifdef WITH_PARTICLE_NODES return &RNA_PointCloud; +# else + return &RNA_ID; +# endif case ID_LP: return &RNA_LightProbe; case ID_SCE: @@ -397,7 +411,11 @@ StructRNA *ID_code_to_RNA_type(short idcode) case ID_SCR: return &RNA_Screen; case ID_SIM: +# ifdef WITH_PARTICLE_NODES 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 8045279eef2..6254e40a410 100644 --- a/source/blender/makesrna/intern/rna_internal.h +++ b/source/blender/makesrna/intern/rna_internal.h @@ -455,10 +455,16 @@ void RNA_def_main_cachefiles(BlenderRNA *brna, PropertyRNA *cprop); void RNA_def_main_paintcurves(BlenderRNA *brna, PropertyRNA *cprop); void RNA_def_main_workspaces(BlenderRNA *brna, PropertyRNA *cprop); void RNA_def_main_lightprobes(BlenderRNA *brna, PropertyRNA *cprop); +#ifdef WITH_PARTICLE_NODES void RNA_def_main_hairs(BlenderRNA *brna, PropertyRNA *cprop); +#endif +#ifdef WITH_HAIR_NODES void RNA_def_main_pointclouds(BlenderRNA *brna, PropertyRNA *cprop); +#endif void RNA_def_main_volumes(BlenderRNA *brna, PropertyRNA *cprop); +#ifdef WITH_PARTICLE_NODES void RNA_def_main_simulations(BlenderRNA *brna, PropertyRNA *cprop); +#endif /* ID Properties */ diff --git a/source/blender/makesrna/intern/rna_main.c b/source/blender/makesrna/intern/rna_main.c index 97702b06b6f..d83fca69278 100644 --- a/source/blender/makesrna/intern/rna_main.c +++ b/source/blender/makesrna/intern/rna_main.c @@ -109,7 +109,9 @@ RNA_MAIN_LISTBASE_FUNCS_DEF(collections) RNA_MAIN_LISTBASE_FUNCS_DEF(curves) RNA_MAIN_LISTBASE_FUNCS_DEF(fonts) RNA_MAIN_LISTBASE_FUNCS_DEF(gpencils) +# ifdef WITH_HAIR_NODES RNA_MAIN_LISTBASE_FUNCS_DEF(hairs) +# endif RNA_MAIN_LISTBASE_FUNCS_DEF(images) RNA_MAIN_LISTBASE_FUNCS_DEF(lattices) RNA_MAIN_LISTBASE_FUNCS_DEF(libraries) @@ -126,11 +128,15 @@ RNA_MAIN_LISTBASE_FUNCS_DEF(objects) RNA_MAIN_LISTBASE_FUNCS_DEF(paintcurves) RNA_MAIN_LISTBASE_FUNCS_DEF(palettes) RNA_MAIN_LISTBASE_FUNCS_DEF(particles) +# ifdef WITH_PARTICLE_NODES RNA_MAIN_LISTBASE_FUNCS_DEF(pointclouds) +# endif RNA_MAIN_LISTBASE_FUNCS_DEF(scenes) RNA_MAIN_LISTBASE_FUNCS_DEF(screens) RNA_MAIN_LISTBASE_FUNCS_DEF(shapekeys) +# ifdef WITH_PARTICLE_NODES 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) @@ -384,25 +390,31 @@ void RNA_def_main(BlenderRNA *brna) "LightProbes", "LightProbe data-blocks", RNA_def_main_lightprobes}, +# ifdef WITH_HAIR_NODES {"hairs", "Hair", "rna_Main_hairs_begin", "Hairs", "Hair data-blocks", RNA_def_main_hairs}, +# endif +# ifdef WITH_PARTICLE_NODES {"pointclouds", "PointCloud", "rna_Main_pointclouds_begin", "Point Clouds", "Point cloud data-blocks", RNA_def_main_pointclouds}, +# endif {"volumes", "Volume", "rna_Main_volumes_begin", "Volumes", "Volume data-blocks", RNA_def_main_volumes}, +# ifdef WITH_PARTICLE_NODES {"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 990a5412093..7c941ddb524 100644 --- a/source/blender/makesrna/intern/rna_main_api.c +++ b/source/blender/makesrna/intern/rna_main_api.c @@ -708,6 +708,7 @@ static bGPdata *rna_Main_gpencils_new(Main *bmain, const char *name) return gpd; } +# ifdef WITH_HAIR_NODES static Hair *rna_Main_hairs_new(Main *bmain, const char *name) { char safe_name[MAX_ID_NAME - 2]; @@ -717,7 +718,9 @@ static Hair *rna_Main_hairs_new(Main *bmain, const char *name) id_us_min(&hair->id); return hair; } +# endif +# ifdef WITH_PARTICLE_NODES static PointCloud *rna_Main_pointclouds_new(Main *bmain, const char *name) { char safe_name[MAX_ID_NAME - 2]; @@ -727,6 +730,7 @@ static PointCloud *rna_Main_pointclouds_new(Main *bmain, const char *name) id_us_min(&pointcloud->id); return pointcloud; } +# endif static Volume *rna_Main_volumes_new(Main *bmain, const char *name) { @@ -738,6 +742,7 @@ static Volume *rna_Main_volumes_new(Main *bmain, const char *name) return volume; } +# ifdef WITH_PARTICLE_NODES static Simulation *rna_Main_simulations_new(Main *bmain, const char *name) { char safe_name[MAX_ID_NAME - 2]; @@ -747,6 +752,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) \ @@ -790,10 +796,16 @@ RNA_MAIN_ID_TAG_FUNCS_DEF(cachefiles, cachefiles, ID_CF) RNA_MAIN_ID_TAG_FUNCS_DEF(paintcurves, paintcurves, ID_PC) RNA_MAIN_ID_TAG_FUNCS_DEF(workspaces, workspaces, ID_WS) RNA_MAIN_ID_TAG_FUNCS_DEF(lightprobes, lightprobes, ID_LP) +# ifdef WITH_HAIR_NODES RNA_MAIN_ID_TAG_FUNCS_DEF(hairs, hairs, ID_HA) +# endif +# ifdef WITH_PARTICLE_NODES RNA_MAIN_ID_TAG_FUNCS_DEF(pointclouds, pointclouds, ID_PT) +# endif RNA_MAIN_ID_TAG_FUNCS_DEF(volumes, volumes, ID_VO) +# ifdef WITH_PARTICLE_NODES RNA_MAIN_ID_TAG_FUNCS_DEF(simulations, simulations, ID_SIM) +# endif # undef RNA_MAIN_ID_TAG_FUNCS_DEF @@ -2194,6 +2206,7 @@ void RNA_def_main_lightprobes(BlenderRNA *brna, PropertyRNA *cprop) RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); } +# ifdef WITH_HAIR_NODES void RNA_def_main_hairs(BlenderRNA *brna, PropertyRNA *cprop) { StructRNA *srna; @@ -2237,7 +2250,9 @@ void RNA_def_main_hairs(BlenderRNA *brna, PropertyRNA *cprop) parm = RNA_def_boolean(func, "value", 0, "Value", ""); RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); } +# endif +# ifdef WITH_PARTICLE_NODES void RNA_def_main_pointclouds(BlenderRNA *brna, PropertyRNA *cprop) { StructRNA *srna; @@ -2284,6 +2299,7 @@ void RNA_def_main_pointclouds(BlenderRNA *brna, PropertyRNA *cprop) parm = RNA_def_boolean(func, "value", 0, "Value", ""); RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); } +# endif void RNA_def_main_volumes(BlenderRNA *brna, PropertyRNA *cprop) { @@ -2329,6 +2345,7 @@ void RNA_def_main_volumes(BlenderRNA *brna, PropertyRNA *cprop) RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); } +# ifdef WITH_PARTICLE_NODES void RNA_def_main_simulations(BlenderRNA *brna, PropertyRNA *cprop) { StructRNA *srna; @@ -2368,5 +2385,6 @@ void RNA_def_main_simulations(BlenderRNA *brna, PropertyRNA *cprop) parm = RNA_def_boolean(func, "value", 0, "Value", ""); RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); } +# endif #endif diff --git a/source/blender/makesrna/intern/rna_modifier.c b/source/blender/makesrna/intern/rna_modifier.c index 65c6706a3b1..0338a094d14 100644 --- a/source/blender/makesrna/intern/rna_modifier.c +++ b/source/blender/makesrna/intern/rna_modifier.c @@ -723,7 +723,9 @@ static StructRNA *rna_Modifier_refine(struct PointerRNA *ptr) case eModifierType_WeightedNormal: return &RNA_WeightedNormalModifier; case eModifierType_Simulation: +# ifdef WITH_PARTICLE_NODES return &RNA_SimulationModifier; +# endif /* Default */ case eModifierType_Fluidsim: /* deprecated */ case eModifierType_None: @@ -1630,6 +1632,7 @@ static void rna_ParticleInstanceModifier_particle_system_set(PointerRNA *ptr, CLAMP_MIN(psmd->psys, 1); } +# ifdef WITH_PARTICLE_NODES static void rna_SimulationModifier_simulation_update(Main *bmain, Scene *scene, PointerRNA *ptr) { SimulationModifierData *smd = ptr->data; @@ -1672,6 +1675,7 @@ static void rna_SimulationModifier_data_path_set(PointerRNA *ptr, const char *va smd->data_path = NULL; } } +# endif /** * Special set callback that just changes the first bit of the expansion flag. @@ -7007,6 +7011,7 @@ static void rna_def_modifier_weightednormal(BlenderRNA *brna) RNA_define_lib_overridable(false); } +# ifdef WITH_PARTICLE_NODES static void rna_def_modifier_simulation(BlenderRNA *brna) { StructRNA *srna; @@ -7035,6 +7040,7 @@ static void rna_def_modifier_simulation(BlenderRNA *brna) RNA_define_lib_overridable(false); } +# endif void RNA_def_modifier(BlenderRNA *brna) { @@ -7164,7 +7170,9 @@ void RNA_def_modifier(BlenderRNA *brna) rna_def_modifier_meshseqcache(brna); rna_def_modifier_surfacedeform(brna); rna_def_modifier_weightednormal(brna); +# ifdef WITH_PARTICLE_NODES rna_def_modifier_simulation(brna); +# endif } #endif diff --git a/source/blender/makesrna/intern/rna_object.c b/source/blender/makesrna/intern/rna_object.c index 08ca3f16b6d..39e1f17d33d 100644 --- a/source/blender/makesrna/intern/rna_object.c +++ b/source/blender/makesrna/intern/rna_object.c @@ -570,9 +570,17 @@ static StructRNA *rna_Object_data_typef(PointerRNA *ptr) case OB_GPENCIL: return &RNA_GreasePencil; case OB_HAIR: +# ifdef WITH_HAIR_NODES return &RNA_Hair; +# else + return &RNA_ID; +# endif case OB_POINTCLOUD: +# ifdef WITH_PARTICLE_NODES return &RNA_PointCloud; +# else + return &RNA_ID; +# endif case OB_VOLUME: return &RNA_Volume; default: diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c index 317aa6bad5d..03a70be6def 100644 --- a/source/blender/makesrna/intern/rna_space.c +++ b/source/blender/makesrna/intern/rna_space.c @@ -2117,6 +2117,7 @@ static void rna_SpaceNodeEditor_node_tree_update(const bContext *C, PointerRNA * ED_node_tree_update(C); } +# ifdef WITH_PARTICLE_NODES static PointerRNA rna_SpaceNodeEditor_simulation_get(PointerRNA *ptr) { SpaceNode *snode = (SpaceNode *)ptr->data; @@ -2148,6 +2149,7 @@ static void rna_SpaceNodeEditor_simulation_set(PointerRNA *ptr, } snode->id = &sim->id; } +# endif static int rna_SpaceNodeEditor_tree_type_get(PointerRNA *ptr) { @@ -6208,6 +6210,7 @@ static void rna_def_space_node(BlenderRNA *brna) RNA_def_property_ui_text( prop, "ID From", "Data-block from which the edited data-block is linked"); +# ifdef WITH_PARTICLE_NODES prop = RNA_def_property(srna, "simulation", PROP_POINTER, PROP_NONE); RNA_def_property_flag(prop, PROP_EDITABLE); RNA_def_property_struct_type(prop, "Simulation"); @@ -6218,6 +6221,7 @@ static void rna_def_space_node(BlenderRNA *brna) NULL, NULL); RNA_def_property_update(prop, NC_SPACE | ND_SPACE_NODE, NULL); +# endif prop = RNA_def_property(srna, "path", PROP_COLLECTION, PROP_NONE); RNA_def_property_collection_sdna(prop, NULL, "treepath", NULL); |