Changeset View
Changeset View
Standalone View
Standalone View
source/blender/makesrna/intern/rna_ID.c
| Show First 20 Lines • Show All 1,930 Lines • ▼ Show 20 Lines | static void rna_def_ID(BlenderRNA *brna) | ||||
| RNA_def_property_ui_text(prop, "Is Indirect", "Is this ID block linked indirectly"); | RNA_def_property_ui_text(prop, "Is Indirect", "Is this ID block linked indirectly"); | ||||
| prop = RNA_def_property(srna, "library", PROP_POINTER, PROP_NONE); | prop = RNA_def_property(srna, "library", PROP_POINTER, PROP_NONE); | ||||
| RNA_def_property_pointer_sdna(prop, NULL, "lib"); | RNA_def_property_pointer_sdna(prop, NULL, "lib"); | ||||
| RNA_def_property_clear_flag(prop, PROP_EDITABLE); | RNA_def_property_clear_flag(prop, PROP_EDITABLE); | ||||
| RNA_def_property_override_flag(prop, PROPOVERRIDE_NO_COMPARISON); | RNA_def_property_override_flag(prop, PROPOVERRIDE_NO_COMPARISON); | ||||
| RNA_def_property_ui_text(prop, "Library", "Library file the data-block is linked from"); | RNA_def_property_ui_text(prop, "Library", "Library file the data-block is linked from"); | ||||
| prop = RNA_def_pointer(srna, | |||||
| "library_weak_reference", | |||||
| "LibraryWeakReference", | |||||
| "Library Weak Reference", | |||||
| "Weak reference to a data-block in another library .blend file (used to " | |||||
| "re-use already appended data instead of appending new copies)"); | |||||
| RNA_def_property_clear_flag(prop, PROP_EDITABLE); | |||||
campbellbarton: Any reason not to make this editable? It's the kind of thing Python scripts could manipulate to… | |||||
mont29AuthorUnsubmitted Done Inline ActionsMain reason is that we'd need a way to ensure uniqueness of edited references then... possible but not high priority currently. mont29: Main reason is that we'd need a way to ensure uniqueness of edited references then... possible… | |||||
| RNA_def_property_override_flag(prop, PROPOVERRIDE_NO_COMPARISON); | |||||
| prop = RNA_def_property(srna, "asset_data", PROP_POINTER, PROP_NONE); | prop = RNA_def_property(srna, "asset_data", PROP_POINTER, PROP_NONE); | ||||
| RNA_def_property_clear_flag(prop, PROP_EDITABLE); | RNA_def_property_clear_flag(prop, PROP_EDITABLE); | ||||
| RNA_def_property_override_flag(prop, PROPOVERRIDE_NO_COMPARISON); | RNA_def_property_override_flag(prop, PROPOVERRIDE_NO_COMPARISON); | ||||
| RNA_def_property_ui_text(prop, "Asset Data", "Additional data for an asset data-block"); | RNA_def_property_ui_text(prop, "Asset Data", "Additional data for an asset data-block"); | ||||
| prop = RNA_def_pointer( | prop = RNA_def_pointer( | ||||
| srna, "override_library", "IDOverrideLibrary", "Library Override", "Library override data"); | srna, "override_library", "IDOverrideLibrary", "Library Override", "Library override data"); | ||||
| RNA_def_property_clear_flag(prop, PROP_EDITABLE); | RNA_def_property_clear_flag(prop, PROP_EDITABLE); | ||||
| ▲ Show 20 Lines • Show All 191 Lines • ▼ Show 20 Lines | static void rna_def_library(BlenderRNA *brna) | ||||
| RNA_def_property_clear_flag(prop, PROP_EDITABLE); | RNA_def_property_clear_flag(prop, PROP_EDITABLE); | ||||
| RNA_def_property_flag(prop, PROP_THICK_WRAP); | RNA_def_property_flag(prop, PROP_THICK_WRAP); | ||||
| func = RNA_def_function(srna, "reload", "WM_lib_reload"); | func = RNA_def_function(srna, "reload", "WM_lib_reload"); | ||||
| RNA_def_function_flag(func, FUNC_USE_REPORTS | FUNC_USE_CONTEXT); | RNA_def_function_flag(func, FUNC_USE_REPORTS | FUNC_USE_CONTEXT); | ||||
| RNA_def_function_ui_description(func, "Reload this library and all its linked data-blocks"); | RNA_def_function_ui_description(func, "Reload this library and all its linked data-blocks"); | ||||
| } | } | ||||
| static void rna_def_library_weak_reference(BlenderRNA *brna) | |||||
| { | |||||
| StructRNA *srna; | |||||
| PropertyRNA *prop; | |||||
| srna = RNA_def_struct(brna, "LibraryWeakReference", NULL); | |||||
| RNA_def_struct_ui_text( | |||||
| srna, | |||||
| "LibraryWeakReference", | |||||
| "Read-only external reference to a linked data-block and its library file"); | |||||
| prop = RNA_def_property(srna, "filepath", PROP_STRING, PROP_FILEPATH); | |||||
| RNA_def_property_string_sdna(prop, NULL, "library_filepath"); | |||||
| RNA_def_property_clear_flag(prop, PROP_EDITABLE); | |||||
| RNA_def_property_ui_text(prop, "File Path", "Path to the library .blend file"); | |||||
| prop = RNA_def_property(srna, "id_name", PROP_STRING, PROP_FILEPATH); | |||||
| RNA_def_property_string_sdna(prop, NULL, "library_id_name"); | |||||
| RNA_def_property_clear_flag(prop, PROP_EDITABLE); | |||||
| RNA_def_property_ui_text( | |||||
| prop, | |||||
| "ID name", | |||||
| "Full ID name in the library .blend file (including the two leading 'id type' chars)"); | |||||
| } | |||||
| /** | /** | ||||
| * \attention This is separate from the above. It allows for RNA functions to | * \attention This is separate from the above. It allows for RNA functions to | ||||
| * return an IDProperty *. See MovieClip.metadata for a usage example. | * return an IDProperty *. See MovieClip.metadata for a usage example. | ||||
| */ | */ | ||||
| static void rna_def_idproperty_wrap_ptr(BlenderRNA *brna) | static void rna_def_idproperty_wrap_ptr(BlenderRNA *brna) | ||||
| { | { | ||||
| StructRNA *srna; | StructRNA *srna; | ||||
| Show All 16 Lines | void RNA_def_ID(BlenderRNA *brna) | ||||
| RNA_def_struct_ui_text(srna, "Any Type", "RNA type used for pointers to any possible data"); | RNA_def_struct_ui_text(srna, "Any Type", "RNA type used for pointers to any possible data"); | ||||
| rna_def_ID(brna); | rna_def_ID(brna); | ||||
| rna_def_ID_override_library(brna); | rna_def_ID_override_library(brna); | ||||
| rna_def_image_preview(brna); | rna_def_image_preview(brna); | ||||
| rna_def_ID_properties(brna); | rna_def_ID_properties(brna); | ||||
| rna_def_ID_materials(brna); | rna_def_ID_materials(brna); | ||||
| rna_def_library(brna); | rna_def_library(brna); | ||||
| rna_def_library_weak_reference(brna); | |||||
| rna_def_idproperty_wrap_ptr(brna); | rna_def_idproperty_wrap_ptr(brna); | ||||
| } | } | ||||
| #endif | #endif | ||||
Any reason not to make this editable? It's the kind of thing Python scripts could manipulate to account for relocating projects - for e.g.