Skip to content

Commit 4e4075c

Browse files
committed
Fix assumption that LayerSDLAnimations have an ATC.
1 parent 09b24c8 commit 4e4075c

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

korman/exporter/material.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -581,15 +581,16 @@ def attach_layer(pClass: type, anim_name: str, controllers: Dict[str, plControll
581581

582582
pClass = plLayerSDLAnimation if anim.sdl_var else plLayerAnimation
583583
attach_layer(pClass, anim.animation_name, controllers)
584-
atc = top_layer.timeConvert
585-
atc.begin, atc.end = converter.get_frame_time_range(*controllers.values())
586-
atc.loopBegin, atc.loopEnd = atc.begin, atc.end
587-
if not anim.auto_start:
588-
atc.flags |= plAnimTimeConvert.kStopped
589-
if anim.loop:
590-
atc.flags |= plAnimTimeConvert.kLoop
591584
if isinstance(top_layer, plLayerSDLAnimation):
592585
top_layer.varName = anim.sdl_var
586+
else:
587+
atc = top_layer.timeConvert
588+
atc.begin, atc.end = converter.get_frame_time_range(*controllers.values())
589+
atc.loopBegin, atc.loopEnd = atc.begin, atc.end
590+
if not anim.auto_start:
591+
atc.flags |= plAnimTimeConvert.kStopped
592+
if anim.loop:
593+
atc.flags |= plAnimTimeConvert.kLoop
593594
else:
594595
# Crappy automatic entire layer animation. Loop it by default.
595596
self._report.msg(f"Exporting crappy '(Entire Animation)'")

0 commit comments

Comments
 (0)