Skip to content

Commit b7f3ad6

Browse files
committed
Merge branch 'dev' into alexey/2065/dropdown-sounds-reimplement
2 parents fb8760d + dec000d commit b7f3ad6

File tree

81 files changed

+1148
-1051
lines changed

Some content is hidden

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

81 files changed

+1148
-1051
lines changed

.github/workflows/FissionUnitTest.yml

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
runUnitTests:
1212
name: Playwright Unit Tests
1313
container:
14-
image: mcr.microsoft.com/playwright:v1.54.0-noble
14+
image: mcr.microsoft.com/playwright:v1.54.2-noble
1515
runs-on: ubuntu-latest
1616
defaults:
1717
run:
@@ -57,3 +57,41 @@ jobs:
5757

5858
- name: Run Tests
5959
run: HOME=/root npm run test
60+
61+
runAssetpackTests:
62+
name: Assetpack Tests
63+
needs: runUnitTests
64+
container:
65+
image: mcr.microsoft.com/playwright:v1.54.2-noble
66+
runs-on: ubuntu-latest
67+
defaults:
68+
run:
69+
working-directory: "fission"
70+
steps:
71+
- name: Checkout Code
72+
uses: actions/checkout@v4
73+
- name: JavaScript Setup
74+
uses: actions/setup-node@v4
75+
with:
76+
node-version: 20
77+
78+
- name: Cache Unzipped Synthesis Assets
79+
id: cache-assets
80+
uses: actions/cache@v3
81+
with:
82+
path: fission/public/Downloadables
83+
key: ${{ runner.os }}-assets-${{hashFiles('fission/public/assetpack.zip')}}
84+
85+
- name: Cache Node Dependencies
86+
uses: actions/cache@v3
87+
with:
88+
key: "${{runner.os}}-npm-fission-${{hashFiles('fission/package.json')}}"
89+
path: "fission/node_modules"
90+
restore-keys: |
91+
${{runner.os}}-npm-fission-
92+
${{runner.os}}-npm
93+
94+
- name: Run Assetpack Tests
95+
run: HOME=/root npm run test src/test/mirabuf/DefaultAssets.test.ts
96+
env:
97+
VITE_RUN_ASSETPACK_TEST: true

exporter/SynthesisFusionAddin/src/ErrorHandling.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ def handle_err_top(func: Callable[..., Result[None]]) -> Callable[..., None]:
129129

130130
def wrapper(*args, **kwargs): # type: ignore
131131
result = func(*args, **kwargs)
132+
132133
if result.is_err():
133134
message, severity = result.unwrap_err()
134135
if severity == ErrorSeverity.Fatal:

exporter/SynthesisFusionAddin/src/Parser/SynthesisParser/JointHierarchy.py

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import enum
22
import sys
33
from logging import ERROR
4+
from os import error
45
from typing import Any, Iterator, cast
56

67
import adsk.core
@@ -221,10 +222,10 @@ def __init__(self, design: adsk.fusion.Design) -> None:
221222
self.grounded = searchForGrounded(design.rootComponent)
222223

223224
if self.grounded is None:
224-
message = "These is no grounded component in this assembly, aborting kinematic export."
225-
gm.ui.messageBox(message)
225+
message = "There is not a pinned component in this assembly, aborting kinematic export."
226+
# gm.ui.messageBox(message)
226227
_____: Err[None] = Err(message, ErrorSeverity.Fatal)
227-
raise RuntimeError()
228+
raise RuntimeError(message)
228229

229230
self.currentTraversal: dict[str, DynamicOccurrenceNode | bool] = dict()
230231
self.groundedConnections: list[adsk.fusion.Occurrence] = []
@@ -247,7 +248,7 @@ def __init__(self, design: adsk.fusion.Design) -> None:
247248
message = populate_node_result.unwrap_err()[0]
248249
gm.ui.messageBox(message)
249250
____: Err[None] = Err(message, ErrorSeverity.Fatal)
250-
raise RuntimeError()
251+
raise RuntimeError(message)
251252

252253
rootNode = populate_node_result.unwrap()
253254
self.groundSimNode = SimulationNode(rootNode, None, grounded=True)
@@ -522,12 +523,9 @@ def buildJointPartHierarchy(
522523

523524
return Ok(None)
524525

525-
# I'm fairly certain bubbling this back up is the way to go
526-
except Warning:
527-
return Err(
528-
"Instantiation of the JointParser failed, likely due to a lack of a grounded component in the assembly",
529-
ErrorSeverity.Fatal,
530-
)
526+
except RuntimeError as e:
527+
progressDialog.progressDialog.hide()
528+
raise e
531529

532530

533531
def populateJoint(simNode: SimulationNode, joints: joint_pb2.Joints, progressDialog: PDMessage) -> Result[None]:

exporter/SynthesisFusionAddin/src/Parser/SynthesisParser/Parser.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,12 @@ def export(self) -> None:
148148
self.pdMessage,
149149
)
150150

