Love react-three editable. As noted in the documentation, it solves some of the same problems that GLTSFX was trying to solve, but with a different approach.
I'm finding it difficult to integrate the use of react-three-edtiable with GLTSFX. As far as I'm aware, you're able to make custom components editable, by wrapping them in editable, but I'm running into problems with this. Any best practice way to do this?
`/*
////Model.tsx
Auto-generated by: https://github.com/pmndrs/gltfjsx
*/
import * as THREE from 'three'
import React, { useRef } from 'react'
import { useGLTF } from '@react-three/drei/useGLTF'
import { GLTF } from 'three/examples/jsm/loaders/GLTFLoader'
type GLTFResult = GLTF & {
nodes: {
['A-1.001_1']: THREE.Mesh
['A-1.001_2']: THREE.Mesh
}
materials: {
['diffuse_0_0_0_255.001']: THREE.MeshStandardMaterial
['Wood-3 Ver.001']: THREE.MeshStandardMaterial
}
}
export default function Model(props: JSX.IntrinsicElements['group']) {
const group = useRef<THREE.Group>()
const { nodes, materials } = useGLTF('/A1.glb') as GLTFResult
return (
<group ref={group} {...props} dispose={null}>
<group name="A-1001" rotation={[Math.PI / 2, 0, 0]}>
<mesh name="A-1.001_1" material={materials['diffuse_0_0_0_255.001']} geometry={nodes['A-1.001_1'].geometry} />
<mesh name="A-1.001_2" material={materials['Wood-3 Ver.001']} geometry={nodes['A-1.001_2'].geometry} />
)
}
useGLTF.preload('/A1.glb')`
`
//App.tsx
import { editable as e } from 'react-three-editable';
import Model from './path/to/Model.tsx'
const EModel = e(Model, 'group');
<EModel uniqueName={'Emodel'} />
`