What could be causing the absence of several nodes in my three.js animations?

As I work on creating a portfolio using three.js, I've encountered an issue with my animation sets not playing after triggering an event. Initially, the code worked fine, but now I keep receiving a series of warnings and the code doesn't run at all.

THREE.PropertyBinding: No target node found for track: LowerBone.position. index-e8a71580.js:3581 THREE.PropertyBinding: No target node found for track: LowerBone.quaternion. index-e8a71580.js:3581 THREE.PropertyBinding: No target node found for track: LowerBone.scale. index-e8a71580.js:3581

These errors are repetitive for every bone in the armature and the mesh itself (the model being a character that represents me with an added armature). Interestingly, the mesh does not encounter the scale error. Below is the relevant code snippet:

Index.html:

<!DOCTYPE html>
<html>
    <head>
        <title>Portfolio</title>
        <style>
            canvas#Rendered {
                position: absolute;
                top: 0px;
            }
            body {
                background-color: black;
            }
        </style>
    </head>
    <body>
        <script type="module" src="main.js"></script>
    </body>
</html>

Main.js

import * as THREE from 'three';
import { GLTFLoader } from 'three/addons/loaders/GLTFLoader.js';

function windowWidth() {
    return window.innerWidth / 2;
}

var phaseone, phasetwo = false;

let mixer, mixer1, mixer2, mixer3/*, mixer4*/;
let intro, afkone, trans, afktwo;

const clock = new THREE.Clock();
const scene = new THREE.Scene();
const camera = new THREE.PerspectiveCamera( 75, windowWidth() / window.innerHeight, 0.1, 1000 );

var model;
const loader = new GLTFLoader();
loader.load( 'untitled.gltf', gltf => {

    model = gltf.asset;

    scene.add( gltf.scene );

    console.log( gltf.animations );

    // Animation setup
    mixer = new THREE.AnimationMixer( model );
    intro = mixer.clipAction( gltf.animations[2], model ).setLoop(THREE.LoopRepeat);
    mixer1 = new THREE.AnimationMixer( model );
    afkone = mixer1.clipAction( gltf.animations[0], model ).setLoop(THREE.LoopRepeat);
    mixer2 = new THREE.AnimationMixer( model );
    trans = mixer2.clipAction( gltf.animations[3], model ).setLoop(THREE.LoopOnce);
    mixer3 = new THREE.AnimationMixer( model );
    afktwo = mixer3.clipAction( gltf.animations[1], model ).setLoop(THREE.LoopRepeat);

    // Play initial animation
    intro.play();

}, undefined, function ( error ) { console.error( error ); } );

// Renderer setup
const renderer = new THREE.WebGLRenderer( { antialias: true, alpha: true } );
renderer.setPixelRatio( window.devicePixelRatio );
renderer.setSize( windowWidth(), window.innerHeight );
renderer.toneMapping = THREE.ACESFilmicToneMapping;
renderer.toneMappingExposure = 1;
renderer.domElement.id = "Rendered";
renderer.domElement.width = windowWidth();
renderer.domElement.style.left = windowWidth() + "px";
document.body.appendChild( renderer.domElement );

camera.position.z = 10;

// Ambient light setup
const ambientLight = new THREE.AmbientLight(0xFFFFFF);
ambientLight.intensity = 4;
scene.add( ambientLight );

// Animation loop
function animate() {

    requestAnimationFrame( animate );

    const delta = clock.getDelta();

    if ( delta && mixer)  {
        mixer.update( delta );
    }

    renderer.render( scene, camera );

}

window.onresize = function () {

    camera.aspect = windowWidth() / window.innerHeight;
    camera.updateProjectionMatrix();
    
    renderer.setSize( windowWidth(), window.innerHeight );

}

And the model: download
To summarize, I'm facing issues with missing properties in the armature according to three.js, despite them being present in Blender and during AnimationAction printing. This prevents any animations from running, and I seek assistance in resolving this error. Any guidance would be appreciated, and feel free to let me know how I can assist you in solving this challenge. (FYI: This was done on GitHub Codespaces)

Despite attempting to revert to a previously functional model and implementing the animation set, the same error persists without any visible discrepancies in the code.

EDIT: For those encountering similar issues, try simplifying your code to its essential components for operation before gradually expanding it. My oversight was adding too much too quickly and overlooking crucial parts of the code, particularly setting model = gltf.asset. Special thanks to Don McCurdy for the support!

Answer №1

One issue I encountered was due to my hasty addition of code, leading me to overlook or inadvertently modify some essential sections. In particular, I mistakenly assigned model = gltf.asset in the midst of debugging. It serves as a crucial reminder to revisit pivotal aspects of your program and ensure they align with the documentation or specified guidelines. Special thanks to Don McCurdy for the invaluable assistance!

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Troubleshooting React and NodeJs Fetch Problem

I am currently working on retrieving data from my API, which is functioning properly. The API endpoint I am trying to fetch results from is http://localhost:5000/api/continents. {"data":[{"continentId":3,"CName":"Atlantis"},{"continentId":2,"CName":"Devia ...

Display the closest locations on the Google Maps interface

I am currently working on a project that involves integrating Google Maps. The project includes storing hospital addresses (in longitude and latitude) in a database. However, I need assistance in displaying the nearest hospital from my current location. I ...

Setting the height of columns in a Bootstrap panel to 100%

Is there a way to achieve 100% height for all three columns even without content? Check out this JSFiddle: <div class="row"> <div class="col-md-12"> <div class="shadow panel panel-default"> <div class="blue white-bord ...

How can I retrieve a text file using an API in a Next.js application?

Is there a way to download a text file using an API in Next.js? The console.log(ninjas) function is already displaying the correct information. I have tested the API with Postman and it works perfectly. When I use GET in Postman, the same information is ...

Discover the method to activate the back button feature on ajax pages

I am currently working on a website that is navigated in the following way: $(document).ready(function () { if (!$('#ajax').length) { // Checking if index.html has been loaded. If not, navigate to index.html and load the hash part with ajax. ...

Learn how to execute JavaScript code in Selenium without launching a web browser

I am currently using the Selenium API for web scraping on pages that contain JavaScript code. Is there a way to retrieve the code without having to open a web browser? I am still learning how to use this API Is this even feasible? ...

Setting up webpack for React to utilize multiple entry points and outputs

Having some trouble configuring the server to handle multiple entries and outputs. The application utilizes Zurb Foundation, jQuery, and React. I'm aiming to exclude jQuery and foundation from the bundle.js file, while also creating a separate bundle ...

The next.js router will update the URL without actually navigating to a new page, meaning that it will still display the current page with the updated URL

My search results are displayed at the route /discovery, and I am working on syncing the search state with URL query parameters. For example, if a user searches for "chicken," the URL becomes /discovery?query=chicken&page=1. When a user clicks on a se ...

When using res.render to pass data to an EJS file and accessing it in plain JavaScript

I'm currently working on an Express GET function where I am sending data to an EJS file using the res.render() function. My question is, how can I access this data in plain JavaScript within the same EJS file? Here is my GET Function: router.get(&a ...

Looking to streamline a JavaScript function, while also incorporating jQuery techniques

I've got this lengthy function for uploading photos using hidden iFrames, and while it does the job well, it's quite messy. I'm looking to simplify it into a cleaner function with fewer lines of code for easier maintenance. function simplif ...

How can we universally detect and resolve the user's language within a React/Next.js application using an Apollo client HOC?

Currently, I am developing an I18n module utilizing the Next.js framework (v5). The challenge I am facing is determining the user's default language universally in order to display the UI in that language. While it is relatively simple to resolve th ...

Boundaries on Maps: A guide to verifying addresses within a boundary

User provides address on the website. If the address falls within the defined boundary, it is marked as "Eligible". If outside the boundary, labeled as "Ineligible". Are there any existing widgets or code snippets available to achieve this functio ...

Vue.js computed property experiencing a minor setback

I'm currently working on developing a test-taking system using Vue and Laravel. When a user inputs the test code and email address, they are directed to the test page. To display all the test questions based on the entered code, I implemented a naviga ...

Apply CSS styling (or class) to each element of a React array of objects within a Component

One issue I'm facing involves adding specific properties to every object in an array based on another value within that same object. One such property is the background color. To illustrate, consider an array of objects: let myObj = { name: "myO ...

Issue with Webpack - npm run start and build operation not functioning?

Although I typically use create-react-app for my React projects, I decided to create one without it. However, I am encountering issues with the webpack configuration as I am not very familiar with it: This is how my package.json file looks like: { " ...

The pictures in a <div> tag are not showing up

Functionality: I have set up 2 different <div> elements with unique IDs. Each of these <div> elements will make an ajax call to fetch a specific set of images for display. To summarize, both <div> elements are invoking the same ajax met ...

Include images in the form of .png files within the td elements of a table that is dynamically generated in the index

I have successfully created a table using embedded JavaScript with the help of messerbill. Here is the code: <table id="Table1"> <tr> <th>Kickoff</th> <th>Status</th> <th>Country</th> < ...

Unable to produce scrolling animation using JavaScript

I'm trying to implement a feature on my website where the page scrolls with a sliding effect when the user presses the "Scroll" button. However, I've encountered issues as it doesn't seem to work despite adding the necessary tags to my HTML ...

I am facing difficulties retrieving the JSON object returned from the Express GET route in Angular

After setting up an express route, the following JSON is returned: [{"_id":"573da7305af4c74002790733","postcode":"nr22ry","firstlineofaddress":"20 high house avenue","tenancynumber":"12454663","role":"operative","association":"company","hash":"b6ba35492f3 ...

Using Rxjs to handle several requests with various headers

I have a specific requirement where, if hasProcessado == true, 10 additional requests should be made before issuing the final request. If the final request fails, 3 more attempts are needed. Furthermore, when sending the last request, it is essential to n ...