Просмотр исходного кода

Merge branch 'master' of https://github.com/BearishSun/BansheeEngine

MarcoROG 9 лет назад
Родитель
Сommit
6fde222bb2
94 измененных файлов с 264 добавлено и 125 удалено
  1. BIN
      Data/Editor/GUISkin.asset
  2. BIN
      Data/Editor/Icons/Sprites/sprite_AnimationClipIcon.psd16.asset
  3. BIN
      Data/Editor/Icons/Sprites/sprite_AnimationClipIcon.psd32.asset
  4. BIN
      Data/Editor/Icons/Sprites/sprite_AnimationClipIcon.psd48.asset
  5. BIN
      Data/Editor/Icons/Sprites/sprite_AudioClipIcon.psd16.asset
  6. BIN
      Data/Editor/Icons/Sprites/sprite_AudioClipIcon.psd32.asset
  7. BIN
      Data/Editor/Icons/Sprites/sprite_AudioClipIcon.psd48.asset
  8. BIN
      Data/Editor/Icons/Sprites/sprite_CSharpIcon.psd16.asset
  9. BIN
      Data/Editor/Icons/Sprites/sprite_CSharpIcon.psd32.asset
  10. BIN
      Data/Editor/Icons/Sprites/sprite_CSharpIcon.psd48.asset
  11. BIN
      Data/Editor/Icons/Sprites/sprite_FolderIcon.psd16.asset
  12. BIN
      Data/Editor/Icons/Sprites/sprite_FolderIcon.psd32.asset
  13. BIN
      Data/Editor/Icons/Sprites/sprite_FolderIcon.psd48.asset
  14. BIN
      Data/Editor/Icons/Sprites/sprite_FontIcon.psd16.asset
  15. BIN
      Data/Editor/Icons/Sprites/sprite_FontIcon.psd32.asset
  16. BIN
      Data/Editor/Icons/Sprites/sprite_FontIcon.psd48.asset
  17. BIN
      Data/Editor/Icons/Sprites/sprite_GUISkinIcon.psd16.asset
  18. BIN
      Data/Editor/Icons/Sprites/sprite_GUISkinIcon.psd32.asset
  19. BIN
      Data/Editor/Icons/Sprites/sprite_GUISkinIcon.psd48.asset
  20. BIN
      Data/Editor/Icons/Sprites/sprite_MaterialIcon.psd16.asset
  21. BIN
      Data/Editor/Icons/Sprites/sprite_MaterialIcon.psd32.asset
  22. BIN
      Data/Editor/Icons/Sprites/sprite_MaterialIcon.psd48.asset
  23. BIN
      Data/Editor/Icons/Sprites/sprite_MeshIcon.psd16.asset
  24. BIN
      Data/Editor/Icons/Sprites/sprite_MeshIcon.psd32.asset
  25. BIN
      Data/Editor/Icons/Sprites/sprite_MeshIcon.psd48.asset
  26. BIN
      Data/Editor/Icons/Sprites/sprite_PhysicsMaterialIcon.psd16.asset
  27. BIN
      Data/Editor/Icons/Sprites/sprite_PhysicsMaterialIcon.psd32.asset
  28. BIN
      Data/Editor/Icons/Sprites/sprite_PhysicsMaterialIcon.psd48.asset
  29. BIN
      Data/Editor/Icons/Sprites/sprite_PhysicsMeshIcon.psd16.asset
  30. BIN
      Data/Editor/Icons/Sprites/sprite_PhysicsMeshIcon.psd32.asset
  31. BIN
      Data/Editor/Icons/Sprites/sprite_PhysicsMeshIcon.psd48.asset
  32. BIN
      Data/Editor/Icons/Sprites/sprite_PrefabIcon.psd16.asset
  33. BIN
      Data/Editor/Icons/Sprites/sprite_PrefabIcon.psd32.asset
  34. BIN
      Data/Editor/Icons/Sprites/sprite_PrefabIcon.psd48.asset
  35. BIN
      Data/Editor/Icons/Sprites/sprite_ShaderIcon.psd16.asset
  36. BIN
      Data/Editor/Icons/Sprites/sprite_ShaderIcon.psd32.asset
  37. BIN
      Data/Editor/Icons/Sprites/sprite_ShaderIcon.psd48.asset
  38. BIN
      Data/Editor/Icons/Sprites/sprite_ShaderIncludeIcon.psd16.asset
  39. BIN
      Data/Editor/Icons/Sprites/sprite_ShaderIncludeIcon.psd32.asset
  40. BIN
      Data/Editor/Icons/Sprites/sprite_ShaderIncludeIcon.psd48.asset
  41. BIN
      Data/Editor/Icons/Sprites/sprite_SpriteIcon.psd16.asset
  42. BIN
      Data/Editor/Icons/Sprites/sprite_SpriteIcon.psd32.asset
  43. BIN
      Data/Editor/Icons/Sprites/sprite_SpriteIcon.psd48.asset
  44. BIN
      Data/Editor/Icons/Sprites/sprite_TextIcon.psd16.asset
  45. BIN
      Data/Editor/Icons/Sprites/sprite_TextIcon.psd32.asset
  46. BIN
      Data/Editor/Icons/Sprites/sprite_TextIcon.psd48.asset
  47. BIN
      Data/Editor/Icons/Sprites/sprite_TextureIcon.psd16.asset
  48. BIN
      Data/Editor/Icons/Sprites/sprite_TextureIcon.psd32.asset
  49. BIN
      Data/Editor/Icons/Sprites/sprite_TextureIcon.psd48.asset
  50. BIN
      Data/Editor/ResourceManifest.asset
  51. BIN
      Data/Editor/Shaders/Selection.bsl.asset
  52. BIN
      Data/Editor/Timestamp.asset
  53. BIN
      Data/Editor/arial.ttf.asset
  54. BIN
      Data/Editor/arialAA.ttf.asset
  55. BIN
      Data/Engine/GUISkin.asset
  56. BIN
      Data/Engine/ResourceManifest.asset
  57. BIN
      Data/Engine/Shaders/Default.bsl.asset
  58. BIN
      Data/Engine/Shaders/DeferredPointLightPassIn.bsl.asset
  59. BIN
      Data/Engine/Shaders/Diffuse.bsl.asset
  60. BIN
      Data/Engine/Shaders/Resolve.bsl.asset
  61. BIN
      Data/Engine/Timestamp.asset
  62. BIN
      Data/Engine/arial.ttf.asset
  63. BIN
      Documentation/Doxygen/SmallLogoRound.png
  64. 22 4
      Documentation/Doxygen/doxystyle.css
  65. 6 6
      Documentation/Doxygen/footer.html
  66. 10 11
      Documentation/Doxygen/header.html
  67. 13 0
      Documentation/GitHub/features.md
  68. 6 13
      Documentation/GitHub/roadmap.md
  69. 1 1
      Documentation/Manuals/Native/materials.md
  70. 1 1
      README.md
  71. 3 3
      Source/BansheeCore/Include/BsAnimationCurve.h
  72. 4 1
      Source/BansheeCore/Include/BsMaterial.h
  73. 2 2
      Source/BansheeCore/Include/BsMaterialParams.h
  74. 6 1
      Source/BansheeCore/Source/BsAnimation.cpp
  75. 2 2
      Source/BansheeCore/Source/BsAnimationClip.cpp
  76. 3 8
      Source/BansheeCore/Source/BsAnimationCurve.cpp
  77. 4 4
      Source/BansheeCore/Source/BsAnimationManager.cpp
  78. 1 7
      Source/BansheeEditor/Include/BsProjectResourceMeta.h
  79. 9 3
      Source/BansheeEditor/Source/BsSelectionRenderer.cpp
  80. 2 2
      Source/BansheeEngine/Include/BsGUIScrollBarVert.h
  81. 4 0
      Source/BansheeEngine/Include/BsRenderable.h
  82. 8 5
      Source/BansheeEngine/Include/BsRendererUtility.h
  83. 15 1
      Source/BansheeEngine/Source/BsRenderable.cpp
  84. 5 2
      Source/BansheeEngine/Source/BsRendererUtility.cpp
  85. 24 6
      Source/BansheeFBXImporter/Source/BsFBXImporter.cpp
  86. 4 4
      Source/BansheeSL/Include/BsSLImporter.h
  87. 2 1
      Source/BansheeSL/Source/BsASTFX.c
  88. 1 1
      Source/BansheeUtility/Include/BsFlags.h
  89. 80 21
      Source/MBansheeEditor/Windows/Animation/EditorAnimInfo.cs
  90. 5 7
      Source/MBansheeEditor/Windows/Animation/GUIAnimFieldDisplay.cs
  91. 0 3
      Source/MBansheeEditor/Windows/Animation/GUIFieldSelector.cs
  92. 9 3
      Source/MBansheeEditor/Windows/AnimationWindow.cs
  93. 3 0
      Source/RenderBeast/Include/BsRendererObject.h
  94. 9 2
      Source/RenderBeast/Source/BsRenderBeast.cpp

BIN
Data/Editor/GUISkin.asset


BIN
Data/Editor/Icons/Sprites/sprite_AnimationClipIcon.psd16.asset


BIN
Data/Editor/Icons/Sprites/sprite_AnimationClipIcon.psd32.asset


BIN
Data/Editor/Icons/Sprites/sprite_AnimationClipIcon.psd48.asset


BIN
Data/Editor/Icons/Sprites/sprite_AudioClipIcon.psd16.asset


BIN
Data/Editor/Icons/Sprites/sprite_AudioClipIcon.psd32.asset


BIN
Data/Editor/Icons/Sprites/sprite_AudioClipIcon.psd48.asset


BIN
Data/Editor/Icons/Sprites/sprite_CSharpIcon.psd16.asset


BIN
Data/Editor/Icons/Sprites/sprite_CSharpIcon.psd32.asset


BIN
Data/Editor/Icons/Sprites/sprite_CSharpIcon.psd48.asset


BIN
Data/Editor/Icons/Sprites/sprite_FolderIcon.psd16.asset


BIN
Data/Editor/Icons/Sprites/sprite_FolderIcon.psd32.asset


BIN
Data/Editor/Icons/Sprites/sprite_FolderIcon.psd48.asset


BIN
Data/Editor/Icons/Sprites/sprite_FontIcon.psd16.asset


