Skip to content

Commit 88c89c4

Browse files
Keep previous default relative behavior when root is not set.
1 parent 9298b2f commit 88c89c4

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

bseq/importer.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,10 @@ def create_obj(fileseq, use_relative, root_path, transform_matrix=Matrix([[1, 0,
158158
object = bpy.data.objects.new(name, mesh)
159159
object.BSEQ.use_relative = use_relative
160160
if use_relative:
161-
object.BSEQ.pattern = bpy.path.relpath(str(fileseq), start=root_path)
161+
if root_path != "":
162+
object.BSEQ.pattern = bpy.path.relpath(str(fileseq), start=root_path)
163+
else:
164+
object.BSEQ.pattern = bpy.path.relpath(str(fileseq))
162165
else:
163166
object.BSEQ.pattern = str(fileseq)
164167
object.BSEQ.init = True
@@ -191,7 +194,11 @@ def update_obj(scene, depsgraph=None):
191194
meshio_mesh = None
192195
pattern = obj.BSEQ.pattern
193196
if obj.BSEQ.use_relative:
194-
pattern = bpy.path.abspath(pattern, start=scene.BSEQ.root_path)
197+
if scene.BSEQ.root_path != "":
198+
pattern = bpy.path.abspath(pattern, start=scene.BSEQ.root_path)
199+
else:
200+
pattern = bpy.path.abspath(pattern)
201+
195202
# in case the blender file was created on windows system, but opened in linux system
196203
pattern = bpy.path.native_pathsep(pattern)
197204
fs = fileseq.FileSequence(pattern)

0 commit comments

Comments
 (0)