Browse Source

Merge pull request #1403 from JimMarlowe/JM-ANIM-1402

Fix preview animations crash #1402
JoshEngebretson 9 years ago
parent
commit
b0beae8443

+ 5 - 1
Resources/EditorData/AtomicEditor/editor/ui/animationtoolbar.tb.txt

@@ -1,3 +1,7 @@
+definitions
+	menubutton
+		lp: height: 28, width: 28
+		skin TBButton.uniformflat
 TBLayout: axis: y, distribution: gravity, spacing: 10
 	lb: min_width: 750
 	TBLayout:
@@ -35,4 +39,4 @@ TBLayout: axis: y, distribution: gravity, spacing: 10
 				tooltip Play Animation
 				lp: width: 30, height: 30
 	TBLayout: distribution: gravity, axis: x, spacing: 4
-			TBContainer: skin: AEContainer, gravity: all, id: blendcontainer
+#	TBContainer: skin: AEContainer, gravity: all, id: blendcontainer

+ 7 - 5
Script/AtomicEditor/ui/AnimationToolbar.ts

@@ -170,12 +170,14 @@ class AnimationToolbar extends Atomic.UIWidget {
 
         this.animatedModel = <Atomic.AnimatedModel>modelNode.getComponent("AnimatedModel");
         this.animationController = <Atomic.AnimationController>modelNode.getComponent("AnimationController");
-        var model = this.animatedModel.model;
-        this.animatedModel.setBoneCreationOverride(true);
-        this.animatedModel.setModel(model, true);
+        if ( this.animatedModel != null && this.animationController != null ) {
+            var model = this.animatedModel.model;
+            this.animatedModel.setBoneCreationOverride(true);
+            this.animatedModel.setModel(model, true);
 
-        var animComp = new Atomic.AnimatedModel();
-        var animContComp = new Atomic.AnimationController();
+            var animComp = new Atomic.AnimatedModel();
+            var animContComp = new Atomic.AnimationController();
+        }
     }
 
     openAnimationSelectionBox(animationWidget: Atomic.UIEditField, animationSlot: Atomic.Animation) {