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

Mirabuf Parser and Initial React UI #966

Merged
merged 127 commits into from
Mar 16, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
127 commits
Select commit Hold shift + click to select a range
4db48f8
Merge branch 'master' of https://github.com/Autodesk/synthesis into dev
BrandonPacewic Jul 3, 2023
a50d97a
Merge branch 'dev' of https://github.com/Autodesk/synthesis into dev
BrandonPacewic Jul 5, 2023
0522a80
Initial commit
BrandonPacewic Jul 5, 2023
ac79136
Tracking `.dll`s
BrandonPacewic Jul 5, 2023
b62a052
Builds
BrandonPacewic Jul 5, 2023
aef2e30
Seems to work
BrandonPacewic Jul 6, 2023
b267415
Removed `.exe` meta
BrandonPacewic Jul 6, 2023
024a3a6
Moved plane in front of camera & fixed material mapping
BrandonPacewic Jul 6, 2023
54b4414
Binary cleanup
BrandonPacewic Jul 6, 2023
c0a1817
Binary cleanup 2.0
BrandonPacewic Jul 6, 2023
0a81bf5
Binary cleanup 3.0
BrandonPacewic Jul 6, 2023
9559928
Fix scaling
BrandonPacewic Jul 6, 2023
4ce4e4b
Loaded custom `html`
BrandonPacewic Jul 6, 2023
11dbfb0
Reordered file structure
BrandonPacewic Jul 6, 2023
712a507
Save before refactoring
BrandonPacewic Jul 10, 2023
9a6a077
Cleanup cef setup
BrandonPacewic Jul 15, 2023
ad65657
Final cleanups
BrandonPacewic Jul 15, 2023
08529e5
Install CEF binary cmake setup
BrandonPacewic Jul 16, 2023
1bc8cdf
Working mac client build
BrandonPacewic Jul 17, 2023
ee03a1a
Sucessfully builds but does not correctly link cef
BrandonPacewic Jul 18, 2023
d6c4513
Not really working
BrandonPacewic Jul 19, 2023
1caf3b5
Broken linking
BrandonPacewic Jul 19, 2023
273703e
Updated two stage build process
BrandonPacewic Jul 20, 2023
8ef8e40
Mac dynamic linking still broken
BrandonPacewic Jul 20, 2023
14f3dd2
Progress for mac arm
BrandonPacewic Jul 20, 2023
1bb9112
Working on windows build
BrandonPacewic Jul 20, 2023
b93d805
Untested windows build script
BrandonPacewic Jul 20, 2023
fa0725a
Updated windows main
BrandonPacewic Jul 20, 2023
09aa24e
started react ui with panel, label, button
PepperLola Jul 21, 2023
f2e307e
Finally a working mac executable
BrandonPacewic Jul 21, 2023
ee80731
started slider component
PepperLola Jul 21, 2023
224be2c
Finished all windows `todo`s
BrandonPacewic Jul 21, 2023
6746cec
Windows cmake syntax error
BrandonPacewic Jul 21, 2023
1dd2b9e
Windows cleanups
BrandonPacewic Jul 21, 2023
f169a5f
Added windows resource files
BrandonPacewic Jul 21, 2023
f0c8a62
More windows cleanups
BrandonPacewic Jul 21, 2023
5ac6ce1
Cmake resource copying bug
BrandonPacewic Jul 21, 2023
e9ff673
improve slider with label and value, button click animation, panel ce…
PepperLola Jul 21, 2023
1ff3ba2
created checkbox, dropdown, stack
PepperLola Jul 21, 2023
5f39fa9
Merge remote-tracking branch 'origin/feature/1563/cef-integration' in…
PepperLola Jul 21, 2023
e300ad1
set cef location to local react server
PepperLola Jul 21, 2023
4fe827c
installed prettier formatter
PepperLola Jul 21, 2023
a7cb3f9
basic modal context
PepperLola Jul 22, 2023
ba8d336
created main hud, modal state management works well enough
PepperLola Jul 22, 2023
cb1af9f
added autodesk logo to main hud
PepperLola Jul 22, 2023
d06039a
gradient to bg of main hud
PepperLola Jul 22, 2023
7e42b4c
added panels manager but modals don't close panels yet
PepperLola Jul 23, 2023
c949301
opening modal closes all panels
PepperLola Jul 23, 2023
a8d54d6
Merge remote-tracking branch 'origin/dev' into feature/1589/react-ui
PepperLola Jul 23, 2023
f05c0c0
fixed build errors, added prettier config
PepperLola Jul 24, 2023
94a81e0
added icons instead of placeholder images
PepperLola Jul 24, 2023
8492549
added framer motion for opening and closing main hud
PepperLola Jul 24, 2023
8484a67
build as single file so no cors error
PepperLola Jul 24, 2023
36bc050
allow eslint warnings, add eslint+prettier format validating action
PepperLola Jul 24, 2023
4e5728c
cd react in action
PepperLola Jul 24, 2023
f39c4cf
guess we need to cd twice
PepperLola Jul 24, 2023
da8ce11
added more modals, disable react-refresh warning
PepperLola Jul 25, 2023
d0b72c9
allow panels to close
PepperLola Jul 25, 2023
70578e1
formatter
PepperLola Jul 25, 2023
44fba4e
fix title wrapping
PepperLola Jul 25, 2023
a3c937e
fix multibot panel
PepperLola Jul 25, 2023
feea9b5
added toast system
PepperLola Jul 25, 2023
f37de83
bad draft of theme editor
PepperLola Jul 25, 2023
42de566
fixed multibot panel, added radio button that doesn't work
PepperLola Jul 25, 2023
79f1e25
Merge remote-tracking branch 'origin/dev' into feature/1589/react-ui
PepperLola Jul 26, 2023
4eb14fc
improved theme manager and added ability to create/edit new themes
PepperLola Aug 2, 2023
4b51505
yarn format
PepperLola Aug 5, 2023
fb378c6
added a couple modals
PepperLola Aug 15, 2023
e3cca73
formatter
PepperLola Aug 15, 2023
bb672d4
added some modals and changed organization to match c#
PepperLola Aug 16, 2023
15ee32f
added a bunch of modals and the Input, ScrollView and Container compo…
PepperLola Aug 16, 2023
9fa4549
format, remove default modal, fix controls panel title wrapping
PepperLola Aug 16, 2023
936c90f
started on theme manager
PepperLola Aug 19, 2023
696d776
finished theme provider with updating colors
PepperLola Aug 19, 2023
7b9dac6
new theme, delete theme, delete all theme modals open, formatted
PepperLola Aug 19, 2023
58b5caa
theme editor preview button, current theme now always shows as select…
PepperLola Aug 19, 2023
48acc76
finished adding modals
PepperLola Aug 21, 2023
0d17a48
added robot placement and scoreboard panels
PepperLola Aug 21, 2023
c859dd6
added more panels
PepperLola Aug 22, 2023
cd89790
Merge remote-tracking branch 'origin/dev' into feature/1589/react-ui
PepperLola Aug 22, 2023
b09d362
added tooltips, made main hud start off screen, added path aliases
PepperLola Aug 22, 2023
b5ca662
added all tooltip calls
PepperLola Aug 22, 2023
a65278e
formatter
PepperLola Aug 22, 2023
f30bec6
added toast colors and util file
PepperLola Aug 22, 2023
424c54a
dumb algorithm for background color in case i can't figure out transp…
PepperLola Aug 22, 2023
4f79100
fixed background color when in prod
PepperLola Aug 23, 2023
1e452b5
made dom functions available for cef
PepperLola Aug 23, 2023
fb1138e
added mouse position function and readability warning in theme editor
PepperLola Aug 23, 2023
8bba32c
improved theme editor ui
PepperLola Aug 23, 2023
2dc8085
fixed theme editor cancel button
PepperLola Aug 23, 2023
32c8149
preliminary mirabuf file import
PepperLola Mar 8, 2024
fbeecf1
Fixed shadows in Jolt example and converted Fusion coordinates to our…
HunterBarclay Mar 10, 2024
fa3bc8a
Adding mirabuf node parsing
HunterBarclay Mar 12, 2024
96cee19
Added mirabuf loading tests, started reworking the node algorithm
HunterBarclay Mar 12, 2024
5e19760
satisfy linter
PepperLola Mar 13, 2024
117f8ef
Preliminary rigid node generation done. Need either AB testing for fu…
HunterBarclay Mar 13, 2024
adda2f9
mirabuf loading progress but transforms are bad
PepperLola Mar 13, 2024
f06d8e2
Rigidgroups still need work
HunterBarclay Mar 13, 2024
c009edf
Added dozer and fixed function change
HunterBarclay Mar 13, 2024
d04e452
not sure what's wrong with rotations and positions
PepperLola Mar 13, 2024
40815b3
Merge branch 'jwrigh/mirabuf-import' of github.com:Autodesk/synthesis…
PepperLola Mar 13, 2024
93584f0
Transposed extracted rotation. Dozers left eye is still missing however
HunterBarclay Mar 13, 2024
ab85d41
Moved julians mirabuf files, updated paths, fixed issue with grounded…
HunterBarclay Mar 13, 2024
66b6e4c
Testing materials plus making meshes by instances
HunterBarclay Mar 14, 2024
7dc8e67
Still working out the matrix conversion issue
HunterBarclay Mar 14, 2024
1f4af07
Fixed JoltExamp temporarily
HunterBarclay Mar 14, 2024
286708f
Matrix conversion work
HunterBarclay Mar 14, 2024
c112a44
moved some functions out of JoltExample
PepperLola Mar 14, 2024
34d2d22
moved transform stuff out of JoltExample and added mira path url param
PepperLola Mar 14, 2024
dc1e21b
Merge branch 'fission' into jwrigh/mirabuf-import
HunterBarclay Mar 14, 2024
6b65f37
Merge branch 'fission' into jwrigh/mirabuf-import
HunterBarclay Mar 14, 2024
4820ec4
Updated to JoltPhysics 0.19.0
HunterBarclay Mar 14, 2024
c331017
Jolt to ThreeJS conversions tested
HunterBarclay Mar 14, 2024
bba0027
Working on SceneRenderer and first SceneObjects
HunterBarclay Mar 15, 2024
a543aa6
Started on some ideas for the core systems. Moved everything to be mo…
HunterBarclay Mar 15, 2024
02c7c28
Merge branch 'jwrigh/mirabuf-import' into feature/1589/react-ui
PepperLola Mar 15, 2024
54c8e46
moved ui over to fission project
PepperLola Mar 15, 2024
99a1686
Tidying
HunterBarclay Mar 15, 2024
7dfe4e8
Fixed stats and mainhud
HunterBarclay Mar 15, 2024
fd18b1e
Added robot modal works, removed cef
HunterBarclay Mar 16, 2024
18a406d
Working on new modal for managing assemblies in the scnee
HunterBarclay Mar 16, 2024
02e3684
Fixing use of Math.random
HunterBarclay Mar 16, 2024
d1c1f12
Fixed format checker
HunterBarclay Mar 16, 2024
ef20dbe
Updated ignore pattern
HunterBarclay Mar 16, 2024
e8a422a
Fixing errors and warning
HunterBarclay Mar 16, 2024
7d2933f
Remove max warnings and fixed any explicit
HunterBarclay Mar 16, 2024
403a157
No longer fails on prettier
HunterBarclay Mar 16, 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
Prev Previous commit
Next Next commit
added toast colors and util file
  • Loading branch information