BIN
Data/Editor/Icons/Sprites/sprite_FontIcon.psd32.asset


BIN
Data/Editor/Icons/Sprites/sprite_FontIcon.psd48.asset


BIN
Data/Editor/Icons/Sprites/sprite_GUISkinIcon.psd16.asset


BIN
Data/Editor/Icons/Sprites/sprite_GUISkinIcon.psd32.asset


BIN
Data/Editor/Icons/Sprites/sprite_GUISkinIcon.psd48.asset


BIN
Data/Editor/Icons/Sprites/sprite_MaterialIcon.psd16.asset


BIN
Data/Editor/Icons/Sprites/sprite_MaterialIcon.psd32.asset


BIN
Data/Editor/Icons/Sprites/sprite_MaterialIcon.psd48.asset


BIN
Data/Editor/Icons/Sprites/sprite_MeshIcon.psd16.asset


BIN
Data/Editor/Icons/Sprites/sprite_MeshIcon.psd32.asset


BIN
Data/Editor/Icons/Sprites/sprite_MeshIcon.psd48.asset


BIN
Data/Editor/Icons/Sprites/sprite_PhysicsMaterialIcon.psd16.asset


BIN
Data/Editor/Icons/Sprites/sprite_PhysicsMaterialIcon.psd32.asset


BIN
Data/Editor/Icons/Sprites/sprite_PhysicsMaterialIcon.psd48.asset


BIN
Data/Editor/Icons/Sprites/sprite_PhysicsMeshIcon.psd16.asset


BIN
Data/Editor/Icons/Sprites/sprite_PhysicsMeshIcon.psd32.asset


BIN
Data/Editor/Icons/Sprites/sprite_PhysicsMeshIcon.psd48.asset


BIN
Data/Editor/Icons/Sprites/sprite_PrefabIcon.psd16.asset


BIN
Data/Editor/Icons/Sprites/sprite_PrefabIcon.psd32.asset


BIN
Data/Editor/Icons/Sprites/sprite_PrefabIcon.psd48.asset


BIN
Data/Editor/Icons/Sprites/sprite_ShaderIcon.psd16.asset


BIN
Data/Editor/Icons/Sprites/sprite_ShaderIcon.psd32.asset


BIN
Data/Editor/Icons/Sprites/sprite_ShaderIcon.psd48.asset


BIN
Data/Editor/Icons/Sprites/sprite_ShaderIncludeIcon.psd16.asset


BIN
Data/Editor/Icons/Sprites/sprite_ShaderIncludeIcon.psd32.asset


BIN
Data/Editor/Icons/Sprites/sprite_ShaderIncludeIcon.psd48.asset


BIN
Data/Editor/Icons/Sprites/sprite_SpriteIcon.psd16.asset


BIN
Data/Editor/Icons/Sprites/sprite_SpriteIcon.psd32.asset


BIN
Data/Editor/Icons/Sprites/sprite_SpriteIcon.psd48.asset


BIN
Data/Editor/Icons/Sprites/sprite_TextIcon.psd16.asset


BIN
Data/Editor/Icons/Sprites/sprite_TextIcon.psd32.asset


BIN
Data/Editor/Icons/Sprites/sprite_TextIcon.psd48.asset


BIN
Data/Editor/Icons/Sprites/sprite_TextureIcon.psd16.asset


BIN
Data/Editor/Icons/Sprites/sprite_TextureIcon.psd32.asset


BIN
Data/Editor/Icons/Sprites/sprite_TextureIcon.psd48.asset


BIN
Data/Editor/ResourceManifest.asset


BIN
Data/Editor/Shaders/Selection.bsl.asset


BIN
Data/Editor/Timestamp.asset


BIN
Data/Editor/arial.ttf.asset


BIN
Data/Editor/arialAA.ttf.asset


BIN
Data/Engine/GUISkin.asset


BIN
Data/Engine/ResourceManifest.asset


BIN
Data/Engine/Shaders/Default.bsl.asset


BIN
Data/Engine/Shaders/DeferredPointLightPassIn.bsl.asset


BIN
Data/Engine/Shaders/Diffuse.bsl.asset


BIN
Data/Engine/Shaders/Resolve.bsl.asset


BIN
Data/Engine/Timestamp.asset


BIN
Data/Engine/arial.ttf.asset


BIN
Documentation/Doxygen/SmallLogoRound.png


+ 22 - 4
Documentation/Doxygen/doxystyle.css

