Skip to content
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

Unable to use particleSystem element in r3f project #22

Open
vpicone opened this issue Jan 10, 2024 · 0 comments
Open

Unable to use particleSystem element in r3f project #22

vpicone opened this issue Jan 10, 2024 · 0 comments

Comments

@vpicone
Copy link

vpicone commented Jan 10, 2024

When exporting a scene using a particle system project locally, the particleSystem element is used. r3f does not recognize this element, and suggests using the extend feature. However, there's no ParticleSystem component exported from Three.js to use with the extend function.

I wanted a reproducible case, but I've been unable to get it to run in the provided CodeSandbox examples. When I try, the error is a little more obtuse Could not load https://prod.spline.design/CpCwU2vP2DhzynSX/scene.splinecode: Cannot read properties of undefined (reading 'create'). Unsure if its related to the above particleSystem issue or not, it would appear not since removing the particle system doesn't fix the error.

/*
  Auto-generated by Spline
*/

import useSpline from '@splinetool/r3f-spline'
import { OrthographicCamera } from '@react-three/drei'

export default function Scene({ ...props }) {
  const { nodes, materials } = useSpline('https://prod.spline.design/CpCwU2vP2DhzynSX/scene.splinecode')
  return (
    <>
      <color attach="background" args={['#4a4a4a']} />
      <group {...props} dispose={null}>
        <scene name="Scene 1">
          <mesh
            name="Text"
            geometry={nodes.Text.geometry}
            material={materials['Text Material']}
            castShadow
            receiveShadow
            position={[1.68, -199.27, 183.69]}
            rotation={[0, Math.PI / 2, 0]}
          />
          <mesh
            name="Sphere"
            geometry={nodes.Sphere.geometry}
            material={materials['Sphere Material']}
            visible={false}
            castShadow
            receiveShadow
            position={[0, 0, -600]}
          />
          <group name="Particles" position={[1.68, -100.47, -698.67]}>
            <particleSystem
              name="Particle Emitter 2"
              geometry={nodes['Particle Emitter 2'].geometry}
              material={materials['']}
            />
          </group>
          <OrthographicCamera name="1" makeDefault={true} far={10000} near={-50000} />
          <hemisphereLight name="Default Ambient Light" intensity={0.75} color="#eaeaea" />
        </scene>
      </group>
    </>
  )
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant