Armory: skeletonBones null in BoneAnimation::setMats for simple custom animations

Created on 24 Jan 2019  路  2Comments  路  Source: armory3d/armory

Hey guys, I created a simple armature with suzanne parented to it, and made two simple actions. Put a blend node with my two actions to run and bam, got this:

Uncaught exception: Unable to get property 'length' of undefined or null reference
while(this.matsFast.length < this.skeletonBones.length) {
^
TypeError: Unable to get property 'length' of undefined or null reference
at setMats (krom.js:9399:9)
at setAction (krom.js:9446:3)
at blend (krom.js:9492:3)
at run (krom.js:536:3)
at armory_logicnode_LogicNode.prototype.runOutput (krom.js:505:6)
at update (krom.js:697:3)
at iron_App.update (krom.js:2506:3)
at Anonymous function (krom.js:22154:3)
at kha_Scheduler.executeTimeTasks (krom.js:22038:4)
at kha_Scheduler.executeFrame (krom.js:21990:3)

Turns out skeletonBones from BoneAnimation.hx is null for some reason. This actually happens on 0.5 too, and with other meshes/skeletons/actions that I created.

So I surrounded the related lines with an if( skeletonBones != null ) test and everything worked fine. I have no idea why it's null, though. I'm sending my file so you can take a look.
test.zip

(drag & drop zipped .blend file here)

bug

Most helpful comment

It still shouldn't raise this error, I opened a PR that fixes this: https://github.com/armory3d/armory/pull/1946.
In the future we should maybe raise warnings for those cases (maybe with a debug flag so that it doesn't slow down the game when published).

All 2 comments

You forgot to specify which actions would be "blended" in the logic nodes.

Corrected here: test.zip

It still shouldn't raise this error, I opened a PR that fixes this: https://github.com/armory3d/armory/pull/1946.
In the future we should maybe raise warnings for those cases (maybe with a debug flag so that it doesn't slow down the game when published).

Was this page helpful?
0 / 5 - 0 ratings

Related issues

DevMagicLord picture DevMagicLord  路  3Comments

e1e5en-gd picture e1e5en-gd  路  3Comments

BrahRah picture BrahRah  路  3Comments

donalffons picture donalffons  路  4Comments

knowledgenude picture knowledgenude  路  3Comments