From 5289bf07352c68db95ba4eadfeab91073f5e332e Mon Sep 17 00:00:00 2001 From: Adam Johnson Date: Fri, 19 Feb 2016 18:26:17 -0500 Subject: [PATCH] Fix NULL LayerAnimation base layer crash Ok, so, the exporter incorrectly assumed it created all plLayerAnimations. In reality, nodes could create the plLayerAnimation first. If the material exporter recreates the object, bad things happen, and an invalid plLayerAnimation is added to the hsGMaterial. UruExplorer then goes KABLOOEY!!! --- korman/exporter/material.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/korman/exporter/material.py b/korman/exporter/material.py index 2cb2eac..88dea03 100644 --- a/korman/exporter/material.py +++ b/korman/exporter/material.py @@ -244,7 +244,7 @@ class MaterialConverter: if ctrl is not None: if layer_animation is None: name = "{}_LayerAnim".format(base_layer.key.name) - layer_animation = self._mgr.add_object(plLayerAnimation, bl=bo, name=name) + layer_animation = self._mgr.find_create_object(plLayerAnimation, bl=bo, name=name) setattr(layer_animation, attr, ctrl) # Alrighty, if we exported any controllers, layer_animation is a plLayerAnimation. We need to do