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
+3
View File
@@ -5,6 +5,7 @@ or vice versa.
"""
import os.path
import pathlib
import string
@@ -12,6 +13,8 @@ class BlendPath(bytes):
"""A path within Blender is always stored as bytes."""
def __new__(cls, path):
if isinstance(path, pathlib.Path):
path = str(path) # handle as string, which is encoded to bytes below.
if isinstance(path, str):
# As a convenience, when a string is given, interpret as UTF-8.
return bytes.__new__(cls, path.encode('utf-8'))