Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Transform Gizmo Refactor #1085

Merged
merged 40 commits into from
Nov 9, 2024
Merged
Show file tree
Hide file tree
Changes from 35 commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
e310017
Adding GizmoSceneObject
Dhruv-0-Arora Aug 7, 2024
4fa1ccd
Working gizmosceneobject on mirabuf objects
Dhruv-0-Arora Aug 7, 2024
faea318
Fixed implementation of pickup but working on shot trajectory
Dhruv-0-Arora Aug 7, 2024
a2b9e63
Fixed Zone Config panel
Dhruv-0-Arora Aug 7, 2024
b2cfa39
Removed unused import
Dhruv-0-Arora Aug 7, 2024
8be2b6f
Fixed configuring shot trajectory panel
Dhruv-0-Arora Aug 7, 2024
10010b4
Cleanup
Dhruv-0-Arora Aug 7, 2024
bf9c086
Adding documentation
Dhruv-0-Arora Aug 7, 2024
0937d76
Added requested changes
Dhruv-0-Arora Aug 8, 2024
1b64d2b
Merge remote-tracking branch 'origin/dev' into dhruv/1798/refactoring…
Dhruv-0-Arora Aug 12, 2024
6d0bc2f
Merge remote-tracking branch 'origin/dev' into dhruv/1798/refactoring…
Dhruv-0-Arora Aug 12, 2024
6f5f2ab
Fixing more merge conflicts
Dhruv-0-Arora Aug 12, 2024
1e9dbcd
Merge remote-tracking branch 'origin/dev' into dhruv/1798/refactoring…
Dhruv-0-Arora Aug 21, 2024
9cd80ac
Renamed mesh to obj and added functional fixes
Dhruv-0-Arora Aug 21, 2024
3181c05
Fixed build errors
Dhruv-0-Arora Aug 21, 2024
ffdf3ff
Cleaned code
Dhruv-0-Arora Aug 22, 2024
03a9d3f
Merge remote-tracking branch 'origin/dev' into dhruv/1798/refactoring…
Dhruv-0-Arora Aug 22, 2024
980bf10
Adding requested changes to remove all translation code from the Mira…
Dhruv-0-Arora Aug 22, 2024
2f8c826
Added fix to zoneconfig + added map for all gizmos attached to mirabu…
Dhruv-0-Arora Aug 23, 2024
8f6c6d8
Merge branch 'dev' into dhruv/1798/refactoring-gizmos
HunterBarclay Sep 22, 2024
50f1ce3
Initial gizmo component progress
HunterBarclay Aug 30, 2024
47b9301
fix!: Locate the issue with using the transform gizmo component.
HunterBarclay Sep 16, 2024
6dbdc35
refactor: Migrate use of gizmo in config UI to new gizmo component.
HunterBarclay Sep 21, 2024
18b9383
refactor: Move input scheme selection into new component.
HunterBarclay Sep 22, 2024
8f4ded3
feat: Add initial config menu that includes gizmo controls.
HunterBarclay Sep 22, 2024
38495f7
feat: Add assembly moving to configuration, along with move panel.
HunterBarclay Sep 22, 2024
b2b648a
fix: Gizmo centers on selected assembly.
HunterBarclay Sep 22, 2024
ceaf33f
fix: Added new initial config panel to import local.
HunterBarclay Sep 22, 2024
269d333
fix: Move assemblies into the center of the field.
HunterBarclay Sep 22, 2024
b10ccc7
Format plus some syntax errors
HunterBarclay Sep 22, 2024
2fc64cc
fix: Extra semi-colons from prettier
HunterBarclay Sep 22, 2024
1177d0d
refactor: Use optional instead of union type.
HunterBarclay Sep 22, 2024
ec877bf
Remove if statement
HunterBarclay Sep 23, 2024
bcd59b9
fix: Make changes suggested by @PepperLola .
HunterBarclay Sep 23, 2024
306d807
Format
HunterBarclay Sep 23, 2024
633d20d
fix: Readd delete controls to buttons
HunterBarclay Oct 11, 2024
710bc8a
fix: Delete and confirm work as expected.
HunterBarclay Oct 11, 2024
fd519b3
feat(gizmos): Add escape and enter keys for gizmo
HunterBarclay Oct 14, 2024
e09be3c
chore: Format
HunterBarclay Oct 21, 2024
7cb3837
chore: Python type linting
HunterBarclay Oct 21, 2024
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
4 changes: 4 additions & 0 deletions fission/src/Synthesis.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ import AnalyticsConsent from "./ui/components/AnalyticsConsent.tsx"
import PreferencesSystem from "./systems/preferences/PreferencesSystem.ts"
import APSManagementModal from "./ui/modals/APSManagementModal.tsx"
import ConfigurePanel from "./ui/panels/configuring/assembly-config/ConfigurePanel.tsx"
import GlobalUIComponent from "./ui/components/GlobalUIComponent.tsx"
import InitialConfigPanel from "./ui/panels/configuring/initial-config/InitialConfigPanel.tsx"

