Skip to content

Commit f9f05f3

Browse files
authored
Merge pull request #18 from MetacityTools/dev
Releasing v0.3.2
2 parents 84e7226 + 7811071 commit f9f05f3

Some content is hidden

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

45 files changed

+472
-193
lines changed

.prettierrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
"importOrder": [
99
"^@utils/(.*)$",
1010
"^@bananagl/(.*)$",
11+
"^@viewer/(.*)$",
1112
"^@editor/(.*)$",
1213
"^@elements/(.*)$",
1314
"^@assets/(.*)$",

README.md

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,23 +20,30 @@ Currently:
2020
- SHP (Polygons and MultiPatch only for now)
2121
- IFC
2222
- GLTF (triangles only)
23+
- Metacity File Format (binary Studio export)
2324

2425
## Roadmap
2526

2627
The project is in active development. The roadmap is as follows:
2728

2829
### v0.4.0
2930

30-
- [ ] Optional interactivity - build BVH only if user opts-in to make the loaded models clickable
31-
- [ ] Hide and show models
32-
- [ ] Viewer - Details TBA
33-
34-
### v0.3.2 - 👨‍💻 In progress
35-
3631
- [ ] Projecting models onto models (2D onto 3D) - ✨WIP https://github.com/vojtatom/geometry
3732
- [ ] Styling???
3833
- [ ] Loading points and lines from SHP
3934
- [ ] Extract Utils to separate SDK form metacity editors
35+
- [ ] Optional interactivity - build BVH only if user opts-in to make the loaded models clickable
36+
37+
### v0.3.3 - 👨‍💻 In progress
38+
39+
- [ ] Browsing hierarchy in viewer
40+
- [ ] Styling based on data in hierarchy?
41+
42+
### v0.3.2 - ✅ Released
43+
44+
- [x] Viewer Base - making it the default view
45+
- [x] Loading models to viewer
46+
- [x] View Controls
4047

4148
### v0.3.1 - ✅ Released
4249

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "metacity-studio",
33
"private": true,
4-
"version": "0.3.1",
4+
"version": "0.3.2",
55
"type": "module",
66
"scripts": {
77
"dev": "vite",

studio/editor/index.html

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
6+
<title>Metacity Studio Editor</title>
7+
</head>
8+
<body>
9+
<div id="root"></div>
10+
<script type="module" src="/src/components/Editor/main.tsx"></script>
11+
</body>
12+
</html>

studio/index.html

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,12 @@
11
<!DOCTYPE html>
22
<html lang="en">
3-
<head>
4-
<meta charset="UTF-8" />
5-
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
6-
<title>Metacity Studio</title>
7-
</head>
8-
<body>
9-
<div id="root"></div>
10-
<script type="module" src="src/components/Editor/main.tsx"></script>
11-
<script>
12-
if (window.safari) {
13-
history.pushState(null, null, location.href);
14-
window.onpopstate = function(event) {
15-
history.go(1);
16-
};
17-
}
18-
</script>
19-
</body>
3+
<head>
4+
<meta charset="UTF-8" />
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
6+
<title>Metacity Studio Viewer</title>
7+
</head>
8+
<body>
9+
<div id="root"></div>
10+
<script type="module" src="/src/components/Viewer/main.tsx"></script>
11+
</body>
2012
</html>

studio/src/assets/viewer.png

397 KB
Loading

studio/src/bananagl/window/window.ts

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,29 @@ export interface ViewSetup {
2323
position: ViewPosition;
2424
}
2525

26+
const debounce = (fn: Function, time: number) => {
27+
let timeout: any;
28+
return (...args: any[]) => {
29+
clearTimeout(timeout);
30+
timeout = setTimeout(() => {
31+
fn(...args);
32+
}, time);
33+
};
34+
};
35+
2636
export class Window {
2737
private views_: ViewSetup[] = [];
2838
controls: WindowControls;
2939

3040
constructor(private canvas: HTMLCanvasElement) {
31-
const observer = new ResizeObserver((entries) => {
32-
for (const entry of entries) {
33-
const { width, height } = entry.contentRect;
34-
this.resize(width, height);
35-
}
36-
});
41+
const observer = new ResizeObserver(
42+
debounce((entries: ResizeObserverEntry[]) => {
43+
for (const entry of entries) {
44+
const { width, height } = entry.contentRect;
45+
this.resize(width, height);
46+
}
47+
}, 100)
48+
);
3749

3850
observer.observe(canvas);
3951
this.forceResize();

studio/src/components/Editor/Canvas/CanvasView.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ import { useRenderer, useScene } from '@utils/utils';
55

66
import * as GL from '@bananagl/bananagl';
77

8-
import { Button } from '@elements/Button';
9-
108
import { Controls } from './Controls';
119
import { Help } from './Help';
1210
import { Settings } from './Settings';

studio/src/components/Editor/Canvas/Controls.tsx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
import { DirectionControls } from './ControlsDirection';
1+
import { DirectionControls } from '@elements/Controls/ControlsDirection';
2+
import { ProjectionControls } from '@elements/Controls/ControlsProjection';
3+
import { SelectionControls } from '@elements/Controls/ControlsSelect';
4+
import { ShaderControls } from '@elements/Controls/ControlsShader';
5+
26
import { ModeControls } from './ControlsMode';
3-
import { ProjectionControls } from './ControlsProjection';
4-
import { SelectionControls } from './ControlsSelect';
5-
import { ShaderControls } from './ControlsShader';
67

78
export function Controls() {
89
return (
@@ -13,7 +14,7 @@ export function Controls() {
1314
<ShaderControls />
1415
<SelectionControls />
1516
</div>
16-
<div className="absolute mt-4 space-x-2 right-0 top-0 z-0 flex flex-row">
17+
<div className="absolute m-4 space-x-2 right-0 top-0 z-0 flex flex-row">
1718
<ModeControls />
1819
</div>
1920
</>

0 commit comments

Comments
 (0)