Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorJulian Eisel <julian@blender.org>2021-07-20 21:00:04 +0300
committerJulian Eisel <julian@blender.org>2021-07-20 22:30:03 +0300
commit8ffc3ee25704c5df8dfdd2c282a2bcbab3a3e933 (patch)
tree45e4787e7c86c84bb035e8a3c5fd8db9b2312b71 /source
parentaeee7f390d935ca913dfa686a1ded7c3d2d57681 (diff)
Cleanup: Correct asset TODO comment, move setter next to getter
Diffstat (limited to 'source')
-rw-r--r--source/blender/makesrna/intern/rna_asset.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/source/blender/makesrna/intern/rna_asset.c b/source/blender/makesrna/intern/rna_asset.c
index 0020d90ba1a..3b39a4edb32 100644
--- a/source/blender/makesrna/intern/rna_asset.c
+++ b/source/blender/makesrna/intern/rna_asset.c
@@ -132,6 +132,14 @@ static PointerRNA rna_AssetHandle_file_data_get(PointerRNA *ptr)
return rna_pointer_inherit_refine(ptr, &RNA_FileSelectEntry, asset_handle->file_data);
}
+static void rna_AssetHandle_file_data_set(PointerRNA *ptr,
+ PointerRNA value,
+ struct ReportList *UNUSED(reports))
+{
+ AssetHandle *asset_handle = ptr->data;
+ asset_handle->file_data = value.data;
+}
+
static void rna_AssetHandle_get_full_library_path(
// AssetHandle *asset,
bContext *C,
@@ -150,14 +158,6 @@ static PointerRNA rna_AssetHandle_local_id_get(PointerRNA *ptr)
return rna_pointer_inherit_refine(ptr, &RNA_ID, id);
}
-static void rna_AssetHandle_file_data_set(PointerRNA *ptr,
- PointerRNA value,
- struct ReportList *UNUSED(reports))
-{
- AssetHandle *asset_handle = ptr->data;
- asset_handle->file_data = value.data;
-}
-
int rna_asset_library_reference_get(const AssetLibraryReference *library)
{
return ED_asset_library_reference_to_enum_value(library);
@@ -343,7 +343,9 @@ static void rna_def_asset_handle(BlenderRNA *brna)
srna = RNA_def_struct(brna, "AssetHandle", "PropertyGroup");
RNA_def_struct_ui_text(srna, "Asset Handle", "Reference to some asset");
- /* TODO why is this editable? There probably shouldn't be a setter. */
+ /* TODO It is super ugly to expose the file data here. We have to do it though so the asset view
+ * template can populate a RNA collection with asset-handles, which are just file entries
+ * currently. A proper design is being worked on. */
prop = RNA_def_property(srna, "file_data", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_EDITABLE);
RNA_def_property_struct_type(prop, "FileSelectEntry");