[Bf-blender-cvs] [249646f19d7] asset-engine: AssetUUID: add basic default init value for asset part of it to rna creator.
Bastien Montagne
noreply at git.blender.org
Wed Nov 6 17:09:04 CET 2019
Commit: 249646f19d7a81359441ca639ba6b43beebe171c
Author: Bastien Montagne
Date: Wed Nov 6 17:08:17 2019 +0100
Branches: asset-engine
https://developer.blender.org/rB249646f19d7a81359441ca639ba6b43beebe171c
AssetUUID: add basic default init value for asset part of it to rna creator.
Reauest from Cosmos pipeline R&D team.
===================================================================
M source/blender/makesrna/intern/rna_ID.c
===================================================================
diff --git a/source/blender/makesrna/intern/rna_ID.c b/source/blender/makesrna/intern/rna_ID.c
index 5503bec2833..5f82e886e3c 100644
--- a/source/blender/makesrna/intern/rna_ID.c
+++ b/source/blender/makesrna/intern/rna_ID.c
@@ -85,8 +85,10 @@ const EnumPropertyItem rna_enum_id_type_items[] = {
# include "DNA_anim_types.h"
+# include "BLI_hash_mm2a.h"
# include "BLI_listbase.h"
# include "BLI_math_base.h"
+# include "PIL_time.h"
# include "BKE_font.h"
# include "BKE_idprop.h"
@@ -617,6 +619,11 @@ static void rna_ID_asset_uuid_create(ID *id)
{
rna_ID_asset_uuid_free(id);
id->uuid = MEM_callocN(sizeof(*id->uuid), __func__);
+ /* Add some dummy init for the asset part of the uuid. */
+ for (int i = 0; i < 4; i++) {
+ id->uuid->uuid_asset[i] = (int)BLI_hash_mm2(
+ id->name + i, sizeof(id->name) - i, (uint)PIL_check_seconds_timer_i());
+ }
id->tag |= LIB_TAG_ASSET;
}
More information about the Bf-blender-cvs
mailing list