Proof of concept for a #r3f #threejs editor, watch this video with sound on 🔊! Current mood: It works but it'll be a big effort to make it usable. 🧵 for how it works 👇

Nov 28, 2022 · 10:39 AM UTC

Update, sound on 🔊! Here I talk through: 🔎 Focusing scene objects [f] 🕋 Transforming scene objects [t,r,s] 🎯 Focus mode [shift + f] This is all to make my life easier when making my game with R3F. Think they'll be useful for you too? Let me know in the comments! 👇
3
6
21
Revived this! Probably took a few years off my life to make it work - stay tuned for a blog post on that! Here's a video with the latest progress, sound on! 🔊 #threejs #r3f #webgamedev #react
4
5
1
24
3,038
Here's a video update for TRIPLEX talking through new features: ✨ Initializing a repo (new & existing) 📜 Menu bar 📦 Scene panel 🎯 Context panel Sound pretty cool? Check out the video and read the next few tweets below 👇 #threejs #r3f #webgamedev #react
3
9
1
38
4,945
Building scenes with React Three Fiber doesn't have to be a slog. With Triplex it's actually pretty fun! #threejs #r3f #react #webgamedev
1
2
15
1,102
Modifying scenes through the UI — neat! #threejs #r3f #react
1
6
653
Been working on undo/redo, now available on latest! npx @triplex/run@latest init
1
9
700
Adding the ability to update props that are represented by union types. This is a smaller part of a larger feature to add props that aren't yet declared on the JSX element. ✨📦
1
6
383
Adding UI toggle buttons for selecting the transform mode in Triplex. Most likely move it next to the menu bar (top left) before shipping. Using Radix Icons! They go alright.
1
2
362
Shipped bottom middle
1
2
430
Adding props to a component that doesn't have them declared in code through the Triplex Editor UI. 🔊 Sound on! #r3f #react #threejs #webgamedev
1
3
1
10
828
Few goals before merging this - mainly to do with the UX of the context panel. Fields shouldn't bounce around when filling them in, just a general stability pass.
1
4
444
That sweet list of available props.
1
4
471
The scene-to-source wiring is done by transforming the scenes AST wrapping scene objects in a group with contextual user data. Clicking on a scene object we traverse up the Three.js scene and if this data exists we can do something with it. Only the opened scene is transformed.
1
5
Surprise! The transformation isn't a bundler plugin but a Deno service that copies source, transforms it using ts-morph and saves it to a temp file. This temp file is then the file imported to the editor! Using ts-morph and the Deno service is important, let's talk about them.
1
6
ts-morph is great for AST manipulation you can batch 'em up and save when ready. Putting this behind a stateful Deno service and you start seeing something very powerful! In the video on mouse up after moving an entity it calls the update api when saving it calls the save api.
1
2
You're also able to get types using ts-morph as it's just a wrapper over the TS compiler. Useful for finding props on JSX elements that aren't already defined on the element in source!
1
3
I see the Deno service as an integral part of scaling an editor as it allows us to remove a lot from the critical path by loading things on demand. It also also IMO raises the ceiling for interesting features such as undo/redo, multiplayer, and more.
1
3
It's not all roses though. 🔡 There's a lot of edge cases to cover with ts-morph extracting types. 🔨 The temp file flow is a bit whack and hardcoded atm 🌏 It will be a huge amount of effort to get something I'd consider production ready
1
3
I imagine the editor being a standalone app which would solve the temp file flow being whack atm. At the end of the day I'd scope this to just a scene editor wrapped in a beautiful UI with features tailored to making us more productive with R3F/JSX.
1
6
Maybe there's an MVP release somewhere in the future for this, who knows. I just want to make games 🤪
1
4
cc @nkSaraf98 you'll be interested in this thread 😄
3
@austin_malerba check this out, pretty cool stuff
2
3
Let me know if you're interested in being an early adopter! You'll get access to the private repo and Discord. Need keen folks who use it and see where it breaks 😋
1
137
That’s awesome man, well done !
1
this is a true game changer! as a blender/react artist this will be immensely helpful; is there anyway I can contribute to this project?
1
1
Thanks! I think I've seen you chime in so keep an eye out on the repo and there will definitely be opportunities soon.