2
0
Эх сурвалжийг харах

Clicking on empty space deselects the selected scene object

Marko Pintera 11 жил өмнө
parent
commit
13b511ed32

+ 3 - 0
BansheeEditor/Include/BsSelection.h

@@ -21,6 +21,9 @@ namespace BansheeEngine
 		Vector<String> getResourceUUIDs() const;
 		void setResourceUUIDs(const Vector<String>& UUIDs);
 
+		void clearSceneSelection();
+		void clearResourceSelection();
+
 	private:
 		void sceneSelectionChanged();
 		void resourceSelectionChanged();

+ 3 - 1
BansheeEditor/Source/BsSceneEditorWidget.cpp

@@ -161,7 +161,7 @@ namespace BansheeEngine
 				{
 					Vector<HSceneObject> selectedSOs = Selection::instance().getSceneObjects();
 
-					auto iterFind = std::find_if(selectedSOs.begin(), selectedSOs.end(), 
+					auto iterFind = std::find_if(selectedSOs.begin(), selectedSOs.end(),
 						[&](const HSceneObject& obj) { return obj == pickedObject; }
 					);
 
@@ -177,6 +177,8 @@ namespace BansheeEngine
 					Selection::instance().setSceneObjects(selectedSOs);
 				}
 			}
+			else
+				Selection::instance().clearSceneSelection();
 		}
 	}
 

+ 10 - 0
BansheeEditor/Source/BsSelection.cpp

@@ -77,6 +77,16 @@ namespace BansheeEngine
 			resourceTreeView->setSelection(mSelectedResourcePaths);
 	}
 
+	void Selection::clearSceneSelection()
+	{
+		setSceneObjects({});
+	}
+
+	void Selection::clearResourceSelection()
+	{
+		setResourceUUIDs({});
+	}
+
 	void Selection::sceneSelectionChanged()
 	{
 		GUISceneTreeView* sceneTreeView = SceneTreeViewLocator::instance();

+ 2 - 3
SceneView.txt

@@ -4,12 +4,11 @@
 
 REFACTOR material getParams* and related classes. Those params should update all gpu program params that share that variable, not just the first found
 Clicking on empty space needs to deselect everything
-Dragging a slider doesn't move it properly (also need to fix colliders so not all handles overlap)
 Need a way to drag and drop items from Scene tree view to Scene view
-Handle normals seem to break as the camera moves at a certain angle
+When dragging a handle make sure it works when cursor leaves the scene view
+Also make sure that handle manager receives mouse up event if its done outside of scene view
 
 Test handles
- - Test basic move handle
  - Test a custom handle from C#
  - FINISH HANDLE IMPLEMENTATION AND GLUE EVERYTHING TOGHETHER