Hair Curves: The new curves object is now available

This commit doesn't implement any new feature but makes the new curves
object type no longer experimental.

Documentation:

* https://docs.blender.org/manual/en/3.3/modeling/curves/primitives.html#empty-hair
* https://docs.blender.org/manual/en/3.3/sculpt_paint/curves_sculpting/introduction.html

Note: This also makes the Selection Paint tool available. This tool
should have been moved out of the "New Curves Tool" flag when we got the
selection drawing to work.

Differential Revision: https://developer.blender.org/D15402
This commit is contained in:
Dalai Felinto 2022-07-08 14:41:21 +02:00
parent 2c55d8c1cf
commit becb1530b1
Notes: blender-bot 2023-02-14 08:08:56 +01:00
Referenced by commit 597955d0a8, Cleanup: Remove compile option for curves object
7 changed files with 21 additions and 83 deletions

View File

@ -72,7 +72,7 @@ class PARTICLE_MT_context_menu(Menu):
props.use_active = False
props.remove_target_particles = True
if experimental.use_new_curves_type and psys.settings.type == 'HAIR':
if psys.settings.type == 'HAIR':
layout.operator(
"curves.convert_from_particle_system",
text="Convert to Curves")

View File

@ -3172,14 +3172,8 @@ class VIEW3D_PT_tools_active(ToolSelectPanelHelper, Panel):
),
],
'SCULPT_CURVES': [
lambda context: (
(
_defs_curves_sculpt.selection_paint,
None,
)
if context is None or context.preferences.experimental.use_new_curves_tools
else ()
),
_defs_curves_sculpt.selection_paint,
None,
_defs_curves_sculpt.comb,
_defs_curves_sculpt.add,
_defs_curves_sculpt.delete,

View File

@ -2272,7 +2272,6 @@ class USERPREF_PT_experimental_prototypes(ExperimentalPanel, Panel):
def draw(self, context):
self._draw_items(
context, (
({"property": "use_new_curves_type"}, "T68981"),
({"property": "use_new_curves_tools"}, "T68981"),
({"property": "use_new_point_cloud_type"}, "T75717"),
({"property": "use_sculpt_texture_paint"}, "T96225"),

View File

@ -718,19 +718,17 @@ class VIEW3D_HT_header(Header):
row = layout.row(align=True)
experimental = context.preferences.experimental
if experimental.use_new_curves_tools:
# Combine the "use selection" toggle with the "set domain" operators
# to allow turning selection off directly.
domain = curves.selection_domain
if domain == 'POINT':
row.prop(curves, "use_sculpt_selection", text="", icon='CURVE_BEZCIRCLE')
else:
row.operator("curves.set_selection_domain", text="", icon='CURVE_BEZCIRCLE').domain = 'POINT'
if domain == 'CURVE':
row.prop(curves, "use_sculpt_selection", text="", icon='CURVE_PATH')
else:
row.operator("curves.set_selection_domain", text="", icon='CURVE_PATH').domain = 'CURVE'
# Combine the "use selection" toggle with the "set domain" operators
# to allow turning selection off directly.
domain = curves.selection_domain
if domain == 'POINT':
row.prop(curves, "use_sculpt_selection", text="", icon='CURVE_BEZCIRCLE')
else:
row.operator("curves.set_selection_domain", text="", icon='CURVE_BEZCIRCLE').domain = 'POINT'
if domain == 'CURVE':
row.prop(curves, "use_sculpt_selection", text="", icon='CURVE_PATH')
else:
row.operator("curves.set_selection_domain", text="", icon='CURVE_PATH').domain = 'CURVE'
# Grease Pencil
if obj and obj.type == 'GPENCIL' and context.gpencil_data:
@ -2111,14 +2109,13 @@ class VIEW3D_MT_curve_add(Menu):
layout.operator("curve.primitive_nurbs_circle_add", text="Nurbs Circle", icon='CURVE_NCIRCLE')
layout.operator("curve.primitive_nurbs_path_add", text="Path", icon='CURVE_PATH')
layout.separator()
layout.operator("object.curves_empty_hair_add", text="Empty Hair", icon='CURVES_DATA')
experimental = context.preferences.experimental
if experimental.use_new_curves_type:
layout.separator()
layout.operator("object.curves_empty_hair_add", text="Empty Hair", icon='CURVES_DATA')
if experimental.use_new_curves_tools:
layout.operator("object.curves_random_add", text="Random", icon='CURVES_DATA')
if experimental.use_new_curves_tools:
layout.operator("object.curves_random_add", text="Random", icon='CURVES_DATA')
class VIEW3D_MT_surface_add(Menu):

View File

@ -2030,14 +2030,6 @@ void OBJECT_OT_speaker_add(wmOperatorType *ot)
/** \name Add Curves Operator
* \{ */
static bool object_curves_add_poll(bContext *C)
{
if (!U.experimental.use_new_curves_type) {
return false;
}
return ED_operator_objectmode(C);
}
static int object_curves_random_add_exec(bContext *C, wmOperator *op)
{
using namespace blender;
@ -2066,7 +2058,7 @@ void OBJECT_OT_curves_random_add(wmOperatorType *ot)
/* api callbacks */
ot->exec = object_curves_random_add_exec;
ot->poll = object_curves_add_poll;
ot->poll = ED_operator_objectmode;
/* flags */
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
@ -2117,9 +2109,6 @@ static int object_curves_empty_hair_add_exec(bContext *C, wmOperator *op)
static bool object_curves_empty_hair_add_poll(bContext *C)
{
if (!U.experimental.use_new_curves_type) {
return false;
}
if (!ED_operator_objectmode(C)) {
return false;
}
@ -2781,28 +2770,6 @@ static const EnumPropertyItem convert_target_items[] = {
{0, nullptr, 0, nullptr, nullptr},
};
static const EnumPropertyItem *convert_target_items_fn(bContext *UNUSED(C),
PointerRNA *UNUSED(ptr),
PropertyRNA *UNUSED(prop),
bool *r_free)
{
EnumPropertyItem *items = nullptr;
int items_num = 0;
for (const EnumPropertyItem *item = convert_target_items; item->identifier != nullptr; item++) {
if (item->value == OB_CURVES) {
if (U.experimental.use_new_curves_type) {
RNA_enum_item_add(&items, &items_num, item);
}
}
else {
RNA_enum_item_add(&items, &items_num, item);
}
}
RNA_enum_item_end(&items, &items_num);
*r_free = true;
return items;
}
static void object_data_convert_ensure_curve_cache(Depsgraph *depsgraph, Scene *scene, Object *ob)
{
if (ob->runtime.curve_cache == nullptr) {
@ -3562,7 +3529,6 @@ void OBJECT_OT_convert(wmOperatorType *ot)
/* properties */
ot->prop = RNA_def_enum(
ot->srna, "target", convert_target_items, OB_MESH, "Target", "Type of object to convert to");
RNA_def_enum_funcs(ot->prop, convert_target_items_fn);
RNA_def_boolean(ot->srna,
"keep_original",
false,

View File

@ -644,8 +644,6 @@ typedef struct UserDef_Experimental {
char SANITIZE_AFTER_HERE;
/* The following options are automatically sanitized (set to 0)
* when the release cycle is not alpha. */
char use_new_curves_type;
/** Only available when #use_new_curves_type is enabled. */
char use_new_curves_tools;
char use_new_point_cloud_type;
char use_full_frame_compositor;
@ -655,7 +653,6 @@ typedef struct UserDef_Experimental {
char enable_eevee_next;
char use_sculpt_texture_paint;
char use_draw_manager_acquire_lock;
char _pad[7];
/** `makesdna` does not allow empty structs. */
} UserDef_Experimental;

View File

@ -1101,16 +1101,6 @@ int rna_show_statusbar_vram_editable(struct PointerRNA *UNUSED(ptr), const char
return GPU_mem_stats_supported() ? PROP_EDITABLE : 0;
}
static int rna_userdef_experimental_use_new_curve_tools_editable(struct PointerRNA *UNUSED(ptr),
const char **r_info)
{
if (U.experimental.use_new_curves_type) {
return PROP_EDITABLE;
}
*r_info = "Only available when new curves type is enabled";
return 0;
}
#else
# define USERDEF_TAG_DIRTY_PROPERTY_UPDATE_ENABLE \
@ -6414,13 +6404,8 @@ static void rna_def_userdef_experimental(BlenderRNA *brna)
"reduces execution time and memory usage)");
RNA_def_property_update(prop, 0, "rna_userdef_update");
prop = RNA_def_property(srna, "use_new_curves_type", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "use_new_curves_type", 1);
RNA_def_property_ui_text(prop, "New Curves Type", "Enable the new curves data type in the UI");
prop = RNA_def_property(srna, "use_new_curves_tools", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "use_new_curves_tools", 1);
RNA_def_property_editable_func(prop, "rna_userdef_experimental_use_new_curve_tools_editable");
RNA_def_property_ui_text(
prop, "New Curves Tools", "Enable additional features for the new curves data block");