diff options
author | Hans Goudey <h.goudey@me.com> | 2022-02-07 20:55:54 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2022-02-07 20:56:48 +0300 |
commit | fe1816f67fbc6aaf383ec77847d668367335d093 (patch) | |
tree | b89fc16a38a498c8b8ca96f9c50ee1a765d167fe /source/blender/editors/animation/anim_channels_defines.c | |
parent | b8c764c5d1fa241a284b985936a96efe0ee23a0f (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/editors/animation/anim_channels_defines.c')
-rw-r--r-- | source/blender/editors/animation/anim_channels_defines.c | 38 |
1 files changed, 20 insertions, 18 deletions
diff --git a/source/blender/editors/animation/anim_channels_defines.c b/source/blender/editors/animation/anim_channels_defines.c index 5afb9334612..a697fd2fc96 100644 --- a/source/blender/editors/animation/anim_channels_defines.c +++ b/source/blender/editors/animation/anim_channels_defines.c @@ -35,8 +35,8 @@ #include "DNA_armature_types.h" #include "DNA_cachefile_types.h" #include "DNA_camera_types.h" +#include "DNA_curves_types.h" #include "DNA_gpencil_types.h" -#include "DNA_hair_types.h" #include "DNA_key_types.h" #include "DNA_lattice_types.h" #include "DNA_light_types.h" @@ -700,8 +700,8 @@ static int acf_object_icon(bAnimListElem *ale) return ICON_OUTLINER_OB_FONT; case OB_SURF: return ICON_OUTLINER_OB_SURFACE; - case OB_HAIR: - return ICON_OUTLINER_OB_HAIR; + case OB_CURVES: + return ICON_OUTLINER_OB_CURVES; case OB_POINTCLOUD: return ICON_OUTLINER_OB_POINTCLOUD; case OB_VOLUME: @@ -2813,15 +2813,15 @@ static bAnimChannelType ACF_DSSPK = { /* Hair Expander ------------------------------------------- */ /* TODO: just get this from RNA? */ -static int acf_dshair_icon(bAnimListElem *UNUSED(ale)) +static int acf_dscurves_icon(bAnimListElem *UNUSED(ale)) { - return ICON_HAIR_DATA; + return ICON_CURVES_DATA; } /* Get the appropriate flag(s) for the setting when it is valid. */ -static int acf_dshair_setting_flag(bAnimContext *UNUSED(ac), - eAnimChannel_Settings setting, - bool *neg) +static int acf_dscurves_setting_flag(bAnimContext *UNUSED(ac), + eAnimChannel_Settings setting, + bool *neg) { /* clear extra return data first */ *neg = false; @@ -2846,22 +2846,24 @@ static int acf_dshair_setting_flag(bAnimContext *UNUSED(ac), } /* get pointer to the setting */ -static void *acf_dshair_setting_ptr(bAnimListElem *ale, eAnimChannel_Settings setting, short *type) +static void *acf_dscurves_setting_ptr(bAnimListElem *ale, + eAnimChannel_Settings setting, + short *type) { - Hair *hair = (Hair *)ale->data; + Curves *curves = (Curves *)ale->data; /* clear extra return data first */ *type = 0; switch (setting) { case ACHANNEL_SETTING_EXPAND: /* expanded */ - return GET_ACF_FLAG_PTR(hair->flag, type); + return GET_ACF_FLAG_PTR(curves->flag, type); case ACHANNEL_SETTING_SELECT: /* selected */ case ACHANNEL_SETTING_MUTE: /* muted (for NLA only) */ case ACHANNEL_SETTING_VISIBLE: /* visible (for Graph Editor only) */ - if (hair->adt) { - return GET_ACF_FLAG_PTR(hair->adt->flag, type); + if (curves->adt) { + return GET_ACF_FLAG_PTR(curves->adt->flag, type); } return NULL; @@ -2870,9 +2872,9 @@ static void *acf_dshair_setting_ptr(bAnimListElem *ale, eAnimChannel_Settings se } } -/* hair expander type define */ +/* Curves expander type define */ static bAnimChannelType ACF_DSHAIR = { - "Hair Expander", /* type name */ + "Curves Expander", /* type name */ ACHANNEL_ROLE_EXPANDER, /* role */ acf_generic_dataexpand_color, /* backdrop color */ @@ -2882,11 +2884,11 @@ static bAnimChannelType ACF_DSHAIR = { acf_generic_idblock_name, /* name */ acf_generic_idblock_name_prop, /* name prop */ - acf_dshair_icon, /* icon */ + acf_dscurves_icon, /* icon */ acf_generic_dataexpand_setting_valid, /* has setting */ - acf_dshair_setting_flag, /* flag for setting */ - acf_dshair_setting_ptr /* pointer for setting */ + acf_dscurves_setting_flag, /* flag for setting */ + acf_dscurves_setting_ptr /* pointer for setting */ }; /* PointCloud Expander ------------------------------------------- */ |