-
-
Notifications
You must be signed in to change notification settings - Fork 29
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
Investigate a plugin / extension system #20
Comments
Ping @krispya what would an integrated ECS view look like? |
Hey @itsdouges, Types of operations:
What I imagined the integration could look like:
Thinking about how a plugin API could work:
RE: ECS Integration |
Yes, I think ideally there would be a new section on the right panel when selecting an Object3D that lets you see, edit and add components, list ids and maybe even state like if it is enabled. All of this data is written to the Objet3D under userData, or you can get it via API calls otherwise. Most components will be represented as a React component child of the Object3D, but they can be added imperatively too so we can't rely on just what is in the React tree. So, I suppose a plugin for this would require being able to add custom sections to the panels. Also context is a must. |
Capturing the discussion on discord! An interesting extension could be support for baking. Essentially doing some expensive computation in the editor and saving the result for runtime. Thinking along the lines of getStaticProps in Next.js. Some example use cases:
|
From Discord by @Ctrlmonster We have a lot of different projects in r3f that do ui -> code / object generation, i.e. navmesh generator, animation system, material/shader graph editors. Edit: |
Another use case: https://github.com/try-triplex/triplex/issues/68 (Export to GLB) |
Another use case: https://github.com/try-triplex/triplex/issues/6 (create component via gltfjsx) |
Would you say the current categories of plugins we're talking about originate from a component prop? E.g: for navmesh @isaac-mason, given a specific component with a specific prop, show a different prop UI that you can enter and then do things, which you can then save and it then gets persisted to the prop (either inline or saved to a file, depending on configuration). And then for anim @Ctrlmonster same thing? Trying to flesh out what this would fundamentally look like. |
Sorry, I missed this! I imagine a simple react navmesh api could look something like this: const Example = () => {
const { navMesh } = useNavigation()
// ...
}
const App = () => (
<Navigation cellSize={0.2} cellHeight={0.2}>
<Walkable>
<SomeMeshToWalkOn />
</Walkable>
<Example />
</Navigation>
) In this imaginary api, navmesh generation logic lives in Maybe if triplex provided some api for checking if we're editing, and a means of persisting data, we could build triplex-friendly components that look something like this: // very simplified example
const Navigation = () => {
// ...
useEffect(() => {
if (triplex.editing) {
// generate
const navMesh = generate()
// persist Uint8Array
triplex.save('navMesh', exportNavMesh(navMesh))
setNavMesh(navMesh)
} else {
// load persisted navmesh
const navMesh = importNavMesh(triplex.load('navMesh'))
setNavMesh(navMesh)
}
}, [])
// ...
} |
We have a lot of opportunities to enable plugins by third party developers for Triplex. This issue should collect all known use cases and opportunities we have to add integrations to Triplex.
The text was updated successfully, but these errors were encountered: