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 /release/scripts/startup/bl_ui | |
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 'release/scripts/startup/bl_ui')
-rw-r--r-- | release/scripts/startup/bl_ui/__init__.py | 2 | ||||
-rw-r--r-- | release/scripts/startup/bl_ui/properties_data_curves.py (renamed from release/scripts/startup/bl_ui/properties_data_hair.py) | 48 | ||||
-rw-r--r-- | release/scripts/startup/bl_ui/space_dopesheet.py | 4 | ||||
-rw-r--r-- | release/scripts/startup/bl_ui/space_outliner.py | 2 | ||||
-rw-r--r-- | release/scripts/startup/bl_ui/space_userpref.py | 2 | ||||
-rw-r--r-- | release/scripts/startup/bl_ui/space_view3d.py | 4 |
6 files changed, 31 insertions, 31 deletions
diff --git a/release/scripts/startup/bl_ui/__init__.py b/release/scripts/startup/bl_ui/__init__.py index 1fb40ad8bc8..7c254596683 100644 --- a/release/scripts/startup/bl_ui/__init__.py +++ b/release/scripts/startup/bl_ui/__init__.py @@ -33,9 +33,9 @@ _modules = [ "properties_data_bone", "properties_data_camera", "properties_data_curve", + "properties_data_curves", "properties_data_empty", "properties_data_gpencil", - "properties_data_hair", "properties_data_light", "properties_data_lattice", "properties_data_mesh", diff --git a/release/scripts/startup/bl_ui/properties_data_hair.py b/release/scripts/startup/bl_ui/properties_data_curves.py index 7f95fad9a9e..0b4bf0283ed 100644 --- a/release/scripts/startup/bl_ui/properties_data_hair.py +++ b/release/scripts/startup/bl_ui/properties_data_curves.py @@ -30,10 +30,10 @@ class DataButtonsPanel: @classmethod def poll(cls, context): engine = context.scene.render.engine - return hasattr(context, 'hair') and context.hair and (engine in cls.COMPAT_ENGINES) + return hasattr(context, 'curves') and context.curves and (engine in cls.COMPAT_ENGINES) -class DATA_PT_context_hair(DataButtonsPanel, Panel): +class DATA_PT_context_curves(DataButtonsPanel, Panel): bl_label = "" bl_options = {'HIDE_HEADER'} COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH'} @@ -42,21 +42,21 @@ class DATA_PT_context_hair(DataButtonsPanel, Panel): layout = self.layout ob = context.object - hair = context.hair + curves = context.curves space = context.space_data if ob: layout.template_ID(ob, "data") - elif hair: + elif curves: layout.template_ID(space, "pin_id") -class HAIR_MT_add_attribute(Menu): +class CURVES_MT_add_attribute(Menu): bl_label = "Add Attribute" @staticmethod - def add_standard_attribute(layout, hair, name, data_type, domain): - exists = hair.attributes.get(name) is not None + def add_standard_attribute(layout, curves, name, data_type, domain): + exists = curves.attributes.get(name) is not None col = layout.column() col.enabled = not exists @@ -69,10 +69,10 @@ class HAIR_MT_add_attribute(Menu): def draw(self, context): layout = self.layout - hair = context.hair + curves = context.curves - self.add_standard_attribute(layout, hair, 'Radius', 'FLOAT', 'POINT') - self.add_standard_attribute(layout, hair, 'Color', 'FLOAT_COLOR', 'POINT') + self.add_standard_attribute(layout, curves, 'radius', 'FLOAT', 'POINT') + self.add_standard_attribute(layout, curves, 'color', 'FLOAT_COLOR', 'POINT') layout.separator() @@ -80,7 +80,7 @@ class HAIR_MT_add_attribute(Menu): layout.operator("geometry.attribute_add", text="Custom...") -class HAIR_UL_attributes(UIList): +class CURVES_UL_attributes(UIList): def draw_item(self, _context, layout, _data, attribute, _icon, _active_data, _active_propname, _index): data_type = attribute.bl_rna.properties['data_type'].enum_items[attribute.data_type] domain = attribute.bl_rna.properties['domain'].enum_items[attribute.domain] @@ -96,44 +96,44 @@ class HAIR_UL_attributes(UIList): sub.label(text=data_type.name) -class DATA_PT_hair_attributes(DataButtonsPanel, Panel): +class DATA_PT_CURVES_attributes(DataButtonsPanel, Panel): bl_label = "Attributes" COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH'} def draw(self, context): - hair = context.hair + curves = context.curves layout = self.layout row = layout.row() col = row.column() col.template_list( - "HAIR_UL_attributes", + "CURVES_UL_attributes", "attributes", - hair, + curves, "attributes", - hair.attributes, + curves.attributes, "active_index", rows=3, ) col = row.column(align=True) - col.menu("HAIR_MT_add_attribute", icon='ADD', text="") + col.menu("CURVES_MT_add_attribute", icon='ADD', text="") col.operator("geometry.attribute_remove", icon='REMOVE', text="") -class DATA_PT_custom_props_hair(DataButtonsPanel, PropertyPanel, Panel): +class DATA_PT_custom_props_curves(DataButtonsPanel, PropertyPanel, Panel): COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH'} _context_path = "object.data" - _property_type = bpy.types.Hair if hasattr(bpy.types, "Hair") else None + _property_type = bpy.types.Curves if hasattr(bpy.types, "Curves") else None classes = ( - DATA_PT_context_hair, - DATA_PT_hair_attributes, - DATA_PT_custom_props_hair, - HAIR_MT_add_attribute, - HAIR_UL_attributes, + DATA_PT_context_curves, + DATA_PT_CURVES_attributes, + DATA_PT_custom_props_curves, + CURVES_MT_add_attribute, + CURVES_UL_attributes, ) if __name__ == "__main__": # only for live edit. diff --git a/release/scripts/startup/bl_ui/space_dopesheet.py b/release/scripts/startup/bl_ui/space_dopesheet.py index 18dfa4da6c6..99edbe647e2 100644 --- a/release/scripts/startup/bl_ui/space_dopesheet.py +++ b/release/scripts/startup/bl_ui/space_dopesheet.py @@ -127,8 +127,8 @@ class DopesheetFilterPopoverBase: flow.prop(dopesheet, "show_lattices", text="Lattices") if bpy.data.metaballs: flow.prop(dopesheet, "show_metaballs", text="Metaballs") - if hasattr(bpy.data, "hairs") and bpy.data.hairs: - flow.prop(dopesheet, "show_hairs", text="Hairs") + if hasattr(bpy.data, "hair_curves") and bpy.data.hair_curves: + flow.prop(dopesheet, "show_hair_curves", text="Hair Curves") if hasattr(bpy.data, "pointclouds") and bpy.data.pointclouds: flow.prop(dopesheet, "show_pointclouds", text="Point Clouds") if bpy.data.volumes: diff --git a/release/scripts/startup/bl_ui/space_outliner.py b/release/scripts/startup/bl_ui/space_outliner.py index d85538a37e0..6cc80c088e0 100644 --- a/release/scripts/startup/bl_ui/space_outliner.py +++ b/release/scripts/startup/bl_ui/space_outliner.py @@ -448,7 +448,7 @@ class OUTLINER_PT_filter(Panel): if ( bpy.data.curves or bpy.data.metaballs or - (hasattr(bpy.data, "hairs") and bpy.data.hairs) or + (hasattr(bpy.data, "hair_curves") and bpy.data.hair_curves) or (hasattr(bpy.data, "pointclouds") and bpy.data.pointclouds) or bpy.data.volumes or bpy.data.lightprobes or diff --git a/release/scripts/startup/bl_ui/space_userpref.py b/release/scripts/startup/bl_ui/space_userpref.py index 78ef68e0bab..26b4229690f 100644 --- a/release/scripts/startup/bl_ui/space_userpref.py +++ b/release/scripts/startup/bl_ui/space_userpref.py @@ -2295,7 +2295,7 @@ class USERPREF_PT_experimental_prototypes(ExperimentalPanel, Panel): def draw(self, context): self._draw_items( context, ( - ({"property": "use_new_hair_type"}, "T68981"), + ({"property": "use_new_curves_type"}, "T68981"), ({"property": "use_new_point_cloud_type"}, "T75717"), ({"property": "use_full_frame_compositor"}, "T88150"), ), diff --git a/release/scripts/startup/bl_ui/space_view3d.py b/release/scripts/startup/bl_ui/space_view3d.py index 03f5d7abe02..ea7a1885369 100644 --- a/release/scripts/startup/bl_ui/space_view3d.py +++ b/release/scripts/startup/bl_ui/space_view3d.py @@ -2148,8 +2148,8 @@ 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 context.preferences.experimental.use_new_hair_type: - layout.operator("object.hair_add", text="Hair", icon='OUTLINER_OB_HAIR') + if context.preferences.experimental.use_new_curves_type: + layout.operator("object.hair_curves_add", text="Hair Curves", icon='OUTLINER_OB_CURVES') if context.preferences.experimental.use_new_point_cloud_type: layout.operator("object.pointcloud_add", text="Point Cloud", icon='OUTLINER_OB_POINTCLOUD') layout.menu("VIEW3D_MT_volume_add", text="Volume", icon='OUTLINER_OB_VOLUME') |