@@ -44,7 +44,7 @@ div.contents {
 
 
 /* Nav bar */
 /* Nav bar */
 .tabs, .tabs2, .tabs3 {
 .tabs, .tabs2, .tabs3 {
-	background-color: rgba(0, 0, 0, 0.12);
+	background-color: rgba(0, 0, 0, 0.8);
 	background-image: none;
 	background-image: none;
     font-family: Lato,'Lucida Grande',Geneva,Helvetica,Arial,sans-serif;
     font-family: Lato,'Lucida Grande',Geneva,Helvetica,Arial,sans-serif;
 	border-bottom: none;
 	border-bottom: none;
@@ -58,7 +58,7 @@ div.contents {
 
 
 .tablist a {
 .tablist a {
 	background-image: none;
 	background-image: none;
-	color: rgba(0, 0, 0, 0.58);
+	color: rgba(255, 255, 255, 1.0);
 	background: transparent;
 	background: transparent;
 	text-shadow: none;
 	text-shadow: none;
 	font-weight: bold;
 	font-weight: bold;
@@ -66,14 +66,13 @@ div.contents {
 
 
 .tablist a:hover {
 .tablist a:hover {
     background-image: none;
     background-image: none;
-	color: rgba(0, 0, 0, 0.58);
+	color: rgba(255, 255, 255, 1.0);
 	text-shadow: none;
 	text-shadow: none;
 }
 }
 
 
 .tablist li.current a {
 .tablist li.current a {
     background-image: none;
     background-image: none;
 	text-shadow: none;
 	text-shadow: none;
-	color: rgba(0, 0, 0, 0.58);
 }
 }
 
 
 .tablist li:hover {
 .tablist li:hover {
@@ -228,6 +227,7 @@ div.toc {
 
 
 .icon {
 .icon {
 	background-color: transparent;
 	background-color: transparent;
+	color: inherit;
 }
 }
 
 
 table.directory {
 table.directory {
@@ -301,6 +301,24 @@ dl.note {
 	border-color: rgba(89, 160, 195, 0.86);
 	border-color: rgba(89, 160, 195, 0.86);
 }
 }
 
 
+#menuSegment {
+    padding: 0;
+    border-bottom: 5px solid #ffb028;
+}
+
+#footerSegment {
+    border-top: 5px solid #ffb028;
+}
+
+#logoItem {
+    padding-bottom: 0px;
+    padding-top: 3px;
+}
+
+#logo {
+    width: 55px;
+}
+
 #projectname
 #projectname
 {
 {
 	font: 300% Lato, Tahoma, Arial,sans-serif;
 	font: 300% Lato, Tahoma, Arial,sans-serif;

+ 6 - 6
Documentation/Doxygen/footer.html

@@ -1,22 +1,22 @@
 <!-- HTML footer for doxygen 1.8.10-->
 <!-- HTML footer for doxygen 1.8.10-->
 <!-- start footer part -->
 <!-- start footer part -->
-	<div class="footer">
-    <div class="ui inverted vertical footer segment">
+    <!-- Footer -->
+    <div class="footer">
+    <div class="ui inverted vertical footer segment" id="footerSegment">
         <div class="ui container">
         <div class="ui container">
             <div class="ui stackable inverted divided equal height grid">
             <div class="ui stackable inverted divided equal height grid">
                 <div class="three wide column">
                 <div class="three wide column">
-                    <h4 class="ui inverted header">About</h4>
+                    <h4 class="ui inverted header">Contact</h4>
                     <div class="ui inverted link list">
                     <div class="ui inverted link list">
                         <a href="http://www.banshee3d.com/contact-us" class="item">Contact us</a>
                         <a href="http://www.banshee3d.com/contact-us" class="item">Contact us</a>
                         <a href="https://github.com/BearishSun/BansheeEngine/issues" target="_blank" class="item">Report an issue</a>
                         <a href="https://github.com/BearishSun/BansheeEngine/issues" target="_blank" class="item">Report an issue</a>
-                        <a href="http://www.banshee3d.com/support" class="item">Support us</a>
                     </div>
                     </div>
                 </div>
                 </div>
                 <div class="three wide column">
                 <div class="three wide column">
                     <h4 class="ui inverted header">Info</h4>
                     <h4 class="ui inverted header">Info</h4>
                     <div class="ui inverted link list">
                     <div class="ui inverted link list">
-                        <a href="http://docs.banshee3d.com/Native" class="item">C++ API documentation</a>
-                        <a href="http://docs.banshee3d.com/Managed" class="item">C# API documentation</a>
+                        <a href="http://www.banshee3d.com/contribute" class="item">Contribute</a>
+                        <a href="http://www.banshee3d.com/development-state" class="item">Development state</a>
                         <a href="https://github.com/BearishSun/BansheeEngine/blob/master/Documentation/GitHub/roadmap.md" target="_blank" class="item">Roadmap</a>
                         <a href="https://github.com/BearishSun/BansheeEngine/blob/master/Documentation/GitHub/roadmap.md" target="_blank" class="item">Roadmap</a>
                         <a href="https://github.com/BearishSun/BansheeEngine/blob/master/Documentation/GitHub/license.md" target="_blank" class="item">License</a>
                         <a href="https://github.com/BearishSun/BansheeEngine/blob/master/Documentation/GitHub/license.md" target="_blank" class="item">License</a>
                     </div>
                     </div>

+ 10 - 11
Documentation/Doxygen/header.html

@@ -22,19 +22,18 @@ $extrastylesheet
 </head>
 </head>
 <body>
 <body>
 <div class="everything">
 <div class="everything">
-	<div class="ui inverted vertical masthead center aligned segment">
-		<div class="ui container">
-			<div class="ui inverted mainmenu menu">
-				<div class="item"><img src="$relpath^SmallLogoRound.png"></div>
-				<a class="item" href="http://www.banshee3d.com"><i class="home icon"></i>Home</a>
-				<a class="item" href="http://www.banshee3d.com/news"><i class="newspaper icon"></i>News</a>
-				<a class="item" href="http://www.banshee3d.com/features"><i class="grid layout icon"></i>Features</a>
-				<a class="item" href="http://www.banshee3d.com/support"><i class="users icon"></i>Support Us</a>
-				<a class="active item" href="http://www.banshee3d.com/docs"><i class="idea icon"></i>Docs</a>
-				<a class="item" href="http://www.banshee3d.com/download"><i class="download icon"></i>Download</a>
-			</div>
+	<div class="ui inverted vertical center aligned segment" id="menuSegment">
+    <div class="ui container">
+        <div class="ui inverted mainmenu menu">
+            <a href="http://www.banshee3d.com"><div class="item" id="logoItem"><img class="ui mini image" id="logo" src="$relpath^SmallLogoRound.png"></div></a>
+			<a class="active item" href="http://www.banshee3d.com"><i class="home icon"></i>Home</a>
+			<a class="item" href="http://www.banshee3d.com/news"><i class="newspaper icon"></i>News</a>
+			<a class="item" href="http://www.banshee3d.com/features"><i class="grid layout icon"></i>Features</a>
+			<a class="item" href="http://www.banshee3d.com/download"><i class="download icon"></i>Download</a>
+			<a class="item" href="http://www.banshee3d.com/docs"><i class="idea icon"></i>Docs</a>
 		</div>
 		</div>
 	</div>
 	</div>
+	</div>
 
 
 	<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
 	<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
 
 

+ 13 - 0
Documentation/GitHub/features.md

@@ -36,6 +36,19 @@ All features listed here are the ones currently available (implemented). If you
   * Supports texture atlases
   * Supports texture atlases
   * Supports arbitrary 3D transformations
   * Supports arbitrary 3D transformations
   * Localization support (string tables)
   * Localization support (string tables)
+* __Animation__
+  * Skeletal animation with skinning
+    * 1D and 2D animation blending
+    * Additive animation support
+    * Animation events
+    * Root bone animation
+    * Animation sockets for animating in-game objects
+    * Post-processing hooks for IK support
+  * Blend shape animation
+  * Generic property animation
+    * Animate any script property
+    * Built-in animation curve editor
+  * Multi-threaded and GPU accelerated
 * __Input__
 * __Input__
   * Mouse/keyboard/gamepad support
   * Mouse/keyboard/gamepad support
   * Provides both raw and OS input
   * Provides both raw and OS input

+ 6 - 13
Documentation/GitHub/roadmap.md

@@ -1,19 +1,11 @@
 # Roadmap
 # Roadmap
 
 
-The focus right now is to implement the most critical missing features:
- - Animation (skeletal, blend shapes, generic script variables)
-
-Planned for Q3 2016 release.
-
----------------------------------------------------
-
-Quickly to follow will be:
- - Ports for Linux & Mac
- - Vulkan (and possibly DX12) implementation
+We are currently focusing on finish up a final set of features before releasing 1.0 stable. These features are:
+ - Vulkan implementation
  - Physically based renderer
  - Physically based renderer
- - Website for the community
- 
-Planned for Q2 2017 release (Version 1.0 beta).
+ - Linux/Mac ports
+
+Planned for Q2 2017 release
 
 
 ---------------------------------------------------
 ---------------------------------------------------
 
 
@@ -35,6 +27,7 @@ There are many more features planned, but these are without a specific timeline
  - Level of detail
  - Level of detail
  - XBONE/PS4 ports
  - XBONE/PS4 ports
  - BSP brushes for level prototyping
  - BSP brushes for level prototyping
+ - Offline lightmapper
  - And more to be decided later...
  - And more to be decided later...
  
  
 Implementation times for each of those roughly ranges from 1-4 months.
 Implementation times for each of those roughly ranges from 1-4 months.

+ 1 - 1
Documentation/Manuals/Native/materials.md

@@ -187,7 +187,7 @@ From the simulation thread you cannot use material to render manually (you must
 
 
 Core thread gives you more flexibility and you can use @ref BansheeEngine::RendererUtility::setPass "RendererUtility::setPass" to bind a specific pass from a material to the pipeline, and @ref BansheeEngine::RendererUtility::setPassParams "RendererUtility::setPassParams" to bind material parameters for a specific pass. 
 Core thread gives you more flexibility and you can use @ref BansheeEngine::RendererUtility::setPass "RendererUtility::setPass" to bind a specific pass from a material to the pipeline, and @ref BansheeEngine::RendererUtility::setPassParams "RendererUtility::setPassParams" to bind material parameters for a specific pass. 
 
 
-In order to retrieve a set of per-program @ref BansheeEngine::RendererUtility::GpuParams "GpuParams" that can be used for binding directly to the pipeline, call @ref BansheeEngine::Material::createParamsSet "Material::createParamsSet", followed by @ref BansheeEngine::Material::updateParamsSet "Material::updateParamsSet". You are required to call @ref BansheeEngine::Material::updateParamsSet "Material::updateParamsSet" whenever material parameters change, in order to transfer the new data to @ref BansheeEngine::RendererUtility::GpuParams "GpuParams".
+In order to retrieve a set of per-program @ref BansheeEngine::GpuParams "GpuParams" that can be used for binding directly to the pipeline, call @ref BansheeEngine::Material::createParamsSet "Material::createParamsSet", followed by @ref BansheeEngine::Material::updateParamsSet "Material::updateParamsSet". You are required to call @ref BansheeEngine::Material::updateParamsSet "Material::updateParamsSet" whenever material parameters change, in order to transfer the new data to @ref BansheeEngine::GpuParams "GpuParams".
 
 
 After pass and pass parameters are bound you can follow them with draw calls as described in the [render API](@ref renderAPI) manual to render objects manually. 
 After pass and pass parameters are bound you can follow them with draw calls as described in the [render API](@ref renderAPI) manual to render objects manually. 
 
 

+ 1 - 1
README.md

@@ -1,5 +1,5 @@
 # What is Banshee? 
 # What is Banshee? 
-A high quality modern game development toolkit. It provides a **high performance multi-threaded game engine** written in C++14 that runs 2D and 3D games. The engine offers a wide variety of high level systems needed for game development, ranging from math and utility libraries, to DirectX 11 and OpenGL support all the way to input, GUI, physics, audio, scripting and support for many popular resource formats (e.g. FBX, PNG, PSD, TTF, OGG, WAV).
+A high quality modern game development toolkit. It provides a **high performance multi-threaded game engine** written in C++14 that runs 2D and 3D games. The engine offers a wide variety of high level systems needed for game development, ranging from math and utility libraries, to DirectX 11 and OpenGL support all the way to input, GUI, physics, audio, animation, scripting and support for many popular resource formats (e.g. FBX, PNG, PSD, TTF, OGG, WAV).
 
 
 On top of the engine Banshee also provides a highly intuitive and customizable **editor** that is easy to use by artists, designers and programmers alike. The editor allows you to manage all your project's assets, build levels, compile scripts, test and publish your game. Editor is also fully extensible via scripting to ensure developers can easily customize it for the exact needs of their projects.
 On top of the engine Banshee also provides a highly intuitive and customizable **editor** that is easy to use by artists, designers and programmers alike. The editor allows you to manage all your project's assets, build levels, compile scripts, test and publish your game. Editor is also fully extensible via scripting to ensure developers can easily customize it for the exact needs of their projects.
 
 

+ 3 - 3
Source/BansheeCore/Include/BsAnimationCurve.h

@@ -39,7 +39,7 @@ namespace BansheeEngine
 		 * happens sequential order (which should be true for most curves). If evaluation is not happening in sequential
 		 * happens sequential order (which should be true for most curves). If evaluation is not happening in sequential
 		 * order using the non-caching version of evaluate() might yield better performance.
 		 * order using the non-caching version of evaluate() might yield better performance.
 		 *
 		 *
-		 * @param[in]	time			Time to evaluate the curve at.
+		 * @param[in]	time			%Time to evaluate the curve at.
 		 * @param[in]	cache			Cached data from previous requests that can be used for speeding up sequential calls
 		 * @param[in]	cache			Cached data from previous requests that can be used for speeding up sequential calls
 		 *								to this method. Caller should ensure to maintain a persistent instance of this data
 		 *								to this method. Caller should ensure to maintain a persistent instance of this data
 		 *								for every animation using this curve in order to ensure cache is maintained.
 		 *								for every animation using this curve in order to ensure cache is maintained.
@@ -53,7 +53,7 @@ namespace BansheeEngine
 		 * Evaluate the animation curve at the specified time. If evaluating multiple values in a sequential order consider
 		 * Evaluate the animation curve at the specified time. If evaluating multiple values in a sequential order consider
 		 * using the cached version of evaluate() for better performance.
 		 * using the cached version of evaluate() for better performance.
 		 *
 		 *
-		 * @param[in]	time	Time to evaluate the curve at.		
+		 * @param[in]	time	%Time to evaluate the curve at.		
 		 * @param[in]	loop	If true the curve will loop when it goes past the end or beggining. Otherwise the curve 
 		 * @param[in]	loop	If true the curve will loop when it goes past the end or beggining. Otherwise the curve 
 		 *						value will be clamped.
 		 *						value will be clamped.
 		 * @return				Interpolated value from the curve at provided time.
 		 * @return				Interpolated value from the curve at provided time.
@@ -64,7 +64,7 @@ namespace BansheeEngine
 		 * Evaluate the animation curve at the specified time and returns a new keyframe containing the evaluated value
 		 * Evaluate the animation curve at the specified time and returns a new keyframe containing the evaluated value
 		 * and tangents.
 		 * and tangents.
 		 *
 		 *
-		 * @param[in]	time	Time to evaluate the curve at.		
+		 * @param[in]	time	%Time to evaluate the curve at.		
 		 * @param[in]	loop	If true the curve will loop when it goes past the end or beggining. Otherwise the curve 
 		 * @param[in]	loop	If true the curve will loop when it goes past the end or beggining. Otherwise the curve 
 		 *						value will be clamped.
 		 *						value will be clamped.
 		 * @return				Keyframe containing the interpolated value and tangents at provided time.
 		 * @return				Keyframe containing the interpolated value and tangents at provided time.

+ 4 - 1
Source/BansheeCore/Include/BsMaterial.h

@@ -639,7 +639,10 @@ namespace BansheeEngine
 		 *  @{
 		 *  @{
 		 */
 		 */
 
 
-		/** @copydoc CoreObject::markCoreDirty */
+		/** 
+		 * Marks the core data as dirty. This causes the syncToCore() method to trigger the next time objects are synced 
+		 * between core and sim threads. 
+		 */
 		void _markCoreDirty() override;
 		void _markCoreDirty() override;
 
 
 		/** @} */
 		/** @} */

+ 2 - 2
Source/BansheeCore/Include/BsMaterialParams.h

@@ -556,7 +556,7 @@ namespace BansheeEngine
 		/** Initializes the core thread version of MaterialParams from its sim thread counterpart. */
 		/** Initializes the core thread version of MaterialParams from its sim thread counterpart. */
 		MaterialParamsCore(const SPtr<ShaderCore>& shader, const SPtr<MaterialParams>& params);
 		MaterialParamsCore(const SPtr<ShaderCore>& shader, const SPtr<MaterialParams>& params);
 		
 		
-		/** @copydoc TMaterialParams<Core>::TMaterialParams */
+		/** @copydoc TMaterialParams::TMaterialParams(const ShaderType&) */
 		MaterialParamsCore(const SPtr<ShaderCore>& shader);
 		MaterialParamsCore(const SPtr<ShaderCore>& shader);
 
 
 		/** 
 		/** 
@@ -587,7 +587,7 @@ namespace BansheeEngine
 	class BS_CORE_EXPORT MaterialParams : public IReflectable, public TMaterialParams<false>
 	class BS_CORE_EXPORT MaterialParams : public IReflectable, public TMaterialParams<false>
 	{
 	{
 	public:
 	public:
-		/** @copydoc TMaterialParams<Core>::TMaterialParams */
+		/** @copydoc TMaterialParams::TMaterialParams(const ShaderType&) */
 		MaterialParams(const HShader& shader);
 		MaterialParams(const HShader& shader);
 
 
 		/** 
 		/** 

+ 6 - 1
Source/BansheeCore/Source/BsAnimation.cpp

@@ -683,7 +683,11 @@ namespace BansheeEngine
 			numChannels = 0;
 			numChannels = 0;
 
 
 		mMorphChannelWeights.assign(numChannels, 0.0f);
 		mMorphChannelWeights.assign(numChannels, 0.0f);
+		if (numChannels > 0)
+			mMorphChannelWeights[0] = 1.0f;
+
 		mDirty |= AnimDirtyStateFlag::Layout;
 		mDirty |= AnimDirtyStateFlag::Layout;
+		mDirty |= AnimDirtyStateFlag::MorphWeights;
 	}
 	}
 
 
 	void Animation::setMorphChannelWeight(UINT32 idx, float weight)
 	void Animation::setMorphChannelWeight(UINT32 idx, float weight)
@@ -1296,8 +1300,9 @@ namespace BansheeEngine
 				didFullRebuild = true;
 				didFullRebuild = true;
 			}
 			}
 			else if(mDirty.isSet(AnimDirtyStateFlag::Value))
 			else if(mDirty.isSet(AnimDirtyStateFlag::Value))
+				mAnimProxy->updateClipInfos(mClipInfos);
 
 
-			if (mDirty.isSet(AnimDirtyStateFlag::MorphWeights))
+			if (mDirty.isSet(AnimDirtyStateFlag::MorphWeights) || didFullRebuild)
 				mAnimProxy->updateMorphChannelWeights(mMorphChannelWeights);
 				mAnimProxy->updateMorphChannelWeights(mMorphChannelWeights);
 		}
 		}
 
 

+ 2 - 2
Source/BansheeCore/Source/BsAnimationClip.cpp

@@ -167,7 +167,7 @@ namespace BansheeEngine
 				if (iterFind == mNameMapping.end())
 				if (iterFind == mNameMapping.end())
 				{
 				{
 					UINT32* indices = mNameMapping[entry.name];
 					UINT32* indices = mNameMapping[entry.name];
-					memset(indices, -1, sizeof(UINT32) * 4);
+					memset(indices, -1, sizeof(UINT32) * (int)CurveType::Count);
 
 
 					indices[typeIdx] = i;
 					indices[typeIdx] = i;
 				}
 				}
@@ -199,7 +199,7 @@ namespace BansheeEngine
 				if (iterFind == mNameMapping.end())
 				if (iterFind == mNameMapping.end())
 				{
 				{
 					UINT32* indices = mNameMapping[entry.name];
 					UINT32* indices = mNameMapping[entry.name];
-					memset(indices, -1, sizeof(UINT32) * 4);
+					memset(indices, -1, sizeof(UINT32) * (int)CurveType::Count);
 
 
 					indices[typeIdx] = i;
 					indices[typeIdx] = i;
 				}
 				}

+ 3 - 8
Source/BansheeCore/Source/BsAnimationCurve.cpp

@@ -179,17 +179,12 @@ namespace BansheeEngine
 #endif
 #endif
 
 
 		if (keyframes.size() > 0)
 		if (keyframes.size() > 0)
-		{
-			mStart = keyframes[0].time;
 			mEnd = keyframes.back().time;
 			mEnd = keyframes.back().time;
-		}
 		else
 		else
-		{
-			mStart = 0.0f;
 			mEnd = 0.0f;
 			mEnd = 0.0f;
-		}
 
 
-		mLength = mEnd - mStart;
+		mStart = 0.0f;
+		mLength = mEnd;
 	}
 	}
 
 
 	template <class T>
 	template <class T>
@@ -202,7 +197,7 @@ namespace BansheeEngine
 			time = 0.0f;
 			time = 0.0f;
 
 
 		// Wrap time if looping
 		// Wrap time if looping
-		if(loop)
+		if(loop && mLength > 0.0f)
 		{
 		{
 			if (time < mStart)
 			if (time < mStart)
 				time = time + (std::floor(mEnd - time) / mLength) * mLength;
 				time = time + (std::floor(mEnd - time) / mLength) * mLength;

+ 4 - 4
Source/BansheeCore/Source/BsAnimationManager.cpp

@@ -310,7 +310,7 @@ namespace BansheeEngine
 							if (diff > 0.0f)
 							if (diff > 0.0f)
 							{
 							{
 								float t = -relative / diff;
 								float t = -relative / diff;
-								shapeInfo.finalWeight = std::min(t, 1.0f);
+								shapeInfo.finalWeight = 1.0f - std::min(t, 1.0f);
 							}
 							}
 							else
 							else
 								shapeInfo.finalWeight = 1.0f;
 								shapeInfo.finalWeight = 1.0f;
@@ -338,7 +338,7 @@ namespace BansheeEngine
 								if (diff > 0.0f)
 								if (diff > 0.0f)
 								{
 								{
 									float t = -relative / diff;
 									float t = -relative / diff;
-									shapeInfo.finalWeight = std::min(t, 1.0f);
+									shapeInfo.finalWeight = 1.0f - std::min(t, 1.0f);
 								}
 								}
 								else
 								else
 									shapeInfo.finalWeight = 1.0f;
 									shapeInfo.finalWeight = 1.0f;
@@ -349,7 +349,7 @@ namespace BansheeEngine
 								if (diff > 0.0f)
 								if (diff > 0.0f)
 								{
 								{
 									float t = relative / diff;
 									float t = relative / diff;
-									shapeInfo.finalWeight = 1.0f - std::min(t, 1.0f);
+									shapeInfo.finalWeight = std::min(t, 1.0f);
 								}
 								}
 								else
 								else
 									shapeInfo.finalWeight = 0.0f;
 									shapeInfo.finalWeight = 0.0f;
@@ -369,7 +369,7 @@ namespace BansheeEngine
 								if (diff > 0.0f)
 								if (diff > 0.0f)
 								{
 								{
 									float t = -relative / diff;
 									float t = -relative / diff;
-									shapeInfo.finalWeight = std::min(t, 1.0f);
+									shapeInfo.finalWeight = 1.0f - std::min(t, 1.0f);
 								}
 								}
 								else
 								else
 									shapeInfo.finalWeight = 1.0f;
 									shapeInfo.finalWeight = 1.0f;

+ 1 - 7
Source/BansheeEditor/Include/BsProjectResourceMeta.h

@@ -92,13 +92,7 @@ namespace BansheeEngine
 		 */
 		 */
 		static SPtr<ProjectFileMeta> create(const SPtr<ImportOptions>& importOptions);
 		static SPtr<ProjectFileMeta> create(const SPtr<ImportOptions>& importOptions);
 
 
-		/** 
-		 * Registers a new resource in the file meta-data. 
-		 *
-		 * @param[in]	resourceMeta	Meta-data to register.
-		 * @param[in]	isOld			Set to true if the meta-data doesn't represent a currently active resource, but
-		 *								is instead stored in the case the resource gets restored later.
-		 */
+		/** Registers a new resource in the file meta-data. */
 		void add(const SPtr<ProjectResourceMeta>& resourceMeta);
 		void add(const SPtr<ProjectResourceMeta>& resourceMeta);
 
 
 		/** 
 		/** 

+ 9 - 3
Source/BansheeEditor/Source/BsSelectionRenderer.cpp

@@ -173,6 +173,7 @@ namespace BansheeEngine
 
 
 			SPtr<GpuBufferCore> boneMatrixBuffer = renderable->getBoneMatrixBuffer();
 			SPtr<GpuBufferCore> boneMatrixBuffer = renderable->getBoneMatrixBuffer();
 			SPtr<VertexBufferCore> morphShapeBuffer = renderable->getMorphShapeBuffer();
 			SPtr<VertexBufferCore> morphShapeBuffer = renderable->getMorphShapeBuffer();
+			SPtr<VertexDeclarationCore> morphVertexDeclaration = renderable->getMorphVertexDeclaration();
 
 
 			Matrix4 worldViewProjMat = viewProjMat * renderable->getTransform();
 			Matrix4 worldViewProjMat = viewProjMat * renderable->getTransform();
 			UINT32 techniqueIdx = mTechniqueIndices[(int)renderable->getAnimType()];
 			UINT32 techniqueIdx = mTechniqueIndices[(int)renderable->getAnimType()];
@@ -185,10 +186,15 @@ namespace BansheeEngine
 			gRendererUtility().setPassParams(mParams[techniqueIdx], 0);
 			gRendererUtility().setPassParams(mParams[techniqueIdx], 0);
 
 
 			UINT32 numSubmeshes = mesh->getProperties().getNumSubMeshes();
 			UINT32 numSubmeshes = mesh->getProperties().getNumSubMeshes();
-			UINT32 renderableId = renderable->getRendererId();
 
 
-			for(UINT32 i = 0; i < numSubmeshes; i++)
-				gRendererUtility().drawMorph(mesh, mesh->getProperties().getSubMesh(i), morphShapeBuffer);
+			for (UINT32 i = 0; i < numSubmeshes; i++)
+			{
+				if (morphVertexDeclaration == nullptr)
+					gRendererUtility().draw(mesh, mesh->getProperties().getSubMesh(i));
+				else
+					gRendererUtility().drawMorph(mesh, mesh->getProperties().getSubMesh(i), morphShapeBuffer,
+						morphVertexDeclaration);
+			}
 		}
 		}
 	}
 	}
 }
 }

+ 2 - 2
Source/BansheeEngine/Include/BsGUIScrollBarVert.h

@@ -29,7 +29,7 @@ namespace BansheeEngine
 		/**
 		/**
 		 * Creates a new vertical scroll bar.
 		 * Creates a new vertical scroll bar.
 		 *
 		 *
-		 * @param[in]	resizeable		If true the scrollbar will have additional handles that allow the scroll handle to
+		 * @param[in]	resizable		If true the scrollbar will have additional handles that allow the scroll handle to
 		 *								be resized. This allows you to adjust the size of the visible scroll area.
 		 *								be resized. This allows you to adjust the size of the visible scroll area.
 		 * @param[in]	styleName		Optional style to use for the element. Style will be retrieved from GUISkin of the
 		 * @param[in]	styleName		Optional style to use for the element. Style will be retrieved from GUISkin of the
 		 *								GUIWidget the element is used on. If not specified default style is used.
 		 *								GUIWidget the element is used on. If not specified default style is used.
@@ -49,7 +49,7 @@ namespace BansheeEngine
 		/**
 		/**
 		 * Creates a new vertical scroll bar.
 		 * Creates a new vertical scroll bar.
 		 *
 		 *
-		 * @param[in]	resizeable		If true the scrollbar will have additional handles that allow the scroll handle to
+		 * @param[in]	resizable		If true the scrollbar will have additional handles that allow the scroll handle to
 		 *								be resized. This allows you to adjust the size of the visible scroll area.
 		 *								be resized. This allows you to adjust the size of the visible scroll area.
 		 * @param[in]	options			Options that allow you to control how is the element positioned and sized.
 		 * @param[in]	options			Options that allow you to control how is the element positioned and sized.
 		 *								This will override any similar options set by style.
 		 *								This will override any similar options set by style.

+ 4 - 0
Source/BansheeEngine/Include/BsRenderable.h

@@ -205,6 +205,9 @@ namespace BansheeEngine
 		/** Returns the vertex buffer containing element's morph shape vertices, if it has any. */
 		/** Returns the vertex buffer containing element's morph shape vertices, if it has any. */
 		const SPtr<VertexBufferCore>& getMorphShapeBuffer() const { return mMorphShapeBuffer; }
 		const SPtr<VertexBufferCore>& getMorphShapeBuffer() const { return mMorphShapeBuffer; }
 
 
+		/** Returns vertex declaration used for rendering meshes containing morph shape information. */
+		const SPtr<VertexDeclarationCore>& getMorphVertexDeclaration() const { return mMorphVertexDeclaration; }
+
 	protected:
 	protected:
 		friend class Renderable;
 		friend class Renderable;
 
 
@@ -225,6 +228,7 @@ namespace BansheeEngine
 
 
 		SPtr<GpuBufferCore> mBoneMatrixBuffer;
 		SPtr<GpuBufferCore> mBoneMatrixBuffer;
 		SPtr<VertexBufferCore> mMorphShapeBuffer;
 		SPtr<VertexBufferCore> mMorphShapeBuffer;
+		SPtr<VertexDeclarationCore> mMorphVertexDeclaration;
 	};
 	};
 
 
 	/** @copydoc TRenderable */
 	/** @copydoc TRenderable */

+ 8 - 5
Source/BansheeEngine/Include/BsRendererUtility.h

@@ -83,14 +83,17 @@ namespace BansheeEngine
 		/**
 		/**
 		 * Draws the specified mesh with an additional vertex buffer containing morph shape vertices.
 		 * Draws the specified mesh with an additional vertex buffer containing morph shape vertices.
 		 *
 		 *
-		 * @param[in]	mesh			Mesh to draw.
-		 * @param[in]	subMesh			Portion of the mesh to draw.
-		 * @param[in]	morphVertices	Buffer containing the morph shape vertices. Will be bound to stream 1. Expected
-		 *								to contain the same number of vertices as the source mesh.
+		 * @param[in]	mesh					Mesh to draw.
+		 * @param[in]	subMesh					Portion of the mesh to draw.
+		 * @param[in]	morphVertices			Buffer containing the morph shape vertices. Will be bound to stream 1. 
+		 *										Expected to contain the same number of vertices as the source mesh.
+		 * @param[in]	morphVertexDeclaration	Vertex declaration describing vertices of the provided mesh and the vertices
+		 *										provided in the morph vertex buffer.
 		 *
 		 *
 		 * @note	Core thread.
 		 * @note	Core thread.
 		 */
 		 */
-		void drawMorph(const SPtr<MeshCoreBase>& mesh, const SubMesh& subMesh, const SPtr<VertexBufferCore>& morphVertices);
+		void drawMorph(const SPtr<MeshCoreBase>& mesh, const SubMesh& subMesh, const SPtr<VertexBufferCore>& morphVertices, 
+			const SPtr<VertexDeclarationCore>& morphVertexDeclaration);
 
 
 		/**
 		/**
 		 * Blits contents of the provided texture into the currently bound render target. If the provided texture contains
 		 * Blits contents of the provided texture into the currently bound render target. If the provided texture contains

+ 15 - 1
Source/BansheeEngine/Source/BsRenderable.cpp

@@ -230,7 +230,7 @@ namespace BansheeEngine
 		{
 		{
 			SPtr<MorphShapes> morphShapes = mMesh->getMorphShapes();
 			SPtr<MorphShapes> morphShapes = mMesh->getMorphShapes();
 
 
-			UINT32 vertexSize = sizeof(Vector3) + sizeof(Vector4);
+			UINT32 vertexSize = sizeof(Vector3) + sizeof(UINT32);
 			UINT32 numVertices = morphShapes->getNumVertices();
 			UINT32 numVertices = morphShapes->getNumVertices();
 
 
 			SPtr<VertexBufferCore> vertexBuffer = VertexBufferCore::create(vertexSize, numVertices, GBU_DYNAMIC);
 			SPtr<VertexBufferCore> vertexBuffer = VertexBufferCore::create(vertexSize, numVertices, GBU_DYNAMIC);
@@ -339,6 +339,20 @@ namespace BansheeEngine
 		{
 		{
 			createAnimationBuffers();
 			createAnimationBuffers();
 
 
+			// Create special vertex declaration if using morph shapes
+			if (mAnimType == RenderableAnimType::Morph || mAnimType == RenderableAnimType::SkinnedMorph)
+			{
+				SPtr<VertexDataDesc> vertexDesc = VertexDataDesc::create();
+				*vertexDesc = * mMesh->getVertexDesc();
+
+				vertexDesc->addVertElem(VET_FLOAT3, VES_POSITION, 1, 1);
+				vertexDesc->addVertElem(VET_UBYTE4_NORM, VES_NORMAL, 1, 1);
+
+				mMorphVertexDeclaration = VertexDeclarationCore::create(vertexDesc);
+			}
+			else
+				mMorphVertexDeclaration = nullptr;
+
 			if (oldIsActive != mIsActive)
 			if (oldIsActive != mIsActive)
 			{
 			{
 				if (mIsActive)
 				if (mIsActive)

+ 5 - 2
Source/BansheeEngine/Source/BsRendererUtility.cpp

@@ -297,13 +297,13 @@ namespace BansheeEngine
 	}
 	}
 
 
 	void RendererUtility::drawMorph(const SPtr<MeshCoreBase>& mesh, const SubMesh& subMesh, 
 	void RendererUtility::drawMorph(const SPtr<MeshCoreBase>& mesh, const SubMesh& subMesh, 
-		const SPtr<VertexBufferCore>& morphVertices)
+		const SPtr<VertexBufferCore>& morphVertices, const SPtr<VertexDeclarationCore>& morphVertexDeclaration)
 	{
 	{
 		// Bind buffers and draw
 		// Bind buffers and draw
 		RenderAPICore& rapi = RenderAPICore::instance();
 		RenderAPICore& rapi = RenderAPICore::instance();
 
 
 		SPtr<VertexData> vertexData = mesh->getVertexData();
 		SPtr<VertexData> vertexData = mesh->getVertexData();
-		rapi.setVertexDeclaration(mesh->getVertexData()->vertexDeclaration); // TODO - Set valid declaration
+		rapi.setVertexDeclaration(morphVertexDeclaration);
 
 
 		auto& meshBuffers = vertexData->getBuffers();
 		auto& meshBuffers = vertexData->getBuffers();
 		SPtr<VertexBufferCore> allBuffers[MAX_BOUND_VERTEX_BUFFERS];
 		SPtr<VertexBufferCore> allBuffers[MAX_BOUND_VERTEX_BUFFERS];
@@ -319,6 +319,9 @@ namespace BansheeEngine
 			endSlot = std::max(iter->first, endSlot);
 			endSlot = std::max(iter->first, endSlot);
 		}
 		}
 
 
+		startSlot = std::min(1U, startSlot);
+		endSlot = std::max(1U, endSlot);
+
 		for (auto iter = meshBuffers.begin(); iter != meshBuffers.end(); ++iter)
 		for (auto iter = meshBuffers.begin(); iter != meshBuffers.end(); ++iter)
 			allBuffers[iter->first - startSlot] = iter->second;
 			allBuffers[iter->first - startSlot] = iter->second;
 
 

+ 24 - 6
Source/BansheeFBXImporter/Source/BsFBXImporter.cpp

@@ -378,19 +378,25 @@ namespace BansheeEngine
 						{
 						{
 							for (UINT32 i = 0; i < numVertices; i++)
 							for (UINT32 i = 0; i < numVertices; i++)
 							{
 							{
+								Vector3 meshPosition = worldTransform.multiplyAffine(mesh->positions[i]);
 								Vector3 blendPosition = worldTransform.multiplyAffine(blendFrame.positions[i]);
 								Vector3 blendPosition = worldTransform.multiplyAffine(blendFrame.positions[i]);
 
 
-								Vector3 positionDelta = blendPosition - mesh->positions[i];
+								Vector3 positionDelta = blendPosition - meshPosition;
 								Vector3 normalDelta;
 								Vector3 normalDelta;
 								if (hasNormals)
 								if (hasNormals)
 								{
 								{
-									Vector3 blendNormal = worldTransformIT.multiplyAffine(blendFrame.normals[i]);
-									normalDelta = blendNormal - mesh->normals[i];
+									Vector3 blendNormal = worldTransformIT.multiplyDirection(blendFrame.normals[i]);
+									blendNormal = Vector3::normalize(blendNormal);
+
+									Vector3 meshNormal = worldTransformIT.multiplyDirection(mesh->normals[i]);
+									meshNormal = Vector3::normalize(meshNormal);
+
+									normalDelta = blendNormal - meshNormal;
 								}
 								}
 								else
 								else
 									normalDelta = Vector3::ZERO;
 									normalDelta = Vector3::ZERO;
 
 
-								if (positionDelta.squaredLength() > 0.0001f || normalDelta.squaredLength() > 0.01f)
+								if (positionDelta.squaredLength() > 0.000001f || normalDelta.squaredLength() > 0.0001f)
 									shape.vertices.push_back(MorphVertex(positionDelta, normalDelta, totalNumVertices + i));
 									shape.vertices.push_back(MorphVertex(positionDelta, normalDelta, totalNumVertices + i));
 							}
 							}
 						}
 						}
@@ -509,9 +515,9 @@ namespace BansheeEngine
 			importScale = options.importScale;
 			importScale = options.importScale;
 
 
 		FbxSystemUnit units = scene->GetGlobalSettings().GetSystemUnit();
 		FbxSystemUnit units = scene->GetGlobalSettings().GetSystemUnit();
-		FbxSystemUnit bsScaledUnits(100.0f, importScale);
+		FbxSystemUnit bsScaledUnits(100.0f);
 
 
-		outputScene.scaleFactor = (float)units.GetConversionFactorTo(bsScaledUnits);
+		outputScene.scaleFactor = (float)units.GetConversionFactorTo(bsScaledUnits) * importScale;
 		outputScene.globalScale = Matrix4::scaling(outputScene.scaleFactor);
 		outputScene.globalScale = Matrix4::scaling(outputScene.scaleFactor);
 		outputScene.rootNode = createImportNode(outputScene, scene->GetRootNode(), nullptr);
 		outputScene.rootNode = createImportNode(outputScene, scene->GetRootNode(), nullptr);
 
 
@@ -1337,6 +1343,10 @@ namespace BansheeEngine
 					blendShape.name = channel->GetName();
 					blendShape.name = channel->GetName();
 					blendShape.frames.resize(frameCount);
 					blendShape.frames.resize(frameCount);
 
 
+					// Get name without invalid characters
+					blendShape.name = StringUtil::replaceAll(blendShape.name, ".", "_");
+					blendShape.name = StringUtil::replaceAll(blendShape.name, "/", "_");
+
 					for (UINT32 k = 0; k < frameCount; k++)
 					for (UINT32 k = 0; k < frameCount; k++)
 					{
 					{
 						FbxShape* fbxShape = channel->GetTargetShape(k);
 						FbxShape* fbxShape = channel->GetTargetShape(k);
@@ -1344,6 +1354,10 @@ namespace BansheeEngine
 						FBXBlendShapeFrame& frame = blendShape.frames[k];
 						FBXBlendShapeFrame& frame = blendShape.frames[k];
 						frame.name = fbxShape->GetName();
 						frame.name = fbxShape->GetName();
 						frame.weight = (float)(weights[k] / 100.0);
 						frame.weight = (float)(weights[k] / 100.0);
+
+						// Get name without invalid characters
+						frame.name = StringUtil::replaceAll(frame.name, ".", "_");
+						frame.name = StringUtil::replaceAll(frame.name, "/", "_");
 						
 						
 						importBlendShapeFrame(fbxShape, *mesh, options, frame);
 						importBlendShapeFrame(fbxShape, *mesh, options, frame);
 					}
 					}
@@ -1714,6 +1728,10 @@ namespace BansheeEngine
 							FBXBlendShapeAnimation& blendShapeAnim = clip.blendShapeAnimations.back();
 							FBXBlendShapeAnimation& blendShapeAnim = clip.blendShapeAnimations.back();
 							blendShapeAnim.blendShape = channel->GetName();
 							blendShapeAnim.blendShape = channel->GetName();
 
 
+							// Get name without invalid characters
+							blendShapeAnim.blendShape = StringUtil::replaceAll(blendShapeAnim.blendShape, ".", "_");
+							blendShapeAnim.blendShape = StringUtil::replaceAll(blendShapeAnim.blendShape, "/", "_");
+
 							FbxAnimCurve* curves[1] = { curve };
 							FbxAnimCurve* curves[1] = { curve };
 							blendShapeAnim.curve = importCurve<float, 1>(curves, importOptions, clip.start, clip.end);
 							blendShapeAnim.curve = importCurve<float, 1>(curves, importOptions, clip.start, clip.end);
 
 

+ 4 - 4
Source/BansheeSL/Include/BsSLImporter.h

@@ -22,16 +22,16 @@ namespace BansheeEngine
 		virtual ~SLImporter();
 		virtual ~SLImporter();
 
 
 		/** @copydoc SpecificImporter::isExtensionSupported */
 		/** @copydoc SpecificImporter::isExtensionSupported */
-		virtual bool isExtensionSupported(const WString& ext) const override;
+		bool isExtensionSupported(const WString& ext) const override;
 
 
 		/** @copydoc SpecificImporter::isMagicNumberSupported */
 		/** @copydoc SpecificImporter::isMagicNumberSupported */
-		virtual bool isMagicNumberSupported(const UINT8* magicNumPtr, UINT32 numBytes) const override;
+		bool isMagicNumberSupported(const UINT8* magicNumPtr, UINT32 numBytes) const override;
 
 
 		/** @copydoc SpecificImporter::import */
 		/** @copydoc SpecificImporter::import */
-		virtual SPtr<Resource> import(const Path& filePath, SPtr<const ImportOptions> importOptions) override;
+		SPtr<Resource> import(const Path& filePath, SPtr<const ImportOptions> importOptions) override;
 
 
 		/** @copydoc SpecificImporter::createImportOptions */
 		/** @copydoc SpecificImporter::createImportOptions */
-		virtual SPtr<ImportOptions> createImportOptions() const override;
+		SPtr<ImportOptions> createImportOptions() const override;
 	};
 	};
 
 
 	/** @} */
 	/** @} */

+ 2 - 1
Source/BansheeSL/Source/BsASTFX.c

@@ -225,8 +225,9 @@ void beginCodeBlock(ParseState* parseState)
 		{
 		{
 			appendCodeBlock(parseState, " ", 1);
 			appendCodeBlock(parseState, " ", 1);
 			appendCodeBlock(parseState, parseState->defines[i].expr, (int)strlen(parseState->defines[i].expr));
 			appendCodeBlock(parseState, parseState->defines[i].expr, (int)strlen(parseState->defines[i].expr));
-			appendCodeBlock(parseState, "\n", 1);
 		}
 		}
+
+		appendCodeBlock(parseState, "\n", 1);
 	}
 	}
 }
 }
 
 

+ 1 - 1
Source/BansheeUtility/Include/BsFlags.h

@@ -267,6 +267,6 @@ namespace BansheeEngine
 		}	
 		}	
 	}; 
 	}; 
 
 
