Blender V5.3
RNA_path.hh File Reference
#include <optional>
#include <string>
#include <variant>
#include <utility>
#include "DNA_listBase.h"
#include "RNA_types.hh"
#include "BLI_string_ref.hh"
#include "BLI_ustring.hh"

Go to the source code of this file.

Classes

struct  blender::RNAPath
struct  blender::rna_path::Member
struct  blender::rna_path::LookupIndex
struct  blender::rna_path::LookupKey
struct  blender::DefaultHash< rna_path::Item >
class  blender::ParsedRNAPath< N >
struct  blender::PropertyElemRNA

Namespaces

namespace  blender
 BMesh Iterators.
namespace  blender::rna_path

Typedefs

using blender::rna_path::Item = std::variant<Member, LookupIndex, LookupKey>
using blender::ParsedRNAPathRef = Span<rna_path::Item>

Functions

std::string blender::rna_path::to_string (const Span< Item > items)
bool blender::operator== (const RNAPath &left, const RNAPath &right)
char * blender::RNA_path_append (const char *path, const PointerRNA *, PropertyRNA *prop, int intkey, const char *strkey)
const char * blender::RNA_path_array_index_token_find (const char *rna_path, const PropertyRNA *array_prop)
bool blender::RNA_path_resolve (const PointerRNA *ptr, const char *path, PointerRNA *r_ptr, PropertyRNA **r_prop)
bool blender::RNA_path_resolve_full (const PointerRNA *ptr, const char *path, PointerRNA *r_ptr, PropertyRNA **r_prop, int *r_index)
bool blender::RNA_path_resolve_full_maybe_null (const PointerRNA *ptr, const char *path, PointerRNA *r_ptr, PropertyRNA **r_prop, int *r_index)
bool blender::RNA_path_resolve_property (const PointerRNA *ptr, const char *path, PointerRNA *r_ptr, PropertyRNA **r_prop)
bool blender::RNA_path_resolve_property (const PointerRNA *ptr, ParsedRNAPathRef path, PointerRNA *r_ptr, PropertyRNA **r_prop)
bool blender::RNA_path_resolve_property_full (const PointerRNA *ptr, const char *path, PointerRNA *r_ptr, PropertyRNA **r_prop, int *r_index)
bool blender::RNA_path_resolve_property_and_item_pointer (const PointerRNA *ptr, const char *path, PointerRNA *r_ptr, PropertyRNA **r_prop, PointerRNA *r_item_ptr)
bool blender::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)
bool blender::RNA_path_resolve_elements (PointerRNA *ptr, const char *path, Vector< PropertyElemRNA > *r_elements)
std::optional< std::string > blender::RNA_path_from_struct_to_idproperty (PointerRNA *ptr, const IDProperty *needle)
ID * blender::RNA_find_real_ID_and_path (ID *id, const char **r_path)
std::optional< std::string > blender::RNA_path_from_ID_to_struct (const PointerRNA *ptr)
std::optional< std::string > blender::RNA_path_from_real_ID_to_struct (Main *bmain, const PointerRNA *ptr, ID **r_real)
std::optional< std::string > blender::RNA_path_from_ID_to_property (const PointerRNA *ptr, PropertyRNA *prop)
std::string blender::RNA_path_from_ptr_to_property_index (const PointerRNA *ptr, PropertyRNA *prop, int index_dim, int index)
std::optional< std::string > blender::RNA_path_from_ID_to_property_index (const PointerRNA *ptr, PropertyRNA *prop, int index_dim, int index)
std::optional< std::string > blender::RNA_path_from_real_ID_to_property_index (Main *bmain, const PointerRNA *ptr, PropertyRNA *prop, int index_dim, int index, ID **r_real_id)
std::optional< std::string > blender::RNA_path_resolve_from_type_to_property (const PointerRNA *ptr, PropertyRNA *prop, const StructRNA *type)
std::string blender::RNA_path_full_ID_py (ID *id)
std::optional< std::string > blender::RNA_path_full_struct_py (const PointerRNA *ptr)
std::optional< std::string > blender::RNA_path_full_property_py_ex (const PointerRNA *ptr, PropertyRNA *prop, int index, bool use_fallback)
std::optional< std::string > blender::RNA_path_full_property_py (const PointerRNA *ptr, PropertyRNA *prop, int index)
std::optional< std::string > blender::RNA_path_struct_property_py (PointerRNA *ptr, PropertyRNA *prop, int index)
std::string blender::RNA_path_property_py (const PointerRNA *ptr, PropertyRNA *prop, int index)
std::string blender::RNA_path_name_to_infix (const StringRefNull string)
std::string blender::RNA_path_number_to_infix (const int number)
std::pair< std::string, std::string > blender::RNA_generate_keys_for_path_rename (const StringRefNull old_infix, const StringRefNull new_infix, const int old_subscript, const int new_subscript, const bool infix_is_name)

Detailed Description

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.hh.