diff --git a/modules/blendfile_pack.py b/modules/blendfile_pack.py index 2e11da5..b021a97 100755 --- a/modules/blendfile_pack.py +++ b/modules/blendfile_pack.py @@ -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 diff --git a/modules/blendfile_path_walker.py b/modules/blendfile_path_walker.py index 8e23836..ced5ac9 100644 --- a/modules/blendfile_path_walker.py +++ b/modules/blendfile_path_walker.py @@ -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="")