PepperLola committed Aug 22, 2023
commit f30bec6f06314f74e64da36cb6d1df5bafa2666a
1 change: 1 addition & 0 deletions react/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ import ScoringZonesPanel from "./panels/configuring/scoring/ScoringZonesPanel"
import ZoneConfigPanel from "./panels/configuring/scoring/ZoneConfigPanel"
import ScoreboardPanel from "./panels/information/ScoreboardPanel"
import DriverStationPanel from "./panels/simulation/DriverStationPanel"
import Toast from "./components/Toast"

const initialModals = [
<SettingsModal modalId="settings" />,
Expand Down
16 changes: 13 additions & 3 deletions react/src/ThemeContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,23 @@ export type ColorName =
| "AcceptCancelButtonText"
| "MatchRedAlliance"
| "MatchBlueAlliance"
| "ToastInfo"
| "ToastWarning"
| "ToastError"

const colorNameToProp = (colorName: ColorName) => {
export const colorNameToTailwind = (colorName: ColorName) => {
return "bg" +
colorName
.replace(/([A-Z]+)/g, "-$1")
.replace(/(?<=[A-Z])([A-Z])(?![A-Z]|$)/g, "-$1")
.toLowerCase()
}
export const colorNameToProp = (colorName: ColorName) => {
return (
"-" +
colorName
.replace(/([A-Z]+)/g, "-$1")
.replace(/(?<=[A-Z])([A-Z])(?![A-Z])/g, "-$1")
.replace(/(?<=[A-Z])([A-Z])(?![A-Z]|$)/g, "-$1")
.toLowerCase()
)
}
Expand Down Expand Up @@ -113,7 +123,7 @@ export const ThemeProvider: React.FC<ThemeProviderProps> = ({
const propName = colorNameToProp(n as ColorName)
root.style.setProperty(
propName,
`rgba(${c.r}, ${c.g}, ${c.b}, ${c.a}`
`rgba(${c.r}, ${c.g}, ${c.b}, ${c.a})`
)
})
}
Expand Down
3 changes: 3 additions & 0 deletions react/src/ToastContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@ export const ToastContainer: React.FC = () => {

return (
<div className="absolute right-0 bottom-0 pl-8 pb-8 w-min h-fit overflow-hidden flex flex-col gap-2">
<Toast id="id-info" title="Title" type="info" description="Test toast" />
<Toast id="id-warning" title="Title" type="warning" description="Test toast" />
<Toast id="id-error" title="Title" type="error" description="Test toast" />
<AnimatePresence>
{toasts.length > 0 &&
toasts.map(t => (
Expand Down
2 changes: 1 addition & 1 deletion react/src/components/Slider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ const Slider: React.FC<SliderProps> = ({
else percent += step - diff
}
const v = percent * (max - min) + min
onChange(v)
if (onChange) onChange(v)
setValue(v)
}
}
Expand Down
7 changes: 4 additions & 3 deletions react/src/components/Toast.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ const TOAST_TIMEOUT: number = 5_000

const Toast: React.FC<ToastData> = ({ id, type, title, description }) => {
const { removeToast } = useToastContext()

useEffect(() => {
const timer = setTimeout(() => {
removeToast(id)
Expand All @@ -30,7 +31,7 @@ const Toast: React.FC<ToastData> = ({ id, type, title, description }) => {
className="h-full w-full text-main-text"
/>
)
className = "bg-purple-700"
className = "bg-toast-info"
break
case "warning":
icon = (
Expand All @@ -39,7 +40,7 @@ const Toast: React.FC<ToastData> = ({ id, type, title, description }) => {
className="h-full w-full text-main-text"
/>
)
className = "bg-yellow-500"
className = "bg-toast-warning"
break
case "error":
icon = (
Expand All @@ -48,7 +49,7 @@ const Toast: React.FC<ToastData> = ({ id, type, title, description }) => {
className="h-full w-full text-main-text"
/>
)
className = "bg-red-500"
className = "bg-toast-error"
break
}

Expand Down
3 changes: 3 additions & 0 deletions react/src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ const defaultColors: Theme = {
FloorGrid: { r: 93, g: 93, b: 93, a: 255 },
MatchRedAlliance: { r: 255, g: 0, b: 0, a: 255 },
MatchBlueAlliance: { r: 0, g: 0, b: 255, a: 255 },
ToastInfo: { r: 126, g: 34, b: 206, a: 255 },
ToastWarning: { r: 234, g: 179, b: 8, a: 255 },
ToastError: { r: 239, g: 68, b: 68, a: 255 },
}
const themes = {
Default: defaultColors,
Expand Down
24 changes: 11 additions & 13 deletions react/src/modals/configuring/theme-editor/ThemeEditorModal.tsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
import React, { useState } from "react"
import { FaChessBoard } from "react-icons/fa6"
import Modal, { ModalPropsImpl } from "../../../components/Modal"
import Modal, { ModalPropsImpl } from "@/components/Modal"
import { RgbaColor, RgbaColorPicker } from "react-colorful"
import Stack, { StackDirection } from "../../../components/Stack"
import Dropdown from "../../../components/Dropdown"
import Button from "../../../components/Button"
import Stack, { StackDirection } from "@/components/Stack"
import Dropdown from "@/components/Dropdown"
import Button from "@/components/Button"
import {
ColorName,
Theme,
colorNameToProp,
colorNameToTailwind,
defaultThemeName,
useTheme,
} from "../../../ThemeContext"
import { useModalControlContext } from "../../../ModalContext"
} from "@/ThemeContext"
import { useModalControlContext } from "@/ModalContext"

const ThemeEditorModal: React.FC<ModalPropsImpl> = ({ modalId }) => {
const { themes, currentTheme, setTheme, updateColor, applyTheme } =
Expand Down Expand Up @@ -97,18 +99,14 @@ const ThemeEditorModal: React.FC<ModalPropsImpl> = ({ modalId }) => {
{Object.entries(themes[selectedTheme]).map(([n, c]) => (
<div
key={n}
className={`flex flex-row gap-2 content-middle align-center cursor-pointer rounded-md p-1 ${
n == selectedColor ? "bg-gray-700" : ""
}`}
className={`flex flex-row gap-2 content-middle align-center cursor-pointer rounded-md p-1 ${n == selectedColor ? "bg-background-secondary" : ""
}`}
onClick={() => {
setSelectedColor(n as ColorName)
}}
>
<div
className="w-6 h-6 rounded-md"
style={{
background: `rgba(${c.r}, ${c.g}, ${c.b}, ${c.a})`,
}}
className={`w-6 h-6 rounded-md ${colorNameToTailwind(n as ColorName)}`}
></div>
<div className="h-6 text-main-text">{n}</div>
</div>
Expand Down
11 changes: 11 additions & 0 deletions react/src/util/CEFAPI.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
export const click = (btn: number, x: number, y: number) => {
const el = document.elementFromPoint(x, y);

const event = new MouseEvent("click", {
clientX: x,
clientY: y,
bubbles: true,
button: btn
})
el?.dispatchEvent(event)
}
63 changes: 36 additions & 27 deletions react/tailwind.config.js
Original file line number Diff line number Diff line change
@@ -1,40 +1,49 @@
/** @type {import('tailwindcss').Config} */

let colors = {
'interactive-element-solid': 'var(--interactive-element-solid)',
'interactive-element-left': 'var(--interactive-element-left)',
'interactive-element-right': 'var(--interactive-element-right)',
'background': 'var(--background)',
'background-secondary': 'var(--background-secondary)',
'interactive-background': 'var(--interactive-background)',
'background-hud': 'var(--background-hud)',
'interactive-hover': 'var(--interactive-hover)',
'interactive-select': 'var(--interactive-select)',
'main-text': 'var(--main-text)',
'scrollbar': 'var(--scrollbar)',
'accept-button': 'var(--accept-button)',
'cancel-button': 'var(--cancel-button)',
'interactive-element-text': 'var(--interactive-element-text)',
'icon': 'var(--icon)',
'main-hud-icon': 'var(--main-hud-icon)',
'main-hud-close-icon': 'var(--main-hud-close-icon)',
'highlight-hover': 'var(--highlight-hover)',
'highlight-select': 'var(--highlight-select)',
'skybox-top': 'var(--skybox-top)',
'skybox-bottom': 'var(--skybox-bottom)',
'floor-grid': 'var(--floor-grid)',
'accept-cancel-button-text': 'var(--accept-cancel-button-text)',
'match-red-alliance': 'var(--match-red-alliance)',
'match-blue-alliance': 'var(--match-blue-alliance)',
'toast-info': 'var(--toast-info)',
'toast-warning': 'var(--toast-warning)',
'toast-error': 'var(--toast-error)',
}

let safelist = Object.keys(colors).map(c => "bg-" + c);

export default {
content: [
"./index.html",
"./src/**/*.{js,jsx,ts,tsx}",
],
theme: {
extend: {
colors: {
'interactive-element-solid': 'var(--interactive-element-solid)',
'interactive-element-left': 'var(--interactive-element-left)',
'interactive-element-right': 'var(--interactive-element-right)',
'background': 'var(--background)',
'background-secondary': 'var(--background-secondary)',
'interactive-background': 'var(--interactive-background)',
'background-hud': 'var(--background-hud)',
'interactive-hover': 'var(--interactive-hover)',
'interactive-select': 'var(--interactive-select)',
'main-text': 'var(--main-text)',
'scrollbar': 'var(--scrollbar)',
'accept-button': 'var(--accept-button)',
'cancel-button': 'var(--cancel-button)',
'interactive-element-text': 'var(--interactive-element-text)',
'icon': 'var(--icon)',
'main-hud-icon': 'var(--main-hud-icon)',
'main-hud-close-icon': 'var(--main-hud-close-icon)',
'highlight-hover': 'var(--highlight-hover)',
'highlight-select': 'var(--highlight-select)',
'skybox-top': 'var(--skybox-top)',
'skybox-bottom': 'var(--skybox-bottom)',
'floor-grid': 'var(--floor-grid)',
'accept-cancel-button-text': 'var(--accept-cancel-button-text)',
'match-red-alliance': 'var(--match-red-alliance)',
'match-blue-alliance': 'var(--match-blue-alliance)',
}
colors: colors,
},
},
safelist: safelist,
plugins: [],
}