-	/** @encond */
+	/** @endcond */
 	/** @} */
 	/** @} */
 }
 }

+ 80 - 21
Source/MBansheeEditor/Windows/Animation/EditorAnimInfo.cs

@@ -19,6 +19,7 @@ namespace BansheeEditor
     {
     {
         public SerializableProperty.FieldType type;
         public SerializableProperty.FieldType type;
         public CurveDrawInfo[] curveInfos;
         public CurveDrawInfo[] curveInfos;
+        public bool isPropertyCurve;
     }
     }
 
 
     /// <summary>
     /// <summary>
@@ -142,6 +143,7 @@ namespace BansheeEditor
                         FieldAnimCurves fieldCurves = new FieldAnimCurves();
                         FieldAnimCurves fieldCurves = new FieldAnimCurves();
                         fieldCurves.type = SerializableProperty.FieldType.Vector3;
                         fieldCurves.type = SerializableProperty.FieldType.Vector3;
                         fieldCurves.curveInfos = new CurveDrawInfo[3];
                         fieldCurves.curveInfos = new CurveDrawInfo[3];
+                        fieldCurves.isPropertyCurve = !clipInfo.isImported;
 
 
                         fieldCurves.curveInfos[0] = new CurveDrawInfo();
                         fieldCurves.curveInfos[0] = new CurveDrawInfo();
                         fieldCurves.curveInfos[0].curve = new EdAnimationCurve(curveEntry.X, tangentsX);
                         fieldCurves.curveInfos[0].curve = new EdAnimationCurve(curveEntry.X, tangentsX);
