Added recursion into library blend files.
This commit is contained in:
@@ -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:
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user