Fix bug indirect library linking
This commit is contained in:
@@ -114,8 +114,11 @@ def pack(blendfile_src, blendfile_dst, mode='FILE',
|
|||||||
lib_visit=lib_visit,
|
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:
|
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
|
fp_blend_basename_last = fp_blend_basename
|
||||||
|
|
||||||
# assume the path might be relative
|
# assume the path might be relative
|
||||||
|
@@ -202,8 +202,14 @@ class FilePath:
|
|||||||
expand_codes_idlib.setdefault(block[b'lib'], set()).add(block[b'name'])
|
expand_codes_idlib.setdefault(block[b'lib'], set()).add(block[b'name'])
|
||||||
return False
|
return False
|
||||||
else:
|
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)
|
len_prev = len(expand_codes)
|
||||||
expand_codes.add(block[b'id.name'])
|
expand_codes.add(id_name)
|
||||||
return (len_prev != len(expand_codes))
|
return (len_prev != len(expand_codes))
|
||||||
|
|
||||||
def block_expand(block, code):
|
def block_expand(block, code):
|
||||||
@@ -338,17 +344,22 @@ class FilePath:
|
|||||||
# check we don't follow the same links more than once
|
# 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_existing = lib_visit.setdefault(lib_path_abs, set())
|
||||||
lib_block_codes -= lib_block_codes_existing
|
lib_block_codes -= lib_block_codes_existing
|
||||||
|
|
||||||
# don't touch them again
|
# don't touch them again
|
||||||
lib_block_codes_existing.update(lib_block_codes)
|
lib_block_codes_existing.update(lib_block_codes)
|
||||||
|
|
||||||
# print("looking for", 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 not os.path.exists(lib_path_abs):
|
||||||
if VERBOSE:
|
if VERBOSE:
|
||||||
print((indent_str + " "), "Library Missing: ", filepath, " -> ", lib_path_abs, sep="")
|
print((indent_str + " "), "Library Missing: ", filepath, " -> ", lib_path_abs, sep="")
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
|
||||||
# import IPython; IPython.embed()
|
# import IPython; IPython.embed()
|
||||||
if VERBOSE:
|
if VERBOSE:
|
||||||
print((indent_str + " "), "Library: ", filepath, " -> ", lib_path_abs, sep="")
|
print((indent_str + " "), "Library: ", filepath, " -> ", lib_path_abs, sep="")
|
||||||
|
Reference in New Issue
Block a user