@@ -249,8 +251,10 @@ namespace BansheeEditor
                         fieldCurves.type = SerializableProperty.FieldType.Color;
                         fieldCurves.type = SerializableProperty.FieldType.Color;
                 }
                 }
 
 
-                fieldCurves.curveInfos = new CurveDrawInfo[numCurves];
+                bool isMorphCurve = false;
+                string curvePath = KVP.Key;
 
 
+                fieldCurves.curveInfos = new CurveDrawInfo[numCurves];
                 for (int i = 0; i < numCurves; i++)
                 for (int i = 0; i < numCurves; i++)
                 {
                 {
                     int curveIdx = KVP.Value[i].Item1;
                     int curveIdx = KVP.Value[i].Item1;
@@ -263,9 +267,21 @@ namespace BansheeEditor
                     fieldCurves.curveInfos[i] = new CurveDrawInfo();
                     fieldCurves.curveInfos[i] = new CurveDrawInfo();
                     fieldCurves.curveInfos[i].curve = new EdAnimationCurve(clipCurves.FloatCurves[curveIdx].Curve, tangents);
                     fieldCurves.curveInfos[i].curve = new EdAnimationCurve(clipCurves.FloatCurves[curveIdx].Curve, tangents);
                     fieldCurves.curveInfos[i].color = GUICurveDrawing.GetUniqueColor(globalCurveIdx++);
                     fieldCurves.curveInfos[i].color = GUICurveDrawing.GetUniqueColor(globalCurveIdx++);
+
+                    if (clipCurves.FloatCurves[curveIdx].Flags.HasFlag(AnimationCurveFlags.MorphFrame))
+                    {
+                        curvePath = "MorphShapes/Frames/" + KVP.Key;
+                        isMorphCurve = true;
+                    }
+                    else if (clipCurves.FloatCurves[curveIdx].Flags.HasFlag(AnimationCurveFlags.MorphWeight))
+                    {
+                        curvePath = "MorphShapes/Weight/" + KVP.Key;
+                        isMorphCurve = true;
+                    }
                 }
                 }
 
 
