2023-08-16 00:20:26 +10:00
|
|
|
/* SPDX-FileCopyrightText: 2020 Blender Authors
|
2023-05-31 16:19:06 +02:00
|
|
|
*
|
|
|
|
|
* SPDX-License-Identifier: GPL-2.0-or-later */
|
2020-08-19 18:12:52 +02:00
|
|
|
|
|
|
|
|
/** \file
|
|
|
|
|
* \ingroup editors
|
|
|
|
|
*/
|
|
|
|
|
|
2021-01-04 13:10:22 +11:00
|
|
|
#pragma once
|
2020-08-19 18:12:52 +02:00
|
|
|
|
2023-12-20 13:25:08 -05:00
|
|
|
#include "BLI_generic_pointer.hh"
|
2023-08-05 02:57:52 +02:00
|
|
|
#include "BLI_string_ref.hh"
|
|
|
|
|
|
2022-05-31 15:46:09 -07:00
|
|
|
#include "DNA_customdata_types.h"
|
|
|
|
|
|
2023-09-25 17:48:21 -04:00
|
|
|
#include "BKE_screen.hh"
|
2023-06-29 13:57:54 +02:00
|
|
|
|
2022-05-31 15:46:09 -07:00
|
|
|
struct Mesh;
|
2022-11-10 14:28:46 -06:00
|
|
|
struct ReportList;
|
2023-10-17 12:35:40 +02:00
|
|
|
struct PointerRNA;
|
|
|
|
|
struct PropertyRNA;
|
2023-12-20 13:25:08 -05:00
|
|
|
namespace blender::bke {
|
|
|
|
|
enum class AttrDomain : int8_t;
|
|
|
|
|
}
|
2023-10-17 12:35:40 +02:00
|
|
|
|
|
|
|
|
namespace blender::ed::geometry {
|
|
|
|
|
|
|
|
|
|
/* -------------------------------------------------------------------- */
|
|
|
|
|
/** \name Attribute Value RNA Property Helpers
|
|
|
|
|
*
|
|
|
|
|
* Functions to make it easier to register RNA properties for the various attribute types and
|
|
|
|
|
* retrieve/set their values.
|
|
|
|
|
* \{ */
|
|
|
|
|
|
|
|
|
|
StringRefNull rna_property_name_for_type(eCustomDataType type);
|
|
|
|
|
PropertyRNA *rna_property_for_type(PointerRNA &ptr, const eCustomDataType type);
|
|
|
|
|
void register_rna_properties_for_attribute_types(StructRNA &srna);
|
|
|
|
|
GPointer rna_property_for_attribute_type_retrieve_value(PointerRNA &ptr,
|
|
|
|
|
const eCustomDataType type,
|
|
|
|
|
void *buffer);
|
|
|
|
|
void rna_property_for_attribute_type_set_value(PointerRNA &ptr, PropertyRNA &prop, GPointer value);
|
2024-03-27 13:13:57 -04:00
|
|
|
bool attribute_set_poll(bContext &C, const ID &object_data);
|
2023-10-17 12:35:40 +02:00
|
|
|
|
|
|
|
|
/** \} */
|
|
|
|
|
|
|
|
|
|
} // namespace blender::ed::geometry
|
|
|
|
|
|
2023-08-04 22:15:25 -04:00
|
|
|
void ED_operatortypes_geometry();
|
2022-11-10 14:28:46 -06:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Convert an attribute with the given name to a new type and domain.
|
|
|
|
|
* The attribute must already exist.
|
|
|
|
|
*
|
|
|
|
|
* \note Does not support meshes in edit mode.
|
|
|
|
|
*/
|
2023-08-04 22:15:25 -04:00
|
|
|
bool ED_geometry_attribute_convert(Mesh *mesh,
|
2022-11-10 14:28:46 -06:00
|
|
|
const char *name,
|
|
|
|
|
eCustomDataType dst_type,
|
2023-12-20 13:13:16 -05:00
|
|
|
blender::bke::AttrDomain dst_domain,
|
2022-11-10 14:28:46 -06:00
|
|
|
ReportList *reports);
|
2023-06-29 13:57:54 +02:00
|
|
|
|
|
|
|
|
namespace blender::ed::geometry {
|
|
|
|
|
|
|
|
|
|
MenuType node_group_operator_assets_menu();
|
2023-09-14 17:35:24 +02:00
|
|
|
MenuType node_group_operator_assets_menu_unassigned();
|
2023-06-29 13:57:54 +02:00
|
|
|
|
2023-09-14 17:43:33 +02:00
|
|
|
void clear_operator_asset_trees();
|
|
|
|
|
|
2023-06-29 13:57:54 +02:00
|
|
|
void ui_template_node_operator_asset_menu_items(uiLayout &layout,
|
2023-09-25 21:58:30 -04:00
|
|
|
const bContext &C,
|
2023-06-29 13:57:54 +02:00
|
|
|
StringRef catalog_path);
|
2023-09-25 21:58:30 -04:00
|
|
|
void ui_template_node_operator_asset_root_items(uiLayout &layout, const bContext &C);
|
2023-06-29 13:57:54 +02:00
|
|
|
|
|
|
|
|
} // namespace blender::ed::geometry
|