Blender
V3.3
|
#include "RNA_types.h"
Go to the source code of this file.
Classes | |
struct | PropertyElemRNA |
Typedefs | |
typedef struct PropertyElemRNA | PropertyElemRNA |
RNA paths are a way to refer to pointers and properties with a string, using a syntax like: scenes[0].objects["Cube"].data.verts[7].co
This provides a way to refer to RNA data while being detached from any particular pointers, which is useful in a number of applications, like UI code or Actions, though efficiency is a concern.
Definition in file RNA_path.h.
typedef struct PropertyElemRNA PropertyElemRNA |
Definition at line 148 of file RNA_path.h.
Find the actual ID pointer and path from it to the given ID.
id | ID reference to search the global owner for. | |
[out] | r_path | Path from the real ID to the initial ID. |
Definition at line 919 of file rna_path.cc.
References BKE_idtype_get_info_from_id(), BLI_assert_msg, ID::flag, GS, id, ID_GR, ID_NT, LIB_EMBEDDED_DATA, ID::name, NULL, and IDTypeInfo::owner_get.
Referenced by RNA_path_full_ID_py(), rna_prepend_real_ID_path(), and rna_property_override_property_real_id_owner().
char* RNA_path_append | ( | const char * | path, |
const PointerRNA * | ptr, | ||
PropertyRNA * | prop, | ||
int | intkey, | ||
const char * | strkey | ||
) |
const char* RNA_path_array_index_token_find | ( | const char * | rna_path, |
const PropertyRNA * | array_prop | ||
) |
Search for the start of the 'rna array index' part of the given rna_path
.
Given the root RNA pointer and resolved RNA property, and the RNA path, return the first character in rna_path
that is part of the array index for the given property. Return NULL if none can be found, e.g. because the property is not an RNA array.
array_prop | if not NULL, the PropertyRNA assumed to be the last one from the RNA path. Only used to ensure it is a valid array property. |
Definition at line 693 of file rna_path.cc.
References PropertyRNA::arraydimension, BLI_assert, ELEM, NULL, PROP_BOOLEAN, PROP_FLOAT, PROP_INT, PropertyRNA::type, and UNLIKELY.
Referenced by BKE_lib_override_library_property_is_animated().
char* RNA_path_from_ID_to_property | ( | const PointerRNA * | ptr, |
PropertyRNA * | prop | ||
) |
Definition at line 1127 of file rna_path.cc.
References ptr, and RNA_path_from_ID_to_property_index().
Referenced by add_driver_button_invoke(), add_driver_button_none(), add_keyingset_button_exec(), ANIM_channel_draw_widgets(), BKE_fcurve_find_by_rna_context_ui(), BKE_keyblock_curval_rnapath_get(), clear_key_button_exec(), copy_as_driver_button_poll(), copy_data_path_button_exec(), copy_data_path_button_poll(), copy_driver_button_exec(), delete_key_button_exec(), driverdropper_sample(), ED_autokeyframe_property(), followpath_path_animate_exec(), id_data_find_fcurve(), insert_key_button_exec(), paste_driver_button_exec(), pyrna_prop_path_from_id(), pyrna_struct_anim_args_parse_ex(), pyrna_struct_path_from_id(), remove_driver_button_exec(), remove_keyingset_button_exec(), RNA_path_full_property_py_ex(), RNA_path_resolve_from_type_to_property(), RNA_path_struct_property_py(), RNA_property_overridden(), rna_property_override_property_real_id_owner(), RNA_property_path_from_ID_check(), RNA_struct_override_matches(), ui_but_anim_expression_create(), and UI_context_copy_to_selected_list().
char* RNA_path_from_ID_to_property_index | ( | const PointerRNA * | ptr, |
PropertyRNA * | prop, | ||
int | index_dim, | ||
int | index | ||
) |
index_dim | The dimension to show, 0 disables. 1 for 1d array, 2 for 2d. etc. |
index | The flattened index to use when index_dim > 0, this is expanded when used with multi-dimensional arrays. |
Definition at line 1071 of file rna_path.cc.
References BLI_sprintfN(), BLI_str_escape(), PointerRNA::data, IDP_Chain::index, PropertyRNA::magic, MAX_IDPROP_NAME, MEM_freeN, NULL, PointerRNA::owner_id, ptr, RNA_MAGIC, RNA_MAX_ARRAY_LENGTH, rna_path_array_multi_string_from_flat_index(), RNA_path_from_ID_to_struct(), RNA_property_identifier(), RNA_struct_is_ID(), and PointerRNA::type.
Referenced by RNA_path_from_ID_to_property(), and RNA_path_from_real_ID_to_property_index().
char* RNA_path_from_ID_to_struct | ( | const PointerRNA * | ptr | ) |
Definition at line 981 of file rna_path.cc.
References BLI_strdup(), PointerRNA::data, StructRNA::nested, NULL, PointerRNA::owner_id, StructRNA::path, ptr, RNA_id_pointer_create(), rna_path_from_ID_to_idpgroup(), RNA_property_identifier(), RNA_PropertyGroup, rna_struct_find_nested(), RNA_struct_is_a(), RNA_struct_is_ID(), and PointerRNA::type.
Referenced by action_get_item_transforms(), DEG_get_evaluated_rna_pointer(), fcurves_to_pchan_links_get(), blender::ed::space_node::node_group_make_insert_selected(), blender::ed::space_node::node_group_separate_selected(), blender::ed::space_node::node_group_ungroup(), pyrna_struct_anim_args_parse_no_resolve(), pyrna_struct_path_from_id(), RNA_path_from_ID_to_property_index(), RNA_path_from_real_ID_to_struct(), RNA_path_full_struct_py(), RNA_path_resolve_from_type_to_property(), WM_context_path_resolve_property_full(), and WM_msg_subscribe_rna_params().
char* RNA_path_from_real_ID_to_property_index | ( | struct Main * | bmain, |
const PointerRNA * | ptr, | ||
PropertyRNA * | prop, | ||
int | index_dim, | ||
int | index, | ||
struct ID ** | r_real_id | ||
) |
Definition at line 1132 of file rna_path.cc.
References IDP_Chain::index, NULL, PointerRNA::owner_id, ptr, RNA_path_from_ID_to_property_index(), and rna_prepend_real_ID_path().
Referenced by copy_as_driver_button_exec(), copy_data_path_button_exec(), and pyrna_prop_repr_ex().
char* RNA_path_from_real_ID_to_struct | ( | struct Main * | bmain, |
const PointerRNA * | ptr, | ||
struct ID ** | r_real | ||
) |
Definition at line 1023 of file rna_path.cc.
References PointerRNA::owner_id, ptr, RNA_path_from_ID_to_struct(), and rna_prepend_real_ID_path().
Referenced by pyrna_struct_repr().
char* RNA_path_from_struct_to_idproperty | ( | PointerRNA * | ptr, |
struct IDProperty * | needle | ||
) |
Find the path from the structure referenced by the pointer to the runtime RNA-defined IDProperty object.
ptr | Reference to the object owning the custom property storage. |
needle | Custom property object to find. |
Definition at line 893 of file rna_path.cc.
References NULL, ptr, rna_idp_path(), and RNA_struct_idprops().
Referenced by rna_path_from_ID_to_idpgroup(), and UI_context_copy_to_selected_list().
Get the ID as a python representation, eg: bpy.data.foo["bar"]
Definition at line 1182 of file rna_path.cc.
References BKE_idtype_idcode_to_name_plural(), BLI_sprintfN(), BLI_str_escape(), Library::filepath, GS, id, ID_IS_LINKED, ID::lib, ID::name, and RNA_find_real_ID_and_path().
Referenced by id_drop_copy(), RNA_path_full_property_py_ex(), RNA_path_full_struct_py(), rna_pointer_as_string__bldata(), and text_drop_paste().
char* RNA_path_full_property_py | ( | struct Main * | bmain, |
const PointerRNA * | ptr, | ||
PropertyRNA * | prop, | ||
int | index | ||
) |
Definition at line 1293 of file rna_path.cc.
References IDP_Chain::index, ptr, and RNA_path_full_property_py_ex().
Referenced by WM_prop_pystring_assign().
char* RNA_path_full_property_py_ex | ( | struct Main * | bmain, |
const PointerRNA * | ptr, | ||
PropertyRNA * | prop, | ||
int | index, | ||
bool | use_fallback | ||
) |
Get the ID.struct.property as a python representation, eg: bpy.data.foo["bar"].some_struct.some_prop[10]
Definition at line 1245 of file rna_path.cc.
References BLI_sprintfN(), IDP_Chain::index, MEM_freeN, NULL, PointerRNA::owner_id, ptr, ret, RNA_path_from_ID_to_property(), RNA_path_full_ID_py(), RNA_property_array_check(), and RNA_property_identifier().
Referenced by copy_data_path_button_exec(), RNA_path_full_property_py(), and ui_tooltip_data_from_button_or_extra_icon().
char* RNA_path_full_struct_py | ( | struct Main * | bmain, |
const PointerRNA * | ptr | ||
) |
Get the ID.struct as a python representation, eg: bpy.data.foo["bar"].some_struct
Definition at line 1217 of file rna_path.cc.
References BLI_sprintfN(), MEM_freeN, NULL, PointerRNA::owner_id, ptr, ret, RNA_path_from_ID_to_struct(), and RNA_path_full_ID_py().
Referenced by copy_data_path_button_exec(), rna_pointer_as_string__bldata(), and ui_tooltip_data_from_button_or_extra_icon().
char* RNA_path_property_py | ( | const PointerRNA * | ptr, |
PropertyRNA * | prop, | ||
int | index | ||
) |
Get the struct.property as a python representation, eg: some_prop[10]
bool RNA_path_resolve | ( | const PointerRNA * | ptr, |
const char * | path, | ||
PointerRNA * | r_ptr, | ||
PropertyRNA ** | r_prop | ||
) |
Resolve the given RNA Path to find the pointer and/or property indicated by fully resolving the path.
Definition at line 503 of file rna_path.cc.
References PointerRNA::data, NULL, ptr, and rna_path_parse().
Referenced by DEG_get_evaluated_rna_pointer(), drw_uniform_property_lookup(), lookup_property(), radial_control_get_path(), RNA_property_path_from_ID_check(), UI_pie_menu_invoke_from_rna_enum(), and wm_msg_rna_update_by_id().
bool RNA_path_resolve_elements | ( | PointerRNA * | ptr, |
const char * | path, | ||
struct ListBase * | r_elements | ||
) |
Resolve the given RNA Path into a linked list of PropertyElemRNA's.
To be used when complex operations over path are needed, like e.g. get relative paths, to avoid too much string operations.
Definition at line 579 of file rna_path.cc.
References NULL, ptr, and rna_path_parse().
Referenced by blender::ed::outliner::OverrideRNAPathTreeBuilder::build_path(), and RNA_path_resolve_from_type_to_property().
char* RNA_path_resolve_from_type_to_property | ( | const PointerRNA * | ptr, |
PropertyRNA * | prop, | ||
const struct StructRNA * | type | ||
) |
bool RNA_path_resolve_full | ( | const PointerRNA * | ptr, |
const char * | path, | ||
PointerRNA * | r_ptr, | ||
PropertyRNA ** | r_prop, | ||
int * | r_index | ||
) |
Resolve the given RNA Path to find the pointer and/or property + array index indicated by fully resolving the path.
Definition at line 515 of file rna_path.cc.
References PointerRNA::data, NULL, ptr, and rna_path_parse().
Referenced by BCAnimationCurve::add_value_from_rna(), blender::deg::DepsgraphRelationBuilder::build_animdata_curves_targets(), blender::deg::DepsgraphRelationBuilder::build_driver_data(), blender::deg::DepsgraphNodeBuilder::build_driver_id_property(), blender::deg::DepsgraphRelationBuilder::build_driver_id_property(), driver_get_variable_property(), blender::deg::RNAPathKey::RNAPathKey(), and screen_user_menu_draw().
bool RNA_path_resolve_full_maybe_null | ( | const PointerRNA * | ptr, |
const char * | path, | ||
PointerRNA * | r_ptr, | ||
PropertyRNA ** | r_prop, | ||
int * | r_index | ||
) |
A version of RNA_path_resolve_full doesn't check the value of PointerRNA.data.
Definition at line 525 of file rna_path.cc.
References NULL, ptr, and rna_path_parse().
Referenced by pyrna_struct_path_resolve().
bool RNA_path_resolve_property | ( | const PointerRNA * | ptr, |
const char * | path, | ||
PointerRNA * | r_ptr, | ||
PropertyRNA ** | r_prop | ||
) |
Resolve the given RNA Path to find both the pointer AND property indicated by fully resolving the path.
This is a convenience method to avoid logic errors and ugly syntax.
Definition at line 531 of file rna_path.cc.
References PointerRNA::data, NULL, ptr, and rna_path_parse().
Referenced by achannel_setting_slider_cb(), achannel_setting_slider_shapekey_cb(), ANIM_add_driver(), ANIM_add_driver_with_target(), ANIM_apply_keyingset(), ANIM_channel_draw_widgets(), ANIM_copy_driver(), ANIM_list_elem_update(), ANIM_paste_driver(), ANIM_unit_mapping_get_factor(), BKE_animsys_rna_path_resolve(), blend_to_default_fcurve(), check_rna_path_is_valid(), clean_fcurve(), clear_keyframe(), delete_keyframe(), getname_anim_fcurve(), graph_panel_key_properties(), insert_keyframe(), insert_keyframe_direct(), lib_override_library_id_reset_do(), nlaevalchan_verify(), override_remove_button_exec(), pastebuf_match_path_property(), pose_propagate_get_refVal(), RNA_struct_find_property(), RNA_struct_override_apply(), RNA_struct_override_store(), UI_context_copy_to_selected_check(), and update_autoflags_fcurve().
bool RNA_path_resolve_property_and_item_pointer | ( | const PointerRNA * | ptr, |
const char * | path, | ||
PointerRNA * | r_ptr, | ||
PropertyRNA ** | r_prop, | ||
PointerRNA * | r_item_ptr | ||
) |
Resolve the given RNA Path to find both the pointer AND property indicated by fully resolving the path, and get the value of the Pointer property (or item of the collection).
This is a convenience method to avoid logic errors and ugly syntax, it combines both RNA_path_resolve and RNA_path_resolve_property in a single call.
r_item_ptr | The final Pointer or Collection item value. You must check for its validity before use! |
Definition at line 553 of file rna_path.cc.
References PointerRNA::data, NULL, ptr, and rna_path_parse().
Referenced by RNA_struct_override_apply().
bool RNA_path_resolve_property_and_item_pointer_full | ( | const PointerRNA * | ptr, |
const char * | path, | ||
PointerRNA * | r_ptr, | ||
PropertyRNA ** | r_prop, | ||
int * | r_index, | ||
PointerRNA * | r_item_ptr | ||
) |
Resolve the given RNA Path to find both the pointer AND property (as well as the array index) indicated by fully resolving the path, and get the value of the Pointer property (or item of the collection).
This is a convenience method to avoid logic errors and ugly syntax, it combines both RNA_path_resolve_full and RNA_path_resolve_property_full in a single call.
r_item_ptr | The final Pointer or Collection item value. You must check for its validity before use! |
Definition at line 566 of file rna_path.cc.
References PointerRNA::data, NULL, ptr, and rna_path_parse().
bool RNA_path_resolve_property_full | ( | const PointerRNA * | ptr, |
const char * | path, | ||
PointerRNA * | r_ptr, | ||
PropertyRNA ** | r_prop, | ||
int * | r_index | ||
) |
Resolve the given RNA Path to find the pointer AND property (as well as the array index) indicated by fully resolving the path.
This is a convenience method to avoid logic errors and ugly syntax.
Definition at line 543 of file rna_path.cc.
References PointerRNA::data, NULL, ptr, and rna_path_parse().
Referenced by BKE_lib_override_rna_property_find(), dtar_get_prop_val(), and pyrna_struct_anim_args_parse_ex().
char* RNA_path_struct_property_py | ( | PointerRNA * | ptr, |
PropertyRNA * | prop, | ||
int | index | ||
) |
Get the struct.property as a python representation, eg: some_struct.some_prop[10]
Definition at line 1298 of file rna_path.cc.
References BLI_sprintfN(), BLI_strdup(), IDP_Chain::index, MEM_freeN, NULL, PointerRNA::owner_id, ptr, ret, RNA_path_from_ID_to_property(), RNA_property_array_check(), RNA_property_identifier(), RNA_struct_find_property(), RNA_struct_is_ID(), and PointerRNA::type.