Explorar o código

Import options now save properly after reimport
Fixed scene tool shortcuts so they don't interfere with camera movement keys
Enabled AA line rendering for gizmos and handles

BearishSun %!s(int64=10) %!d(string=hai) anos
pai
achega
49ae9699cf

+ 23 - 23
BansheeCore/Source/BsMeshImportOptions.cpp

@@ -1,24 +1,24 @@
-#include "BsMeshImportOptions.h"
-#include "BsMeshImportOptionsRTTI.h"
-
-namespace BansheeEngine
-{
-	MeshImportOptions::MeshImportOptions()
-		:mCPUReadable(false), mImportNormals(false), mImportTangents(false), 
-		mImportBlendShapes(false), mImportSkin(false), mImportAnimation(false),
-		mImportScale(1.0f)
-	{ }
-
-	/************************************************************************/
-	/* 								SERIALIZATION                      		*/
-	/************************************************************************/
-	RTTITypeBase* MeshImportOptions::getRTTIStatic()
-	{
-		return MeshImportOptionsRTTI::instance();
-	}
-
-	RTTITypeBase* MeshImportOptions::getRTTI() const
-	{
-		return MeshImportOptions::getRTTIStatic();
-	}
+#include "BsMeshImportOptions.h"
+#include "BsMeshImportOptionsRTTI.h"
+
+namespace BansheeEngine
+{
+	MeshImportOptions::MeshImportOptions()
+		:mCPUReadable(false), mImportNormals(true), mImportTangents(true),
+		mImportBlendShapes(false), mImportSkin(false), mImportAnimation(false),
+		mImportScale(1.0f)
+	{ }
+
+	/************************************************************************/
+	/* 								SERIALIZATION                      		*/
+	/************************************************************************/
+	RTTITypeBase* MeshImportOptions::getRTTIStatic()
+	{
+		return MeshImportOptionsRTTI::instance();
+	}
+
+	RTTITypeBase* MeshImportOptions::getRTTI() const
+	{
+		return MeshImportOptions::getRTTIStatic();
+	}
 }

+ 87 - 85
BansheeEditor/Include/BsProjectResourceMeta.h

@@ -1,86 +1,88 @@
-#pragma once
-
-#include "BsEditorPrerequisites.h"
-#include "BsIReflectable.h"
-
-namespace BansheeEngine
-{
-	/**
-	 * @brief	Contains meta-data for a resource stored in the ProjectLibrary.
-	 */
-	class ProjectResourceMeta : public IReflectable
-	{
-	private:
-		struct ConstructPrivately {};
-
-	public:
-		explicit ProjectResourceMeta(const ConstructPrivately&);
-
-		/**
-		 * @brief	Creates a new project library resource meta-data entry.
-		 *
-		 * @param	uuid				UUID of the resource.
-		 * @param	typeId				RTTI type id of the resource.
-		 * @param	resourceMetaData	Non-project library specific meta-data.
-		 * @param	importOptions		Import options used for importing the resource.
-		 *
-		 * @return	New project library resource meta data instance.
-		 */
-		static ProjectResourceMetaPtr create(const String& uuid, UINT32 typeId, const ResourceMetaDataPtr& resourceMetaData,
-			const ImportOptionsPtr& importOptions);
-
-		/**
-		 * @brief	Returns the UUID of the resource this meta data belongs to.
-		 */
-		const String& getUUID() const { return mUUID; }
-
-		/**
-		 * @brief	Returns the non-project library specific meta-data,
-		 */
-		ResourceMetaDataPtr getResourceMetaData() const { return mResourceMeta; }
-
-		/**
-		 * @brief	Returns the import options used for importing the resource this
-		 *			object is referencing.
-		 */
-		const ImportOptionsPtr& getImportOptions() const { return mImportOptions; }
-
-		/**
-		 * @brief	Returns the RTTI type ID of the resource this object is referencing.
-		 */
-		UINT32 getTypeID() const { return mTypeId; }
-
-		/**
-		 * @brief	Checks should this resource always be included in the build, regardless if
-		 *			it's being referenced or not.
-		 */
-		bool getIncludeInBuild() const { return mIncludeInBuild; }
-
-		/**
-		 * @brief	Determines if this resource will always be included in the build, regardless if
-		 *			it's being referenced or not.
-		 */
-		void setIncludeInBuild(bool include) { mIncludeInBuild = include; }
-
-	private:
-		String mUUID;
-		ResourceMetaDataPtr mResourceMeta;
-		ImportOptionsPtr mImportOptions;
-		UINT32 mTypeId;
-		bool mIncludeInBuild;
-
-		/************************************************************************/
-		/* 								RTTI		                     		*/
-		/************************************************************************/
-
-		/**
-		 * @brief	Creates a new empty meta-data instance. Used only for serialization purposes.
-		 */
-		static ProjectResourceMetaPtr createEmpty();
-
-	public:
-		friend class ProjectResourceMetaRTTI;
-		static RTTITypeBase* getRTTIStatic();
-		virtual RTTITypeBase* getRTTI() const override;	
-	};
+#pragma once
+
+#include "BsEditorPrerequisites.h"
+#include "BsIReflectable.h"
+
+namespace BansheeEngine
+{
+	/**
+	 * @brief	Contains meta-data for a resource stored in the ProjectLibrary.
+	 */
+	class ProjectResourceMeta : public IReflectable
+	{
+	private:
+		struct ConstructPrivately {};
+
+	public:
+		explicit ProjectResourceMeta(const ConstructPrivately&);
+
+		/**
+		 * @brief	Creates a new project library resource meta-data entry.
+		 *
+		 * @param	uuid				UUID of the resource.
+		 * @param	typeId				RTTI type id of the resource.
+		 * @param	resourceMetaData	Non-project library specific meta-data.
+		 * @param	importOptions		Import options used for importing the resource.
+		 *
+		 * @return	New project library resource meta data instance.
+		 */
+		static ProjectResourceMetaPtr create(const String& uuid, UINT32 typeId, const ResourceMetaDataPtr& resourceMetaData,
+			const ImportOptionsPtr& importOptions);
+
+		/**
+		 * @brief	Returns the UUID of the resource this meta data belongs to.
+		 */
+		const String& getUUID() const { return mUUID; }
+
+		/**
+		 * @brief	Returns the non-project library specific meta-data,
+		 */
+		ResourceMetaDataPtr getResourceMetaData() const { return mResourceMeta; }
+
+		/**
+		 * @brief	Returns the import options used for importing the resource this
+		 *			object is referencing.
+		 */
+		const ImportOptionsPtr& getImportOptions() const { return mImportOptions; }
+
+		/**
+		 * @brief	Returns the RTTI type ID of the resource this object is referencing.
+		 */
+		UINT32 getTypeID() const { return mTypeId; }
+
+		/**
+		 * @brief	Checks should this resource always be included in the build, regardless if
+		 *			it's being referenced or not.
+		 */
+		bool getIncludeInBuild() const { return mIncludeInBuild; }
+
+		/**
+		 * @brief	Determines if this resource will always be included in the build, regardless if
+		 *			it's being referenced or not.
+		 */
+		void setIncludeInBuild(bool include) { mIncludeInBuild = include; }
+
+	private:
+		friend class ProjectLibrary;
+
+		String mUUID;
+		ResourceMetaDataPtr mResourceMeta;
+		ImportOptionsPtr mImportOptions;
+		UINT32 mTypeId;
+		bool mIncludeInBuild;
+
+		/************************************************************************/
+		/* 								RTTI		                     		*/
+		/************************************************************************/
+
+		/**
+		 * @brief	Creates a new empty meta-data instance. Used only for serialization purposes.
+		 */
+		static ProjectResourceMetaPtr createEmpty();
+
+	public:
+		friend class ProjectResourceMetaRTTI;
+		static RTTITypeBase* getRTTIStatic();
+		virtual RTTITypeBase* getRTTI() const override;	
+	};
 }

+ 4 - 0
BansheeEditor/Source/BsProjectLibrary.cpp

@@ -444,6 +444,10 @@ namespace BansheeEngine
 
 					Importer::instance().reimport(importedResource, resource->path, curImportOptions);
 				}
+
+				resource->meta->mImportOptions = curImportOptions;
+				FileEncoder fs(metaPath);
+				fs.encode(resource->meta.get());
 			}
 
 			addDependencies(resource);