const worker = new Lazy<Worker>(() => new WPILibWSWorker())

Expand Down Expand Up @@ -162,6 +164,7 @@ function Synthesis() {
closeAllPanels={closeAllPanels}
>
<ToastProvider key="toast-provider">
<GlobalUIComponent />
<Scene useStats={import.meta.env.DEV} key="scene-in-toast-provider" />
<SceneOverlay />
<MainHUD key={"main-hud"} />
Expand Down Expand Up @@ -228,6 +231,7 @@ const initialPanels: ReactElement[] = [
<WSViewPanel key="ws-view" panelId="ws-view" />,
<DebugPanel key="debug" panelId="debug" />,
<ConfigurePanel key="configure" panelId="configure" />,
<InitialConfigPanel key="initial-config" panelId="initial-config" />,
]

export default Synthesis
26 changes: 13 additions & 13 deletions fission/src/aps/APS.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import World from "@/systems/World"
import { MainHUD_AddToast } from "@/ui/components/MainHUD"
import { Global_AddToast } from "@/ui/components/GlobalUIControls"
import { Mutex } from "async-mutex"

const APS_AUTH_KEY = "aps_auth"
Expand All @@ -14,7 +14,7 @@ export const ENDPOINT_SYNTHESIS_CHALLENGE = `/api/aps/challenge`

const ENDPOINT_AUTODESK_AUTHENTICATION_AUTHORIZE = "https://developer.api.autodesk.com/authentication/v2/authorize"
const ENDPOINT_AUTODESK_AUTHENTICATION_TOKEN = "https://developer.api.autodesk.com/authentication/v2/token"
const ENDPOINT_AUTODESK_REVOKE_TOKEN = "https://developer.api.autodesk.com/authentication/v2/revoke"
const ENDPOINT_AUTODESK_AUTHENTICATION_REVOKE = "https://developer.api.autodesk.com/authentication/v2/revoke"
const ENDPOINT_AUTODESK_USERINFO = "https://api.userprofile.autodesk.com/userinfo"

export interface APSAuth {
Expand Down Expand Up @@ -163,7 +163,7 @@ class APS {
["client_id", CLIENT_ID],
] as string[][]),
}
const res = await fetch(ENDPOINT_AUTODESK_REVOKE_TOKEN, opts)
const res = await fetch(ENDPOINT_AUTODESK_AUTHENTICATION_REVOKE, opts)
if (!res.ok) {
console.log("Failed to revoke auth token:\n")
return false
Expand Down Expand Up @@ -205,7 +205,7 @@ class APS {
} catch (e) {
console.error(e)
World.AnalyticsSystem?.Exception("APS Login Failure")
MainHUD_AddToast("error", "Error signing in.", "Please try again.")
Global_AddToast?.("error", "Error signing in.", "Please try again.")
}
})
}
Expand Down Expand Up @@ -236,7 +236,7 @@ class APS {
const json = await res.json()
if (!res.ok) {
if (shouldRelog) {
MainHUD_AddToast("warning", "Must Re-signin.", json.userMessage)
Global_AddToast?.("warning", "Must Re-signin.", json.userMessage)
this.auth = undefined
await this.requestAuthCode()
return false
Expand All @@ -249,13 +249,13 @@ class APS {
if (this.auth) {
await this.loadUserInfo(this.auth)
if (APS.userInfo) {
MainHUD_AddToast("info", "ADSK Login", `Hello, ${APS.userInfo.givenName}`)
Global_AddToast?.("info", "ADSK Login", `Hello, ${APS.userInfo.givenName}`)
}
}
return true
} catch (e) {
World.AnalyticsSystem?.Exception("APS Login Failure")
MainHUD_AddToast("error", "Error signing in.", "Please try again.")
Global_AddToast?.("error", "Error signing in.", "Please try again.")
this.auth = undefined
await this.requestAuthCode()
return false
Expand All @@ -281,7 +281,7 @@ class APS {
const json = await res.json()
if (!res.ok) {
World.AnalyticsSystem?.Exception("APS Login Failure")
MainHUD_AddToast("error", "Error signing in.", json.userMessage)
Global_AddToast?.("error", "Error signing in.", json.userMessage)
this.auth = undefined
return
}
Expand All @@ -293,7 +293,7 @@ class APS {
if (auth) {
await this.loadUserInfo(auth)
if (APS.userInfo) {
MainHUD_AddToast("info", "ADSK Login", `Hello, ${APS.userInfo.givenName}`)
Global_AddToast?.("info", "ADSK Login", `Hello, ${APS.userInfo.givenName}`)
}
} else {
console.error("Couldn't get auth data.")
Expand All @@ -306,7 +306,7 @@ class APS {
if (retry_login) {
this.auth = undefined
World.AnalyticsSystem?.Exception("APS Login Failure")
MainHUD_AddToast("error", "Error signing in.", "Please try again.")
Global_AddToast?.("error", "Error signing in.", "Please try again.")
}
}

Expand All @@ -327,7 +327,7 @@ class APS {
const json = await res.json()
if (!res.ok) {
World.AnalyticsSystem?.Exception("APS Failure: User Info")
MainHUD_AddToast("error", "Error fetching user data.", json.userMessage)
Global_AddToast?.("error", "Error fetching user data.", json.userMessage)
this.auth = undefined
await this.requestAuthCode()
return
Expand All @@ -347,7 +347,7 @@ class APS {
} catch (e) {
console.error(e)
World.AnalyticsSystem?.Exception("APS Login Failure: User Info")
MainHUD_AddToast("error", "Error signing in.", "Please try again.")
Global_AddToast?.("error", "Error signing in.", "Please try again.")
this.auth = undefined
}
}
Expand All @@ -363,7 +363,7 @@ class APS {
} catch (e) {
console.error(e)
World.AnalyticsSystem?.Exception("APS Login Failure: Code Challenge")
MainHUD_AddToast("error", "Error signing in.", "Please try again.")
Global_AddToast?.("error", "Error signing in.", "Please try again.")
}
}
}
Expand Down
12 changes: 6 additions & 6 deletions fission/src/aps/APSDataManagement.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
import { MainHUD_AddToast } from "@/ui/components/MainHUD"
import { Global_AddToast } from "@/ui/components/GlobalUIControls"
import APS from "./APS"
import TaskStatus from "@/util/TaskStatus"
import { Mutex } from "async-mutex"
Expand Down Expand Up @@ -140,9 +140,9 @@ export async function getHubs(): Promise<Hub[] | undefined> {
console.log(auth)
console.log(APS.userInfo)
if (e instanceof APSDataError) {
MainHUD_AddToast("error", e.title, e.detail)
Global_AddToast?.("error", e.title, e.detail)
} else if (e instanceof Error) {
MainHUD_AddToast("error", "Failed to get hubs.", e.message)
Global_AddToast?.("error", "Failed to get hubs.", e.message)
}
return undefined
}
Expand Down Expand Up @@ -179,7 +179,7 @@ export async function getProjects(hub: Hub): Promise<Project[] | undefined> {
} catch (e) {
console.error("Failed to get hubs")
if (e instanceof Error) {
MainHUD_AddToast("error", "Failed to get hubs.", e.message)
Global_AddToast?.("error", "Failed to get hubs.", e.message)
}
return undefined
}
Expand Down Expand Up @@ -224,7 +224,7 @@ export async function getFolderData(project: Project, folder: Folder): Promise<D
} catch (e) {
console.error("Failed to get folder data")
if (e instanceof Error) {
MainHUD_AddToast("error", "Failed to get folder data.", e.message)
Global_AddToast?.("error", "Failed to get folder data.", e.message)
}
return undefined
}
Expand All @@ -250,7 +250,7 @@ export async function searchFolder(project: Project, folder: Folder, filters?: F
},
})
if (!res.ok) {
MainHUD_AddToast("error", "Error getting cloud files.", "Please sign in again.")
Global_AddToast?.("error", "Error getting cloud files.", "Please sign in again.")
return []
}
const json = await res.json()
Expand Down
2 changes: 0 additions & 2 deletions fission/src/mirabuf/MirabufInstance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -234,8 +234,6 @@ class MirabufInstance {
}
}

console.debug(batchMap)

// Construct batched meshes
batchMap.forEach((materialBodyMap, material) => {
const count = countMap.get(material)!
Expand Down
Loading
Loading