2

I'm new on three.js and I don't understand what does it mean?

I want to show .dae object.

Anybody can help w/ this case?

enter image description here

Alexander Shtang
  • 1,819
  • 4
  • 15
  • 24

4 Answers4

9

Not related, but please note that uuid has changed their declare, this one works for me:

import { v4 as uuidv4 } from 'uuid';

uuidv4(); // ⇨ '9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d'

Hope this helps.

סטנלי גרונן
  • 2,917
  • 23
  • 46
  • 68
MindVN
  • 91
  • 2
  • 3
3

This is not a three.js error, this is a JavaScript error. As the error states Cannot read property 'uuid' of undefined javascript can not read a property of an undefined variable.

Thus, your clipObject is undefined.

You may need to read the JavaScript checking for null vs. undefined and difference between == and ===

GramThanos
  • 3,572
  • 1
  • 22
  • 34
1

The error was in the following line

var action = mixer.clipAction( animations[ 0 ] ).play();

I used code from example from threejs website and the example was a moving example of a stormtrooper from star wars. But in my example the object is static. So I just removed the line.

Alexander Shtang
  • 1,819
  • 4
  • 15
  • 24
0

To fix error, you need to comment few lines like below (object have`t anim):

const loader = new FBXLoader(); loader.load ( 'files/models/fbx/ContainerBox_05/ContainerBox_05.fbx', function (object) { //mixer = new THREE.AnimationMixer(object); <-- COMMENT THIS

    //const <-- COMMENT THIS
                    
    //action = mixer.clipAction(object.animations[0]); <-- COMMENT THIS
    //action.play(); <-- COMMENT THIS