+ 7 - 7
MBansheeEditor/Scene/SceneWindow.cs

@@ -305,22 +305,22 @@ namespace BansheeEditor
             {
                 if (!Input.IsPointerButtonHeld(PointerButton.Right))
                 {
-                    if (VirtualInput.IsButtonUp(toggleProfilerOverlayKey))
+                    if (VirtualInput.IsButtonDown(toggleProfilerOverlayKey))
                         EditorSettings.SetBool(ProfilerOverlayActiveKey, !EditorSettings.GetBool(ProfilerOverlayActiveKey));
 
-                    if (VirtualInput.IsButtonUp(viewToolKey))
+                    if (VirtualInput.IsButtonDown(viewToolKey))
                         EditorApplication.ActiveSceneTool = SceneViewTool.View;
 
-                    if (VirtualInput.IsButtonUp(moveToolKey))
+                    if (VirtualInput.IsButtonDown(moveToolKey))
                         EditorApplication.ActiveSceneTool = SceneViewTool.Move;
 
-                    if (VirtualInput.IsButtonUp(rotateToolKey))
+                    if (VirtualInput.IsButtonDown(rotateToolKey))
                         EditorApplication.ActiveSceneTool = SceneViewTool.Rotate;
 
-                    if (VirtualInput.IsButtonUp(scaleToolKey))
+                    if (VirtualInput.IsButtonDown(scaleToolKey))
                         EditorApplication.ActiveSceneTool = SceneViewTool.Scale;
 
-                    if (VirtualInput.IsButtonUp(duplicateKey))
+                    if (VirtualInput.IsButtonDown(duplicateKey))
                     {
                         SceneObject[] selectedObjects = Selection.SceneObjects;
                         CleanDuplicates(ref selectedObjects);
@@ -338,7 +338,7 @@ namespace BansheeEditor
                         }
                     }
 
-                    if (VirtualInput.IsButtonUp(deleteKey))
+                    if (VirtualInput.IsButtonDown(deleteKey))
                     {
                         SceneObject[] selectedObjects = Selection.SceneObjects;
                         CleanDuplicates(ref selectedObjects);