add trace for imgui.ini, add assets manager system and objects manager system, add some icons, add entity tree node for scene Hierachy's entities, add convert blend file process(but not actual use it, just implement) BUGS: file copy not work
@ -15,6 +15,7 @@
|
||||
#include "Prism/Physics/Physics3D.h"
|
||||
#include "Prism/Renderer/Renderer2D.h"
|
||||
#include "Prism/Script/ScriptEngine.h"
|
||||
#include "Prism/Utilities/DragDropData.h"
|
||||
|
||||
namespace Prism
|
||||
{
|
||||
@ -171,6 +172,9 @@ namespace Prism
|
||||
m_SceneHierarchyPanel->SetEntityDeletedCallback(std::bind(&EditorLayer::OnEntityDeleted, this, std::placeholders::_1));
|
||||
UpdateWindowTitle("untitled Scene");
|
||||
|
||||
m_AssetManagerPanel = CreateScope<AssetsManagerPanel>();
|
||||
m_ObjectsPanel = CreateScope<ObjectsPanel>();
|
||||
|
||||
// OpenScene("assets/scenes/FPSDemo.scene");
|
||||
NewScene();
|
||||
}
|
||||
@ -654,6 +658,9 @@ namespace Prism
|
||||
if (m_UIShowBoundingBoxes && Property("On Top", m_UIShowBoundingBoxesOnTop))
|
||||
ShowBoundingBoxes(m_UIShowBoundingBoxes, m_UIShowBoundingBoxesOnTop);
|
||||
|
||||
m_AssetManagerPanel->OnImGuiRender();
|
||||
m_ObjectsPanel->OnImGuiRender();
|
||||
|
||||
const char* label = m_SelectionMode == SelectionMode::Entity ? "Entity" : "Mesh";
|
||||
if (ImGui::Button(label))
|
||||
{
|
||||
@ -835,6 +842,44 @@ namespace Prism
|
||||
}
|
||||
}
|
||||
|
||||
if (ImGui::BeginDragDropTarget())
|
||||
{
|
||||
auto payload = ImGui::AcceptDragDropPayload("scene_entity_objectP");
|
||||
if (payload)
|
||||
{
|
||||
const auto data = (DragDropData*)payload->Data;
|
||||
if (std::string_view(data->Type) == "Mesh")
|
||||
{
|
||||
auto entity = m_EditorScene->CreateEntity(data->Name);
|
||||
entity.AddComponent<MeshComponent>(Ref<Mesh>::Create(data->SourcePath));
|
||||
}
|
||||
}
|
||||
ImGui::EndDragDropTarget();
|
||||
}
|
||||
|
||||
/* Payload Implementation For Getting Assets In The Viewport From Asset Manager */
|
||||
if (ImGui::BeginDragDropTarget())
|
||||
{
|
||||
auto payload = ImGui::AcceptDragDropPayload("scene_entity_assetsP");
|
||||
if (payload)
|
||||
{
|
||||
auto data = (DragDropData*)payload->Data;
|
||||
|
||||
if (std::string_view(data->Type) == "PrismScene")
|
||||
{
|
||||
auto sceneName = data->SourcePath;
|
||||
OpenScene(sceneName);
|
||||
}
|
||||
|
||||
if (std::string_view(data->Type) == "Mesh")
|
||||
{
|
||||
auto entity = m_EditorScene->CreateEntity(data->Name);
|
||||
entity.AddComponent<MeshComponent>(Ref<Mesh>::Create(data->SourcePath));
|
||||
}
|
||||
}
|
||||
ImGui::EndDragDropTarget();
|
||||
}
|
||||
|
||||
ImGui::End();
|
||||
ImGui::PopStyleVar();
|
||||
}
|
||||
|
||||
@ -6,6 +6,8 @@
|
||||
#define EDITORLAYER_H
|
||||
|
||||
#include "Prism.h"
|
||||
#include "Prism/Editor/AssetsManagerPanel.h"
|
||||
#include "Prism/Editor/ObjectsPanel.h"
|
||||
#include "Prism/Editor/SceneHierachyPanel.h"
|
||||
|
||||
namespace Prism
|
||||
@ -56,6 +58,8 @@ namespace Prism
|
||||
float GetSnapValue() const;
|
||||
private:
|
||||
Scope<SceneHierarchyPanel> m_SceneHierarchyPanel;
|
||||
Scope<AssetsManagerPanel> m_AssetManagerPanel;
|
||||
Scope<ObjectsPanel> m_ObjectsPanel;
|
||||
|
||||
Ref<Scene> m_ActiveScene;
|
||||
Ref<Scene> m_RuntimeScene, m_EditorScene;
|
||||
|
||||
BIN
Editor/assets/editor/asset.png
Normal file
|
After Width: | Height: | Size: 13 KiB |
BIN
Editor/assets/editor/back.png
Normal file
|
After Width: | Height: | Size: 16 KiB |
BIN
Editor/assets/editor/blend.png
Normal file
|
After Width: | Height: | Size: 44 KiB |
BIN
Editor/assets/editor/btn_back.png
Normal file
|
After Width: | Height: | Size: 26 KiB |
BIN
Editor/assets/editor/btn_fwrd.png
Normal file
|
After Width: | Height: | Size: 26 KiB |
BIN
Editor/assets/editor/close.png
Normal file
|
After Width: | Height: | Size: 23 KiB |
BIN
Editor/assets/editor/csc.png
Normal file
|
After Width: | Height: | Size: 10 KiB |
BIN
Editor/assets/editor/favourites.png
Normal file
|
After Width: | Height: | Size: 24 KiB |
BIN
Editor/assets/editor/fbx.png
Normal file
|
After Width: | Height: | Size: 32 KiB |
BIN
Editor/assets/editor/file.png
Normal file
|
After Width: | Height: | Size: 7.9 KiB |
BIN
Editor/assets/editor/folder.png
Normal file
|
After Width: | Height: | Size: 5.1 KiB |
BIN
Editor/assets/editor/folder_hierarchy.png
Normal file
|
After Width: | Height: | Size: 5.0 KiB |
BIN
Editor/assets/editor/grid.png
Normal file
|
After Width: | Height: | Size: 6.9 KiB |
BIN
Editor/assets/editor/list.png
Normal file
|
After Width: | Height: | Size: 2.0 KiB |
BIN
Editor/assets/editor/obj.png
Normal file
|
After Width: | Height: | Size: 21 KiB |
BIN
Editor/assets/editor/png.png
Normal file
|
After Width: | Height: | Size: 13 KiB |
BIN
Editor/assets/editor/resource.png
Normal file
|
After Width: | Height: | Size: 7.1 KiB |
BIN
Editor/assets/editor/scene.png
Normal file
|
After Width: | Height: | Size: 23 KiB |
BIN
Editor/assets/editor/script.png
Normal file
|
After Width: | Height: | Size: 25 KiB |
BIN
Editor/assets/editor/search.png
Normal file
|
After Width: | Height: | Size: 12 KiB |
BIN
Editor/assets/editor/tags.png
Normal file
|
After Width: | Height: | Size: 18 KiB |
BIN
Editor/assets/editor/wav.png
Normal file
|
After Width: | Height: | Size: 12 KiB |
BIN
Editor/assets/meshes/Default/Cone.fbx
Normal file
BIN
Editor/assets/meshes/Default/Cube.fbx
Normal file
BIN
Editor/assets/meshes/Default/Cylinder.fbx
Normal file
BIN
Editor/assets/meshes/Default/Plane.fbx
Normal file
BIN
Editor/assets/meshes/Default/Sphere.fbx
Normal file
BIN
Editor/assets/meshes/Default/Torus.fbx
Normal file
96
Editor/imgui.ini
Normal file
@ -0,0 +1,96 @@
|
||||
[Window][DockSpace Demo]
|
||||
Pos=0,0
|
||||
Size=2066,1198
|
||||
Collapsed=0
|
||||
|
||||
[Window][Debug##Default]
|
||||
Pos=60,60
|
||||
Size=400,400
|
||||
Collapsed=0
|
||||
|
||||
[Window][Scene Hierarchy]
|
||||
Pos=1595,24
|
||||
Size=471,428
|
||||
Collapsed=0
|
||||
DockId=0x00000009,0
|
||||
|
||||
[Window][Properties]
|
||||
Pos=1595,454
|
||||
Size=471,744
|
||||
Collapsed=0
|
||||
DockId=0x0000000A,0
|
||||
|
||||
[Window][Scene Renderer]
|
||||
Pos=0,648
|
||||
Size=481,550
|
||||
Collapsed=0
|
||||
DockId=0x00000006,0
|
||||
|
||||
[Window][Materials]
|
||||
Pos=0,24
|
||||
Size=481,622
|
||||
Collapsed=0
|
||||
DockId=0x00000005,0
|
||||
|
||||
[Window][Script Engine Debug]
|
||||
Pos=1595,454
|
||||
Size=471,744
|
||||
Collapsed=0
|
||||
DockId=0x0000000A,2
|
||||
|
||||
[Window][Model]
|
||||
Pos=1595,454
|
||||
Size=471,744
|
||||
Collapsed=0
|
||||
DockId=0x0000000A,3
|
||||
|
||||
[Window][Toolbar]
|
||||
Pos=483,24
|
||||
Size=1110,32
|
||||
Collapsed=0
|
||||
DockId=0x00000001,0
|
||||
|
||||
[Window][Viewport]
|
||||
Pos=483,58
|
||||
Size=1110,722
|
||||
Collapsed=0
|
||||
DockId=0x0000000B,0
|
||||
|
||||
[Window][Environment]
|
||||
Pos=1595,454
|
||||
Size=471,744
|
||||
Collapsed=0
|
||||
DockId=0x0000000A,1
|
||||
|
||||
[Window][Project]
|
||||
Pos=483,782
|
||||
Size=1110,416
|
||||
Collapsed=0
|
||||
DockId=0x0000000C,0
|
||||
|
||||
[Window][Objects]
|
||||
Pos=483,782
|
||||
Size=1110,416
|
||||
Collapsed=0
|
||||
DockId=0x0000000C,1
|
||||
|
||||
[Window][Physics]
|
||||
Pos=189,113
|
||||
Size=468,371
|
||||
Collapsed=0
|
||||
|
||||
[Docking][Data]
|
||||
DockSpace ID=0xC0DFADC4 Window=0xD0388BC8 Pos=150,89 Size=2066,1174 Split=X Selected=0x0C01D6D5
|
||||
DockNode ID=0x00000007 Parent=0xC0DFADC4 SizeRef=1557,1542 Split=X
|
||||
DockNode ID=0x00000003 Parent=0x00000007 SizeRef=481,1542 Split=Y Selected=0x5D711C2C
|
||||
DockNode ID=0x00000005 Parent=0x00000003 SizeRef=481,817 Selected=0x5D711C2C
|
||||
DockNode ID=0x00000006 Parent=0x00000003 SizeRef=481,723 Selected=0x68D924E0
|
||||
DockNode ID=0x00000004 Parent=0x00000007 SizeRef=1074,1542 Split=Y
|
||||
DockNode ID=0x00000001 Parent=0x00000004 SizeRef=2560,32 CentralNode=1 HiddenTabBar=1 Selected=0x0C01D6D5
|
||||
DockNode ID=0x00000002 Parent=0x00000004 SizeRef=2560,1508 Split=Y Selected=0xC450F867
|
||||
DockNode ID=0x0000000B Parent=0x00000002 SizeRef=1401,669 HiddenTabBar=1 Selected=0xC450F867
|
||||
DockNode ID=0x0000000C Parent=0x00000002 SizeRef=1401,386 Selected=0x9C21DE82
|
||||
DockNode ID=0x00000008 Parent=0xC0DFADC4 SizeRef=471,1542 Split=Y Selected=0x8C72BEA8
|
||||
DockNode ID=0x00000009 Parent=0x00000008 SizeRef=315,563 Selected=0xB8729153
|
||||
DockNode ID=0x0000000A Parent=0x00000008 SizeRef=315,977 Selected=0x73E3D51F
|
||||
|
||||