Fix bug indirect library linking

This commit is contained in:
2014-11-05 19:24:48 +01:00
parent 073d4784df
commit 0ce5b61d12
2 changed files with 17 additions and 3 deletions

View File

@@ -114,8 +114,11 @@ def pack(blendfile_src, blendfile_dst, mode='FILE',
lib_visit=lib_visit,
):
# we could pass this in!
fp_blend = os.path.join(fp.basedir, fp_blend_basename)
if fp_blend_basename_last != fp_blend_basename:
yield report(" %s: %s\n" % (colorize("blend", color='blue'), fp.basedir + fp_blend_basename))
yield report(" %s: %s\n" % (colorize("blend", color='blue'), fp_blend))
fp_blend_basename_last = fp_blend_basename
# assume the path might be relative

View File

@@ -202,8 +202,14 @@ class FilePath:
expand_codes_idlib.setdefault(block[b'lib'], set()).add(block[b'name'])
return False
else:
id_name = block[b'id.name']
# if we touched this already, don't touch again
if id_name not in block_codes:
return False
len_prev = len(expand_codes)
expand_codes.add(block[b'id.name'])
expand_codes.add(id_name)
return (len_prev != len(expand_codes))
def block_expand(block, code):
@@ -338,17 +344,22 @@ class FilePath:
# check we don't follow the same links more than once
lib_block_codes_existing = lib_visit.setdefault(lib_path_abs, set())
lib_block_codes -= lib_block_codes_existing
# don't touch them again
lib_block_codes_existing.update(lib_block_codes)
# print("looking for", lib_block_codes)
if not lib_block_codes:
if VERBOSE:
print((indent_str + " "), "Library Skipped (visited): ", filepath, " -> ", lib_path_abs, sep="")
continue
if not os.path.exists(lib_path_abs):
if VERBOSE:
print((indent_str + " "), "Library Missing: ", filepath, " -> ", lib_path_abs, sep="")
continue
# import IPython; IPython.embed()
if VERBOSE:
print((indent_str + " "), "Library: ", filepath, " -> ", lib_path_abs, sep="")