hubs-plugin-api
hubs-plugin-api copied to clipboard
Spoke Node API
I think the Spoke Node API is going to live on for a while. Maybe we'll migrate completely to ECSY, but I think it may take a while. If we want an API for Spoke in the meantime, here's a start.
import Spoke from "spoke";
import { Mesh, BoxBufferGeometry, MeshBasicMaterial } from "three";
import React from "react";
class CubeNode extends Spoke.EditorNodeMixin(Mesh) {
constructor() {
super(new BoxBufferGeometry(), new MeshBasicMaterial());
}
...
}
function CubeNodeEditor({ node }) {
return (
<Spoke.NodeEditor>
...
</Spoke.NodeEditor>
)
}
export function config(editor) {
editor.registerNode(CubeNode, CubeNodeEditor);
}