Cleanup
This commit is contained in:
@@ -37,9 +37,14 @@ class C_defs:
|
|||||||
SEQ_TYPE_MASK = 7
|
SEQ_TYPE_MASK = 7
|
||||||
SEQ_TYPE_EFFECT = 8
|
SEQ_TYPE_EFFECT = 8
|
||||||
|
|
||||||
|
IMA_SRC_FILE = 1
|
||||||
|
IMA_SRC_SEQUENCE = 2
|
||||||
|
IMA_SRC_MOVIE = 3
|
||||||
|
|
||||||
|
|
||||||
if VERBOSE:
|
if VERBOSE:
|
||||||
_A = open("/tmp/a.log", 'w')
|
_A = open("/tmp/a.log", 'w')
|
||||||
|
|
||||||
class log_deps:
|
class log_deps:
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def info(msg):
|
def info(msg):
|
||||||
@@ -50,8 +55,7 @@ if VERBOSE:
|
|||||||
if s is None:
|
if s is None:
|
||||||
return "None"
|
return "None"
|
||||||
else:
|
else:
|
||||||
return (", ".join(sorted(i.decode('ascii') for i in sorted(s))))
|
return (", ".join(sorted(i.decode('ascii') for i in sorted(s))))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class FPElem:
|
class FPElem:
|
||||||
@@ -163,12 +167,10 @@ class FilePath:
|
|||||||
# print(indent_str + "Opening:", filepath)
|
# print(indent_str + "Opening:", filepath)
|
||||||
# print(indent_str + "... blocks:", block_codes)
|
# print(indent_str + "... blocks:", block_codes)
|
||||||
|
|
||||||
|
|
||||||
log_deps.info("~")
|
log_deps.info("~")
|
||||||
log_deps.info("%s%s" % (indent_str, filepath.decode('utf-8')))
|
log_deps.info("%s%s" % (indent_str, filepath.decode('utf-8')))
|
||||||
log_deps.info("%s%s" % (indent_str, set_as_str(block_codes)))
|
log_deps.info("%s%s" % (indent_str, set_as_str(block_codes)))
|
||||||
|
|
||||||
|
|
||||||
basedir = os.path.dirname(os.path.abspath(filepath))
|
basedir = os.path.dirname(os.path.abspath(filepath))
|
||||||
if rootdir is None:
|
if rootdir is None:
|
||||||
rootdir = basedir
|
rootdir = basedir
|
||||||
@@ -369,8 +371,7 @@ class FilePath:
|
|||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def _from_block_IM(block, basedir, extra_info, level):
|
def _from_block_IM(block, basedir, extra_info, level):
|
||||||
# (IMA_SRC_FILE, IMA_SRC_SEQUENCE, IMA_SRC_MOVIE)
|
if block[b'source'] not in {C_defs.IMA_SRC_FILE, C_defs.IMA_SRC_SEQUENCE, C_defs.IMA_SRC_MOVIE}:
|
||||||
if block[b'source'] not in {1, 2, 3}:
|
|
||||||
return
|
return
|
||||||
if block[b'packedfile']:
|
if block[b'packedfile']:
|
||||||
return
|
return
|
||||||
@@ -596,7 +597,6 @@ class ExpandID:
|
|||||||
for item in bf_utils.iter_ListBase(block.get_pointer(b'base.first')):
|
for item in bf_utils.iter_ListBase(block.get_pointer(b'base.first')):
|
||||||
yield item.get_pointer(b'object', sdna_index_refine=sdna_index_Base)
|
yield item.get_pointer(b'object', sdna_index_refine=sdna_index_Base)
|
||||||
|
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def expand_GR(block): # 'Group'
|
def expand_GR(block): # 'Group'
|
||||||
sdna_index_GroupObject = block.file.sdna_index_from_id[b'GroupObject']
|
sdna_index_GroupObject = block.file.sdna_index_from_id[b'GroupObject']
|
||||||
@@ -640,4 +640,3 @@ class utils:
|
|||||||
def compatpath(path):
|
def compatpath(path):
|
||||||
# keep '//'
|
# keep '//'
|
||||||
return path[:2] + path[2:].replace(b'/', b'\\')
|
return path[:2] + path[2:].replace(b'/', b'\\')
|
||||||
|
|
||||||
|
@@ -41,7 +41,6 @@ def pack(blendfile_src, blendfile_dst, mode='FILE', pathmap=None):
|
|||||||
# this means that the same libs wont be touched many times to modify the same data
|
# this means that the same libs wont be touched many times to modify the same data
|
||||||
# also prevents cyclic loops from crashing.
|
# also prevents cyclic loops from crashing.
|
||||||
|
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import shutil
|
import shutil
|
||||||
|
|
||||||
@@ -74,7 +73,7 @@ def pack(blendfile_src, blendfile_dst, mode='FILE', pathmap=None):
|
|||||||
path_temp_files.add(filepath_tmp)
|
path_temp_files.add(filepath_tmp)
|
||||||
return filepath_tmp
|
return filepath_tmp
|
||||||
|
|
||||||
base_dir_src = os.path.dirname(blendfile_src)
|
# base_dir_src = os.path.dirname(blendfile_src)
|
||||||
base_dir_dst = os.path.dirname(blendfile_dst)
|
base_dir_dst = os.path.dirname(blendfile_dst)
|
||||||
|
|
||||||
base_dir_dst_subdir = os.path.join(base_dir_dst, SUBDIR)
|
base_dir_dst_subdir = os.path.join(base_dir_dst, SUBDIR)
|
||||||
@@ -127,15 +126,11 @@ def pack(blendfile_src, blendfile_dst, mode='FILE', pathmap=None):
|
|||||||
if pathmap is not None:
|
if pathmap is not None:
|
||||||
blendfile_src_basename = os.path.basename(blendfile_src).decode('utf-8')
|
blendfile_src_basename = os.path.basename(blendfile_src).decode('utf-8')
|
||||||
blendfile_dst_basename = os.path.basename(blendfile_dst).decode('utf-8')
|
blendfile_dst_basename = os.path.basename(blendfile_dst).decode('utf-8')
|
||||||
print("AAAAA")
|
|
||||||
print(blendfile_src_basename, blendfile_dst_basename)
|
|
||||||
|
|
||||||
if blendfile_src_basename != blendfile_dst_basename:
|
if blendfile_src_basename != blendfile_dst_basename:
|
||||||
pathmap[blendfile_dst_basename] = pathmap[blendfile_src_basename]
|
pathmap[blendfile_dst_basename] = pathmap[blendfile_src_basename]
|
||||||
del pathmap[blendfile_src_basename]
|
del pathmap[blendfile_src_basename]
|
||||||
# del blendfile_src_basename, blendfile_dst_basename
|
del blendfile_src_basename, blendfile_dst_basename
|
||||||
# print(pathmap)
|
|
||||||
|
|
||||||
|
|
||||||
# --------------------
|
# --------------------
|
||||||
# Handle File Copy/Zip
|
# Handle File Copy/Zip
|
||||||
@@ -247,4 +242,3 @@ def main():
|
|||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
main()
|
main()
|
||||||
|
|
||||||
|
@@ -46,7 +46,6 @@ def blendfile_remap(blendfile_src, blendpath_dst, path_remap):
|
|||||||
|
|
||||||
return filepath_tmp
|
return filepath_tmp
|
||||||
|
|
||||||
|
|
||||||
for fp, (rootdir, fp_blend_basename) in blendfile_path_walker.FilePath.visit_from_blend(
|
for fp, (rootdir, fp_blend_basename) in blendfile_path_walker.FilePath.visit_from_blend(
|
||||||
blendfile_src,
|
blendfile_src,
|
||||||
readonly=False,
|
readonly=False,
|
||||||
@@ -128,4 +127,3 @@ def main():
|
|||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
main()
|
main()
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user