Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans Goudey <h.goudey@me.com>2022-02-07 20:55:54 +0300
committerHans Goudey <h.goudey@me.com>2022-02-07 20:56:48 +0300
commitfe1816f67fbc6aaf383ec77847d668367335d093 (patch)
treeb89fc16a38a498c8b8ca96f9c50ee1a765d167fe /source/blender/makesrna
parentb8c764c5d1fa241a284b985936a96efe0ee23a0f (diff)
Curves: Rename "Hair" types, variables, and functions to "Curves"
Based on discussions from T95355 and T94193, the plan is to use the name "Curves" to describe the data-block container for multiple curves. Eventually this will replace the existing "Curve" data-block. However, it will be a while before the curve data-block can be replaced so in order to distinguish the two curve types in the UI, "Hair Curves" will be used, but eventually changed back to "Curves". This patch renames "hair-related" files, functions, types, and variable names to this convention. A deep rename is preferred to keep code consistent and to avoid any "hair" terminology from leaking, since the new data-block is meant for all curve types, not just hair use cases. The downside of this naming is that the difference between "Curve" and "Curves" has become important. That was considered during design discussons and deemed acceptable, especially given the non-permanent nature of the somewhat common conflict. Some points of interest: - All DNA compatibility is lost, just like rBf59767ff9729. - I renamed `ID_HA` to `ID_CV` so there is no complete mismatch. - `hair_curves` is used where necessary to distinguish from the existing "curves" plural. - I didn't rename any of the cycles/rendering code function names, since that is also used by the old hair particle system. Differential Revision: https://developer.blender.org/D14007
Diffstat (limited to 'source/blender/makesrna')
-rw-r--r--source/blender/makesrna/RNA_access.h2
-rw-r--r--source/blender/makesrna/intern/CMakeLists.txt4
-rw-r--r--source/blender/makesrna/intern/makesrna.c4
-rw-r--r--source/blender/makesrna/intern/rna_ID.c16
-rw-r--r--source/blender/makesrna/intern/rna_action.c4
-rw-r--r--source/blender/makesrna/intern/rna_attribute.c4
-rw-r--r--source/blender/makesrna/intern/rna_curves.c (renamed from source/blender/makesrna/intern/rna_hair.c)82
-rw-r--r--source/blender/makesrna/intern/rna_internal.h6
-rw-r--r--source/blender/makesrna/intern/rna_main.c17
-rw-r--r--source/blender/makesrna/intern/rna_main_api.c48
-rw-r--r--source/blender/makesrna/intern/rna_material.c2
-rw-r--r--source/blender/makesrna/intern/rna_object.c8
-rw-r--r--source/blender/makesrna/intern/rna_space.c4
-rw-r--r--source/blender/makesrna/intern/rna_userdef.c8
14 files changed, 109 insertions, 100 deletions
diff --git a/source/blender/makesrna/RNA_access.h b/source/blender/makesrna/RNA_access.h
index 43439428ea7..47afa0f9a13 100644
--- a/source/blender/makesrna/RNA_access.h
+++ b/source/blender/makesrna/RNA_access.h
@@ -308,7 +308,7 @@ extern StructRNA RNA_GizmoProperties;
extern StructRNA RNA_GlowSequence;
extern StructRNA RNA_GpencilModifier;
extern StructRNA RNA_GreasePencil;
-extern StructRNA RNA_Hair;
+extern StructRNA RNA_Curves;
extern StructRNA RNA_Header;
extern StructRNA RNA_Histogram;
extern StructRNA RNA_HookGpencilModifier;
diff --git a/source/blender/makesrna/intern/CMakeLists.txt b/source/blender/makesrna/intern/CMakeLists.txt
index e3c89af6186..91d7c5a1394 100644
--- a/source/blender/makesrna/intern/CMakeLists.txt
+++ b/source/blender/makesrna/intern/CMakeLists.txt
@@ -101,9 +101,9 @@ set(DEFSRC
if(WITH_EXPERIMENTAL_FEATURES)
add_definitions(-DWITH_SIMULATION_DATABLOCK)
- add_definitions(-DWITH_HAIR_NODES)
+ add_definitions(-DWITH_NEW_CURVES_TYPE)
list(APPEND DEFSRC
- rna_hair.c
+ rna_curves.c
rna_simulation.c
)
endif()
diff --git a/source/blender/makesrna/intern/makesrna.c b/source/blender/makesrna/intern/makesrna.c
index 1e9cebbc3ea..0fadbda5a18 100644
--- a/source/blender/makesrna/intern/makesrna.c
+++ b/source/blender/makesrna/intern/makesrna.c
@@ -4376,8 +4376,8 @@ 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},
+#ifdef WITH_NEW_CURVES_TYPE
+ {"rna_curves.c", NULL, RNA_def_curves},
#endif
{"rna_image.c", "rna_image_api.c", RNA_def_image},
{"rna_key.c", NULL, RNA_def_key},
diff --git a/source/blender/makesrna/intern/rna_ID.c b/source/blender/makesrna/intern/rna_ID.c
index 8fc634fc087..9bb78cb483d 100644
--- a/source/blender/makesrna/intern/rna_ID.c
+++ b/source/blender/makesrna/intern/rna_ID.c
@@ -76,7 +76,7 @@ const EnumPropertyItem rna_enum_id_type_items[] = {
{ID_SPK, "SPEAKER", ICON_SPEAKER, "Speaker", ""},
{ID_TXT, "TEXT", ICON_TEXT, "Text", ""},
{ID_TE, "TEXTURE", ICON_TEXTURE_DATA, "Texture", ""},
- {ID_HA, "HAIR", ICON_HAIR_DATA, "Hair", ""},
+ {ID_CV, "CURVES", ICON_CURVES_DATA, "Hair Curves", ""},
{ID_PT, "POINTCLOUD", ICON_POINTCLOUD_DATA, "Point Cloud", ""},
{ID_VO, "VOLUME", ICON_VOLUME_DATA, "Volume", ""},
{ID_WM, "WINDOWMANAGER", ICON_WINDOW, "Window Manager", ""},
@@ -151,7 +151,7 @@ const struct IDFilterEnumPropertyItem rna_enum_id_type_filter_items[] = {
ICON_OUTLINER_COLLECTION,
"Collections",
"Show Collection data-blocks"},
- {FILTER_ID_HA, "filter_hair", ICON_HAIR_DATA, "Hairs", "Show/hide Hair data-blocks"},
+ {FILTER_ID_CV, "filter_hair", ICON_CURVES_DATA, "Hairs", "Show/hide Hair data-blocks"},
{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,
@@ -385,9 +385,9 @@ 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;
+# ifdef WITH_NEW_CURVES_TYPE
+ if (base_type == &RNA_Curves) {
+ return ID_CV;
}
# endif
if (base_type == &RNA_Lattice) {
@@ -492,9 +492,9 @@ StructRNA *ID_code_to_RNA_type(short idcode)
return &RNA_GreasePencil;
case ID_GR:
return &RNA_Collection;
- case ID_HA:
-# ifdef WITH_HAIR_NODES
- return &RNA_Hair;
+ case ID_CV:
+# ifdef WITH_NEW_CURVES_TYPE
+ return &RNA_Curves;
# else
return &RNA_ID;
# endif
diff --git a/source/blender/makesrna/intern/rna_action.c b/source/blender/makesrna/intern/rna_action.c
index 6b134977c5a..f4236a860ab 100644
--- a/source/blender/makesrna/intern/rna_action.c
+++ b/source/blender/makesrna/intern/rna_action.c
@@ -625,11 +625,11 @@ 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);
- prop = RNA_def_property(srna, "show_hairs", PROP_BOOLEAN, PROP_NONE);
+ prop = RNA_def_property(srna, "show_hair_curves", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "filterflag2", ADS_FILTER_NOHAIR);
RNA_def_property_ui_text(
prop, "Display Hair", "Include visualization of hair related animation data");
- RNA_def_property_ui_icon(prop, ICON_OUTLINER_OB_HAIR, 0);
+ RNA_def_property_ui_icon(prop, ICON_OUTLINER_OB_CURVES, 0);
RNA_def_property_update(prop, NC_ANIMATION | ND_ANIMCHAN | NA_EDITED, NULL);
prop = RNA_def_property(srna, "show_pointclouds", PROP_BOOLEAN, PROP_NONE);
diff --git a/source/blender/makesrna/intern/rna_attribute.c b/source/blender/makesrna/intern/rna_attribute.c
index da835fb89c4..dc0d00aaa77 100644
--- a/source/blender/makesrna/intern/rna_attribute.c
+++ b/source/blender/makesrna/intern/rna_attribute.c
@@ -26,8 +26,8 @@
#include "rna_internal.h"
+#include "DNA_curves_types.h"
#include "DNA_customdata_types.h"
-#include "DNA_hair_types.h"
#include "DNA_mesh_types.h"
#include "DNA_meshdata_types.h"
#include "DNA_pointcloud_types.h"
@@ -188,7 +188,7 @@ const EnumPropertyItem *rna_enum_attribute_domain_itemf(ID *id,
if (id_type == ID_PT && !ELEM(domain_item->value, ATTR_DOMAIN_POINT)) {
continue;
}
- if (id_type == ID_HA && !ELEM(domain_item->value, ATTR_DOMAIN_POINT, ATTR_DOMAIN_CURVE)) {
+ if (id_type == ID_CV && !ELEM(domain_item->value, ATTR_DOMAIN_POINT, ATTR_DOMAIN_CURVE)) {
continue;
}
if (id_type == ID_ME && ELEM(domain_item->value, ATTR_DOMAIN_CURVE)) {
diff --git a/source/blender/makesrna/intern/rna_hair.c b/source/blender/makesrna/intern/rna_curves.c
index 30e1fd48c03..faa067000bb 100644
--- a/source/blender/makesrna/intern/rna_hair.c
+++ b/source/blender/makesrna/intern/rna_curves.c
@@ -25,7 +25,7 @@
#include "rna_internal.h"
-#include "DNA_hair_types.h"
+#include "DNA_curves_types.h"
#include "BLI_math_base.h"
#include "BLI_string.h"
@@ -35,27 +35,27 @@
# include "BLI_math_vector.h"
# include "BKE_attribute.h"
-# include "BKE_hair.h"
+# include "BKE_curves.h"
# include "DEG_depsgraph.h"
# include "WM_api.h"
# include "WM_types.h"
-static Hair *rna_hair(PointerRNA *ptr)
+static Curves *rna_curves(PointerRNA *ptr)
{
- return (Hair *)ptr->owner_id;
+ return (Curves *)ptr->owner_id;
}
-static int rna_Hair_curve_offset_data_length(PointerRNA *ptr)
+static int rna_Curves_curve_offset_data_length(PointerRNA *ptr)
{
- const Hair *curves = rna_hair(ptr);
+ const Curves *curves = rna_curves(ptr);
return curves->geometry.curve_size + 1;
}
-static void rna_Hair_curve_offset_data_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
+static void rna_Curves_curve_offset_data_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
{
- const Hair *curves = rna_hair(ptr);
+ const Curves *curves = rna_curves(ptr);
rna_iterator_array_begin(iter,
(void *)curves->geometry.offsets,
sizeof(int),
@@ -66,9 +66,9 @@ static void rna_Hair_curve_offset_data_begin(CollectionPropertyIterator *iter, P
static int rna_CurvePoint_index_get(PointerRNA *ptr)
{
- const Hair *hair = rna_hair(ptr);
+ const Curves *curves = rna_curves(ptr);
const float(*co)[3] = ptr->data;
- return (int)(co - hair->geometry.position);
+ return (int)(co - curves->geometry.position);
}
static void rna_CurvePoint_location_get(PointerRNA *ptr, float value[3])
@@ -83,22 +83,22 @@ static void rna_CurvePoint_location_set(PointerRNA *ptr, const float value[3])
static float rna_CurvePoint_radius_get(PointerRNA *ptr)
{
- const Hair *hair = rna_hair(ptr);
- if (hair->geometry.radius == NULL) {
+ const Curves *curves = rna_curves(ptr);
+ if (curves->geometry.radius == NULL) {
return 0.0f;
}
const float(*co)[3] = ptr->data;
- return hair->geometry.radius[co - hair->geometry.position];
+ return curves->geometry.radius[co - curves->geometry.position];
}
static void rna_CurvePoint_radius_set(PointerRNA *ptr, float value)
{
- const Hair *hair = rna_hair(ptr);
- if (hair->geometry.radius == NULL) {
+ const Curves *curves = rna_curves(ptr);
+ if (curves->geometry.radius == NULL) {
return;
}
const float(*co)[3] = ptr->data;
- hair->geometry.radius[co - hair->geometry.position] = value;
+ curves->geometry.radius[co - curves->geometry.position] = value;
}
static char *rna_CurvePoint_path(PointerRNA *ptr)
@@ -108,8 +108,8 @@ static char *rna_CurvePoint_path(PointerRNA *ptr)
static int rna_CurveSlice_index_get(PointerRNA *ptr)
{
- Hair *hair = rna_hair(ptr);
- return (int)((int *)ptr->data - hair->geometry.offsets);
+ Curves *curves = rna_curves(ptr);
+ return (int)((int *)ptr->data - curves->geometry.offsets);
}
static char *rna_CurveSlice_path(PointerRNA *ptr)
@@ -119,11 +119,11 @@ static char *rna_CurveSlice_path(PointerRNA *ptr)
static void rna_CurveSlice_points_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
{
- Hair *hair = rna_hair(ptr);
+ Curves *curves = rna_curves(ptr);
const int *offset_ptr = (int *)ptr->data;
const int offset = *offset_ptr;
const int size = *(offset_ptr + 1) - offset;
- float(*co)[3] = hair->geometry.position + *offset_ptr;
+ float(*co)[3] = curves->geometry.position + *offset_ptr;
rna_iterator_array_begin(iter, co, sizeof(float[3]), size, 0, NULL);
}
@@ -140,9 +140,9 @@ static int rna_CurveSlice_points_length_get(PointerRNA *ptr)
return *(offset_ptr + 1) - offset;
}
-static void rna_Hair_update_data(struct Main *UNUSED(bmain),
- struct Scene *UNUSED(scene),
- PointerRNA *ptr)
+static void rna_Curves_update_data(struct Main *UNUSED(bmain),
+ struct Scene *UNUSED(scene),
+ PointerRNA *ptr)
{
ID *id = ptr->owner_id;
@@ -155,7 +155,7 @@ static void rna_Hair_update_data(struct Main *UNUSED(bmain),
#else
-static void rna_def_hair_point(BlenderRNA *brna)
+static void rna_def_curves_point(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
@@ -169,13 +169,13 @@ static void rna_def_hair_point(BlenderRNA *brna)
RNA_def_property_float_funcs(
prop, "rna_CurvePoint_location_get", "rna_CurvePoint_location_set", NULL);
RNA_def_property_ui_text(prop, "Position", "");
- RNA_def_property_update(prop, 0, "rna_Hair_update_data");
+ RNA_def_property_update(prop, 0, "rna_Curves_update_data");
prop = RNA_def_property(srna, "radius", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_funcs(
prop, "rna_CurvePoint_radius_get", "rna_CurvePoint_radius_set", NULL);
RNA_def_property_ui_text(prop, "Radius", "");
- RNA_def_property_update(prop, 0, "rna_Hair_update_data");
+ RNA_def_property_update(prop, 0, "rna_Curves_update_data");
prop = RNA_def_property(srna, "index", PROP_INT, PROP_UNSIGNED);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
@@ -183,7 +183,7 @@ static void rna_def_hair_point(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Index", "Index of this points");
}
-static void rna_def_hair_curve(BlenderRNA *brna)
+static void rna_def_curves_curve(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
@@ -222,21 +222,21 @@ static void rna_def_hair_curve(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Index", "Index of this curve");
}
-static void rna_def_hair(BlenderRNA *brna)
+static void rna_def_curves(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
- srna = RNA_def_struct(brna, "Hair", "ID");
- RNA_def_struct_ui_text(srna, "Hair", "Hair data-block for hair curves");
- RNA_def_struct_ui_icon(srna, ICON_HAIR_DATA);
+ srna = RNA_def_struct(brna, "Curves", "ID");
+ RNA_def_struct_ui_text(srna, "Hair Curves", "Hair data-block for hair curves");
+ RNA_def_struct_ui_icon(srna, ICON_CURVES_DATA);
/* Point and Curve RNA API helpers. */
prop = RNA_def_property(srna, "curves", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "geometry.offsets", "geometry.curve_size");
RNA_def_property_struct_type(prop, "CurveSlice");
- RNA_def_property_ui_text(prop, "Curves", "All hair curves");
+ RNA_def_property_ui_text(prop, "Curves", "All curves in the data-block");
/* TODO: better solution for (*co)[3] parsing issue. */
@@ -244,7 +244,7 @@ static void rna_def_hair(BlenderRNA *brna)
prop = RNA_def_property(srna, "points", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "geometry.position", "geometry.point_size");
RNA_def_property_struct_type(prop, "CurvePoint");
- RNA_def_property_ui_text(prop, "Points", "Control points of all hair curves");
+ RNA_def_property_ui_text(prop, "Points", "Control points of all curves");
RNA_define_verify_sdna(1);
/* Direct access to built-in attributes. */
@@ -253,22 +253,22 @@ static void rna_def_hair(BlenderRNA *brna)
prop = RNA_def_property(srna, "position_data", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "geometry.position", "geometry.point_size");
RNA_def_property_struct_type(prop, "FloatVectorAttributeValue");
- RNA_def_property_update(prop, 0, "rna_Hair_update_data");
+ RNA_def_property_update(prop, 0, "rna_Curves_update_data");
RNA_define_verify_sdna(1);
prop = RNA_def_property(srna, "curve_offset_data", PROP_COLLECTION, PROP_NONE);
RNA_def_property_collection_sdna(prop, NULL, "geometry.offsets", NULL);
RNA_def_property_struct_type(prop, "IntAttributeValue");
RNA_def_property_collection_funcs(prop,
- "rna_Hair_curve_offset_data_begin",
+ "rna_Curves_curve_offset_data_begin",
"rna_iterator_array_next",
"rna_iterator_array_end",
"rna_iterator_array_get",
- "rna_Hair_curve_offset_data_length",
+ "rna_Curves_curve_offset_data_length",
NULL,
NULL,
NULL);
- RNA_def_property_update(prop, 0, "rna_Hair_update_data");
+ RNA_def_property_update(prop, 0, "rna_Curves_update_data");
/* materials */
prop = RNA_def_property(srna, "materials", PROP_COLLECTION, PROP_NONE);
@@ -286,11 +286,11 @@ static void rna_def_hair(BlenderRNA *brna)
rna_def_animdata_common(srna);
}
-void RNA_def_hair(BlenderRNA *brna)
+void RNA_def_curves(BlenderRNA *brna)
{
- rna_def_hair_point(brna);
- rna_def_hair_curve(brna);
- rna_def_hair(brna);
+ rna_def_curves_point(brna);
+ rna_def_curves_curve(brna);
+ rna_def_curves(brna);
}
#endif
diff --git a/source/blender/makesrna/intern/rna_internal.h b/source/blender/makesrna/intern/rna_internal.h
index 0e0391197ea..407f474ddab 100644
--- a/source/blender/makesrna/intern/rna_internal.h
+++ b/source/blender/makesrna/intern/rna_internal.h
@@ -170,7 +170,7 @@ void RNA_def_fcurve(struct BlenderRNA *brna);
void RNA_def_gpencil(struct BlenderRNA *brna);
void RNA_def_greasepencil_modifier(struct BlenderRNA *brna);
void RNA_def_shader_fx(struct BlenderRNA *brna);
-void RNA_def_hair(struct BlenderRNA *brna);
+void RNA_def_curves(struct BlenderRNA *brna);
void RNA_def_image(struct BlenderRNA *brna);
void RNA_def_key(struct BlenderRNA *brna);
void RNA_def_light(struct BlenderRNA *brna);
@@ -496,8 +496,8 @@ 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_HAIR_NODES
-void RNA_def_main_hairs(BlenderRNA *brna, PropertyRNA *cprop);
+#ifdef WITH_NEW_CURVES_TYPE
+void RNA_def_main_hair_curves(BlenderRNA *brna, PropertyRNA *cprop);
#endif
void RNA_def_main_pointclouds(BlenderRNA *brna, PropertyRNA *cprop);
void RNA_def_main_volumes(BlenderRNA *brna, PropertyRNA *cprop);
diff --git a/source/blender/makesrna/intern/rna_main.c b/source/blender/makesrna/intern/rna_main.c
index 57a2a867d0a..230c04bfd9c 100644
--- a/source/blender/makesrna/intern/rna_main.c
+++ b/source/blender/makesrna/intern/rna_main.c
@@ -110,8 +110,8 @@ 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)
+# ifdef WITH_NEW_CURVES_TYPE
+RNA_MAIN_LISTBASE_FUNCS_DEF(hair_curves)
# endif
RNA_MAIN_LISTBASE_FUNCS_DEF(images)
RNA_MAIN_LISTBASE_FUNCS_DEF(lattices)
@@ -389,8 +389,17 @@ void RNA_def_main(BlenderRNA *brna)
"Light Probes",
"Light Probe data-blocks",
RNA_def_main_lightprobes},
-# ifdef WITH_HAIR_NODES
- {"hairs", "Hair", "rna_Main_hairs_begin", "Hairs", "Hair data-blocks", RNA_def_main_hairs},
+# ifdef WITH_NEW_CURVES_TYPE
+ /**
+ * \note The name `hair_curves` is chosen to be different than `curves`,
+ * but they are generic curve data-blocks, not just for hair.
+ */
+ {"hair_curves",
+ "Curves",
+ "rna_Main_hair_curves_begin",
+ "Hair Curves",
+ "Hair curve data-blocks",
+ RNA_def_main_hair_curves},
# endif
{"pointclouds",
"PointCloud",
diff --git a/source/blender/makesrna/intern/rna_main_api.c b/source/blender/makesrna/intern/rna_main_api.c
index 4344ed0dff5..f8d2d6524c2 100644
--- a/source/blender/makesrna/intern/rna_main_api.c
+++ b/source/blender/makesrna/intern/rna_main_api.c
@@ -46,9 +46,9 @@
# include "BKE_camera.h"
# include "BKE_collection.h"
# include "BKE_curve.h"
+# include "BKE_curves.h"
# include "BKE_displist.h"
# include "BKE_gpencil.h"
-# include "BKE_hair.h"
# include "BKE_icons.h"
# include "BKE_idtype.h"
# include "BKE_image.h"
@@ -86,8 +86,8 @@
# include "DNA_camera_types.h"
# include "DNA_collection_types.h"
# include "DNA_curve_types.h"
+# include "DNA_curves_types.h"
# include "DNA_gpencil_types.h"
-# include "DNA_hair_types.h"
# include "DNA_lattice_types.h"
# include "DNA_light_types.h"
# include "DNA_lightprobe_types.h"
@@ -763,18 +763,18 @@ 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)
+# ifdef WITH_NEW_CURVES_TYPE
+static Curves *rna_Main_hair_curves_new(Main *bmain, const char *name)
{
char safe_name[MAX_ID_NAME - 2];
rna_idname_validate(name, safe_name);
- Hair *hair = BKE_hair_add(bmain, safe_name);
- id_us_min(&hair->id);
+ Curves *curves = BKE_curves_add(bmain, safe_name);
+ id_us_min(&curves->id);
WM_main_add_notifier(NC_ID | NA_ADDED, NULL);
- return hair;
+ return curves;
}
# endif
@@ -861,8 +861,8 @@ 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)
+# ifdef WITH_NEW_CURVES_TYPE
+RNA_MAIN_ID_TAG_FUNCS_DEF(hair_curves, hair_curves, ID_CV)
# endif
RNA_MAIN_ID_TAG_FUNCS_DEF(pointclouds, pointclouds, ID_PT)
RNA_MAIN_ID_TAG_FUNCS_DEF(volumes, volumes, ID_VO)
@@ -2269,47 +2269,47 @@ 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)
+# ifdef WITH_NEW_CURVES_TYPE
+void RNA_def_main_hair_curves(BlenderRNA *brna, PropertyRNA *cprop)
{
StructRNA *srna;
FunctionRNA *func;
PropertyRNA *parm;
- RNA_def_property_srna(cprop, "BlendDataHairs");
- srna = RNA_def_struct(brna, "BlendDataHairs", NULL);
+ RNA_def_property_srna(cprop, "BlendDataHairCurves");
+ srna = RNA_def_struct(brna, "BlendDataHairCurves", NULL);
RNA_def_struct_sdna(srna, "Main");
- RNA_def_struct_ui_text(srna, "Main Hairs", "Collection of hairs");
+ RNA_def_struct_ui_text(srna, "Main Hair Curves", "Collection of hair curves");
- func = RNA_def_function(srna, "new", "rna_Main_hairs_new");
+ func = RNA_def_function(srna, "new", "rna_Main_hair_curves_new");
RNA_def_function_ui_description(func, "Add a new hair to the main database");
- parm = RNA_def_string(func, "name", "Hair", 0, "", "New name for the data-block");
+ parm = RNA_def_string(func, "name", "Curves", 0, "", "New name for the data-block");
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
/* return type */
- parm = RNA_def_pointer(func, "hair", "Hair", "", "New hair data-block");
+ parm = RNA_def_pointer(func, "curves", "Curves", "", "New curves 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 hair from the current blendfile");
- parm = RNA_def_pointer(func, "hair", "Hair", "", "Hair to remove");
+ RNA_def_function_ui_description(func, "Remove a curves data-block from the current blendfile");
+ parm = RNA_def_pointer(func, "curves", "Curves", "", "Curves data-block to remove");
RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED | PARM_RNAPTR);
RNA_def_parameter_clear_flags(parm, PROP_THICK_WRAP, 0);
RNA_def_boolean(func,
"do_unlink",
true,
"",
- "Unlink all usages of this hair before deleting it "
- "(WARNING: will also delete objects instancing that hair data)");
+ "Unlink all usages of this curves before deleting it "
+ "(WARNING: will also delete objects instancing that curves data)");
RNA_def_boolean(func,
"do_id_user",
true,
"",
- "Decrement user counter of all datablocks used by this hair data");
+ "Decrement user counter of all datablocks used by this curves data");
RNA_def_boolean(
- func, "do_ui_user", true, "", "Make sure interface does not reference this hair data");
+ func, "do_ui_user", true, "", "Make sure interface does not reference this curves data");
- func = RNA_def_function(srna, "tag", "rna_Main_hairs_tag");
+ func = RNA_def_function(srna, "tag", "rna_Main_hair_curves_tag");
parm = RNA_def_boolean(func, "value", 0, "Value", "");
RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
}
diff --git a/source/blender/makesrna/intern/rna_material.c b/source/blender/makesrna/intern/rna_material.c
index 22a75c0d992..67943b290da 100644
--- a/source/blender/makesrna/intern/rna_material.c
+++ b/source/blender/makesrna/intern/rna_material.c
@@ -718,7 +718,7 @@ void RNA_def_material(BlenderRNA *brna)
{MA_FLAT, "FLAT", ICON_MATPLANE, "Flat", "Flat XY plane"},
{MA_SPHERE, "SPHERE", ICON_MATSPHERE, "Sphere", "Sphere"},
{MA_CUBE, "CUBE", ICON_MATCUBE, "Cube", "Cube"},
- {MA_HAIR, "HAIR", ICON_HAIR, "Hair", "Hair strands"},
+ {MA_HAIR, "HAIR", ICON_CURVES, "Hair", "Hair strands"},
{MA_SHADERBALL, "SHADERBALL", ICON_MATSHADERBALL, "Shader Ball", "Shader ball"},
{MA_CLOTH, "CLOTH", ICON_MATCLOTH, "Cloth", "Cloth"},
{MA_FLUID, "FLUID", ICON_MATFLUID, "Fluid", "Fluid"},
diff --git a/source/blender/makesrna/intern/rna_object.c b/source/blender/makesrna/intern/rna_object.c
index 2bb341e00fb..be37e574c9c 100644
--- a/source/blender/makesrna/intern/rna_object.c
+++ b/source/blender/makesrna/intern/rna_object.c
@@ -271,7 +271,7 @@ const EnumPropertyItem rna_enum_object_type_items[] = {
OBTYPE_CU_SURF,
{OB_MBALL, "META", ICON_OUTLINER_OB_META, "Metaball", ""},
OBTYPE_CU_FONT,
- {OB_HAIR, "HAIR", ICON_OUTLINER_OB_HAIR, "Hair", ""},
+ {OB_CURVES, "CURVES", ICON_OUTLINER_OB_CURVES, "Hair Curves", ""},
{OB_POINTCLOUD, "POINTCLOUD", ICON_OUTLINER_OB_POINTCLOUD, "Point Cloud", ""},
{OB_VOLUME, "VOLUME", ICON_OUTLINER_OB_VOLUME, "Volume", ""},
{OB_GPENCIL, "GPENCIL", ICON_OUTLINER_OB_GREASEPENCIL, "Grease Pencil", ""},
@@ -613,9 +613,9 @@ static StructRNA *rna_Object_data_typef(PointerRNA *ptr)
return &RNA_LightProbe;
case OB_GPENCIL:
return &RNA_GreasePencil;
- case OB_HAIR:
-# ifdef WITH_HAIR_NODES
- return &RNA_Hair;
+ case OB_CURVES:
+# ifdef WITH_NEW_CURVES_TYPE
+ return &RNA_Curves;
# else
return &RNA_ID;
# endif
diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c
index 9a3c40bf306..07521d39256 100644
--- a/source/blender/makesrna/intern/rna_space.c
+++ b/source/blender/makesrna/intern/rna_space.c
@@ -3277,7 +3277,7 @@ static struct IDFilterEnumPropertyItem rna_enum_space_file_id_filter_categories[
ICON_OUTLINER_COLLECTION,
"Objects & Collections",
"Show objects and collections"},
- {FILTER_ID_AR | FILTER_ID_CU | FILTER_ID_LT | FILTER_ID_MB | FILTER_ID_ME | FILTER_ID_HA |
+ {FILTER_ID_AR | FILTER_ID_CU | FILTER_ID_LT | FILTER_ID_MB | FILTER_ID_ME | FILTER_ID_CV |
FILTER_ID_PT | FILTER_ID_VO,
"category_geometry",
ICON_NODETREE,
@@ -5004,7 +5004,7 @@ 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"}},
- {"Hair", (1 << OB_HAIR), {"show_object_viewport_hair", "show_object_select_hair"}},
+ {"Hair", (1 << OB_CURVES), {"show_object_viewport_hair", "show_object_select_hair"}},
{"Point Cloud",
(1 << OB_POINTCLOUD),
{"show_object_viewport_pointcloud", "show_object_select_pointcloud"}},
diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c
index aef219c4236..53af3f5bed5 100644
--- a/source/blender/makesrna/intern/rna_userdef.c
+++ b/source/blender/makesrna/intern/rna_userdef.c
@@ -5293,7 +5293,7 @@ static void rna_def_userdef_edit(BlenderRNA *brna)
prop, "Duplicate GPencil", "Causes grease pencil data to be duplicated with the object");
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_boolean_sdna(prop, NULL, "dupflag", USER_DUP_CURVES);
RNA_def_property_ui_text(
prop, "Duplicate Hair", "Causes hair data to be duplicated with the object");
@@ -6399,9 +6399,9 @@ 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_hair_type", PROP_BOOLEAN, PROP_NONE);
- RNA_def_property_boolean_sdna(prop, NULL, "use_new_hair_type", 1);
- RNA_def_property_ui_text(prop, "New Hair Type", "Enable the new hair type in the ui");
+ 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_cycles_debug", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "use_cycles_debug", 1);