[Bf-blender-cvs] [8b4997c] asset-engine: WIP dummy code to update assets on file (re)load.
Bastien Montagne
noreply at git.blender.org
Fri Mar 4 14:40:59 CET 2016
Commit: 8b4997c6c7784191912e0b440e8a9242399bb73d
Author: Bastien Montagne
Date: Tue Mar 1 16:58:31 2016 +0100
Branches: asset-engine
https://developer.blender.org/rB8b4997c6c7784191912e0b440e8a9242399bb73d
WIP dummy code to update assets on file (re)load.
Actual code will be implemented in asset-experiment (we need id-remap code for this),
but will first try to define dummy API in this branch.
===================================================================
M source/blender/blenkernel/intern/blender.c
===================================================================
diff --git a/source/blender/blenkernel/intern/blender.c b/source/blender/blenkernel/intern/blender.c
index e66bc74..03ffbed 100644
--- a/source/blender/blenkernel/intern/blender.c
+++ b/source/blender/blenkernel/intern/blender.c
@@ -515,15 +515,21 @@ static void read_file_update_assets(bContext *C)
ListBase *lb_array[MAX_LIBARRAY];
int i = set_listbasepointers(bmain, lb_array);
+ BKE_main_id_tag_all(bmain, LIB_TAG_DOIT, false);
+
while (i--) {
for (ID *id = lb_array[i]->first; id; id = id->next) {
- if (id->uuid && id->lib && (id->tag & LIB_TAG_EXTERN)) {
- printf("We need to check for updated asset %s...\n", id->name);
+ if (id->tag & LIB_TAG_ASSET) {
+ BLI_assert(id->lib);
+ id->lib->id.tag | LIB_TAG_DOIT;
+ if (id->uuid) {
+ printf("We need to check for updated asset %s...\n", id->name);
+ }
+ else {
+ printf("We need to check for updated asset sub-data %s...\n", id->name);
+ }
id->tag |= LIB_TAG_DOIT;
}
- else {
- id->tag &= ~LIB_TAG_DOIT;
- }
}
}
}
More information about the Bf-blender-cvs
mailing list