Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
# Changelog
## v0.8.2 - 2026-02-01
### 🐞 Fixes
- [Patch] added a dropdown menu to import button (645a6e7…)
- [Patch] Added parenting to scenegraph (7dd0179…)
- [Patch] Added option to select child entity by using shift,right mouse (c5210ee…)
- [Patch] Added quick preview (c6c7f40…)
- [Patch] Fixed issue of new project copying data over from previous one (452fa93…)
## v0.8.1 - 2026-01-26
## v0.8.0 - 2026-01-19
### 🐞 Fixes
Expand Down
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ let package = Package(
// Use a branch during active development:
// .package(url: "https://github.com/untoldengine/UntoldEngine.git", branch: "develop"),
// Or pin to a release:
.package(url: "https://github.com/untoldengine/UntoldEngine.git", exact: "0.8.1"),
.package(url: "https://github.com/untoldengine/UntoldEngine.git", exact: "0.8.2"),
],
targets: [
.executableTarget(
Expand Down
5 changes: 5 additions & 0 deletions Sources/UntoldEditor/Build/CreateProjectView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,11 @@ struct CreateProjectView: View {
isBuilding = true
buildProgress = "Creating project..."

// Clear the current project BEFORE building to prevent asset copying
NotificationCenter.default.post(name: .projectWillSwitch, object: nil)
assetBasePath = nil
EditorAssetBasePath.shared.basePath = nil

Task {
do {
let settings = createBuildSettings()
Expand Down
54 changes: 38 additions & 16 deletions Sources/UntoldEditor/Editor/AssetBrowserView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ struct AssetBrowserView: View {
@State private var statusMessage: String?
@State private var statusIsError = false
@State private var targetEntityName: String = "None"
@State private var showImportMenu = false
var editor_addEntityWithAsset: () -> Void
private var currentFolderPath: URL? {
folderPathStack.last
Expand All @@ -75,9 +76,18 @@ struct AssetBrowserView: View {
.bold()
.foregroundColor(.white)

Button(action: importAsset) {
Menu {
ForEach(AssetCategory.allCases, id: \.self) { category in
Button(action: { importAssetForCategory(category) }) {
HStack {
Image(systemName: category.iconName)
Text("Import \(category.rawValue)")
}
}
}
} label: {
HStack(spacing: 6) {
Text("Import Asset")
Text("Import")
Image(systemName: "plus.circle")
.foregroundColor(.white)
}
Expand Down Expand Up @@ -320,37 +330,49 @@ struct AssetBrowserView: View {
}
}

private func importAsset() {
private func importAssetForCategory(_ category: AssetCategory) {
guard editorBaseAssetPath.basePath != nil else {
showBasePathAlert = true
return
}

let openPanel = NSOpenPanel()
openPanel.allowedContentTypes = [
UTType(filenameExtension: "usdz")!,
.png, .jpeg, .tiff,
UTType(filenameExtension: "hdr")!,
UTType(filenameExtension: "ply")!,
UTType(filenameExtension: "json")!,
UTType(filenameExtension: "uscript")!,
]
openPanel.canChooseDirectories = (selectedCategory == "Materials")

// Set allowed file types based on category
switch category {
case .models:
openPanel.allowedContentTypes = [UTType(filenameExtension: "usdz")!]
case .animations:
openPanel.allowedContentTypes = [UTType(filenameExtension: "usdz")!]
case .scripts:
openPanel.allowedContentTypes = [UTType(filenameExtension: "uscript")!]
case .scenes:
openPanel.allowedContentTypes = [UTType(filenameExtension: "json")!]
case .gaussians:
openPanel.allowedContentTypes = [UTType(filenameExtension: "ply")!]
case .materials:
openPanel.allowedContentTypes = [.png, .jpeg, .tiff]
case .hdr:
openPanel.allowedContentTypes = [UTType(filenameExtension: "hdr")!]
}

openPanel.canChooseDirectories = (category == .materials)
openPanel.allowsMultipleSelection = true

guard let basePath = assetBasePath else { return }
// Supported categories must match your enum/string values
guard ["Models", "Animations", "HDR", "Materials", "Gaussians", "Scenes", "Scripts"].contains(selectedCategory) else { return }
let categoryString = category.rawValue
// Ensure category is valid
guard ["Models", "Animations", "HDR", "Materials", "Gaussians", "Scenes", "Scripts"].contains(categoryString) else { return }

let fm = FileManager.default
let categoryRoot = basePath.appendingPathComponent(selectedCategory!, isDirectory: true)
let categoryRoot = basePath.appendingPathComponent(categoryString, isDirectory: true)
// Ensure category folder exists (e.g., <Base>/Models)
try? fm.createDirectory(at: categoryRoot, withIntermediateDirectories: true)

if openPanel.runModal() == .OK {
for sourceURL in openPanel.urls {
do {
switch selectedCategory {
switch categoryString {
case "HDR":
// Copy .hdr directly into HDR folder
let destURL = categoryRoot.appendingPathComponent(sourceURL.lastPathComponent)
Expand Down
1 change: 1 addition & 0 deletions Sources/UntoldEditor/Editor/EditorController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ class EditorController: SelectionDelegate, ObservableObject {
// Notification to ask the Asset Browser to reload its listing
extension Notification.Name {
static let assetBrowserReload = Notification.Name("AssetBrowser.Reload")
static let projectWillSwitch = Notification.Name("Project.WillSwitch")
}

func saveScene(sceneData: SceneData) {
Expand Down
Loading
Loading