Skip to content

Commit e99d6d8

Browse files
Merge dev
* 'dev' of github.com:Autodesk/synthesis: feat: hide unused wheeltypes feat: hide material tagging UI and mix and match toggle fix: run formatter Update fission/src/mirabuf/MirabufSceneObject.ts Update fission/src/ui/panels/configuring/assembly-config/configure/AssemblySelection.tsx fix: make configure asset panel react to configuration changes and robot removals
2 parents ee4b132 + 91a6e62 commit e99d6d8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+131
-98
lines changed

exporter/SynthesisFusionAddin/web/src/App.tsx

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { useCallback, useEffect, useState } from "react"
22

33
import "./App.css"
4-
import { RestartAlt, Settings, SportsFootball, Texture } from "@mui/icons-material"
4+
import { RestartAlt, Settings, SportsFootball } from "@mui/icons-material"
55
import DownloadIcon from "@mui/icons-material/Download"
66
import PrecisionManufacturingIcon from "@mui/icons-material/PrecisionManufacturing"
77
import SaveIcon from "@mui/icons-material/Save"
@@ -36,7 +36,7 @@ import GamepiecesConfigTab from "./ui/GamepiecesConfigTab.tsx"
3636
import GeneralConfigTab from "./ui/GeneralConfigTab.tsx"
3737
import GlobalAlert from "./ui/GlobalAlert.tsx"
3838
import JointsConfigTab from "./ui/JointsConfigTab.tsx"
39-
import MaterialTaggingTab, { type TaggedBody } from "./ui/MaterialTaggingTab.tsx"
39+
import type { TaggedBody } from "./ui/MaterialTaggingTab.tsx"
4040

4141
function TabPanel(props: { children?: React.ReactNode; value: number; index: number }) {
4242
const { children, value, index, ...other } = props
@@ -179,7 +179,11 @@ function App() {
179179
return (
180180
<ThemeProvider theme={theme}>
181181
<Backdrop
182-
sx={theme => ({ color: "#fff", zIndex: theme.zIndex.drawer + 1, backdropFilter: "blur(0px)" })}
182+
sx={theme => ({
183+
color: "#fff",
184+
zIndex: theme.zIndex.drawer + 1,
185+
backdropFilter: "blur(0px)",
186+
})}
183187
open={isSelecting}
184188
onClick={() => {
185189
Global_SetAlert(
@@ -227,7 +231,7 @@ function App() {
227231
disabled={generalConfig.exportMode === ExportMode.ROBOT}
228232
/>
229233

230-
<Tab icon={<Texture />} iconPosition={"start"} label="Materials" />
234+
{/*<Tab icon={<Texture />} iconPosition={"start"} label="Materials" />*/}
231235

232236
{/*<Tab label="APS" />*/}
233237
</Tabs>
@@ -252,13 +256,13 @@ function App() {
252256
selection={{ isSelecting, setIsSelecting }}
253257
/>
254258
</TabPanel>
255-
<TabPanel value={activeTab} index={3}>
256-
<MaterialTaggingTab
257-
tags={taggedBodies}
258-
updateTags={updateTaggedBodies}
259-
selection={{ isSelecting, setIsSelecting }}
260-
/>
261-
</TabPanel>
259+
{/*<TabPanel value={activeTab} index={3}>*/}
260+
{/* <MaterialTaggingTab*/}
261+
{/* tags={taggedBodies}*/}
262+
{/* updateTags={updateTaggedBodies}*/}
263+
{/* selection={{ isSelecting, setIsSelecting }}*/}
264+
{/* />*/}
265+
{/*</TabPanel>*/}
262266
<Container
263267
sx={{
264268
position: "sticky",

exporter/SynthesisFusionAddin/web/src/ui/GeneralConfigTab.tsx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import AnimationIcon from "@mui/icons-material/Animation"
22
import ArchiveIcon from "@mui/icons-material/Archive"
33
import BalanceIcon from "@mui/icons-material/Balance"
44
import LaunchIcon from "@mui/icons-material/Launch"
5-
import PrecisionManufacturingIcon from "@mui/icons-material/PrecisionManufacturing"
65
import SaveIcon from "@mui/icons-material/Save"
76
import TuneIcon from "@mui/icons-material/Tune"
87
import {
@@ -135,13 +134,14 @@ function GeneralConfigTab({ config, updateConfigItem }: ConfigTabProps): React.R
135134
<Switch edge="end" onChange={updateLiteral("compressOutput")} checked={config.compressOutput} />
136135
</ListItem>
137136
<Collapse in={config.exportMode === ExportMode.ROBOT}>
138-
<ListItem>
139-
<ListItemIcon>
140-
<PrecisionManufacturingIcon />
141-
</ListItemIcon>
142-
<ListItemText primary="Export as Part" secondary="Use to export as a part for Mix And Match" />
143-
<Switch edge="end" onChange={updateLiteral("exportAsPart")} checked={config.exportAsPart} />
144-
</ListItem>
137+
{/* TODO: enable when mix and match is created */}
138+
{/*<ListItem>*/}
139+
{/* <ListItemIcon>*/}
140+
{/* <PrecisionManufacturingIcon />*/}
141+
{/* </ListItemIcon>*/}
142+
{/* <ListItemText primary="Export as Part" secondary="Use to export as a part for Mix And Match" />*/}
143+
{/* <Switch edge="end" onChange={updateLiteral("exportAsPart")} checked={config.exportAsPart} />*/}
144+
{/*</ListItem>*/}
145145
<ListItem>
146146
<ListItemIcon>
147147
<TuneIcon />

exporter/SynthesisFusionAddin/web/src/ui/JointsConfigTab.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,8 @@ function JointsConfigTab({ joints, updateJoints, selection }: JointsConfigTabPro
207207
/>
208208

209209
<h4>
210-
{joints.filter(j => j.isWheel).length} Wheel{joints.filter(j => j.isWheel).length !== 1 ? "s" : ""}
210+
{joints.filter(j => j.isWheel).length} Wheel
211+
{joints.filter(j => j.isWheel).length !== 1 ? "s" : ""}
211212
</h4>
212213
<TableContainer component={Paper} elevation={6}>
213214
<Table sx={{ minWidth: 650 }} aria-label="simple table">
@@ -241,8 +242,8 @@ function JointsConfigTab({ joints, updateJoints, selection }: JointsConfigTabPro
241242
fullWidth
242243
>
243244
<MenuItem value={WheelType.STANDARD}>Standard</MenuItem>
244-
<MenuItem value={WheelType.MECANUM}>Mecanum</MenuItem>
245-
<MenuItem value={WheelType.OMNI}>Omni</MenuItem>
245+
{/*<MenuItem value={WheelType.MECANUM}>Mecanum</MenuItem>*/}
246+
{/*<MenuItem value={WheelType.OMNI}>Omni</MenuItem>*/}
246247
</Select>
247248
</TableCell>
248249
</TableRow>

fission/src/mirabuf/MirabufSceneObject.ts

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,8 @@ class MirabufSceneObject extends SceneObject implements ContextSupplier {
313313
if (this.miraType === MiraType.ROBOT || !cameraControls.focusProvider) {
314314
cameraControls.focusProvider = this
315315
}
316+
317+
MirabufObjectChangeEvent.dispatch(this)
316318
}
317319

318320
// Centered in xz plane, bottom surface of object
@@ -431,6 +433,7 @@ class MirabufSceneObject extends SceneObject implements ContextSupplier {
431433
if (this._brain && this._brain instanceof SynthesisBrain) {
432434
this._brain.clearControls()
433435
}
436+
MirabufObjectChangeEvent.dispatch(null)
434437
}
435438

436439
public eject() {
@@ -986,3 +989,29 @@ export class RigidNodeAssociate extends BodyAssociate {
986989
}
987990

988991
export default MirabufSceneObject
992+
993+
export class MirabufObjectChangeEvent extends Event {
994+
private static _eventKey = "MirabufObjectChange"
995+
private _obj: MirabufSceneObject | null
996+
997+
private constructor(obj: MirabufSceneObject | null) {
998+
super(MirabufObjectChangeEvent._eventKey)
999+
this._obj = obj
1000+
}
1001+
1002+
public static addEventListener(cb: (object: MirabufSceneObject | null) => void): () => void {
1003+
const listener = (event: Event) => {
1004+
if (event instanceof MirabufObjectChangeEvent) {
1005+
cb(event._obj)
1006+
} else {
1007+
cb(null)
1008+
}
1009+
}
1010+
window.addEventListener(this._eventKey, listener)
1011+
return () => window.removeEventListener(this._eventKey, listener)
1012+
}
1013+
1014+
public static dispatch(obj: MirabufSceneObject | null) {
1015+
window.dispatchEvent(new MirabufObjectChangeEvent(obj))
1016+
}
1017+
}

fission/src/ui/UIProvider.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import CloseIcon from "@mui/icons-material/Close"
2-
import { IconButton } from "./components/StyledComponents"
32
import type { SnackbarKey, SnackbarMessage, VariantType } from "notistack"
43
import { useSnackbar } from "notistack"
54
import type React from "react"
@@ -8,6 +7,7 @@ import { useCallback, useReducer, useState } from "react"
87
import { v4 as uuidv4 } from "uuid"
98
import type { ModalImplProps } from "./components/Modal"
109
import type { PanelImplProps } from "./components/Panel"
10+
import { IconButton } from "./components/StyledComponents"
1111
import {
1212
CloseType,
1313
type ConfigureScreenFn,

fission/src/ui/components/AnalyticsConsent.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { Box } from "@mui/material"
2-
import { Button } from "./StyledComponents"
32
import { AiOutlineClose } from "react-icons/ai"
43
import Label from "./Label"
4+
import { Button } from "./StyledComponents"
55

66
interface AnalyticsConsentProps {
77
onClose: () => void

fission/src/ui/components/ContextMenu.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import { Divider, Stack } from "@mui/material"
2-
import { Button } from "./StyledComponents"
32
import type React from "react"
43
import { useEffect, useState } from "react"
54
import { type ContextData, ContextSupplierEvent } from "./ContextMenuData"
65
import { globalOpenModal, globalOpenPanel } from "./GlobalUIControls"
76
import Label from "./Label"
7+
import { Button } from "./StyledComponents"
88

99
interface ContextMenuStateData {
1010
data: ContextData

fission/src/ui/components/MainHUD.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { Box, Stack } from "@mui/material"
2-
import { Button, IconButton } from "./StyledComponents"
32
import { motion } from "framer-motion"
43
import type React from "react"
54
import { useEffect, useState } from "react"
@@ -20,7 +19,7 @@ import DebugPanel from "../panels/DebugPanel"
2019
import DeveloperToolPanel from "../panels/DeveloperToolPanel"
2120
import ImportMirabufPanel from "../panels/mirabuf/ImportMirabufPanel"
2221
import { setAddToast, setOpenModal, setOpenPanel } from "./GlobalUIControls"
23-
import { SynthesisIcons } from "./StyledComponents"
22+
import { Button, IconButton, SynthesisIcons } from "./StyledComponents"
2423
import { TouchControlsEvent, TouchControlsEventKeys } from "./TouchControls"
2524
import UserIcon from "./UserIcon"
2625

fission/src/ui/components/Modal.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { Card, CardActions, CardContent, CardHeader, Modal as MUIModal } from "@mui/material"
2-
import { Button } from "./StyledComponents"
32
import React, { type ReactElement } from "react"
43
import type { Modal as ModalType, Panel as PanelType } from "../helpers/UIProviderHelpers"
54
import { CloseType, useUIContext } from "../helpers/UIProviderHelpers"
5+
import { Button } from "./StyledComponents"
66

77
export type ModalImplProps<T, P> = Partial<{
88
modal: ModalType<T, P>

fission/src/ui/components/Panel.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { Card, CardActions, CardContent, CardHeader } from "@mui/material"
2-
import { Button } from "./StyledComponents"
32
import React, { type ReactElement } from "react"
43
import Draggable from "react-draggable"
54
import {
@@ -9,6 +8,7 @@ import {
98
type Panel as PanelType,
109
useUIContext,
1110
} from "../helpers/UIProviderHelpers"
11+
import { Button } from "./StyledComponents"
1212

1313
// biome-ignore-start lint/suspicious/noExplicitAny: need to be able to extend
1414
export type PanelImplProps<T, P> = Partial<{

0 commit comments

Comments
 (0)