Added recursion into library blend files.

This commit is contained in:
Sybren A. Stüvel
2018-02-28 12:42:27 +01:00
parent cb5eff2dcb
commit 86af05e823
7 changed files with 108 additions and 24 deletions
@@ -30,6 +30,7 @@ import tempfile
import typing
from . import exceptions, dna_io, dna, header
from blender_asset_tracer import bpathlib
log = logging.getLogger(__name__)
@@ -277,6 +278,21 @@ class BlendFile:
return structs, sdna_index_from_id
def abspath(self, relpath: bpathlib.BlendPath) -> bpathlib.BlendPath:
"""Construct an absolute path from a blendfile-relative path."""
if relpath.is_absolute():
return relpath
bfile_dir = self.filepath.absolute().parent
root = bpathlib.BlendPath(bfile_dir)
abspath = relpath.absolute(root)
my_log = self.log.getChild('abspath')
my_log.info('Resolved %s relative to %s to %s', relpath, self.filepath, abspath)
return abspath
class BlendFileBlock:
"""