Changeset View
Changeset View
Standalone View
Standalone View
source/blender/makesrna/intern/rna_asset.c
| Show First 20 Lines • Show All 120 Lines • ▼ Show 20 Lines | |||||
| static void rna_AssetMetaData_active_tag_range( | static void rna_AssetMetaData_active_tag_range( | ||||
| PointerRNA *ptr, int *min, int *max, int *softmin, int *softmax) | PointerRNA *ptr, int *min, int *max, int *softmin, int *softmax) | ||||
| { | { | ||||
| const AssetMetaData *asset_data = ptr->data; | const AssetMetaData *asset_data = ptr->data; | ||||
| *min = *softmin = 0; | *min = *softmin = 0; | ||||
| *max = *softmax = MAX2(asset_data->tot_tags - 1, 0); | *max = *softmax = MAX2(asset_data->tot_tags - 1, 0); | ||||
| } | } | ||||
| static void rna_AssetMetaData_catalog_id_set(PointerRNA *ptr, const char *value) | |||||
| { | |||||
| AssetMetaData *asset_data = ptr->data; | |||||
| BKE_asset_metadata_catalog_id_set(asset_data, value); | |||||
| } | |||||
| static PointerRNA rna_AssetHandle_file_data_get(PointerRNA *ptr) | static PointerRNA rna_AssetHandle_file_data_get(PointerRNA *ptr) | ||||
| { | { | ||||
| AssetHandle *asset_handle = ptr->data; | AssetHandle *asset_handle = ptr->data; | ||||
| /* Have to cast away const, but the file entry API doesn't allow modifications anyway. */ | /* Have to cast away const, but the file entry API doesn't allow modifications anyway. */ | ||||
| return rna_pointer_inherit_refine( | return rna_pointer_inherit_refine( | ||||
| ptr, &RNA_FileSelectEntry, (FileDirEntry *)asset_handle->file_data); | ptr, &RNA_FileSelectEntry, (FileDirEntry *)asset_handle->file_data); | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 116 Lines • ▼ Show 20 Lines | RNA_def_property_ui_text(prop, | ||||
| "Tags", | "Tags", | ||||
| "Custom tags (name tokens) for the asset, used for filtering and " | "Custom tags (name tokens) for the asset, used for filtering and " | ||||
| "general asset management"); | "general asset management"); | ||||
| rna_def_asset_tags_api(brna, prop); | rna_def_asset_tags_api(brna, prop); | ||||
| prop = RNA_def_property(srna, "active_tag", PROP_INT, PROP_NONE); | prop = RNA_def_property(srna, "active_tag", PROP_INT, PROP_NONE); | ||||
| RNA_def_property_int_funcs(prop, NULL, NULL, "rna_AssetMetaData_active_tag_range"); | RNA_def_property_int_funcs(prop, NULL, NULL, "rna_AssetMetaData_active_tag_range"); | ||||
| RNA_def_property_ui_text(prop, "Active Tag", "Index of the tag set for editing"); | RNA_def_property_ui_text(prop, "Active Tag", "Index of the tag set for editing"); | ||||
| prop = RNA_def_property(srna, "catalog_id", PROP_STRING, PROP_NONE); | |||||
| RNA_def_property_string_funcs(prop, NULL, NULL, "rna_AssetMetaData_catalog_id_set"); | |||||
| RNA_def_property_ui_text( | |||||
| prop, | |||||
| "Catalog ID", | |||||
| "Symbolic catalog identifier, used by Blender to look up the asset's catalog path"); | |||||
| } | } | ||||
| static void rna_def_asset_handle_api(StructRNA *srna) | static void rna_def_asset_handle_api(StructRNA *srna) | ||||
| { | { | ||||
| FunctionRNA *func; | FunctionRNA *func; | ||||
| PropertyRNA *parm; | PropertyRNA *parm; | ||||
| func = RNA_def_function(srna, "get_full_library_path", "rna_AssetHandle_get_full_library_path"); | func = RNA_def_function(srna, "get_full_library_path", "rna_AssetHandle_get_full_library_path"); | ||||
| ▲ Show 20 Lines • Show All 83 Lines • Show Last 20 Lines | |||||