Preferences: New experimental settings for particle system and hair
This replaces the cmake options `WITH_NEW_OBJECT_TYPES` and `WITH_NEW_SIMULATION_TYPE` with two experimental userpref settings: * `use_new_particle_system`: Enables the point cloud type and the simulation editor. * `use_new_hair_type`: Only displays the add-operator in the add menu for now. Note, in the current state you can't do anything productive with the new particle system or the new hair type. Features will be added step by step in the upcoming weeks and months. Reviewers: brecht Differential Revision: https://developer.blender.org/D8096
This commit is contained in:
parent
13a5b954c3
commit
87ceff3d1b
Notes:
blender-bot
2023-02-13 22:01:04 +01:00
Referenced by issue #78218, System Crashes when switching to Edit Mode
|
@ -321,14 +321,6 @@ mark_as_advanced(WITH_SYSTEM_GLOG)
|
|||
# Freestyle
|
||||
option(WITH_FREESTYLE "Enable Freestyle (advanced edges rendering)" ON)
|
||||
|
||||
# New object types
|
||||
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_NEW_SIMULATION_TYPE "Enable simulation data block (use for development only, don't save in files)" OFF)
|
||||
mark_as_advanced(WITH_NEW_SIMULATION_TYPE)
|
||||
|
||||
# Misc
|
||||
if(WIN32)
|
||||
option(WITH_INPUT_IME "Enable Input Method Editor (IME) for complex Asian character input" ON)
|
||||
|
|
|
@ -92,10 +92,6 @@ if(WITH_MOD_FLUID)
|
|||
add_definitions(-DWITH_FLUID)
|
||||
endif()
|
||||
|
||||
if(WITH_NEW_OBJECT_TYPES)
|
||||
add_definitions(-DWITH_NEW_OBJECT_TYPES)
|
||||
endif()
|
||||
|
||||
if(WITH_OPENVDB)
|
||||
add_definitions(-DWITH_OPENVDB ${OPENVDB_DEFINITIONS})
|
||||
list(APPEND INC_SYS
|
||||
|
|
|
@ -628,7 +628,6 @@ void BlenderSync::sync_particle_hair(
|
|||
}
|
||||
}
|
||||
|
||||
#ifdef WITH_NEW_OBJECT_TYPES
|
||||
static float4 hair_point_as_float4(BL::HairPoint b_point)
|
||||
{
|
||||
float4 mP = float3_to_float4(get_float3(b_point.co()));
|
||||
|
@ -794,12 +793,10 @@ static void export_hair_curves_motion(Hair *hair, BL::Hair b_hair, int motion_st
|
|||
export_hair_motion_validate_attribute(hair, motion_step, num_motion_keys, have_motion);
|
||||
}
|
||||
}
|
||||
#endif /* WITH_NEW_OBJECT_TYPES */
|
||||
|
||||
/* Hair object. */
|
||||
void BlenderSync::sync_hair(Hair *hair, BL::Object &b_ob, bool motion, int motion_step)
|
||||
{
|
||||
#ifdef WITH_NEW_OBJECT_TYPES
|
||||
/* Convert Blender hair to Cycles curves. */
|
||||
BL::Hair b_hair(b_ob.data());
|
||||
if (motion) {
|
||||
|
@ -808,12 +805,6 @@ void BlenderSync::sync_hair(Hair *hair, BL::Object &b_ob, bool motion, int motio
|
|||
else {
|
||||
export_hair_curves(scene, hair, b_hair);
|
||||
}
|
||||
#else
|
||||
(void)hair;
|
||||
(void)b_ob;
|
||||
(void)motion;
|
||||
(void)motion_step;
|
||||
#endif /* WITH_NEW_OBJECT_TYPES */
|
||||
}
|
||||
|
||||
void BlenderSync::sync_hair(BL::Depsgraph b_depsgraph,
|
||||
|
@ -832,15 +823,11 @@ void BlenderSync::sync_hair(BL::Depsgraph b_depsgraph,
|
|||
hair->used_shaders = used_shaders;
|
||||
|
||||
if (view_layer.use_hair) {
|
||||
#ifdef WITH_NEW_OBJECT_TYPES
|
||||
if (b_ob.type() == BL::Object::type_HAIR) {
|
||||
/* Hair object. */
|
||||
sync_hair(hair, b_ob, false);
|
||||
assert(mesh == NULL);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
else {
|
||||
/* Particle hair. */
|
||||
bool need_undeformed = hair->need_attribute(scene, ATTR_STD_GENERATED);
|
||||
BL::Mesh b_mesh = object_to_mesh(
|
||||
|
@ -872,16 +859,12 @@ void BlenderSync::sync_hair_motion(BL::Depsgraph b_depsgraph,
|
|||
|
||||
/* Export deformed coordinates. */
|
||||
if (ccl::BKE_object_is_deform_modified(b_ob, b_scene, preview)) {
|
||||
#ifdef WITH_NEW_OBJECT_TYPES
|
||||
if (b_ob.type() == BL::Object::type_HAIR) {
|
||||
/* Hair object. */
|
||||
sync_hair(hair, b_ob, true, motion_step);
|
||||
assert(mesh == NULL);
|
||||
return;
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
else {
|
||||
/* Particle hair. */
|
||||
BL::Mesh b_mesh = object_to_mesh(b_data, b_ob, b_depsgraph, false, Mesh::SUBDIVISION_NONE);
|
||||
if (b_mesh) {
|
||||
|
|
|
@ -40,13 +40,9 @@ Geometry *BlenderSync::sync_geometry(BL::Depsgraph &b_depsgraph,
|
|||
BL::Material material_override = view_layer.material_override;
|
||||
Shader *default_shader = (b_ob.type() == BL::Object::type_VOLUME) ? scene->default_volume :
|
||||
scene->default_surface;
|
||||
#ifdef WITH_NEW_OBJECT_TYPES
|
||||
Geometry::Type geom_type = (b_ob.type() == BL::Object::type_HAIR || use_particle_hair) ?
|
||||
Geometry::HAIR :
|
||||
Geometry::MESH;
|
||||
#else
|
||||
Geometry::Type geom_type = (use_particle_hair) ? Geometry::HAIR : Geometry::MESH;
|
||||
#endif
|
||||
|
||||
/* Find shader indices. */
|
||||
vector<Shader *> used_shaders;
|
||||
|
@ -125,11 +121,7 @@ Geometry *BlenderSync::sync_geometry(BL::Depsgraph &b_depsgraph,
|
|||
|
||||
geom->name = ustring(b_ob_data.name().c_str());
|
||||
|
||||
#ifdef WITH_NEW_OBJECT_TYPES
|
||||
if (b_ob.type() == BL::Object::type_HAIR || use_particle_hair) {
|
||||
#else
|
||||
if (use_particle_hair) {
|
||||
#endif
|
||||
Hair *hair = static_cast<Hair *>(geom);
|
||||
sync_hair(b_depsgraph, b_ob, hair, used_shaders);
|
||||
}
|
||||
|
@ -170,11 +162,7 @@ void BlenderSync::sync_geometry_motion(BL::Depsgraph &b_depsgraph,
|
|||
return;
|
||||
}
|
||||
|
||||
#ifdef WITH_NEW_OBJECT_TYPES
|
||||
if (b_ob.type() == BL::Object::type_HAIR || use_particle_hair) {
|
||||
#else
|
||||
if (use_particle_hair) {
|
||||
#endif
|
||||
Hair *hair = static_cast<Hair *>(geom);
|
||||
sync_hair_motion(b_depsgraph, b_ob, hair, motion_step);
|
||||
}
|
||||
|
|
|
@ -69,11 +69,7 @@ bool BlenderSync::object_is_mesh(BL::Object &b_ob)
|
|||
|
||||
BL::Object::type_enum type = b_ob.type();
|
||||
|
||||
#ifdef WITH_NEW_OBJECT_TYPES
|
||||
if (type == BL::Object::type_VOLUME || type == BL::Object::type_HAIR) {
|
||||
#else
|
||||
if (type == BL::Object::type_VOLUME) {
|
||||
#endif
|
||||
/* Will be exported attached to mesh. */
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -2139,6 +2139,8 @@ class USERPREF_PT_experimental_system(ExperimentalPanel, Panel):
|
|||
self._draw_items(
|
||||
context, (
|
||||
({"property": "use_undo_legacy"}, "T60695"),
|
||||
({"property": "use_new_particle_system"}, "T73324"),
|
||||
({"property": "use_new_hair_type"}, "T68981"),
|
||||
),
|
||||
)
|
||||
|
||||
|
|
|
@ -2171,9 +2171,9 @@ class VIEW3D_MT_add(Menu):
|
|||
layout.menu("VIEW3D_MT_surface_add", icon='OUTLINER_OB_SURFACE')
|
||||
layout.menu("VIEW3D_MT_metaball_add", text="Metaball", icon='OUTLINER_OB_META')
|
||||
layout.operator("object.text_add", text="Text", icon='OUTLINER_OB_FONT')
|
||||
if hasattr(bpy.data, "hairs"):
|
||||
if context.preferences.experimental.use_new_hair_type:
|
||||
layout.operator("object.hair_add", text="Hair", icon='OUTLINER_OB_HAIR')
|
||||
if hasattr(bpy.data, "pointclouds"):
|
||||
if context.preferences.experimental.use_new_particle_system:
|
||||
layout.operator("object.pointcloud_add", text="Point Cloud", icon='OUTLINER_OB_POINTCLOUD')
|
||||
layout.menu("VIEW3D_MT_volume_add", text="Volume", icon='OUTLINER_OB_VOLUME')
|
||||
layout.operator_menu_enum("object.gpencil_add", "type", text="Grease Pencil", icon='OUTLINER_OB_GREASEPENCIL')
|
||||
|
|
|
@ -91,8 +91,4 @@ if(WITH_INTERNATIONAL)
|
|||
add_definitions(-DWITH_INTERNATIONAL)
|
||||
endif()
|
||||
|
||||
if(WITH_NEW_OBJECT_TYPES)
|
||||
add_definitions(-DWITH_NEW_OBJECT_TYPES)
|
||||
endif()
|
||||
|
||||
blender_add_lib(bf_editor_object "${SRC}" "${INC}" "${INC_SYS}" "${LIB}")
|
||||
|
|
|
@ -1511,6 +1511,14 @@ void OBJECT_OT_speaker_add(wmOperatorType *ot)
|
|||
/** \name Add Hair Operator
|
||||
* \{ */
|
||||
|
||||
static bool object_hair_add_poll(bContext *C)
|
||||
{
|
||||
if (!U.experimental.use_new_hair_type) {
|
||||
return false;
|
||||
}
|
||||
return ED_operator_objectmode(C);
|
||||
}
|
||||
|
||||
static int object_hair_add_exec(bContext *C, wmOperator *op)
|
||||
{
|
||||
ushort local_view_bits;
|
||||
|
@ -1534,7 +1542,7 @@ void OBJECT_OT_hair_add(wmOperatorType *ot)
|
|||
|
||||
/* api callbacks */
|
||||
ot->exec = object_hair_add_exec;
|
||||
ot->poll = ED_operator_objectmode;
|
||||
ot->poll = object_hair_add_poll;
|
||||
|
||||
/* flags */
|
||||
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
|
||||
|
@ -1548,6 +1556,14 @@ void OBJECT_OT_hair_add(wmOperatorType *ot)
|
|||
/** \name Add Point Cloud Operator
|
||||
* \{ */
|
||||
|
||||
static bool object_pointcloud_add_poll(bContext *C)
|
||||
{
|
||||
if (!U.experimental.use_new_particle_system) {
|
||||
return false;
|
||||
}
|
||||
return ED_operator_objectmode(C);
|
||||
}
|
||||
|
||||
static int object_pointcloud_add_exec(bContext *C, wmOperator *op)
|
||||
{
|
||||
ushort local_view_bits;
|
||||
|
@ -1571,7 +1587,7 @@ void OBJECT_OT_pointcloud_add(wmOperatorType *ot)
|
|||
|
||||
/* api callbacks */
|
||||
ot->exec = object_pointcloud_add_exec;
|
||||
ot->poll = ED_operator_objectmode;
|
||||
ot->poll = object_pointcloud_add_poll;
|
||||
|
||||
/* flags */
|
||||
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
|
||||
|
|
|
@ -109,10 +109,8 @@ void ED_operatortypes_object(void)
|
|||
WM_operatortype_append(OBJECT_OT_light_add);
|
||||
WM_operatortype_append(OBJECT_OT_camera_add);
|
||||
WM_operatortype_append(OBJECT_OT_speaker_add);
|
||||
#ifdef WITH_NEW_OBJECT_TYPES
|
||||
WM_operatortype_append(OBJECT_OT_hair_add);
|
||||
WM_operatortype_append(OBJECT_OT_pointcloud_add);
|
||||
#endif
|
||||
WM_operatortype_append(OBJECT_OT_volume_add);
|
||||
WM_operatortype_append(OBJECT_OT_volume_import);
|
||||
WM_operatortype_append(OBJECT_OT_add);
|
||||
|
|
|
@ -54,8 +54,4 @@ if(WITH_FREESTYLE)
|
|||
add_definitions(-DWITH_FREESTYLE)
|
||||
endif()
|
||||
|
||||
if(WITH_NEW_OBJECT_TYPES)
|
||||
add_definitions(-DWITH_NEW_OBJECT_TYPES)
|
||||
endif()
|
||||
|
||||
blender_add_lib(bf_editor_space_buttons "${SRC}" "${INC}" "${INC_SYS}" "${LIB}")
|
||||
|
|
|
@ -251,14 +251,12 @@ static int buttons_context_path_data(ButsContextPath *path, int type)
|
|||
else if (RNA_struct_is_a(ptr->type, &RNA_GreasePencil) && (type == -1 || type == OB_GPENCIL)) {
|
||||
return 1;
|
||||
}
|
||||
#ifdef WITH_NEW_OBJECT_TYPES
|
||||
else if (RNA_struct_is_a(ptr->type, &RNA_Hair) && (type == -1 || type == OB_HAIR)) {
|
||||
return 1;
|
||||
}
|
||||
else if (RNA_struct_is_a(ptr->type, &RNA_PointCloud) && (type == -1 || type == OB_POINTCLOUD)) {
|
||||
return 1;
|
||||
}
|
||||
#endif
|
||||
else if (RNA_struct_is_a(ptr->type, &RNA_Volume) && (type == -1 || type == OB_VOLUME)) {
|
||||
return 1;
|
||||
}
|
||||
|
@ -796,10 +794,8 @@ const char *buttons_context_dir[] = {
|
|||
"line_style",
|
||||
"collection",
|
||||
"gpencil",
|
||||
#ifdef WITH_NEW_OBJECT_TYPES
|
||||
"hair",
|
||||
"pointcloud",
|
||||
#endif
|
||||
"volume",
|
||||
NULL,
|
||||
};
|
||||
|
@ -878,7 +874,6 @@ int buttons_context(const bContext *C, const char *member, bContextDataResult *r
|
|||
set_pointer_type(path, result, &RNA_LightProbe);
|
||||
return 1;
|
||||
}
|
||||
#ifdef WITH_NEW_OBJECT_TYPES
|
||||
else if (CTX_data_equals(member, "hair")) {
|
||||
set_pointer_type(path, result, &RNA_Hair);
|
||||
return 1;
|
||||
|
@ -887,7 +882,6 @@ int buttons_context(const bContext *C, const char *member, bContextDataResult *r
|
|||
set_pointer_type(path, result, &RNA_PointCloud);
|
||||
return 1;
|
||||
}
|
||||
#endif
|
||||
else if (CTX_data_equals(member, "volume")) {
|
||||
set_pointer_type(path, result, &RNA_Volume);
|
||||
return 1;
|
||||
|
|
|
@ -75,10 +75,6 @@ if(WITH_OPENIMAGEDENOISE)
|
|||
add_definitions(-DWITH_OPENIMAGEDENOISE)
|
||||
endif()
|
||||
|
||||
if (WITH_NEW_SIMULATION_TYPE)
|
||||
add_definitions(-DWITH_NEW_SIMULATION_TYPE)
|
||||
endif()
|
||||
|
||||
add_definitions(${GL_DEFINITIONS})
|
||||
|
||||
blender_add_lib(bf_editor_space_node "${SRC}" "${INC}" "${INC_SYS}" "${LIB}")
|
||||
|
|
|
@ -936,11 +936,10 @@ static void node_space_subtype_item_extend(bContext *C, EnumPropertyItem **item,
|
|||
bool free;
|
||||
const EnumPropertyItem *item_src = RNA_enum_node_tree_types_itemf_impl(C, &free);
|
||||
for (const EnumPropertyItem *item_iter = item_src; item_iter->identifier; item_iter++) {
|
||||
#ifndef WITH_NEW_SIMULATION_TYPE
|
||||
if (STREQ(item_iter->identifier, "SimulationNodeTree")) {
|
||||
if (!U.experimental.use_new_particle_system &&
|
||||
STREQ(item_iter->identifier, "SimulationNodeTree")) {
|
||||
continue;
|
||||
}
|
||||
#endif
|
||||
RNA_enum_item_add(item, totitem, item_iter);
|
||||
}
|
||||
if (free) {
|
||||
|
|
|
@ -619,8 +619,10 @@ typedef struct UserDef_FileSpaceData {
|
|||
|
||||
typedef struct UserDef_Experimental {
|
||||
char use_undo_legacy;
|
||||
char use_new_particle_system;
|
||||
char use_new_hair_type;
|
||||
/** `makesdna` does not allow empty structs. */
|
||||
char _pad0[7];
|
||||
char _pad0[5];
|
||||
} UserDef_Experimental;
|
||||
|
||||
#define USER_EXPERIMENTAL_TEST(userdef, member) \
|
||||
|
|
|
@ -47,6 +47,7 @@ set(DEFSRC
|
|||
rna_fluid.c
|
||||
rna_gpencil.c
|
||||
rna_gpencil_modifier.c
|
||||
rna_hair.c
|
||||
rna_image.c
|
||||
rna_key.c
|
||||
rna_lattice.c
|
||||
|
@ -77,9 +78,11 @@ 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
|
||||
rna_pointcloud.c
|
||||
rna_test.c
|
||||
rna_text.c
|
||||
rna_texture.c
|
||||
|
@ -96,20 +99,6 @@ set(DEFSRC
|
|||
rna_xr.c
|
||||
)
|
||||
|
||||
if(WITH_NEW_OBJECT_TYPES)
|
||||
list(APPEND DEFSRC
|
||||
rna_hair.c
|
||||
rna_pointcloud.c
|
||||
)
|
||||
endif()
|
||||
|
||||
if (WITH_NEW_SIMULATION_TYPE)
|
||||
list(APPEND DEFSRC
|
||||
rna_simulation.c
|
||||
)
|
||||
endif()
|
||||
|
||||
|
||||
set(APISRC
|
||||
rna_action_api.c
|
||||
rna_animation_api.c
|
||||
|
@ -345,15 +334,6 @@ if(WITH_XR_OPENXR)
|
|||
add_definitions(-DWITH_XR_OPENXR)
|
||||
endif()
|
||||
|
||||
if(WITH_NEW_OBJECT_TYPES)
|
||||
add_definitions(-DWITH_NEW_OBJECT_TYPES)
|
||||
endif()
|
||||
|
||||
if (WITH_NEW_SIMULATION_TYPE)
|
||||
add_definitions(-DWITH_NEW_SIMULATION_TYPE)
|
||||
endif()
|
||||
|
||||
|
||||
# Build makesrna executable
|
||||
blender_include_dirs(
|
||||
.
|
||||
|
|
|
@ -4269,9 +4269,7 @@ 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_NEW_OBJECT_TYPES
|
||||
{"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},
|
||||
|
@ -4294,9 +4292,7 @@ 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_NEW_OBJECT_TYPES
|
||||
{"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},
|
||||
|
@ -4306,9 +4302,7 @@ 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_NEW_SIMULATION_TYPE
|
||||
{"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},
|
||||
|
|
|
@ -71,17 +71,13 @@ 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_NEW_SIMULATION_TYPE
|
||||
{ID_SIM, "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", ""},
|
||||
{ID_TE, "TEXTURE", ICON_TEXTURE_DATA, "Texture", ""},
|
||||
#ifdef WITH_NEW_OBJECT_TYPES
|
||||
{ID_HA, "HAIR", ICON_HAIR_DATA, "Hair", ""},
|
||||
{ID_PT, "POINTCLOUD", ICON_POINTCLOUD_DATA, "PointCloud", ""},
|
||||
#endif
|
||||
{ID_VO, "VOLUME", ICON_VOLUME_DATA, "Volume", ""},
|
||||
{ID_WM, "WINDOWMANAGER", ICON_WINDOW, "Window Manager", ""},
|
||||
{ID_WO, "WORLD", ICON_WORLD_DATA, "World", ""},
|
||||
|
@ -254,11 +250,9 @@ short RNA_type_to_ID_code(const StructRNA *type)
|
|||
if (base_type == &RNA_FreestyleLineStyle) {
|
||||
return ID_LS;
|
||||
}
|
||||
# ifdef WITH_NEW_OBJECT_TYPES
|
||||
if (base_type == &RNA_Hair) {
|
||||
return ID_HA;
|
||||
}
|
||||
# endif
|
||||
if (base_type == &RNA_Lattice) {
|
||||
return ID_LT;
|
||||
}
|
||||
|
@ -292,11 +286,9 @@ short RNA_type_to_ID_code(const StructRNA *type)
|
|||
if (base_type == &RNA_PaintCurve) {
|
||||
return ID_PC;
|
||||
}
|
||||
# ifdef WITH_NEW_OBJECT_TYPES
|
||||
if (base_type == &RNA_PointCloud) {
|
||||
return ID_PT;
|
||||
}
|
||||
# endif
|
||||
if (base_type == &RNA_LightProbe) {
|
||||
return ID_LP;
|
||||
}
|
||||
|
@ -306,11 +298,9 @@ short RNA_type_to_ID_code(const StructRNA *type)
|
|||
if (base_type == &RNA_Screen) {
|
||||
return ID_SCR;
|
||||
}
|
||||
# ifdef WITH_NEW_SIMULATION_TYPE
|
||||
if (base_type == &RNA_Simulation) {
|
||||
return ID_SIM;
|
||||
}
|
||||
# endif
|
||||
if (base_type == &RNA_Sound) {
|
||||
return ID_SO;
|
||||
}
|
||||
|
@ -364,11 +354,7 @@ StructRNA *ID_code_to_RNA_type(short idcode)
|
|||
case ID_GR:
|
||||
return &RNA_Collection;
|
||||
case ID_HA:
|
||||
# ifdef WITH_NEW_OBJECT_TYPES
|
||||
return &RNA_Hair;
|
||||
# else
|
||||
return &RNA_ID;
|
||||
# endif
|
||||
case ID_IM:
|
||||
return &RNA_Image;
|
||||
case ID_KE:
|
||||
|
@ -402,11 +388,7 @@ StructRNA *ID_code_to_RNA_type(short idcode)
|
|||
case ID_PC:
|
||||
return &RNA_PaintCurve;
|
||||
case ID_PT:
|
||||
# ifdef WITH_NEW_OBJECT_TYPES
|
||||
return &RNA_PointCloud;
|
||||
# else
|
||||
return &RNA_ID;
|
||||
# endif
|
||||
case ID_LP:
|
||||
return &RNA_LightProbe;
|
||||
case ID_SCE:
|
||||
|
@ -414,11 +396,7 @@ StructRNA *ID_code_to_RNA_type(short idcode)
|
|||
case ID_SCR:
|
||||
return &RNA_Screen;
|
||||
case ID_SIM:
|
||||
# ifdef WITH_NEW_SIMULATION_TYPE
|
||||
return &RNA_Simulation;
|
||||
# else
|
||||
return &RNA_ID;
|
||||
# endif
|
||||
case ID_SO:
|
||||
return &RNA_Sound;
|
||||
case ID_SPK:
|
||||
|
|
|
@ -569,7 +569,6 @@ static void rna_def_dopesheet(BlenderRNA *brna)
|
|||
RNA_def_property_ui_icon(prop, ICON_FILE, 0);
|
||||
RNA_def_property_update(prop, NC_ANIMATION | ND_ANIMCHAN | NA_EDITED, NULL);
|
||||
|
||||
# ifdef WITH_NEW_OBJECT_TYPES
|
||||
prop = RNA_def_property(srna, "show_hairs", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_negative_sdna(prop, NULL, "filterflag2", ADS_FILTER_NOHAIR);
|
||||
RNA_def_property_ui_text(
|
||||
|
@ -583,7 +582,6 @@ static void rna_def_dopesheet(BlenderRNA *brna)
|
|||
prop, "Display Point Cloud", "Include visualization of point cloud related animation data");
|
||||
RNA_def_property_ui_icon(prop, ICON_OUTLINER_OB_POINTCLOUD, 0);
|
||||
RNA_def_property_update(prop, NC_ANIMATION | ND_ANIMCHAN | NA_EDITED, NULL);
|
||||
# endif
|
||||
|
||||
prop = RNA_def_property(srna, "show_volumes", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_negative_sdna(prop, NULL, "filterflag2", ADS_FILTER_NOVOLUME);
|
||||
|
|
|
@ -109,9 +109,7 @@ 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_NEW_OBJECT_TYPES
|
||||
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)
|
||||
|
@ -128,15 +126,11 @@ 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_NEW_OBJECT_TYPES
|
||||
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_NEW_SIMULATION_TYPE
|
||||
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)
|
||||
|
@ -390,7 +384,6 @@ void RNA_def_main(BlenderRNA *brna)
|
|||
"LightProbes",
|
||||
"LightProbe data-blocks",
|
||||
RNA_def_main_lightprobes},
|
||||
# ifdef WITH_NEW_OBJECT_TYPES
|
||||
{"hairs", "Hair", "rna_Main_hairs_begin", "Hairs", "Hair data-blocks", RNA_def_main_hairs},
|
||||
{"pointclouds",
|
||||
"PointCloud",
|
||||
|
@ -398,21 +391,18 @@ void RNA_def_main(BlenderRNA *brna)
|
|||
"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_NEW_SIMULATION_TYPE
|
||||
{"simulations",
|
||||
"Simulation",
|
||||
"rna_Main_simulations_begin",
|
||||
"Simulations",
|
||||
"Simulation data-blocks",
|
||||
RNA_def_main_simulations},
|
||||
# endif
|
||||
{NULL, NULL, NULL, NULL, NULL, NULL},
|
||||
};
|
||||
|
||||
|
|
|
@ -708,7 +708,6 @@ static bGPdata *rna_Main_gpencils_new(Main *bmain, const char *name)
|
|||
return gpd;
|
||||
}
|
||||
|
||||
# ifdef WITH_NEW_OBJECT_TYPES
|
||||
static Hair *rna_Main_hairs_new(Main *bmain, const char *name)
|
||||
{
|
||||
char safe_name[MAX_ID_NAME - 2];
|
||||
|
@ -728,7 +727,6 @@ 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)
|
||||
{
|
||||
|
@ -740,7 +738,6 @@ static Volume *rna_Main_volumes_new(Main *bmain, const char *name)
|
|||
return volume;
|
||||
}
|
||||
|
||||
# ifdef WITH_NEW_SIMULATION_TYPE
|
||||
static Simulation *rna_Main_simulations_new(Main *bmain, const char *name)
|
||||
{
|
||||
char safe_name[MAX_ID_NAME - 2];
|
||||
|
@ -750,7 +747,6 @@ 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) \
|
||||
|
@ -794,14 +790,10 @@ 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_NEW_OBJECT_TYPES
|
||||
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_NEW_SIMULATION_TYPE
|
||||
RNA_MAIN_ID_TAG_FUNCS_DEF(simulations, simulations, ID_SIM)
|
||||
# endif
|
||||
|
||||
# undef RNA_MAIN_ID_TAG_FUNCS_DEF
|
||||
|
||||
|
|
|
@ -290,13 +290,11 @@ const EnumPropertyItem rna_enum_object_modifier_type_items[] = {
|
|||
"Spawn particles from the shape"},
|
||||
{eModifierType_Softbody, "SOFT_BODY", ICON_MOD_SOFT, "Soft Body", ""},
|
||||
{eModifierType_Surface, "SURFACE", ICON_MODIFIER, "Surface", ""},
|
||||
#ifdef WITH_NEW_SIMULATION_TYPE
|
||||
{eModifierType_Simulation,
|
||||
"SIMULATION",
|
||||
ICON_PHYSICS,
|
||||
"Simulation",
|
||||
""}, /* TODO: Use correct icon. */
|
||||
#endif
|
||||
{0, NULL, 0, NULL, NULL},
|
||||
};
|
||||
|
||||
|
@ -1632,7 +1630,6 @@ static void rna_ParticleInstanceModifier_particle_system_set(PointerRNA *ptr,
|
|||
CLAMP_MIN(psmd->psys, 1);
|
||||
}
|
||||
|
||||
# ifdef WITH_NEW_SIMULATION_TYPE
|
||||
static void rna_SimulationModifier_simulation_update(Main *bmain, Scene *scene, PointerRNA *ptr)
|
||||
{
|
||||
SimulationModifierData *smd = ptr->data;
|
||||
|
@ -1641,7 +1638,6 @@ static void rna_SimulationModifier_simulation_update(Main *bmain, Scene *scene,
|
|||
}
|
||||
rna_Modifier_dependency_update(bmain, scene, ptr);
|
||||
}
|
||||
# endif
|
||||
|
||||
/**
|
||||
* Special set callback that just changes the first bit of the expansion flag.
|
||||
|
@ -6838,12 +6834,10 @@ static void rna_def_modifier_simulation(BlenderRNA *brna)
|
|||
|
||||
RNA_define_lib_overridable(true);
|
||||
|
||||
# ifdef WITH_NEW_SIMULATION_TYPE
|
||||
prop = RNA_def_property(srna, "simulation", PROP_POINTER, PROP_NONE);
|
||||
RNA_def_property_ui_text(prop, "Simulation", "Simulation to access");
|
||||
RNA_def_property_flag(prop, PROP_EDITABLE);
|
||||
RNA_def_property_update(prop, 0, "rna_SimulationModifier_simulation_update");
|
||||
# endif
|
||||
|
||||
prop = RNA_def_property(srna, "data_path", PROP_STRING, PROP_NONE);
|
||||
RNA_def_property_ui_text(
|
||||
|
|
|
@ -234,10 +234,8 @@ const EnumPropertyItem rna_enum_object_type_items[] = {
|
|||
OBTYPE_CU_SURF,
|
||||
{OB_MBALL, "META", 0, "Meta", ""},
|
||||
OBTYPE_CU_FONT,
|
||||
#ifdef WITH_NEW_OBJECT_TYPES
|
||||
{OB_HAIR, "HAIR", 0, "Hair", ""},
|
||||
{OB_POINTCLOUD, "POINTCLOUD", 0, "PointCloud", ""},
|
||||
#endif
|
||||
{OB_VOLUME, "VOLUME", 0, "Volume", ""},
|
||||
{0, "", 0, NULL, NULL},
|
||||
{OB_ARMATURE, "ARMATURE", 0, "Armature", ""},
|
||||
|
@ -565,12 +563,10 @@ static StructRNA *rna_Object_data_typef(PointerRNA *ptr)
|
|||
return &RNA_LightProbe;
|
||||
case OB_GPENCIL:
|
||||
return &RNA_GreasePencil;
|
||||
# ifdef WITH_NEW_OBJECT_TYPES
|
||||
case OB_HAIR:
|
||||
return &RNA_Hair;
|
||||
case OB_POINTCLOUD:
|
||||
return &RNA_PointCloud;
|
||||
# endif
|
||||
case OB_VOLUME:
|
||||
return &RNA_Volume;
|
||||
default:
|
||||
|
|
|
@ -2181,7 +2181,6 @@ static void rna_SpaceNodeEditor_node_tree_update(const bContext *C, PointerRNA *
|
|||
ED_node_tree_update(C);
|
||||
}
|
||||
|
||||
# ifdef WITH_NEW_SIMULATION_TYPE
|
||||
static PointerRNA rna_SpaceNodeEditor_simulation_get(PointerRNA *ptr)
|
||||
{
|
||||
SpaceNode *snode = (SpaceNode *)ptr->data;
|
||||
|
@ -2213,7 +2212,6 @@ static void rna_SpaceNodeEditor_simulation_set(PointerRNA *ptr,
|
|||
}
|
||||
snode->id = &sim->id;
|
||||
}
|
||||
# endif
|
||||
|
||||
static int rna_SpaceNodeEditor_tree_type_get(PointerRNA *ptr)
|
||||
{
|
||||
|
@ -4317,12 +4315,10 @@ static void rna_def_space_view3d(BlenderRNA *brna)
|
|||
{"Surface", (1 << OB_SURF), {"show_object_viewport_surf", "show_object_select_surf"}},
|
||||
{"Meta", (1 << OB_MBALL), {"show_object_viewport_meta", "show_object_select_meta"}},
|
||||
{"Font", (1 << OB_FONT), {"show_object_viewport_font", "show_object_select_font"}},
|
||||
# ifdef WITH_NEW_OBJECT_TYPES
|
||||
{"Hair", (1 << OB_HAIR), {"show_object_viewport_hair", "show_object_select_hair"}},
|
||||
{"Point Cloud",
|
||||
(1 << OB_POINTCLOUD),
|
||||
{"show_object_viewport_pointcloud", "show_object_select_pointcloud"}},
|
||||
# endif
|
||||
{"Volume", (1 << OB_VOLUME), {"show_object_viewport_volume", "show_object_select_volume"}},
|
||||
{"Armature",
|
||||
(1 << OB_ARMATURE),
|
||||
|
@ -5534,9 +5530,7 @@ static void rna_def_fileselect_idfilter(BlenderRNA *brna)
|
|||
"Grease Pencil",
|
||||
"Show Grease pencil data-blocks"},
|
||||
{FILTER_ID_GR, "filter_group", ICON_GROUP, "Collections", "Show Collection data-blocks"},
|
||||
# ifdef WITH_NEW_OBJECT_TYPES
|
||||
{FILTER_ID_HA, "filter_hair", ICON_HAIR_DATA, "Hairs", "Show/hide Hair data-blocks"},
|
||||
# endif
|
||||
{FILTER_ID_IM, "filter_image", ICON_IMAGE_DATA, "Images", "Show Image data-blocks"},
|
||||
{FILTER_ID_LA, "filter_light", ICON_LIGHT_DATA, "Lights", "Show Light data-blocks"},
|
||||
{FILTER_ID_LP,
|
||||
|
@ -5580,21 +5574,17 @@ static void rna_def_fileselect_idfilter(BlenderRNA *brna)
|
|||
ICON_CURVE_BEZCURVE,
|
||||
"Paint Curves",
|
||||
"Show Paint Curve data-blocks"},
|
||||
# ifdef WITH_NEW_OBJECT_TYPES
|
||||
{FILTER_ID_PT,
|
||||
"filter_pointcloud",
|
||||
ICON_POINTCLOUD_DATA,
|
||||
"Point Clouds",
|
||||
"Show/hide Point Cloud data-blocks"},
|
||||
# endif
|
||||
{FILTER_ID_SCE, "filter_scene", ICON_SCENE_DATA, "Scenes", "Show Scene data-blocks"},
|
||||
# ifdef WITH_NEW_SIMULATION_TYPE
|
||||
{FILTER_ID_SIM,
|
||||
"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"},
|
||||
|
@ -6276,7 +6266,6 @@ 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_NEW_SIMULATION_TYPE
|
||||
prop = RNA_def_property(srna, "simulation", PROP_POINTER, PROP_NONE);
|
||||
RNA_def_property_flag(prop, PROP_EDITABLE);
|
||||
RNA_def_property_struct_type(prop, "Simulation");
|
||||
|
@ -6287,7 +6276,6 @@ 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);
|
||||
|
|
|
@ -5063,7 +5063,6 @@ static void rna_def_userdef_edit(BlenderRNA *brna)
|
|||
RNA_def_property_ui_text(
|
||||
prop, "Duplicate GPencil", "Causes grease pencil data to be duplicated with the object");
|
||||
|
||||
# ifdef WITH_NEW_OBJECT_TYPES
|
||||
prop = RNA_def_property(srna, "use_duplicate_hair", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(prop, NULL, "dupflag", USER_DUP_HAIR);
|
||||
RNA_def_property_ui_text(
|
||||
|
@ -5073,7 +5072,6 @@ static void rna_def_userdef_edit(BlenderRNA *brna)
|
|||
RNA_def_property_boolean_sdna(prop, NULL, "dupflag", USER_DUP_POINTCLOUD);
|
||||
RNA_def_property_ui_text(
|
||||
prop, "Duplicate Point Cloud", "Causes point cloud data to be duplicated with the object");
|
||||
# endif
|
||||
|
||||
prop = RNA_def_property(srna, "use_duplicate_volume", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(prop, NULL, "dupflag", USER_DUP_VOLUME);
|
||||
|
@ -6072,6 +6070,15 @@ static void rna_def_userdef_experimental(BlenderRNA *brna)
|
|||
prop,
|
||||
"Undo Legacy",
|
||||
"Use legacy undo (slower than the new default one, but may be more stable in some cases)");
|
||||
|
||||
prop = RNA_def_property(srna, "use_new_particle_system", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(prop, NULL, "use_new_particle_system", 1);
|
||||
RNA_def_property_ui_text(
|
||||
prop, "Use New Particle System", "Enable the new particle system in the ui");
|
||||
|
||||
prop = RNA_def_property(srna, "use_new_hair_type", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(prop, NULL, "use_new_hair_type", 1);
|
||||
RNA_def_property_ui_text(prop, "Use New Hair Type", "Enable the new hair type in the ui");
|
||||
}
|
||||
|
||||
static void rna_def_userdef_addon_collection(BlenderRNA *brna, PropertyRNA *cprop)
|
||||
|
|
Loading…
Reference in New Issue