|
@@ -1,5 +1,7 @@
|
|
|
//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
|
|
//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
|
|
|
//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
|
|
//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
|
|
|
|
|
+
|
|
|
|
|
+using System.Collections.Generic;
|
|
|
using BansheeEngine;
|
|
using BansheeEngine;
|
|
|
|
|
|
|
|
namespace BansheeEditor
|
|
namespace BansheeEditor
|
|
@@ -120,6 +122,67 @@ namespace BansheeEditor
|
|
|
GUILayoutY boundsContent = boundsLayout.AddLayoutY();
|
|
GUILayoutY boundsContent = boundsLayout.AddLayoutY();
|
|
|
boundsContent.AddElement(centerField);
|
|
boundsContent.AddElement(centerField);
|
|
|
boundsContent.AddElement(sizeField);
|
|
boundsContent.AddElement(sizeField);
|
|
|
|
|
+
|
|
|
|
|
+ // Morph shapes
|
|
|
|
|
+ Renderable renderable = animation.SceneObject.GetComponent<Renderable>();
|
|
|
|
|
+ MorphShapes morphShapes = renderable?.Mesh?.MorphShapes;
|
|
|
|
|
+ if (morphShapes != null)
|
|
|
|
|
+ {
|
|
|
|
|
+ GUIToggle morphShapesToggle = new GUIToggle(new LocEdString("Morph shapes"), EditorStyles.Foldout);
|
|
|
|
|
+
|
|
|
|
|
+ Layout.AddElement(morphShapesToggle);
|
|
|
|
|
+ GUILayoutY channelsLayout = Layout.AddLayoutY();
|
|
|
|
|
+
|
|
|
|
|
+ morphShapesToggle.OnToggled += x =>
|
|
|
|
|
+ {
|
|
|
|
|
+ channelsLayout.Active = x;
|
|
|
|
|
+ Persistent.SetBool("Channels_Expanded", x);
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ channelsLayout.Active = Persistent.GetBool("Channels_Expanded");
|
|
|
|
|
+
|
|
|
|
|
+ MorphChannel[] channels = morphShapes.Channels;
|
|
|
|
|
+ for (int i = 0; i < channels.Length; i++)
|
|
|
|
|
+ {
|
|
|
|
|
+ GUILayoutY channelLayout = channelsLayout.AddLayoutY();
|
|
|
|
|
+
|
|
|
|
|
+ GUILayoutX channelTitleLayout = channelLayout.AddLayoutX();
|
|
|
|
|
+ GUILayoutX channelContentLayout = channelLayout.AddLayoutX();
|
|
|
|
|
+
|
|
|
|
|
+ string channelName = channels[i].Name;
|
|
|
|
|
+ GUIToggle channelNameField = new GUIToggle(channelName, EditorStyles.Foldout);
|
|
|
|
|
+
|
|
|
|
|
+ channelTitleLayout.AddSpace(15); // Indent
|
|
|
|
|
+ channelTitleLayout.AddElement(channelNameField);
|
|
|
|
|
+ channelTitleLayout.AddFlexibleSpace();
|
|
|
|
|
+
|
|
|
|
|
+ channelNameField.OnToggled += x =>
|
|
|
|
|
+ {
|
|
|
|
|
+ channelContentLayout.Active = x;
|
|
|
|
|
+
|
|
|
|
|
+ Persistent.SetBool(channelName + "_Expanded", x);
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ channelContentLayout.Active = Persistent.GetBool(channelName + "_Expanded");
|
|
|
|
|
+
|
|
|
|
|
+ MorphShape[] shapes = channels[i].Shapes;
|
|
|
|
|
+ for (int j = 0; j < shapes.Length; j++)
|
|
|
|
|
+ {
|
|
|
|
|
+ GUILayoutX shapeLayout = channelContentLayout.AddLayoutX();
|
|
|
|
|
+
|
|
|
|
|
+ GUILabel shapeNameField = new GUILabel(shapes[j].Name);
|
|
|
|
|
+
|
|
|
|
|
+ LocString weightString = new LocEdString("Weight: {0}");
|
|
|
|
|
+ weightString.SetParameter(0, shapes[j].Weight.ToString());
|
|
|
|
|
+ GUILabel weightField = new GUILabel(weightString);
|
|
|
|
|
+
|
|
|
|
|
+ shapeLayout.AddSpace(30); // Indent
|
|
|
|
|
+ shapeLayout.AddElement(shapeNameField);
|
|
|
|
|
+ shapeLayout.AddFlexibleSpace();
|
|
|
|
|
+ shapeLayout.AddElement(weightField);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/// <summary>
|
|
/// <summary>
|