32#include "RNA_prototypes.hh"
38#include <fmt/format.h>
51 constexpr size_t name_maxncpy = 256;
54 if (name ==
nullptr) {
87 const char *structname =
nullptr, *propname =
nullptr;
89 const char *arrayname =
nullptr;
90 bool free_structname =
false;
114 char pchanName[name_maxncpy], constName[name_maxncpy];
118 structname =
BLI_sprintfN(
"%s : %s", pchanName, constName);
119 free_structname =
true;
125 free_structname =
true;
136 char stripname[name_maxncpy];
138 rna_path.c_str(),
"sequence_editor.strips_all[", stripname,
sizeof(stripname)))
140 if (strstr(
rna_path.c_str(),
".transform.") || strstr(
rna_path.c_str(),
".crop.") ||
141 strstr(
rna_path.c_str(),
".modifiers["))
143 const char *structname_all =
BLI_sprintfN(
"%s : %s", stripname, structname);
144 if (free_structname) {
145 MEM_delete(structname);
147 structname = structname_all;
148 free_structname =
true;
159 if (free_structname) {
160 MEM_delete(structname);
162 structname =
node.label_or_name().c_str();
163 free_structname =
false;
169 if (free_structname) {
170 MEM_delete(structname);
172 structname =
node->label_or_name().c_str();
173 free_structname =
false;
186 propname = input->name().c_str();
193 propname = socket->
name;
208 arrayname = &arrayindbuf[0];
219 BLI_snprintf_utf8(name, name_maxncpy,
"%s%s (%s)", arrayname, propname, structname);
226 if (free_structname) {
227 MEM_delete(structname);
237 constexpr size_t name_maxncpy = 256;
238 char name_buffer[name_maxncpy];
239 name_buffer[0] =
'\0';
242 for (
ID *user : slot.
users(bmain)) {
244 if (icon.has_value()) {
250 if (!slot.
users(bmain).is_empty()) {
254 return fmt::format(
"\"{}[{}]\"", fcurve.rna_path().c_str(), fcurve.
array_index);
266 return fmt::format(
"\"{}[{}]\"", fcurve.rna_path().c_str(), fcurve.
array_index);
271 return fmt::format(
"\"{}[{}]\"", fcurve.rna_path().c_str(), fcurve.
array_index);
277 return fmt::format(
"\"{}[{}]\"", fcurve.rna_path().c_str(), fcurve.
array_index);
283 return fmt::format(
"\"{}[{}]\"", fcurve.rna_path().c_str(), fcurve.
array_index);
294 std::string arrayname;
297 arrayname = std::string(1, c);
300 arrayname = fmt::format(
"[{}]", fcurve.
array_index);
302 return arrayname +
" " + propname;
308#define HSV_BANDWIDTH 0.3f
323 grouping = (4 - (tot % 2));
336 hsv[0] =
fmod(hsv[0], 1.0f);
340 hsv[1] = ((hsv[0] > 0.5f) && (hsv[0] < 0.8f)) ? 0.5f : 0.6f;
Functions and classes to work with Actions.
#define SNPRINTF_UTF8(dst, format,...)
Read Blender memory allocation and freeing.
#define BLI_assert_unreachable()
Span< ID * > users(Main &bmain) const
static constexpr int64_t not_found
ccl_device_inline float2 fmod(const float2 a, const float b)
const bNodeTreeInterfaceSocket * node_find_interface_input_by_identifier(const bNodeTree &ntree, StringRef identifier)
bNode & node_find_node(bNodeTree &ntree, bNodeSocket &socket)
char * RNA_property_string_get_alloc(PointerRNA *ptr, PropertyRNA *prop, char *fixedbuf, int fixedlen, int *r_len)
BLI_assert(slot->slot_subtype.map==BMO_OP_SLOT_SUBTYPE_MAP_FLT)
size_t size_t size_t BLI_snprintf_utf8(char *__restrict dst, size_t dst_maxncpy, const char *__restrict format,...) ATTR_NONNULL(1
bool RNA_struct_is_a(const StructRNA *type, const StructRNA *srna)
bool bool BLI_str_quoted_substr(const char *__restrict str, const char *__restrict prefix, char *result, size_t result_maxncpy)
PointerRNA RNA_id_pointer_create(ID *id)
StructRNA * ID_code_to_RNA_type(short idcode)
char * BLI_strncpy_utf8(char *__restrict dst, const char *__restrict src, size_t dst_maxncpy) ATTR_NONNULL(1
char * BLI_sprintfN(const char *__restrict format,...) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1) ATTR_MALLOC ATTR_PRINTF_FORMAT(1
const char * RNA_struct_ui_name(const StructRNA *type)
bool RNA_property_array_check(PropertyRNA *prop)
void hsv_to_rgb_v(const float hsv[3], float r_rgb[3])
char RNA_property_array_item_char(PropertyRNA *prop, int index)
PropertyRNA * RNA_struct_type_find_property(StructRNA *srna, const char *identifier)
PropertyRNA * RNA_struct_name_property(const StructRNA *type)
int RNA_struct_ui_icon(const StructRNA *type)
std::optional< int > getname_anim_fcurve(char *name, ID *id, FCurve *fcu)
ID_Type GS(const char *name)
void getcolor_fcurve_rainbow(int cur, int tot, float out[3])
std::string getname_anim_fcurve_for_slot(Main &bmain, const animrig::Slot &slot, FCurve &fcurve)
bool RNA_path_resolve_property(const PointerRNA *ptr, const char *path, PointerRNA *r_ptr, PropertyRNA **r_prop)
const char * RNA_property_ui_name(const PropertyRNA *prop, const PointerRNA *ptr)
KERNEL_FEATURE_LIGHT_PASSES KERNEL_FEATURE_PATH_GUIDING float
struct bNodeTree * node_group