-                string curvePath = KVP.Key;
+                fieldCurves.isPropertyCurve = !clipInfo.isImported && !isMorphCurve;
+
                 clipInfo.curves[curvePath] = fieldCurves;
                 clipInfo.curves[curvePath] = fieldCurves;
             }
             }
 
 
@@ -286,6 +302,28 @@ namespace BansheeEditor
             return ProjectLibrary.IsSubresource(resourcePath);
             return ProjectLibrary.IsSubresource(resourcePath);
         }
         }
 
 
+        /// <summary>
+        /// Checks does a curve with the specified path represent a curve affecting a morph shape.
+        /// </summary>
+        /// <param name="path">Path of the curve to check.</param>
+        /// <returns>True if morph shape frame or weight animation, false otherwise.</returns>
+        public static bool IsMorphShapeCurve(string path)
+        {
+            if (string.IsNullOrEmpty(path))
+                return false;
+
+            string trimmedPath = path.Trim('/');
+            string[] entries = trimmedPath.Split('/');
+
+            if (entries.Length < 3)
+                return false;
+
+            if (entries[entries.Length - 3] != "MorphShapes")
+                return false;
+
+            return entries[entries.Length - 2] == "Weight" || entries[entries.Length - 2] == "Frames";
+        }
+
         /// <summary>
         /// <summary>
         /// Applies any changes made to the animation curves or events to the actual animation clip. Only works for
         /// Applies any changes made to the animation curves or events to the actual animation clip. Only works for
         /// non-imported animation clips.
         /// non-imported animation clips.
