Blender V5.3
RNA_access.hh
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2023 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
5/* Use a define instead of `#pragma once` because of `rna_internal.hh` */
6#ifndef __RNA_ACCESS_H__
7#define __RNA_ACCESS_H__
8
12
13#include <optional>
14#include <stdarg.h>
15#include <string>
16
17#include "DNA_listBase.h"
18
19#include "RNA_types.hh"
20
21#include "BLI_compiler_attrs.hh"
22#include "BLI_enum_flags.hh"
23#include "BLI_function_ref.hh"
24#include "BLI_string_ref.hh"
25#include "BLI_ustring.hh"
26
27namespace blender {
28
29struct ID;
33struct IDProperty;
34struct Main;
35struct ReportList;
36struct Scene;
37struct bContext;
38
39enum eID_OverrideLib_Op : short;
40
55
56/* Types */
57BlenderRNA &RNA_blender_rna_get();
58
59/* Pointer
60 *
61 * These functions will fill in RNA pointers, this can be done in three ways:
62 * - a pointer Main is created by just passing the data pointer
63 * - a pointer to a datablock can be created with the type and id data pointer
64 * - a pointer to data contained in a datablock can be created with the id type
65 * and id data pointer, and the data type and pointer to the struct itself.
66 *
67 * There is also a way to get a pointer with the information about all structs.
68 */
69
70PointerRNA RNA_main_pointer_create(Main *main);
77PointerRNA RNA_id_pointer_create(ID *id);
85PointerRNA RNA_pointer_create_discrete(ID *id, StructRNA *type, void *data);
92PointerRNA RNA_pointer_create_with_parent(const PointerRNA &parent, StructRNA *type, void *data);
102PointerRNA RNA_pointer_create_id_subdata(ID &id, StructRNA *type, void *data);
103
112PointerRNA RNA_pointer_create_from_ancestor(const PointerRNA &ptr, const int ancestor_idx);
113
114bool RNA_path_resolved_create(PointerRNA *ptr,
115 PropertyRNA *prop,
116 int prop_index,
117 PathResolvedRNA *r_anim_rna);
118
120PointerRNA RNA_pointer_recast(PointerRNA *ptr);
121
122/* Structs */
123
124StructRNA *RNA_struct_find(const char *identifier);
125
126const char *RNA_struct_identifier(const StructRNA *type);
127const char *RNA_struct_ui_name(const StructRNA *type);
128const char *RNA_struct_ui_name_raw(const StructRNA *type);
129const char *RNA_struct_ui_description(const StructRNA *type);
130const char *RNA_struct_ui_description_raw(const StructRNA *type);
131const char *RNA_struct_translation_context(const StructRNA *type);
132int RNA_struct_ui_icon(const StructRNA *type);
133
137std::string RNA_struct_to_string(const StructRNA &type);
138
139PropertyRNA *RNA_struct_name_property(const StructRNA *type);
140const EnumPropertyItem *RNA_struct_property_tag_defines(const StructRNA *type);
141PropertyRNA *RNA_struct_iterator_property(StructRNA *type);
142StructRNA *RNA_struct_base(StructRNA *type);
148const StructRNA *RNA_struct_base_child_of(const StructRNA *type, const StructRNA *parent_type);
149
150bool RNA_struct_is_ID(const StructRNA *type);
151bool RNA_struct_is_a(const StructRNA *type, const StructRNA *srna);
152
155void **RNA_struct_instance(PointerRNA *ptr);
156
157void *RNA_struct_py_type_get(StructRNA *srna);
158void RNA_struct_py_type_set(StructRNA *srna, void *py_type);
159
160void *RNA_struct_blender_type_get(StructRNA *srna);
161void RNA_struct_blender_type_set(StructRNA *srna, void *blender_type);
162
163IDProperty **RNA_struct_idprops_p(PointerRNA *ptr);
164IDProperty *RNA_struct_idprops(PointerRNA *ptr, bool create);
165bool RNA_struct_idprops_check(const StructRNA *srna);
166bool RNA_struct_system_idprops_register_check(const StructRNA *type);
167bool RNA_struct_idprops_datablock_allowed(const StructRNA *type);
168
170IDProperty **RNA_struct_system_idprops_p(PointerRNA *ptr);
171IDProperty *RNA_struct_system_idprops(PointerRNA *ptr, bool create);
173bool RNA_struct_system_idprops_check(StructRNA *srna);
183bool RNA_struct_idprops_contains_datablock(const StructRNA *type);
187bool RNA_struct_system_idprops_unset(PointerRNA *ptr, const char *identifier);
188
193bool RNA_struct_in_public_namespace(const StructRNA *type);
194
195PropertyRNA *RNA_struct_find_property(PointerRNA *ptr, const char *identifier);
196
206PropertyRNA *RNA_struct_find_property(PointerRNA *ptr, UString identifier);
207
212PropertyRNA *RNA_struct_find_property_check(PointerRNA &props,
213 const char *name,
214 const PropertyType property_type_check);
219PropertyRNA *RNA_struct_find_collection_property_check(PointerRNA &props,
220 const char *name,
221 const StructRNA *struct_type_check);
222
223bool RNA_struct_contains_property(PointerRNA *ptr, PropertyRNA *prop_test);
224unsigned int RNA_struct_count_properties(StructRNA *srna);
225
239std::optional<AncestorPointerRNA> RNA_struct_search_closest_ancestor_by_type(
240 const PointerRNA *ptr, const StructRNA *srna);
241
246const ListBaseT<PropertyRNA> *RNA_struct_type_properties(StructRNA *srna);
247PropertyRNA *RNA_struct_type_find_property_no_base(StructRNA *srna, UString identifier);
252PropertyRNA *RNA_struct_type_find_property(StructRNA *srna, const char *identifier);
253
254FunctionRNA *RNA_struct_find_function(StructRNA *srna, const char *identifier);
256
257[[nodiscard]] char *RNA_struct_name_get_alloc_ex(
258 PointerRNA *ptr, char *fixedbuf, int fixedlen, int *r_len, PropertyRNA **r_nameprop);
259[[nodiscard]] char *RNA_struct_name_get_alloc(PointerRNA *ptr,
260 char *fixedbuf,
261 int fixedlen,
262 int *r_len);
263
267bool RNA_struct_available_or_report(ReportList *reports, const char *identifier);
268bool RNA_struct_bl_idname_ok_or_report(ReportList *reports,
269 const char *identifier,
270 const char *sep);
271
272/* Properties
273 *
274 * Access to struct properties. All this works with RNA pointers rather than
275 * direct pointers to the data. */
276
277/* Property Information */
278
279const char *RNA_property_identifier(const PropertyRNA *prop);
280const char *RNA_property_description(PropertyRNA *prop);
281
282const DeprecatedRNA *RNA_property_deprecated(const PropertyRNA *prop);
283
284PropertyType RNA_property_type(PropertyRNA *prop);
285PropertySubType RNA_property_subtype(PropertyRNA *prop);
286PropertyUnit RNA_property_unit(PropertyRNA *prop);
288int RNA_property_flag(PropertyRNA *prop);
289int RNA_property_override_flag(PropertyRNA *prop);
296int RNA_property_tags(PropertyRNA *prop);
298bool RNA_property_builtin(PropertyRNA *prop);
299void *RNA_property_py_data_get(PropertyRNA *prop);
300
301int RNA_property_array_length(PointerRNA *ptr, PropertyRNA *prop);
302bool RNA_property_array_check(PropertyRNA *prop);
306int RNA_property_multi_array_length(PointerRNA *ptr, PropertyRNA *prop, int dimension);
310int RNA_property_array_dimension(const PointerRNA *ptr, PropertyRNA *prop, int length[]);
311char RNA_property_array_item_char(PropertyRNA *prop, int index);
312int RNA_property_array_item_index(PropertyRNA *prop, char name);
313
317int RNA_property_string_maxlength(PropertyRNA *prop);
318
322bool RNA_property_string_is_utf8(PropertyRNA *prop);
323
324const char *RNA_property_ui_name(const PropertyRNA *prop, const PointerRNA *ptr = nullptr);
325const char *RNA_property_ui_name_raw(const PropertyRNA *prop, const PointerRNA *ptr = nullptr);
326const char *RNA_property_ui_description(const PropertyRNA *prop, const PointerRNA *ptr = nullptr);
327const char *RNA_property_ui_description_raw(const PropertyRNA *prop,
328 const PointerRNA *ptr = nullptr);
329const char *RNA_property_translation_context(const PropertyRNA *prop);
330int RNA_property_ui_icon(const PropertyRNA *prop);
331
332bool RNA_property_undo_check(const PropertyRNA *prop, const StructRNA *type);
333
334/* Dynamic Property Information */
335
336void RNA_property_int_range(PointerRNA *ptr, PropertyRNA *prop, int *hardmin, int *hardmax);
338 PointerRNA *ptr, PropertyRNA *prop, int *softmin, int *softmax, int *step);
339
340void RNA_property_float_range(PointerRNA *ptr, PropertyRNA *prop, float *hardmin, float *hardmax);
341void RNA_property_float_ui_range(PointerRNA *ptr,
342 PropertyRNA *prop,
343 float *softmin,
344 float *softmax,
345 float *step,
346 float *precision);
347
348int RNA_property_float_clamp(PointerRNA *ptr, PropertyRNA *prop, float *value);
349int RNA_property_int_clamp(PointerRNA *ptr, PropertyRNA *prop, int *value);
350
351bool RNA_enum_identifier(const EnumPropertyItem *item, int value, const char **r_identifier);
352int RNA_enum_bitflag_identifiers(const EnumPropertyItem *item,
353 int value,
354 const char **r_identifier);
355bool RNA_enum_name(const EnumPropertyItem *item, int value, const char **r_name);
356bool RNA_enum_name_gettexted(const EnumPropertyItem *item,
357 int value,
358 const char *translation_context,
359 const char **r_name);
360bool RNA_enum_description(const EnumPropertyItem *item, int value, const char **r_description);
361int RNA_enum_from_value(const EnumPropertyItem *item, int value);
362int RNA_enum_from_identifier(const EnumPropertyItem *item, const char *identifier);
363bool RNA_enum_value_from_identifier(const EnumPropertyItem *item,
364 const char *identifier,
365 int *r_value);
370int RNA_enum_from_name(const EnumPropertyItem *item, const char *name);
371unsigned int RNA_enum_items_count(const EnumPropertyItem *item);
372
373void RNA_property_enum_items_ex(bContext *C,
374 PointerRNA *ptr,
375 PropertyRNA *prop,
376 bool use_static,
377 const EnumPropertyItem **r_item,
378 int *r_totitem,
379 bool *r_free);
380void RNA_property_enum_items(bContext *C,
381 PointerRNA *ptr,
382 PropertyRNA *prop,
383 const EnumPropertyItem **r_item,
384 int *r_totitem,
385 bool *r_free);
387 PointerRNA *ptr,
388 PropertyRNA *prop,
389 const EnumPropertyItem **r_item,
390 int *r_totitem,
391 bool *r_free);
393 PointerRNA *ptr,
394 PropertyRNA *prop,
395 const EnumPropertyItem **r_item,
396 int *r_totitem,
397 bool *r_free);
399 bContext *C, PointerRNA *ptr, PropertyRNA *prop, const char *identifier, int *r_value);
401 bContext *C, PointerRNA *ptr, PropertyRNA *prop, int value, const char **r_identifier);
403 bContext *C, PointerRNA *ptr, PropertyRNA *prop, int value, const char **r_name);
405 bContext *C, PointerRNA *ptr, PropertyRNA *prop, int value, const char **r_name);
406
408 bContext *C, PointerRNA *ptr, PropertyRNA *prop, int value, EnumPropertyItem *r_item);
410 bContext *C, PointerRNA *ptr, PropertyRNA *prop, int value, EnumPropertyItem *r_item);
411
413 bContext *C, PointerRNA *ptr, PropertyRNA *prop, int value, const char **r_identifier);
414
415StructRNA *RNA_property_pointer_type(PointerRNA *ptr, PropertyRNA *prop);
416bool RNA_property_pointer_poll(PointerRNA *ptr, PropertyRNA *prop, PointerRNA *value);
417
421bool RNA_property_is_runtime(const PropertyRNA *prop);
422
423bool RNA_property_editable(const PointerRNA *ptr, PropertyRNA *prop);
428bool RNA_property_editable_info(const PointerRNA *ptr, PropertyRNA *prop, const char **r_info);
432bool RNA_property_editable_index(const PointerRNA *ptr, PropertyRNA *prop, const int index);
433
437bool RNA_property_editable_flag(const PointerRNA *ptr, PropertyRNA *prop);
438
447bool RNA_property_animateable(const PointerRNA *ptr, PropertyRNA *prop_orig);
457bool RNA_property_anim_editable(const PointerRNA *ptr, PropertyRNA *prop_orig);
458bool RNA_property_animated(PointerRNA *ptr, PropertyRNA *prop);
471bool RNA_property_driver_editable(const PointerRNA *ptr, PropertyRNA *prop);
476bool RNA_property_overridable_get(const PointerRNA *ptr, PropertyRNA *prop);
480bool RNA_property_overridable_library_set(PointerRNA *ptr, PropertyRNA *prop, bool is_overridable);
481bool RNA_property_overridden(PointerRNA *ptr, PropertyRNA *prop);
482bool RNA_property_comparable(PointerRNA *ptr, PropertyRNA *prop);
487bool RNA_property_path_from_ID_check(PointerRNA *ptr, PropertyRNA *prop); /* slow, use with care */
488
489void RNA_property_update(bContext *C, PointerRNA *ptr, PropertyRNA *prop);
493void RNA_property_update_main(Main *bmain, Scene *scene, PointerRNA *ptr, PropertyRNA *prop);
498bool RNA_property_update_check(PropertyRNA *prop);
499
500/* Property Data */
501
502bool RNA_property_boolean_get(PointerRNA *ptr, PropertyRNA *prop);
503void RNA_property_boolean_set(PointerRNA *ptr, PropertyRNA *prop, bool value);
504void RNA_property_boolean_get_array(PointerRNA *ptr, PropertyRNA *prop, bool *values);
505void RNA_property_boolean_get_array_at_most(PointerRNA *ptr,
506 PropertyRNA *prop,
507 bool *values,
508 int values_num);
509bool RNA_property_boolean_get_index(PointerRNA *ptr, PropertyRNA *prop, int index);
510void RNA_property_boolean_set_array(PointerRNA *ptr, PropertyRNA *prop, const bool *values);
511void RNA_property_boolean_set_array_at_most(PointerRNA *ptr,
512 PropertyRNA *prop,
513 const bool *values,
514 int values_num);
515void RNA_property_boolean_set_index(PointerRNA *ptr, PropertyRNA *prop, int index, bool value);
516bool RNA_property_boolean_get_default(PointerRNA *ptr, PropertyRNA *prop);
517void RNA_property_boolean_get_default_array(PointerRNA *ptr, PropertyRNA *prop, bool *values);
518bool RNA_property_boolean_get_default_index(PointerRNA *ptr, PropertyRNA *prop, int index);
519
520int RNA_property_int_get(PointerRNA *ptr, PropertyRNA *prop);
521void RNA_property_int_set(PointerRNA *ptr, PropertyRNA *prop, int value);
522void RNA_property_int_get_array(PointerRNA *ptr, PropertyRNA *prop, int *values);
523void RNA_property_int_get_array_at_most(PointerRNA *ptr,
524 PropertyRNA *prop,
525 int *values,
526 int values_num);
527void RNA_property_int_get_array_range(PointerRNA *ptr, PropertyRNA *prop, int values[2]);
528int RNA_property_int_get_index(PointerRNA *ptr, PropertyRNA *prop, int index);
529void RNA_property_int_set_array(PointerRNA *ptr, PropertyRNA *prop, const int *values);
530void RNA_property_int_set_index(PointerRNA *ptr, PropertyRNA *prop, int index, int value);
531void RNA_property_int_set_array_at_most(PointerRNA *ptr,
532 PropertyRNA *prop,
533 const int *values,
534 int values_num);
535int RNA_property_int_get_default(PointerRNA *ptr, PropertyRNA *prop);
536bool RNA_property_int_set_default(PropertyRNA *prop, int value);
537void RNA_property_int_get_default_array(PointerRNA *ptr, PropertyRNA *prop, int *values);
538int RNA_property_int_get_default_index(PointerRNA *ptr, PropertyRNA *prop, int index);
539
540float RNA_property_float_get(PointerRNA *ptr, PropertyRNA *prop);
541void RNA_property_float_set(PointerRNA *ptr, PropertyRNA *prop, float value);
542void RNA_property_float_get_array(PointerRNA *ptr, PropertyRNA *prop, float *values);
543void RNA_property_float_get_array_at_most(PointerRNA *ptr,
544 PropertyRNA *prop,
545 float *values,
546 int values_num);
547void RNA_property_float_get_array_range(PointerRNA *ptr, PropertyRNA *prop, float values[2]);
548float RNA_property_float_get_index(PointerRNA *ptr, PropertyRNA *prop, int index);
549void RNA_property_float_set_array(PointerRNA *ptr, PropertyRNA *prop, const float *values);
550void RNA_property_float_set_array_at_most(PointerRNA *ptr,
551 PropertyRNA *prop,
552 const float *values,
553 int values_num);
554void RNA_property_float_set_index(PointerRNA *ptr, PropertyRNA *prop, int index, float value);
555float RNA_property_float_get_default(PointerRNA *ptr, PropertyRNA *prop);
556bool RNA_property_float_set_default(PropertyRNA *prop, float value);
557void RNA_property_float_get_default_array(PointerRNA *ptr, PropertyRNA *prop, float *values);
558float RNA_property_float_get_default_index(PointerRNA *ptr, PropertyRNA *prop, int index);
559
560std::string RNA_property_string_get(PointerRNA *ptr, PropertyRNA *prop);
561void RNA_property_string_get(PointerRNA *ptr, PropertyRNA *prop, char *value);
562char *RNA_property_string_get_alloc(PointerRNA *ptr,
563 PropertyRNA *prop,
564 char *fixedbuf,
565 int fixedlen,
566 int *r_len) ATTR_WARN_UNUSED_RESULT;
567void RNA_property_string_set(PointerRNA *ptr, PropertyRNA *prop, const char *value);
568void RNA_property_string_set_bytes(PointerRNA *ptr, PropertyRNA *prop, const char *value, int len);
569
576void RNA_property_string_search(const bContext *C,
577 PointerRNA *ptr,
578 PropertyRNA *prop,
579 const char *edit_text,
580 FunctionRef<void(StringPropertySearchVisitParams)> visit_fn);
581
586std::optional<std::string> RNA_property_string_path_filter(const bContext *C,
587 PointerRNA *ptr,
588 PropertyRNA *prop);
589
594int RNA_property_string_length(PointerRNA *ptr, PropertyRNA *prop);
595void RNA_property_string_get_default(PointerRNA *ptr,
596 PropertyRNA *prop,
597 char *value,
598 int value_maxncpy);
599char *RNA_property_string_get_default_alloc(PointerRNA *ptr,
600 PropertyRNA *prop,
601 char *fixedbuf,
602 int fixedlen,
603 int *r_len) ATTR_WARN_UNUSED_RESULT;
607int RNA_property_string_default_length(PointerRNA *ptr, PropertyRNA *prop);
608
609int RNA_property_enum_get(PointerRNA *ptr, PropertyRNA *prop);
610void RNA_property_enum_set(PointerRNA *ptr, PropertyRNA *prop, int value);
611int RNA_property_enum_get_default(PointerRNA *ptr, PropertyRNA *prop);
620 const bContext *C, PointerRNA *ptr, PropertyRNA *prop, int from_value, int step);
621
627PointerRNA RNA_property_pointer_get(PointerRNA *ptr, PropertyRNA *prop) ATTR_NONNULL(1, 2);
635PointerRNA RNA_property_pointer_get_never_create(PointerRNA *ptr, PropertyRNA *prop)
636 ATTR_NONNULL(1, 2);
637void RNA_property_pointer_set(PointerRNA *ptr,
638 PropertyRNA *prop,
639 PointerRNA ptr_value,
640 ReportList *reports) ATTR_NONNULL(1, 2);
641PointerRNA RNA_property_pointer_get_default(Main &bmain, PointerRNA &ptr, PropertyRNA &prop);
642
643void RNA_property_collection_begin(PointerRNA *ptr,
644 PropertyRNA *prop,
645 CollectionPropertyIterator *iter);
646void RNA_property_collection_next(CollectionPropertyIterator *iter);
647void RNA_property_collection_skip(CollectionPropertyIterator *iter, int num);
648void RNA_property_collection_end(CollectionPropertyIterator *iter);
649int RNA_property_collection_length(PointerRNA *ptr, PropertyRNA *prop);
654bool RNA_property_collection_is_empty(PointerRNA *ptr, PropertyRNA *prop);
655int RNA_property_collection_lookup_index(PointerRNA *ptr,
656 PropertyRNA *prop,
657 const PointerRNA *t_ptr);
658bool RNA_property_collection_lookup_int(PointerRNA *ptr,
659 PropertyRNA *prop,
660 int key,
661 PointerRNA *r_ptr);
662bool RNA_property_collection_lookup_string(PointerRNA *ptr,
663 PropertyRNA *prop,
664 const char *key,
665 PointerRNA *r_ptr);
667 PointerRNA *ptr, PropertyRNA *prop, const char *key, PointerRNA *r_ptr, int *r_index);
668
669bool RNA_property_collection_lookup_int_has_fn(PropertyRNA *prop);
677
681bool RNA_property_collection_assign_int(PointerRNA *ptr,
682 PropertyRNA *prop,
683 int key,
684 const PointerRNA *assign_ptr);
685std::optional<PointerRNA> RNA_property_collection_type_get(PointerRNA *ptr, PropertyRNA *prop);
686
687/* efficient functions to set properties for arrays */
689 PointerRNA *ptr, PropertyRNA *prop, PropertyRNA *itemprop, bool set, RawArray *array);
690int RNA_property_collection_raw_get(ReportList *reports,
691 PointerRNA *ptr,
692 PropertyRNA *prop,
693 const char *propname,
694 void *array,
695 RawPropertyType type,
696 int len);
697int RNA_property_collection_raw_set(ReportList *reports,
698 PointerRNA *ptr,
699 PropertyRNA *prop,
700 const char *propname,
701 void *array,
702 RawPropertyType type,
703 int len);
705RawPropertyType RNA_property_raw_type(PropertyRNA *prop);
706
711void RNA_sync_system_properties(Main &bmain, PointerRNA &ptr, IDProperty &idprops);
716void RNA_ensure_and_sync_system_properties(Main &bmain, PointerRNA &ptr, IDProperty &idprops);
717
718/* to create ID property groups */
719void RNA_property_pointer_add(PointerRNA *ptr, PropertyRNA *prop);
720void RNA_property_pointer_remove(PointerRNA *ptr, PropertyRNA *prop);
721void RNA_property_collection_add(PointerRNA *ptr, PropertyRNA *prop, PointerRNA *r_ptr);
722bool RNA_property_collection_remove(PointerRNA *ptr, PropertyRNA *prop, int key);
723void RNA_property_collection_clear(PointerRNA *ptr, PropertyRNA *prop);
725 PropertyRNA *prop,
726 int src_index,
727 int dst_index);
728
729/* copy/reset */
730bool RNA_property_copy(Main *bmain,
731 PointerRNA *ptr,
732 PointerRNA *fromptr,
733 PropertyRNA *prop,
734 int index,
735 IDOverrideLibraryProperty *removed_oprop = nullptr,
736 IDOverrideLibraryPropertyOperation *removed_opop = nullptr);
741bool RNA_property_reset(Main *bmain, PointerRNA *ptr, PropertyRNA *prop, int index);
742bool RNA_property_assign_default(PointerRNA *ptr, PropertyRNA *prop);
743
744/* Quick name based property access
745 *
746 * These are just an easier way to access property values without having to
747 * call RNA_struct_find_property. The names have to exist as RNA properties
748 * for the type in the pointer, if they do not exist an error will be printed.
749 *
750 * There is no support for pointers and collections here yet, these can be
751 * added when ID properties support them. */
752
753bool RNA_boolean_get(PointerRNA *ptr, const char *name);
754void RNA_boolean_set(PointerRNA *ptr, const char *name, bool value);
755void RNA_boolean_get_array(PointerRNA *ptr, const char *name, bool *values);
756void RNA_boolean_set_array(PointerRNA *ptr, const char *name, const bool *values);
757
758int RNA_int_get(PointerRNA *ptr, const char *name);
759void RNA_int_set(PointerRNA *ptr, const char *name, int value);
760void RNA_int_get_array(PointerRNA *ptr, const char *name, int *values);
761void RNA_int_set_array(PointerRNA *ptr, const char *name, const int *values);
762
763float RNA_float_get(PointerRNA *ptr, const char *name);
764void RNA_float_set(PointerRNA *ptr, const char *name, float value);
765void RNA_float_get_array(PointerRNA *ptr, const char *name, float *values);
766void RNA_float_set_array(PointerRNA *ptr, const char *name, const float *values);
767
768int RNA_enum_get(PointerRNA *ptr, const char *name);
769void RNA_enum_set(PointerRNA *ptr, const char *name, int value);
770void RNA_enum_set_identifier(bContext *C, PointerRNA *ptr, const char *name, const char *id);
771bool RNA_enum_is_equal(bContext *C, PointerRNA *ptr, const char *name, const char *enumname);
772
773/* Lower level functions that don't use a PointerRNA. */
774bool RNA_enum_value_from_id(const EnumPropertyItem *item, const char *identifier, int *r_value);
775bool RNA_enum_id_from_value(const EnumPropertyItem *item, int value, const char **r_identifier);
776bool RNA_enum_icon_from_value(const EnumPropertyItem *item, int value, int *r_icon);
777bool RNA_enum_name_from_value(const EnumPropertyItem *item, int value, const char **r_name);
778
779void RNA_string_get(PointerRNA *ptr, const char *name, char *value);
785std::string RNA_string_get(PointerRNA *ptr, const char *name);
786char *RNA_string_get_alloc(PointerRNA *ptr,
787 const char *name,
788 char *fixedbuf,
789 int fixedlen,
790 int *r_len) ATTR_WARN_UNUSED_RESULT;
791int RNA_string_length(PointerRNA *ptr, const char *name);
792void RNA_string_set(PointerRNA *ptr, const char *name, const char *value);
793
797PointerRNA RNA_pointer_get(PointerRNA *ptr, const char *name);
798/* Set the property name of PointerRNA ptr to ptr_value */
799void RNA_pointer_set(PointerRNA *ptr, const char *name, PointerRNA ptr_value);
800void RNA_pointer_add(PointerRNA *ptr, const char *name);
801
802void RNA_collection_begin(PointerRNA *ptr, const char *name, CollectionPropertyIterator *iter);
803int RNA_collection_length(PointerRNA *ptr, const char *name);
804bool RNA_collection_is_empty(PointerRNA *ptr, const char *name);
805void RNA_collection_add(PointerRNA *ptr, const char *name, PointerRNA *r_value);
806void RNA_collection_clear(PointerRNA *ptr, const char *name);
807
808#define RNA_BEGIN(sptr, itemptr, propname) \
809 { \
810 CollectionPropertyIterator rna_macro_iter; \
811 for (RNA_collection_begin(sptr, propname, &rna_macro_iter); rna_macro_iter.valid; \
812 RNA_property_collection_next(&rna_macro_iter)) \
813 { \
814 PointerRNA itemptr = rna_macro_iter.ptr;
815
816#define RNA_END \
817 } \
818 RNA_property_collection_end(&rna_macro_iter); \
819 } \
820 ((void)0)
821
822#define RNA_PROP_BEGIN(sptr, itemptr, prop) \
823 { \
824 CollectionPropertyIterator rna_macro_iter; \
825 for (RNA_property_collection_begin(sptr, prop, &rna_macro_iter); rna_macro_iter.valid; \
826 RNA_property_collection_next(&rna_macro_iter)) \
827 { \
828 PointerRNA itemptr = rna_macro_iter.ptr;
829
830#define RNA_PROP_END \
831 } \
832 RNA_property_collection_end(&rna_macro_iter); \
833 } \
834 ((void)0)
835
836#define RNA_STRUCT_BEGIN(sptr, prop) \
837 { \
838 CollectionPropertyIterator rna_macro_iter{}; \
839 for (RNA_property_collection_begin( \
840 sptr, RNA_struct_iterator_property((sptr)->type), &rna_macro_iter); \
841 rna_macro_iter.valid; \
842 RNA_property_collection_next(&rna_macro_iter)) \
843 { \
844 PropertyRNA *prop = (PropertyRNA *)rna_macro_iter.ptr.data;
845
846#define RNA_STRUCT_BEGIN_SKIP_RNA_TYPE(sptr, prop) \
847 { \
848 CollectionPropertyIterator rna_macro_iter; \
849 RNA_property_collection_begin( \
850 sptr, RNA_struct_iterator_property((sptr)->type), &rna_macro_iter); \
851 if (rna_macro_iter.valid) { \
852 RNA_property_collection_next(&rna_macro_iter); \
853 } \
854 for (; rna_macro_iter.valid; RNA_property_collection_next(&rna_macro_iter)) { \
855 PropertyRNA *prop = (PropertyRNA *)rna_macro_iter.ptr.data;
856
857#define RNA_STRUCT_END \
858 } \
859 RNA_property_collection_end(&rna_macro_iter); \
860 } \
861 ((void)0)
862
876bool RNA_property_is_set_ex(PointerRNA *ptr, PropertyRNA *prop, bool use_ghost);
877bool RNA_property_is_set(PointerRNA *ptr, PropertyRNA *prop);
878void RNA_property_unset(PointerRNA *ptr, PropertyRNA *prop);
880bool RNA_struct_property_is_set_ex(PointerRNA *ptr, const char *identifier, bool use_ghost);
881bool RNA_struct_property_is_set(PointerRNA *ptr, const char *identifier);
882bool RNA_property_is_idprop(const PropertyRNA *prop);
886bool RNA_property_is_unlink(PropertyRNA *prop);
887void RNA_struct_property_unset(PointerRNA *ptr, const char *identifier);
888
892std::string RNA_property_as_string(
893 bContext *C, PointerRNA *ptr, PropertyRNA *prop, int index, int max_prop_length);
898std::string RNA_pointer_as_string_id(bContext *C, PointerRNA *ptr);
899std::optional<std::string> RNA_pointer_as_string(bContext *C,
900 PointerRNA *ptr,
901 PropertyRNA *prop_ptr,
902 PointerRNA *ptr_prop);
906std::string RNA_pointer_as_string_keywords_ex(bContext *C,
907 PointerRNA *ptr,
908 bool as_function,
909 bool all_args,
910 bool nested_args,
911 int max_prop_length,
912 PropertyRNA *iterprop);
913std::string RNA_pointer_as_string_keywords(bContext *C,
914 PointerRNA *ptr,
915 bool as_function,
916 bool all_args,
917 bool nested_args,
918 int max_prop_length);
920 bContext *C, FunctionRNA *func, bool as_function, bool all_args, int max_prop_length);
921
922/* Function */
923
924const char *RNA_function_identifier(FunctionRNA *func);
925const char *RNA_function_ui_description(FunctionRNA *func);
926const char *RNA_function_ui_description_raw(FunctionRNA *func);
927int RNA_function_flag(FunctionRNA *func);
928int RNA_function_defined(FunctionRNA *func);
929
930PropertyRNA *RNA_function_get_parameter(PointerRNA *ptr, FunctionRNA *func, int index);
931PropertyRNA *RNA_function_find_parameter(PointerRNA *ptr,
932 FunctionRNA *func,
933 const char *identifier);
934const ListBaseT<PropertyRNA> *RNA_function_defined_parameters(FunctionRNA *func);
935
936/* Utility */
937
938int RNA_parameter_flag(PropertyRNA *prop);
939
940ParameterList *RNA_parameter_list_create(ParameterList *parms, PointerRNA *ptr, FunctionRNA *func);
941void RNA_parameter_list_free(ParameterList *parms);
942int RNA_parameter_list_size(const ParameterList *parms);
943int RNA_parameter_list_arg_count(const ParameterList *parms);
944int RNA_parameter_list_ret_count(const ParameterList *parms);
945
946void RNA_parameter_list_begin(ParameterList *parms, ParameterIterator *iter);
947void RNA_parameter_list_next(ParameterIterator *iter);
948void RNA_parameter_list_end(ParameterIterator *iter);
949
950void RNA_parameter_get(ParameterList *parms, PropertyRNA *parm, void **r_value);
951void RNA_parameter_get_lookup(ParameterList *parms, const char *identifier, void **r_value);
952void RNA_parameter_set(ParameterList *parms, PropertyRNA *parm, const void *value);
953void RNA_parameter_set_lookup(ParameterList *parms, const char *identifier, const void *value);
954
955/* Only for PROP_DYNAMIC properties! */
956
957int RNA_parameter_dynamic_length_get(ParameterList *parms, PropertyRNA *parm);
958int RNA_parameter_dynamic_length_get_data(ParameterList *parms, PropertyRNA *parm, void *data);
959void RNA_parameter_dynamic_length_set(ParameterList *parms, PropertyRNA *parm, int length);
960void RNA_parameter_dynamic_length_set_data(ParameterList *parms,
961 PropertyRNA *parm,
962 void *data,
963 int length);
964
966 bContext *C, ReportList *reports, PointerRNA *ptr, FunctionRNA *func, ParameterList *parms);
967
968std::optional<StringRefNull> RNA_translate_ui_text(
969 const char *text, const char *text_ctxt, StructRNA *type, PropertyRNA *prop, int translate);
970
971/* ID */
972
975
976/* macro which inserts the function name */
977#if defined __GNUC__
978# define RNA_warning(format, args...) _RNA_warning("%s: " format "\n", __func__, ##args)
979#elif defined(_MSVC_TRADITIONAL) && \
980 !_MSVC_TRADITIONAL /* The "new preprocessor" is enabled via `/Zc:preprocessor`. */
981# define RNA_warning(format, ...) _RNA_warning("%s: " format "\n", __FUNCTION__, ##__VA_ARGS__)
982#else
983# define RNA_warning(format, ...) _RNA_warning("%s: " format "\n", __FUNCTION__, __VA_ARGS__)
984#endif
985
987#if defined __GNUC__
988# define RNA_warning_bare(format, args...) _RNA_warning(format "\n", ##args)
989#elif defined(_MSVC_TRADITIONAL) && \
990 !_MSVC_TRADITIONAL /* The "new preprocessor" is enabled via `/Zc:preprocessor`. */
991# define RNA_warning_bare(format, ...) _RNA_warning(format "\n", ##__VA_ARGS__)
992#else
993# define RNA_warning_bare(format, ...) _RNA_warning(format "\n", __VA_ARGS__)
994#endif
995
997void _RNA_warning(const char *format, ...) ATTR_PRINTF_FORMAT(1, 2);
998
999/* Equals test. */
1000
1006 /* Only care about equality, not full comparison. */
1015};
1016
1018 Main *bmain, PointerRNA *ptr_a, PointerRNA *ptr_b, PropertyRNA *prop, eRNACompareMode mode);
1019bool RNA_struct_equals(Main *bmain, PointerRNA *ptr_a, PointerRNA *ptr_b, eRNACompareMode mode);
1020
1021/* Override. */
1022
1038
1056
1068
1069
1079bool RNA_struct_override_matches(Main *bmain,
1080 PointerRNA *ptr_local,
1081 PointerRNA *ptr_reference,
1082 const char *root_path,
1083 size_t root_path_len,
1084 IDOverrideLibrary *liboverride,
1085 eRNAOverrideMatch flags,
1086 eRNAOverrideMatchResult *r_report_flags);
1087
1092bool RNA_struct_override_store(Main *bmain,
1093 PointerRNA *ptr_local,
1094 PointerRNA *ptr_reference,
1095 PointerRNA *ptr_storage,
1096 IDOverrideLibrary *liboverride);
1097
1112
1121void RNA_struct_override_apply(Main *bmain,
1122 PointerRNA *id_ptr_dst,
1123 PointerRNA *id_ptr_src,
1124 PointerRNA *id_ptr_storage,
1125 IDOverrideLibrary *liboverride,
1127
1128IDOverrideLibraryProperty *RNA_property_override_property_find(Main *bmain,
1129 PointerRNA *ptr,
1130 PropertyRNA *prop,
1131 ID **r_owner_id);
1132IDOverrideLibraryProperty *RNA_property_override_property_get(Main *bmain,
1133 PointerRNA *ptr,
1134 PropertyRNA *prop,
1135 bool *r_created);
1136
1137IDOverrideLibraryPropertyOperation *RNA_property_override_property_operation_find(
1138 Main *bmain, PointerRNA *ptr, PropertyRNA *prop, int index, bool strict, bool *r_strict);
1139IDOverrideLibraryPropertyOperation *RNA_property_override_property_operation_get(
1140 Main *bmain,
1141 PointerRNA *ptr,
1142 PropertyRNA *prop,
1143 eID_OverrideLib_Op operation,
1144 int index,
1145 bool strict,
1146 bool *r_strict,
1147 bool *r_created);
1148
1150 PointerRNA *ptr,
1151 PropertyRNA *prop,
1152 int index);
1153
1154void RNA_struct_state_owner_set(const char *name);
1155const char *RNA_struct_state_owner_get();
1156
1157} // namespace blender
1158
1159#endif /* __RNA_ACCESS_H__ */
#define ATTR_PRINTF_FORMAT(format_param, dots_param)
#define ATTR_WARN_UNUSED_RESULT
#define ATTR_NONNULL(...)
#define ENUM_OPERATORS(_enum_type)
These structs are the foundation for all linked lists in the library system.
#define C
Definition RandGen.cpp:29
Definition scene.h:133
#define main()
#define index(i)
VecBase< float, D > step(VecOp< float, D >, VecOp< float, D >) RET
float length(VecOp< float, D >) RET
float4x4 translate(float4x4 mat, float3 translation)
ccl_device_inline dual1 len(const ccl_private dual< T > &a)
Definition math_dual.h:263
BMesh Iterators.
PropertyRNA * RNA_function_find_parameter(PointerRNA *, FunctionRNA *func, const char *identifier)
char * RNA_property_string_get_alloc(PointerRNA *ptr, PropertyRNA *prop, char *fixedbuf, int fixedlen, int *r_len)
void RNA_collection_begin(PointerRNA *ptr, const char *name, CollectionPropertyIterator *iter)
eRNAOverrideMatchResult
@ RNA_OVERRIDE_MATCH_RESULT_RESTORED
@ RNA_OVERRIDE_MATCH_RESULT_CREATED
@ RNA_OVERRIDE_MATCH_RESULT_INIT
@ RNA_OVERRIDE_MATCH_RESULT_RESTORE_TAGGED
bool RNA_property_assign_default(PointerRNA *ptr, PropertyRNA *prop)
int RNA_property_array_length(PointerRNA *ptr, PropertyRNA *prop)
PointerRNA RNA_pointer_create_from_ancestor(const PointerRNA &ptr, const int ancestor_idx)
void RNA_property_string_get_default(PointerRNA *ptr, PropertyRNA *prop, char *value, const int value_maxncpy)
const char * RNA_function_ui_description_raw(FunctionRNA *func)
void RNA_float_set_array(PointerRNA *ptr, const char *name, const float *values)
int RNA_property_enum_bitflag_identifiers(bContext *C, PointerRNA *ptr, PropertyRNA *prop, const int value, const char **r_identifier)
bool RNA_property_overridable_library_set(PointerRNA *, PropertyRNA *prop, const bool is_overridable)
void ** RNA_struct_instance(PointerRNA *ptr)
int RNA_parameter_dynamic_length_get_data(ParameterList *, PropertyRNA *parm, void *data)
PointerRNA RNA_property_pointer_get(PointerRNA *ptr, PropertyRNA *prop)
std::string RNA_struct_to_string(const StructRNA &type)
bool RNA_struct_idprops_datablock_allowed(const StructRNA *type)
bool RNA_struct_system_idprops_check(StructRNA *srna)
void RNA_property_int_get_array_at_most(PointerRNA *ptr, PropertyRNA *prop, int *values, int values_num)
void RNA_property_int_get_default_array(PointerRNA *ptr, PropertyRNA *prop, int *values)
void RNA_parameter_get(ParameterList *parms, PropertyRNA *parm, void **r_value)
int RNA_enum_get(PointerRNA *ptr, const char *name)
void RNA_property_float_get_array_range(PointerRNA *ptr, PropertyRNA *prop, float values[2])
void RNA_property_float_get_array(PointerRNA *ptr, PropertyRNA *prop, float *values)
void RNA_property_float_get_array_at_most(PointerRNA *ptr, PropertyRNA *prop, float *values, int values_num)
PointerRNA RNA_main_pointer_create(Main *main)
PropertyRNA * RNA_struct_find_property(PointerRNA *ptr, const char *identifier)
bool RNA_struct_idprops_check(const StructRNA *srna)
PointerRNA RNA_pointer_recast(PointerRNA *ptr)
void RNA_property_update(bContext *C, PointerRNA *ptr, PropertyRNA *prop)
void RNA_property_pointer_set(PointerRNA *ptr, PropertyRNA *prop, PointerRNA ptr_value, ReportList *reports)
int RNA_parameter_list_ret_count(const ParameterList *parms)
bool RNA_struct_is_a(const StructRNA *type, const StructRNA *srna)
const char * RNA_property_ui_name_raw(const PropertyRNA *prop, const PointerRNA *ptr)
const char * RNA_function_ui_description(FunctionRNA *func)
void RNA_property_string_set_bytes(PointerRNA *ptr, PropertyRNA *prop, const char *value, int len)
void RNA_property_update_main(Main *bmain, Scene *scene, PointerRNA *ptr, PropertyRNA *prop)
PointerRNA RNA_blender_rna_pointer_create()
int RNA_property_string_length(PointerRNA *ptr, PropertyRNA *prop)
bool RNA_enum_is_equal(bContext *C, PointerRNA *ptr, const char *name, const char *enumname)
bool RNA_property_editable_flag(const PointerRNA *ptr, PropertyRNA *prop)
void RNA_property_pointer_remove(PointerRNA *ptr, PropertyRNA *prop)
void RNA_property_int_get_array_range(PointerRNA *ptr, PropertyRNA *prop, int values[2])
bool RNA_property_reset(Main *bmain, PointerRNA *ptr, PropertyRNA *prop, int index)
bool RNA_property_enum_identifier(bContext *C, PointerRNA *ptr, PropertyRNA *prop, const int value, const char **r_identifier)
PointerRNA RNA_id_pointer_create(ID *id)
void RNA_parameter_set(ParameterList *parms, PropertyRNA *parm, const void *value)
void * RNA_struct_py_type_get(StructRNA *srna)
int RNA_property_collection_lookup_index(PointerRNA *ptr, PropertyRNA *prop, const PointerRNA *t_ptr)
PropertyRNA * RNA_struct_type_find_property_no_base(StructRNA *srna, const UString identifier)
void RNA_property_float_set(PointerRNA *ptr, PropertyRNA *prop, float value)
const char * RNA_property_identifier(const PropertyRNA *prop)
void RNA_parameter_dynamic_length_set(ParameterList *parms, PropertyRNA *parm, int length)
bool RNA_property_editable_info(const PointerRNA *ptr, PropertyRNA *prop, const char **r_info)
eRNAStatus RNA_property_collection_move(PointerRNA *ptr, PropertyRNA *prop, int src_index, int dst_index)
StructRNA * ID_code_to_RNA_type(short idcode)
void RNA_property_boolean_get_array(PointerRNA *ptr, PropertyRNA *prop, bool *values)
void RNA_string_set(PointerRNA *ptr, const char *name, const char *value)
bool RNA_struct_available_or_report(ReportList *reports, const char *identifier)
bool RNA_property_builtin(PropertyRNA *prop)
bool RNA_property_enum_name(bContext *C, PointerRNA *ptr, PropertyRNA *prop, const int value, const char **r_name)
bool RNA_property_float_set_default(PropertyRNA *prop, float value)
eRNAOverrideApplyFlag
@ RNA_OVERRIDE_APPLY_FLAG_SKIP_RESYNC_CHECK
@ RNA_OVERRIDE_APPLY_FLAG_IGNORE_ID_POINTERS
@ RNA_OVERRIDE_APPLY_FLAG_RESTORE_ONLY
@ RNA_OVERRIDE_APPLY_FLAG_NOP
int RNA_property_enum_get(PointerRNA *ptr, PropertyRNA *prop)
void RNA_property_enum_items(bContext *C, PointerRNA *ptr, PropertyRNA *prop, const EnumPropertyItem **r_item, int *r_totitem, bool *r_free)
int RNA_enum_bitflag_identifiers(const EnumPropertyItem *item, const int value, const char **r_identifier)
uint RNA_struct_count_properties(StructRNA *srna)
int RNA_property_collection_raw_get(ReportList *reports, PointerRNA *ptr, PropertyRNA *prop, const char *propname, void *array, RawPropertyType type, int len)
float RNA_property_float_get_index(PointerRNA *ptr, PropertyRNA *prop, int index)
void RNA_int_set(PointerRNA *ptr, const char *name, int value)
IDOverrideLibraryPropertyOperation * RNA_property_override_property_operation_get(Main *bmain, PointerRNA *ptr, PropertyRNA *prop, const eID_OverrideLib_Op operation, const int index, const bool strict, bool *r_strict, bool *r_created)
bool RNA_struct_equals(Main *bmain, PointerRNA *ptr_a, PointerRNA *ptr_b, eRNACompareMode mode)
PointerRNA RNA_property_pointer_get_default(Main &bmain, PointerRNA &, PropertyRNA &prop)
void RNA_sync_system_properties(Main &bmain, PointerRNA &ptr, IDProperty &idprops)
std::optional< AncestorPointerRNA > RNA_struct_search_closest_ancestor_by_type(const PointerRNA *ptr, const StructRNA *srna)
const char * RNA_struct_state_owner_get()
FunctionRNA * RNA_struct_find_function(StructRNA *srna, const char *identifier_c_str)
PointerRNA RNA_property_pointer_get_never_create(PointerRNA *ptr, PropertyRNA *prop)
bool RNA_struct_property_is_set_ex(PointerRNA *ptr, const char *identifier, bool use_ghost)
void RNA_parameter_list_next(ParameterIterator *iter)
void * RNA_struct_blender_type_get(StructRNA *srna)
void RNA_property_collection_begin(PointerRNA *ptr, PropertyRNA *prop, CollectionPropertyIterator *iter)
bool RNA_struct_idprops_contains_datablock(const StructRNA *type)
PropertyUnit RNA_property_unit(PropertyRNA *prop)
void RNA_parameter_list_end(ParameterIterator *)
short RNA_type_to_ID_code(const StructRNA *type)
bool RNA_property_driver_editable(const PointerRNA *ptr, PropertyRNA *prop)
PropertyRNA * RNA_struct_find_property_check(PointerRNA &props, const char *name, const PropertyType property_type_check)
void RNA_struct_property_unset(PointerRNA *ptr, const char *identifier)
std::string RNA_property_string_get(PointerRNA *ptr, PropertyRNA *prop)
bool RNA_property_overridable_get(const PointerRNA *ptr, PropertyRNA *prop)
StructUnregisterFunc RNA_struct_unregister(StructRNA *type)
bool RNA_property_enum_value(bContext *C, PointerRNA *ptr, PropertyRNA *prop, const char *identifier, int *r_value)
bool RNA_property_collection_assign_int(PointerRNA *ptr, PropertyRNA *prop, const int key, const PointerRNA *assign_ptr)
int RNA_int_get(PointerRNA *ptr, const char *name)
std::optional< std::string > RNA_pointer_as_string(bContext *C, PointerRNA *ptr, PropertyRNA *prop_ptr, PointerRNA *ptr_prop)
float RNA_property_float_get_default_index(PointerRNA *ptr, PropertyRNA *prop, int index)
const char * RNA_property_description(PropertyRNA *prop)
bool RNA_property_string_is_utf8(PropertyRNA *prop)
IDProperty ** RNA_struct_system_idprops_p(PointerRNA *ptr)
char * RNA_struct_name_get_alloc(PointerRNA *ptr, char *fixedbuf, int fixedlen, int *r_len)
void RNA_enum_set(PointerRNA *ptr, const char *name, int value)
void RNA_property_float_set_array(PointerRNA *ptr, PropertyRNA *prop, const float *values)
int RNA_property_override_flag(PropertyRNA *prop)
const char * RNA_property_translation_context(const PropertyRNA *prop)
void RNA_property_boolean_set_array(PointerRNA *ptr, PropertyRNA *prop, const bool *values)
const char * RNA_struct_ui_name(const StructRNA *type)
@ RNA_OVERRIDE_COMPARE_IGNORE_NON_OVERRIDABLE
@ RNA_OVERRIDE_COMPARE_RESTORE
@ RNA_OVERRIDE_COMPARE_TAG_FOR_RESTORE
@ RNA_OVERRIDE_COMPARE_CREATE
@ RNA_OVERRIDE_COMPARE_IGNORE_OVERRIDDEN
bool RNA_property_animateable(const PointerRNA *ptr, PropertyRNA *prop_orig)
PropertyRNA * RNA_struct_iterator_property(StructRNA *type)
void RNA_property_string_search(const bContext *C, PointerRNA *ptr, PropertyRNA *prop, const char *edit_text, FunctionRef< void(StringPropertySearchVisitParams)> visit_fn)
uint RNA_enum_items_count(const EnumPropertyItem *item)
int RNA_property_collection_length(PointerRNA *ptr, PropertyRNA *prop)
void RNA_boolean_get_array(PointerRNA *ptr, const char *name, bool *values)
const char * RNA_struct_ui_name_raw(const StructRNA *type)
PropertyScaleType RNA_property_ui_scale(PropertyRNA *prop)
int RNA_property_array_item_index(PropertyRNA *prop, char name)
bool RNA_property_comparable(PointerRNA *, PropertyRNA *prop)
eID_OverrideLib_Op
Definition DNA_ID.h:182
int RNA_enum_from_value(const EnumPropertyItem *item, const int value)
StructRNA * RNA_struct_find(const char *identifier)
char * RNA_string_get_alloc(PointerRNA *ptr, const char *name, char *fixedbuf, int fixedlen, int *r_len)
const ListBaseT< PropertyRNA > * RNA_struct_type_properties(StructRNA *srna)
PropertyPathTemplateType
Definition RNA_types.hh:564
void RNA_pointer_add(PointerRNA *ptr, const char *name)
void RNA_struct_override_apply(Main *bmain, PointerRNA *id_ptr_dst, PointerRNA *id_ptr_src, PointerRNA *id_ptr_storage, IDOverrideLibrary *liboverride, const eRNAOverrideApplyFlag flag)
bool RNA_property_collection_remove(PointerRNA *ptr, PropertyRNA *prop, int key)
@ RNA_EQ_UNSET_MATCH_NONE
@ RNA_EQ_UNSET_MATCH_ANY
int RNA_function_flag(FunctionRNA *func)
ParameterList * RNA_parameter_list_create(ParameterList *parms, PointerRNA *, FunctionRNA *func)
void RNA_parameter_dynamic_length_set_data(ParameterList *, PropertyRNA *parm, void *data, int length)
PropertyRNA * RNA_function_get_parameter(PointerRNA *, FunctionRNA *func, int index)
bool RNA_property_boolean_get(PointerRNA *ptr, PropertyRNA *prop)
bool RNA_property_array_check(PropertyRNA *prop)
void RNA_property_collection_add(PointerRNA *ptr, PropertyRNA *prop, PointerRNA *r_ptr)
bool RNA_enum_value_from_id(const EnumPropertyItem *item, const char *identifier, int *r_value)
void RNA_property_int_set_array(PointerRNA *ptr, PropertyRNA *prop, const int *values)
bool RNA_property_enum_name_gettexted(bContext *C, PointerRNA *ptr, PropertyRNA *prop, const int value, const char **r_name)
void RNA_property_int_set(PointerRNA *ptr, PropertyRNA *prop, int value)
std::string RNA_pointer_as_string_id(bContext *C, PointerRNA *ptr)
const EnumPropertyItem * RNA_struct_property_tag_defines(const StructRNA *type)
PropertyType RNA_property_type(PropertyRNA *prop)
bool RNA_property_collection_lookup_string_has_fn(PropertyRNA *prop)
bool RNA_property_is_runtime(const PropertyRNA *prop)
bool RNA_property_undo_check(const PropertyRNA *prop, const StructRNA *type)
PropertyPathTemplateType RNA_property_path_template_type(PropertyRNA *prop)
void RNA_int_set_array(PointerRNA *ptr, const char *name, const int *values)
int RNA_function_defined(FunctionRNA *func)
int RNA_property_enum_get_default(PointerRNA *ptr, PropertyRNA *prop)
PropertyScaleType
Definition RNA_types.hh:251
int RNA_enum_from_identifier(const EnumPropertyItem *item, const char *identifier)
bool RNA_property_anim_editable(const PointerRNA *ptr, PropertyRNA *prop_orig)
void RNA_property_string_set(PointerRNA *ptr, PropertyRNA *prop, const char *value)
std::optional< StringRefNull > RNA_translate_ui_text(const char *text, const char *text_ctxt, StructRNA *type, PropertyRNA *prop, int translate)
void RNA_collection_clear(PointerRNA *ptr, const char *name)
StructRNA * RNA_property_pointer_type(PointerRNA *ptr, PropertyRNA *prop)
bool RNA_enum_name_from_value(const EnumPropertyItem *item, int value, const char **r_name)
eStringPropertySearchFlag
Definition RNA_types.hh:869
int RNA_property_tags(PropertyRNA *prop)
IDProperty * RNA_struct_system_idprops(PointerRNA *ptr, bool create)
void RNA_property_int_get_array(PointerRNA *ptr, PropertyRNA *prop, int *values)
BMesh const char void * data
std::string RNA_pointer_as_string_keywords(bContext *C, PointerRNA *ptr, const bool as_function, const bool all_args, const bool nested_args, const int max_prop_length)
void RNA_property_collection_end(CollectionPropertyIterator *iter)
void RNA_int_get_array(PointerRNA *ptr, const char *name, int *values)
bool RNA_property_is_set_ex(PointerRNA *ptr, PropertyRNA *prop, bool use_ghost)
void RNA_property_enum_items_ex(bContext *C, PointerRNA *ptr, PropertyRNA *prop, const bool use_static, const EnumPropertyItem **r_item, int *r_totitem, bool *r_free)
IDProperty * RNA_struct_idprops(PointerRNA *ptr, bool create)
bool RNA_enum_name(const EnumPropertyItem *item, const int value, const char **r_name)
bool(*)(Main *bmain, StructRNA *type) StructUnregisterFunc
bool RNA_property_boolean_get_index(PointerRNA *ptr, PropertyRNA *prop, int index)
std::string RNA_function_as_string_keywords(bContext *C, FunctionRNA *func, const bool as_function, const bool all_args, const int max_prop_length)
bool RNA_path_resolved_create(PointerRNA *ptr, PropertyRNA *prop, const int prop_index, PathResolvedRNA *r_anim_rna)
bool RNA_struct_contains_property(PointerRNA *ptr, PropertyRNA *prop_test)
int RNA_parameter_dynamic_length_get(ParameterList *parms, PropertyRNA *parm)
void RNA_property_unset(PointerRNA *ptr, PropertyRNA *prop)
char RNA_property_array_item_char(PropertyRNA *prop, int index)
bool RNA_enum_icon_from_value(const EnumPropertyItem *item, int value, int *r_icon)
int RNA_property_flag(PropertyRNA *prop)
bool RNA_struct_override_matches(Main *bmain, PointerRNA *ptr_local, PointerRNA *ptr_reference, const char *root_path, const size_t root_path_len, IDOverrideLibrary *liboverride, const eRNAOverrideMatch flags, eRNAOverrideMatchResult *r_report_flags)
int RNA_property_float_clamp(PointerRNA *ptr, PropertyRNA *prop, float *value)
bool RNA_property_collection_lookup_string(PointerRNA *ptr, PropertyRNA *prop, const char *key, PointerRNA *r_ptr)
const char * RNA_function_identifier(FunctionRNA *func)
void _RNA_warning(const char *format,...)
const char * RNA_property_ui_description_raw(const PropertyRNA *prop, const PointerRNA *ptr)
RawPropertyType RNA_property_raw_type(PropertyRNA *prop)
int RNA_parameter_list_size(const ParameterList *parms)
IDOverrideLibraryProperty * RNA_property_override_property_find(Main *bmain, PointerRNA *ptr, PropertyRNA *prop, ID **r_owner_id)
bool RNA_property_is_idprop(const PropertyRNA *prop)
bool RNA_struct_property_is_set(PointerRNA *ptr, const char *identifier)
void RNA_struct_py_type_set(StructRNA *srna, void *py_type)
bool RNA_property_enum_item_from_value_gettexted(bContext *C, PointerRNA *ptr, PropertyRNA *prop, const int value, EnumPropertyItem *r_item)
PointerRNA RNA_pointer_create_discrete(ID *id, StructRNA *type, void *data)
PropertyRNA * RNA_struct_type_find_property(StructRNA *srna, const char *identifier)
bool RNA_property_update_check(PropertyRNA *prop)
void RNA_property_boolean_set_array_at_most(PointerRNA *ptr, PropertyRNA *prop, const bool *values, int values_num)
void RNA_property_enum_items_gettexted(bContext *C, PointerRNA *ptr, PropertyRNA *prop, const EnumPropertyItem **r_item, int *r_totitem, bool *r_free)
const char * RNA_struct_ui_description_raw(const StructRNA *type)
void RNA_property_float_set_array_at_most(PointerRNA *ptr, PropertyRNA *prop, const float *values, int values_num)
ATTR_WARN_UNUSED_RESULT const size_t num
eRNAOverrideStatus RNA_property_override_library_status(Main *bmain, PointerRNA *ptr, PropertyRNA *prop, const int index)
bool RNA_boolean_get(PointerRNA *ptr, const char *name)
void RNA_property_collection_skip(CollectionPropertyIterator *iter, int num)
bool RNA_enum_id_from_value(const EnumPropertyItem *item, int value, const char **r_identifier)
void RNA_property_pointer_add(PointerRNA *ptr, PropertyRNA *prop)
PropertyRNA * RNA_struct_name_property(const StructRNA *type)
bool RNA_property_collection_lookup_int_has_fn(PropertyRNA *prop)
int RNA_property_array_dimension(const PointerRNA *ptr, PropertyRNA *prop, int length[])
bool RNA_property_overridden(PointerRNA *ptr, PropertyRNA *prop)
bool RNA_struct_system_idprops_unset(PointerRNA *ptr, const char *identifier)
int RNA_parameter_list_arg_count(const ParameterList *parms)
void RNA_float_set(PointerRNA *ptr, const char *name, float value)
void RNA_boolean_set(PointerRNA *ptr, const char *name, bool value)
PointerRNA RNA_pointer_get(PointerRNA *ptr, const char *name)
std::optional< std::string > RNA_property_string_path_filter(const bContext *C, PointerRNA *ptr, PropertyRNA *prop)
bool RNA_property_enum_item_from_value(bContext *C, PointerRNA *ptr, PropertyRNA *prop, const int value, EnumPropertyItem *r_item)
int RNA_struct_ui_icon(const StructRNA *type)
bool RNA_struct_is_ID(const StructRNA *type)
int RNA_string_length(PointerRNA *ptr, const char *name)
void RNA_parameter_get_lookup(ParameterList *parms, const char *identifier, void **r_value)
const DeprecatedRNA * RNA_property_deprecated(const PropertyRNA *prop)
void RNA_boolean_set_array(PointerRNA *ptr, const char *name, const bool *values)
bool RNA_struct_system_idprops_register_check(const StructRNA *type)
int RNA_property_enum_step(const bContext *C, PointerRNA *ptr, PropertyRNA *prop, int from_value, int step)
const char * RNA_struct_identifier(const StructRNA *type)
void RNA_property_int_ui_range(PointerRNA *ptr, PropertyRNA *prop, int *softmin, int *softmax, int *step)
void RNA_struct_state_owner_set(const char *name)
bool RNA_enum_value_from_identifier(const EnumPropertyItem *item, const char *identifier, int *r_value)
void RNA_property_collection_next(CollectionPropertyIterator *iter)
int RNA_property_string_default_length(PointerRNA *ptr, PropertyRNA *prop)
float RNA_property_float_get(PointerRNA *ptr, PropertyRNA *prop)
PropertySubType RNA_property_subtype(PropertyRNA *prop)
const char * RNA_struct_ui_description(const StructRNA *type)
bool RNA_enum_name_gettexted(const EnumPropertyItem *item, int value, const char *translation_context, const char **r_name)
bool RNA_property_collection_is_empty(PointerRNA *ptr, PropertyRNA *prop)
int RNA_parameter_flag(PropertyRNA *prop)
bool RNA_struct_bl_idname_ok_or_report(ReportList *reports, const char *identifier, const char *sep)
const StructRNA * RNA_struct_base_child_of(const StructRNA *type, const StructRNA *parent_type)
bool RNA_property_int_set_default(PropertyRNA *prop, int value)
float RNA_property_float_get_default(PointerRNA *ptr, PropertyRNA *prop)
void RNA_struct_blender_type_set(StructRNA *srna, void *blender_type)
StructRNA *(*)(Main *bmain, ReportList *reports, void *data, const char *identifier, StructValidateFunc validate, StructCallbackFunc call, StructFreeFunc free) StructRegisterFunc
int RNA_property_collection_raw_set(ReportList *reports, PointerRNA *ptr, PropertyRNA *prop, const char *propname, void *array, RawPropertyType type, int len)
StructRNA * RNA_struct_base(StructRNA *type)
void RNA_ensure_and_sync_system_properties(Main &bmain, PointerRNA &ptr, IDProperty &idprops)
char * RNA_struct_name_get_alloc_ex(PointerRNA *ptr, char *fixedbuf, int fixedlen, int *r_len, PropertyRNA **r_nameprop)
IDOverrideLibraryProperty * RNA_property_override_property_get(Main *bmain, PointerRNA *ptr, PropertyRNA *prop, bool *r_created)
void RNA_property_collection_clear(PointerRNA *ptr, PropertyRNA *prop)
const char * RNA_property_ui_description(const PropertyRNA *prop, const PointerRNA *ptr)
std::optional< PointerRNA > RNA_property_collection_type_get(PointerRNA *ptr, PropertyRNA *prop)
int RNA_function_call(bContext *C, ReportList *reports, PointerRNA *ptr, FunctionRNA *func, ParameterList *parms)
std::string RNA_pointer_as_string_keywords_ex(bContext *C, PointerRNA *ptr, const bool as_function, const bool all_args, const bool nested_args, const int max_prop_length, PropertyRNA *iterprop)
bool RNA_enum_description(const EnumPropertyItem *item, const int value, const char **r_description)
int RNA_property_int_get_default(PointerRNA *ptr, PropertyRNA *prop)
bool RNA_property_collection_lookup_string_supported(PropertyRNA *prop)
void RNA_parameter_set_lookup(ParameterList *parms, const char *identifier, const void *value)
void RNA_property_enum_set(PointerRNA *ptr, PropertyRNA *prop, int value)
bool RNA_property_collection_lookup_int(PointerRNA *ptr, PropertyRNA *prop, int key, PointerRNA *r_ptr)
PointerRNA RNA_pointer_create_id_subdata(ID &id, StructRNA *type, void *data)
void RNA_property_float_get_default_array(PointerRNA *ptr, PropertyRNA *prop, float *values)
bool RNA_property_collection_lookup_string_has_nameprop(PropertyRNA *prop)
IDOverrideLibraryPropertyOperation * RNA_property_override_property_operation_find(Main *bmain, PointerRNA *ptr, PropertyRNA *prop, const int index, const bool strict, bool *r_strict)
bool RNA_property_editable(const PointerRNA *ptr, PropertyRNA *prop)
Span< std::unique_ptr< FunctionRNA > > RNA_struct_type_functions(StructRNA *srna)
PointerRNA RNA_pointer_create_with_parent(const PointerRNA &parent, StructRNA *type, void *data)
int RNA_property_int_clamp(PointerRNA *ptr, PropertyRNA *prop, int *value)
int RNA_property_multi_array_length(PointerRNA *ptr, PropertyRNA *prop, int dimension)
void RNA_property_boolean_set(PointerRNA *ptr, PropertyRNA *prop, bool value)
int RNA_property_ui_icon(const PropertyRNA *prop)
bool RNA_property_animated(PointerRNA *ptr, PropertyRNA *prop)
bool RNA_property_collection_lookup_string_index(PointerRNA *ptr, PropertyRNA *prop, const char *key, PointerRNA *r_ptr, int *r_index)
bool RNA_collection_is_empty(PointerRNA *ptr, const char *name)
void RNA_pointer_set(PointerRNA *ptr, const char *name, PointerRNA ptr_value)
int RNA_enum_from_name(const EnumPropertyItem *item, const char *name)
void RNA_property_int_set_index(PointerRNA *ptr, PropertyRNA *prop, int index, int value)
void RNA_property_float_ui_range(PointerRNA *ptr, PropertyRNA *prop, float *softmin, float *softmax, float *step, float *precision)
size_t RNA_raw_type_sizeof(RawPropertyType type)
void RNA_property_float_set_index(PointerRNA *ptr, PropertyRNA *prop, int index, float value)
bool RNA_enum_identifier(const EnumPropertyItem *item, const int value, const char **r_identifier)
std::string RNA_string_get(PointerRNA *ptr, const char *name)
void RNA_parameter_list_begin(ParameterList *parms, ParameterIterator *iter)
bool RNA_property_boolean_get_default_index(PointerRNA *ptr, PropertyRNA *prop, int index)
void RNA_property_boolean_set_index(PointerRNA *ptr, PropertyRNA *prop, int index, bool value)
void RNA_property_boolean_get_array_at_most(PointerRNA *ptr, PropertyRNA *prop, bool *values, int values_num)
PropertyRNA * RNA_struct_find_collection_property_check(PointerRNA &props, const char *name, const StructRNA *struct_type_check)
int RNA_property_string_maxlength(PropertyRNA *prop)
int RNA_property_int_get(PointerRNA *ptr, PropertyRNA *prop)
char * RNA_property_string_get_default_alloc(PointerRNA *ptr, PropertyRNA *prop, char *fixedbuf, int fixedlen, int *r_len)
IDProperty ** RNA_struct_idprops_p(PointerRNA *ptr)
void RNA_property_int_range(PointerRNA *ptr, PropertyRNA *prop, int *hardmin, int *hardmax)
int RNA_property_int_get_default_index(PointerRNA *ptr, PropertyRNA *prop, int index)
eStringPropertySearchFlag RNA_property_string_search_flag(PropertyRNA *prop)
void RNA_property_boolean_get_default_array(PointerRNA *ptr, PropertyRNA *prop, bool *values)
void RNA_collection_add(PointerRNA *ptr, const char *name, PointerRNA *r_value)
int RNA_property_collection_raw_array(PointerRNA *ptr, PropertyRNA *prop, PropertyRNA *itemprop, bool set, RawArray *array)
bool RNA_struct_in_public_namespace(const StructRNA *type)
bool RNA_property_pointer_poll(PointerRNA *ptr, PropertyRNA *prop, PointerRNA *value)
bool RNA_struct_override_store(Main *bmain, PointerRNA *ptr_local, PointerRNA *ptr_reference, PointerRNA *ptr_storage, IDOverrideLibrary *liboverride)
bool RNA_property_boolean_get_default(PointerRNA *ptr, PropertyRNA *prop)
float RNA_float_get(PointerRNA *ptr, const char *name)
int RNA_property_int_get_index(PointerRNA *ptr, PropertyRNA *prop, int index)
void RNA_enum_set_identifier(bContext *C, PointerRNA *ptr, const char *name, const char *id)
bool RNA_property_is_set(PointerRNA *ptr, PropertyRNA *prop)
const char * RNA_property_ui_name(const PropertyRNA *prop, const PointerRNA *ptr)
const ListBaseT< PropertyRNA > * RNA_function_defined_parameters(FunctionRNA *func)
void RNA_float_get_array(PointerRNA *ptr, const char *name, float *values)
void RNA_parameter_list_free(ParameterList *parms)
bool RNA_property_copy(Main *bmain, PointerRNA *ptr, PointerRNA *fromptr, PropertyRNA *prop, int index, IDOverrideLibraryProperty *removed_oprop, IDOverrideLibraryPropertyOperation *removed_opop)
const char * RNA_struct_translation_context(const StructRNA *type)
bool RNA_property_path_from_ID_check(PointerRNA *ptr, PropertyRNA *prop)
int RNA_collection_length(PointerRNA *ptr, const char *name)
void RNA_property_enum_items_gettexted_all(bContext *C, PointerRNA *ptr, PropertyRNA *prop, const EnumPropertyItem **r_item, int *r_totitem, bool *r_free)
void RNA_property_int_set_array_at_most(PointerRNA *ptr, PropertyRNA *prop, const int *values, int values_num)
void RNA_property_float_range(PointerRNA *ptr, PropertyRNA *prop, float *hardmin, float *hardmax)
std::string RNA_property_as_string(bContext *C, PointerRNA *ptr, PropertyRNA *prop, int index, int max_prop_length)
bool RNA_property_editable_index(const PointerRNA *ptr, PropertyRNA *prop, const int index)
StructRegisterFunc RNA_struct_register(StructRNA *type)
BlenderRNA RNA_blender_rna_get()
bool RNA_property_is_unlink(PropertyRNA *prop)
bool RNA_property_equals(Main *bmain, PointerRNA *ptr_a, PointerRNA *ptr_b, PropertyRNA *prop, eRNACompareMode mode)
void * RNA_property_py_data_get(PropertyRNA *prop)