diff --git a/source/blender/makesrna/intern/rna_armature.cc b/source/blender/makesrna/intern/rna_armature.cc index b7ce6cd6f2a..62a5c1f5d2e 100644 --- a/source/blender/makesrna/intern/rna_armature.cc +++ b/source/blender/makesrna/intern/rna_armature.cc @@ -811,6 +811,15 @@ static IDProperty **rna_Bone_system_idprops(PointerRNA *ptr) return &bone->system_properties; } +static std::optional rna_EditBone_path(const PointerRNA *ptr) +{ + EditBone *ebone = static_cast(ptr->data); + char name_esc[sizeof(ebone->name) * 2]; + + BLI_str_escape(name_esc, ebone->name, sizeof(name_esc)); + return fmt::format("edit_bones[\"{}\"]", name_esc); +} + static IDProperty **rna_EditBone_idprops(PointerRNA *ptr) { EditBone *ebone = static_cast(ptr->data); @@ -1867,6 +1876,7 @@ static void rna_def_edit_bone(BlenderRNA *brna) srna = RNA_def_struct(brna, "EditBone", nullptr); RNA_def_struct_sdna(srna, "EditBone"); + RNA_def_struct_path_func(srna, "rna_EditBone_path"); RNA_def_struct_idprops_func(srna, "rna_EditBone_idprops"); RNA_def_struct_system_idprops_func(srna, "rna_EditBone_system_idprops"); RNA_def_struct_ui_text(srna, "Edit Bone", "Edit mode bone in an armature data-block");