[Bf-blender-cvs] [245a704b7cb] asset-metadata: Support "Author" metadata field

Julian Eisel noreply at git.blender.org
Fri Jul 10 16:58:03 CEST 2020


Commit: 245a704b7cb3fe2a329286980b76fdb8947aa72e
Author: Julian Eisel
Date:   Fri Jul 10 15:14:26 2020 +0200
Branches: asset-metadata
https://developer.blender.org/rB245a704b7cb3fe2a329286980b76fdb8947aa72e

Support "Author" metadata field

===================================================================

M	source/blender/makesdna/DNA_asset_types.h
M	source/blender/makesrna/intern/rna_asset.c

===================================================================

diff --git a/source/blender/makesdna/DNA_asset_types.h b/source/blender/makesdna/DNA_asset_types.h
index ef42d1d475d..ab626d73be0 100644
--- a/source/blender/makesdna/DNA_asset_types.h
+++ b/source/blender/makesdna/DNA_asset_types.h
@@ -36,8 +36,11 @@ typedef struct CustomTag {
 typedef struct AssetData {
   /** Thumbnail image of the data-block. Duplicate of the referenced ID preview. */
   struct PreviewImage *preview;
+
   /** Optional description of this asset for display in the UI. Dynamic length. */
   char *description;
+  /** Optional name of the person that created this asset. */
+  char author[64]; /* MAX_NAME */
   /** User defined tags for this asset. The asset manager uses these for filtering, but how they
    * function exactly (e.g. how they are registered to provide a list of searchable available tags)
    * is up to the asset-engine. */
diff --git a/source/blender/makesrna/intern/rna_asset.c b/source/blender/makesrna/intern/rna_asset.c
index f7a1c0acb03..32725739cde 100644
--- a/source/blender/makesrna/intern/rna_asset.c
+++ b/source/blender/makesrna/intern/rna_asset.c
@@ -161,6 +161,10 @@ static void rna_def_asset_data(BlenderRNA *brna)
   RNA_def_property_ui_text(
       prop, "Description", "A description of the asset to be displayed for the user");
 
+  prop = RNA_def_property(srna, "author", PROP_STRING, PROP_NONE);
+  RNA_def_property_string_maxlength(prop, MAX_NAME);
+  RNA_def_property_ui_text(prop, "Author", "Name of the person responsible for the asset");
+
   prop = RNA_def_property(srna, "tags", PROP_COLLECTION, PROP_NONE);
   RNA_def_property_struct_type(prop, "CustomTag");
   RNA_def_property_flag(prop, PROP_EDITABLE);



More information about the Bf-blender-cvs mailing list