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
87 lines
3.0 KiB
C
87 lines
3.0 KiB
C
/*
|
|
* This program is free software; you can redistribute it and/or
|
|
* modify it under the terms of the GNU General Public License
|
|
* as published by the Free Software Foundation; either version 2
|
|
* of the License, or (at your option) any later version.
|
|
*
|
|
* This program is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
* GNU General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU General Public License
|
|
* along with this program; if not, write to the Free Software Foundation,
|
|
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
*
|
|
* The Original Code is Copyright (C) 2006 Blender Foundation.
|
|
* All rights reserved.
|
|
*/
|
|
|
|
/** \file
|
|
* \ingroup bke
|
|
* \brief Generic geometry attributes built on CustomData.
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include "BLI_sys_types.h"
|
|
|
|
#include "BKE_customdata.h"
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
struct CustomData;
|
|
struct CustomDataLayer;
|
|
struct ID;
|
|
struct ReportList;
|
|
|
|
/* Attribute.domain */
|
|
typedef enum AttributeDomain {
|
|
ATTR_DOMAIN_AUTO = -1, /* Use for nodes to choose automatically based on other data. */
|
|
ATTR_DOMAIN_POINT = 0, /* Mesh, Curve or Point Cloud Point */
|
|
ATTR_DOMAIN_EDGE = 1, /* Mesh Edge */
|
|
ATTR_DOMAIN_FACE = 2, /* Mesh Face */
|
|
ATTR_DOMAIN_CORNER = 3, /* Mesh Corner */
|
|
ATTR_DOMAIN_CURVE = 4, /* A single curve in a larger curve data-block */
|
|
ATTR_DOMAIN_INSTANCE = 5, /* Instance */
|
|
|
|
ATTR_DOMAIN_NUM
|
|
} AttributeDomain;
|
|
|
|
/* Attributes */
|
|
|
|
bool BKE_id_attributes_supported(struct ID *id);
|
|
|
|
struct CustomDataLayer *BKE_id_attribute_new(
|
|
struct ID *id, const char *name, int type, AttributeDomain domain, struct ReportList *reports);
|
|
bool BKE_id_attribute_remove(struct ID *id,
|
|
struct CustomDataLayer *layer,
|
|
struct ReportList *reports);
|
|
|
|
struct CustomDataLayer *BKE_id_attribute_find(const struct ID *id,
|
|
const char *name,
|
|
int type,
|
|
AttributeDomain domain);
|
|
|
|
AttributeDomain BKE_id_attribute_domain(struct ID *id, struct CustomDataLayer *layer);
|
|
int BKE_id_attribute_data_length(struct ID *id, struct CustomDataLayer *layer);
|
|
bool BKE_id_attribute_required(struct ID *id, struct CustomDataLayer *layer);
|
|
bool BKE_id_attribute_rename(struct ID *id,
|
|
struct CustomDataLayer *layer,
|
|
const char *new_name,
|
|
struct ReportList *reports);
|
|
|
|
int BKE_id_attributes_length(struct ID *id, CustomDataMask mask);
|
|
|
|
struct CustomDataLayer *BKE_id_attributes_active_get(struct ID *id);
|
|
void BKE_id_attributes_active_set(struct ID *id, struct CustomDataLayer *layer);
|
|
int *BKE_id_attributes_active_index_p(struct ID *id);
|
|
|
|
CustomData *BKE_id_attributes_iterator_next_domain(struct ID *id, struct CustomDataLayer *layers);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|