@@ -357,15 +395,16 @@ namespace BansheeEditor
                 }
                 }
                 else
                 else
                 {
                 {
-                    Action<int, string> addCurve = (idx, subPath) =>
+                    Action<int, string, string, AnimationCurveFlags> addCurve = (idx, path, subPath, flags) =>
                     {
                     {
-                        string path = kvp.Key + subPath;
+                        string fullPath = path + subPath;
 
 
-                        NamedFloatCurve curve = new NamedFloatCurve(path,
-                        new AnimationCurve(kvp.Value.curveInfos[idx].curve.KeyFrames));
+                        NamedFloatCurve curve = new NamedFloatCurve(fullPath,
+                            new AnimationCurve(kvp.Value.curveInfos[idx].curve.KeyFrames));
+                        curve.Flags = flags;
 
 
                         EditorFloatCurveTangents curveTangents = new EditorFloatCurveTangents();
                         EditorFloatCurveTangents curveTangents = new EditorFloatCurveTangents();
-                        curveTangents.name = path;
+                        curveTangents.name = fullPath;
                         curveTangents.tangents = kvp.Value.curveInfos[idx].curve.TangentModes;
                         curveTangents.tangents = kvp.Value.curveInfos[idx].curve.TangentModes;
 
 
                         floatCurves.Add(curve);
                         floatCurves.Add(curve);
@@ -375,30 +414,50 @@ namespace BansheeEditor
                     switch (kvp.Value.type)
                     switch (kvp.Value.type)
                     {
                     {
                         case SerializableProperty.FieldType.Vector2:
                         case SerializableProperty.FieldType.Vector2:
-                            addCurve(0, ".x");
-                            addCurve(1, ".y");
+                            addCurve(0, kvp.Key, ".x", 0);
+                            addCurve(1, kvp.Key, ".y", 0);
                             break;
                             break;
                         case SerializableProperty.FieldType.Vector3:
                         case SerializableProperty.FieldType.Vector3:
-                            addCurve(0, ".x");
-                            addCurve(1, ".y");
-                            addCurve(2, ".z");
+                            addCurve(0, kvp.Key, ".x", 0);
+                            addCurve(1, kvp.Key, ".y", 0);
+                            addCurve(2, kvp.Key, ".z", 0);
                             break;
                             break;
                         case SerializableProperty.FieldType.Vector4:
                         case SerializableProperty.FieldType.Vector4:
-                            addCurve(0, ".x");
-                            addCurve(1, ".y");
-                            addCurve(2, ".z");
-                            addCurve(3, ".w");
+                            addCurve(0, kvp.Key, ".x", 0);
+                            addCurve(1, kvp.Key, ".y", 0);
+                            addCurve(2, kvp.Key, ".z", 0);
+                            addCurve(3, kvp.Key, ".w", 0);
                             break;
                             break;
                         case SerializableProperty.FieldType.Color:
                         case SerializableProperty.FieldType.Color:
-                            addCurve(0, ".r");
-                            addCurve(1, ".g");
-                            addCurve(2, ".b");
-                            addCurve(3, ".a");
+                            addCurve(0, kvp.Key, ".r", 0);
+                            addCurve(1, kvp.Key, ".g", 0);
+                            addCurve(2, kvp.Key, ".b", 0);
+                            addCurve(3, kvp.Key, ".a", 0);
                             break;
                             break;
                         case SerializableProperty.FieldType.Bool:
                         case SerializableProperty.FieldType.Bool:
                         case SerializableProperty.FieldType.Int:
                         case SerializableProperty.FieldType.Int:
                         case SerializableProperty.FieldType.Float:
                         case SerializableProperty.FieldType.Float:
-                            addCurve(0, "");
+                        {
+                            AnimationCurveFlags flags = 0;
+                            string path = kvp.Key;
+
+                            if (IsMorphShapeCurve(kvp.Key))
+                            {
+                                string trimmedPath = path.Trim('/');
+                                string[] entries = trimmedPath.Split('/');
+
+                                bool isWeight = entries[entries.Length - 2] == "Weight";
+
+                                if (isWeight)
+                                    flags = AnimationCurveFlags.MorphWeight;
+                                else
+                                    flags = AnimationCurveFlags.MorphFrame;
+
+                                path = entries[entries.Length - 1];
+                            }
+
+                            addCurve(0, path, "", flags);
+                        }
                             break;
                             break;
                     }
                     }
                 }
                 }

+ 5 - 7
Source/MBansheeEditor/Windows/Animation/GUIAnimFieldDisplay.cs

@@ -195,7 +195,7 @@ namespace BansheeEditor
                     continue;
                     continue;
 
 
                 bool entryIsMissing;
                 bool entryIsMissing;
-                if (fieldInfos[i].isUserCurve)
+                if (fieldInfos[i].curveGroup.isPropertyCurve)
                 {
                 {
                     string pathSuffix;
                     string pathSuffix;
                     SerializableProperty property = Animation.FindProperty(root, fieldInfos[i].path, out pathSuffix);
                     SerializableProperty property = Animation.FindProperty(root, fieldInfos[i].path, out pathSuffix);
@@ -299,7 +299,7 @@ namespace BansheeEditor
     /// </summary>
     /// </summary>
     internal abstract class GUIAnimFieldEntry
     internal abstract class GUIAnimFieldEntry
     {
     {
-        private const int MAX_PATH_LENGTH = 30;
+        private const int MAX_PATH_LENGTH = 20;
         protected const int INDENT_AMOUNT = 10;
         protected const int INDENT_AMOUNT = 10;
 
 
         protected string path;
         protected string path;
@@ -781,11 +781,11 @@ namespace BansheeEditor
         public GUIAnimMissingEntry(GUIAnimFieldLayouts layouts, string path)
         public GUIAnimMissingEntry(GUIAnimFieldLayouts layouts, string path)
             : base(layouts, path, false, 15)
             : base(layouts, path, false, 15)
         {
         {
-            missingLabel = new GUILabel("Missing property!", GUIOption.FixedHeight(GetEntryHeight()));
+            missingLabel = new GUILabel("Missing!", GUIOption.FixedHeight(GetEntryHeight()));
             underlayLayout = layouts.underlay.AddLayoutX();
             underlayLayout = layouts.underlay.AddLayoutX();
             underlayLayout.AddFlexibleSpace();
             underlayLayout.AddFlexibleSpace();
             underlayLayout.AddElement(missingLabel);
             underlayLayout.AddElement(missingLabel);
-            underlayLayout.AddSpace(50);
+            underlayLayout.AddSpace(15);
 
 
             overlaySpacing = new GUILabel("", GUIOption.FixedHeight(GetEntryHeight()));
             overlaySpacing = new GUILabel("", GUIOption.FixedHeight(GetEntryHeight()));
             layouts.overlay.AddElement(overlaySpacing);
             layouts.overlay.AddElement(overlaySpacing);
@@ -806,16 +806,14 @@ namespace BansheeEditor
     /// </summary>
     /// </summary>
     internal struct AnimFieldInfo
     internal struct AnimFieldInfo
     {
     {
-        public AnimFieldInfo(string path, FieldAnimCurves curveGroup, bool isUserCurve)
+        public AnimFieldInfo(string path, FieldAnimCurves curveGroup)
         {
         {
             this.path = path;
             this.path = path;
             this.curveGroup = curveGroup;
             this.curveGroup = curveGroup;
-            this.isUserCurve = isUserCurve;
         }
         }
 
 
         public string path;
         public string path;
         public FieldAnimCurves curveGroup;
         public FieldAnimCurves curveGroup;
-        public bool isUserCurve;
     }
     }
 
 
     /** @} */
     /** @} */

+ 0 - 3
Source/MBansheeEditor/Windows/Animation/GUIFieldSelector.cs

@@ -248,14 +248,11 @@ namespace BansheeEditor
             }
             }
 
 
             // Handle special fields
             // Handle special fields
-            Debug.Log("Type: " + serializableObject.Type);
             if (serializableObject.Type == typeof(Animation))
             if (serializableObject.Type == typeof(Animation))
             {
             {
                 Animation anim = serializableObject.Object as Animation;
                 Animation anim = serializableObject.Object as Animation;
-                Debug.Log("Anim: " + (anim != null));
                 MorphShapes morphShapes = anim?.SceneObject.GetComponent<Renderable>()?.Mesh?.MorphShapes;
                 MorphShapes morphShapes = anim?.SceneObject.GetComponent<Renderable>()?.Mesh?.MorphShapes;
 
 
-                Debug.Log("Shapes: " + (morphShapes != null));
                 if (morphShapes != null)
                 if (morphShapes != null)
                 {
                 {
                     string propertyPath = parent.path + "/MorphShapes";
                     string propertyPath = parent.path + "/MorphShapes";

+ 9 - 3
Source/MBansheeEditor/Windows/AnimationWindow.cs

@@ -710,7 +710,7 @@ namespace BansheeEditor
             persistentData.dirtyAnimClips[clip.UUID] = clipInfo;
             persistentData.dirtyAnimClips[clip.UUID] = clipInfo;
 
 
             foreach (var curve in clipInfo.curves)
             foreach (var curve in clipInfo.curves)
-                guiFieldDisplay.AddField(new AnimFieldInfo(curve.Key, curve.Value, !clipInfo.isImported));
+                guiFieldDisplay.AddField(new AnimFieldInfo(curve.Key, curve.Value));
 
 
             guiCurveEditor.Events = clipInfo.events;
             guiCurveEditor.Events = clipInfo.events;
             guiCurveEditor.DisableCurveEdit = clipInfo.isImported;
             guiCurveEditor.DisableCurveEdit = clipInfo.isImported;
@@ -1346,13 +1346,15 @@ namespace BansheeEditor
         private void AddNewField(string path, SerializableProperty.FieldType type)
         private void AddNewField(string path, SerializableProperty.FieldType type)
         {
         {
             bool noSelection = selectedFields.Count == 0;
             bool noSelection = selectedFields.Count == 0;
-            
+            bool isPropertyCurve = !clipInfo.isImported && !EditorAnimClipInfo.IsMorphShapeCurve(path);
+
             switch (type)
             switch (type)
             {
             {
                 case SerializableProperty.FieldType.Vector4:
                 case SerializableProperty.FieldType.Vector4:
                     {
                     {
                         FieldAnimCurves fieldCurves = new FieldAnimCurves();
                         FieldAnimCurves fieldCurves = new FieldAnimCurves();
                         fieldCurves.type = type;
                         fieldCurves.type = type;
+                        fieldCurves.isPropertyCurve = isPropertyCurve;
                         fieldCurves.curveInfos = new CurveDrawInfo[4];
                         fieldCurves.curveInfos = new CurveDrawInfo[4];
 
 
                         string[] subPaths = { ".x", ".y", ".z", ".w" };
                         string[] subPaths = { ".x", ".y", ".z", ".w" };
@@ -1370,6 +1372,7 @@ namespace BansheeEditor
                     {
                     {
                         FieldAnimCurves fieldCurves = new FieldAnimCurves();
                         FieldAnimCurves fieldCurves = new FieldAnimCurves();
                         fieldCurves.type = type;
                         fieldCurves.type = type;
+                        fieldCurves.isPropertyCurve = isPropertyCurve;
                         fieldCurves.curveInfos = new CurveDrawInfo[3];
                         fieldCurves.curveInfos = new CurveDrawInfo[3];
 
 
                         string[] subPaths = { ".x", ".y", ".z" };
                         string[] subPaths = { ".x", ".y", ".z" };
@@ -1387,6 +1390,7 @@ namespace BansheeEditor
                     {
                     {
                         FieldAnimCurves fieldCurves = new FieldAnimCurves();
                         FieldAnimCurves fieldCurves = new FieldAnimCurves();
                         fieldCurves.type = type;
                         fieldCurves.type = type;
+                        fieldCurves.isPropertyCurve = isPropertyCurve;
                         fieldCurves.curveInfos = new CurveDrawInfo[2];
                         fieldCurves.curveInfos = new CurveDrawInfo[2];
 
 
                         string[] subPaths = { ".x", ".y" };
                         string[] subPaths = { ".x", ".y" };
@@ -1404,6 +1408,7 @@ namespace BansheeEditor
                     {
                     {
                         FieldAnimCurves fieldCurves = new FieldAnimCurves();
                         FieldAnimCurves fieldCurves = new FieldAnimCurves();
                         fieldCurves.type = type;
                         fieldCurves.type = type;
+                        fieldCurves.isPropertyCurve = isPropertyCurve;
                         fieldCurves.curveInfos = new CurveDrawInfo[4];
                         fieldCurves.curveInfos = new CurveDrawInfo[4];
 
 
                         string[] subPaths = { ".r", ".g", ".b", ".a" };
                         string[] subPaths = { ".r", ".g", ".b", ".a" };
@@ -1421,6 +1426,7 @@ namespace BansheeEditor
                     {
                     {
                         FieldAnimCurves fieldCurves = new FieldAnimCurves();
                         FieldAnimCurves fieldCurves = new FieldAnimCurves();
                         fieldCurves.type = type;
                         fieldCurves.type = type;
+                        fieldCurves.isPropertyCurve = isPropertyCurve;
                         fieldCurves.curveInfos = new CurveDrawInfo[1];
                         fieldCurves.curveInfos = new CurveDrawInfo[1];
 
 
                         fieldCurves.curveInfos[0].curve = new EdAnimationCurve();
                         fieldCurves.curveInfos[0].curve = new EdAnimationCurve();
@@ -1484,7 +1490,7 @@ namespace BansheeEditor
         {
         {
             List<AnimFieldInfo> existingFields = new List<AnimFieldInfo>();
             List<AnimFieldInfo> existingFields = new List<AnimFieldInfo>();
             foreach (var KVP in clipInfo.curves)
             foreach (var KVP in clipInfo.curves)
-                existingFields.Add(new AnimFieldInfo(KVP.Key, KVP.Value, !clipInfo.isImported));
+                existingFields.Add(new AnimFieldInfo(KVP.Key, KVP.Value));
 
 
             guiFieldDisplay.SetFields(existingFields.ToArray());
             guiFieldDisplay.SetFields(existingFields.ToArray());
         }
         }

+ 3 - 0
Source/RenderBeast/Include/BsRendererObject.h

@@ -54,6 +54,9 @@ namespace BansheeEngine
 		/** Vertex buffer containing element's morph shape vertices, if it has any. */
 		/** Vertex buffer containing element's morph shape vertices, if it has any. */
 		SPtr<VertexBufferCore> morphShapeBuffer;
 		SPtr<VertexBufferCore> morphShapeBuffer;
 
 
+		/** Vertex declaration used for rendering meshes containing morph shape information. */
+		SPtr<VertexDeclarationCore> morphVertexDeclaration;
+
 		/** Version of the morph shape vertices in the buffer. */
 		/** Version of the morph shape vertices in the buffer. */
 		mutable UINT32 morphShapeVersion;
 		mutable UINT32 morphShapeVersion;
 	};
 	};

+ 9 - 2
Source/RenderBeast/Source/BsRenderBeast.cpp

@@ -144,6 +144,7 @@ namespace BansheeEngine
 				renElement.morphShapeVersion = 0;
 				renElement.morphShapeVersion = 0;
 				renElement.morphShapeBuffer = renderable->getMorphShapeBuffer();
 				renElement.morphShapeBuffer = renderable->getMorphShapeBuffer();
 				renElement.boneMatrixBuffer = renderable->getBoneMatrixBuffer();
 				renElement.boneMatrixBuffer = renderable->getBoneMatrixBuffer();
+				renElement.morphVertexDeclaration = renderable->getMorphVertexDeclaration();
 
 
 				renElement.material = renderable->getMaterial(i);
 				renElement.material = renderable->getMaterial(i);
 				if (renElement.material == nullptr)
 				if (renElement.material == nullptr)
@@ -186,11 +187,13 @@ namespace BansheeEngine
 							// If using morph shapes ignore POSITION1 and NORMAL1 missing since we assign them from within the renderer
 							// If using morph shapes ignore POSITION1 and NORMAL1 missing since we assign them from within the renderer
 							if(animType == RenderableAnimType::Morph || animType == RenderableAnimType::SkinnedMorph)
 							if(animType == RenderableAnimType::Morph || animType == RenderableAnimType::SkinnedMorph)
 							{
 							{
-								std::remove_if(missingElements.begin(), missingElements.end(), [](const VertexElement& x)
+								auto removeIter = std::remove_if(missingElements.begin(), missingElements.end(), [](const VertexElement& x)
 								{
 								{
 									return (x.getSemantic() == VES_POSITION && x.getSemanticIdx() == 1) ||
 									return (x.getSemantic() == VES_POSITION && x.getSemanticIdx() == 1) ||
 										(x.getSemantic() == VES_NORMAL && x.getSemanticIdx() == 1);
 										(x.getSemantic() == VES_NORMAL && x.getSemanticIdx() == 1);
 								});
 								});
+
+								missingElements.erase(removeIter, missingElements.end());
 							}
 							}
 
 
 							if (!missingElements.empty())
 							if (!missingElements.empty())
@@ -835,7 +838,11 @@ namespace BansheeEngine
 		else
 		else
 			setPassParams(element.params, nullptr, passIdx);
 			setPassParams(element.params, nullptr, passIdx);
 
 
-		gRendererUtility().drawMorph(element.mesh, element.subMesh, element.morphShapeBuffer);
+		if(element.morphVertexDeclaration == nullptr)
+			gRendererUtility().draw(element.mesh, element.subMesh);
+		else
+			gRendererUtility().drawMorph(element.mesh, element.subMesh, element.morphShapeBuffer, 
+				element.morphVertexDeclaration);
 	}
 	}
 
 
 	void RenderBeast::refreshSamplerOverrides(bool force)
 	void RenderBeast::refreshSamplerOverrides(bool force)