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

GLTF Export from Blender 2.8 using GLTFJSX contains zero nodes or materials #9

Closed
robksawyer opened this issue Feb 6, 2020 · 2 comments

Comments

@robksawyer
Copy link

robksawyer commented Feb 6, 2020

I'm using the default GLTF export feature from Blender to export my model that is at a scale of 18.6 and it seems to not contain any nodes or materials after converting via the gltfjsx conversion. Using react-three-fiber version ^4.0.9.

The following is what I'm seeing. What am I doing wrong?

GLB Code (when I remove spread operator and just assign a variable)
Screen Shot 2020-02-06 at 8 24 30 AM
Screen Shot 2020-02-06 at 8 25 02 AM

Conversion code

// Auto-generated by https://github.com/react-spring/gltfjsx

import * as THREE from 'three'
import React, { useEffect, useRef } from 'react'
import { useLoader, useFrame } from 'react-three-fiber'
import { GLTFLoader } from 'three/examples/jsm/loaders/GLTFLoader'

export default function Model(props) {
  const group = useRef()
  const { nodes, materials, animations } = useLoader(GLTFLoader, '/models/round-logo.glb')

  console.log('nodes', nodes)
  return (
    <group ref={group} {...props} dispose={null}>
      <scene name="Scene">
        <mesh
          material={materials['Material']}
          geometry={nodes['Curve004'].geometry}
          name="Curve004"
          rotation={[Math.PI / 2, 0, 0]}
          scale={[10, 0, 10]}
        />
      </scene>
    </group>
  )
}
@drcmda
Copy link
Member

drcmda commented Feb 6, 2020

needs an update of r3f, then it will work, see https://github.com/react-spring/gltfjsx/blob/master/whatsnew.md

@robksawyer
Copy link
Author

I ran yarn add react-three-fiber@latest and that did the trick. I previously tried using 4.0.12 and that didn't work. Maybe an update to the docs to eliminate confusion? Thanks for the help, loving everything! Nice work!

@drcmda drcmda closed this as completed Apr 15, 2020
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

2 participants