151-
JointHierarchy.buildJointPartHierarchy(design, assembly_out.data.joints, self.exporterOptions, self.pdMessage)
151+
try:
152+
JointHierarchy.buildJointPartHierarchy(
153+
design, assembly_out.data.joints, self.exporterOptions, self.pdMessage
154+
)
155+
except RuntimeError as e:
156+
raise e
152157

153158
# These don't have an effect, I forgot how this is suppose to work
154159
# progressDialog.message = "Taking Photo for thumbnail..."

exporter/SynthesisFusionAddin/src/UI/ConfigCommand.py

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -247,8 +247,7 @@ def notify(self, html_args: adsk.core.HTMLEventArgs) -> None:
247247
)
248248
elif html_args.action == "export":
249249
opts = moduleExporterOptions.ExporterOptions().readFromJSON(data)
250-
export(opts)
251-
html_args.returnData = "{}"
250+
export(opts, html_args)
252251
elif html_args.action == "save":
253252
opts = moduleExporterOptions.ExporterOptions().readFromJSON(data)
254253
opts.writeToDesign()
@@ -336,7 +335,7 @@ def addChildOccurrences(childOccurrences: adsk.fusion.OccurrenceList) -> None:
336335

337336

338337
@logFailure(messageBox=True)
339-
def export(exporterOptions: moduleExporterOptions.ExporterOptions) -> None:
338+
def export(exporterOptions: moduleExporterOptions.ExporterOptions, html_args: adsk.core.HTMLEventArgs) -> None:
340339
logger.info("NEWUI")
341340
logger.info(exporterOptions)
342341
design = adsk.fusion.Design.cast(adsk.core.Application.get().activeProduct)
@@ -361,8 +360,13 @@ def export(exporterOptions: moduleExporterOptions.ExporterOptions) -> None:
361360
exporterOptions.version = docVersion
362361
exporterOptions.materials = 0
363362

364-
Parser.Parser(exporterOptions).export()
363+
try:
364+
Parser.Parser(exporterOptions).export()
365+
except RuntimeError as e:
366+
html_args.returnData = json.dumps({"_err": str(e)})
367+
return
365368
exporterOptions.writeToDesign()
369+
html_args.returnData = "{}"
366370

367371
if exporterOptions.openSynthesisUponExport:
368372
res = webbrowser.open(APP_WEBSITE_URL)
@@ -431,7 +435,10 @@ def notify(self, _: adsk.core.CommandEventArgs) -> None:
431435
try:
432436
Parser.Parser(exporterOptions).export()
433437
except:
434-
pass
438+
jointConfigTab.reset()
439+
gamepieceConfigTab.reset()
440+
441+
return
435442
exporterOptions.writeToDesign()
436443
jointConfigTab.reset()
437444
gamepieceConfigTab.reset()

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/lib/index.ts

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,12 @@ const errorMatchers: { text: string; cb: () => void }[] = [
4040
Global_SetAlert("info", "Selection cancelled")
4141
},
4242
},
43+
{
44+
text: "not a pinned",
45+
cb: () => {
46+
Global_SetAlert("error", "Please pin a component to export the assembly")
47+
},
48+
},
4349
]
4450

4551
export async function sendData<A extends keyof Messages>(
@@ -64,9 +70,10 @@ export async function sendData<A extends keyof Messages>(
6470
})
6571
if (!wasHandled) {
6672
console.error({ action, errorResponse: parsed._err })
73+
return undefined
6774
}
6875

69-
return undefined
76+
return parsed as Messages[A][1] & { _err: string }
7077
}
7178
return parsed as Messages[A][1]
7279
} catch (error) {
@@ -85,9 +92,12 @@ export async function sendDataAndToast<A extends keyof Messages>(
8592

8693
if (resp === undefined) {
8794
Global_SetAlert("error", failureMsg)
88-
} else {
95+
} else if (resp._err === undefined) {
8996
Global_SetAlert("info", sucessMsg)
97+
} else {
98+
return undefined
9099
}
100+
91101
return resp
92102
}
93103

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/biome.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,5 +179,5 @@
179179
{ "includes": ["src/proto/**/*"], "linter": { "enabled": false } }
180180
],
181181

182-
"assist": { "enabled": true, "actions": { "source": { "organizeImports": "on" } } }
182+
"assist": { "enabled": true, "actions": { "source": { "organizeImports": "off" } } }
183183
}

0 commit comments

Comments
 (0)