Jump to content

Several Question


reddozen
 Share

Recommended Posts

Collada Animation:

It's not likely that it will come up with anyone else before it's fixed, but here's the bug reported to Blender.

https://developer.blender.org/T40374

 

I'll pick back up on this once they get it resolved in Blender.

 

 

Octree:

I guess I''ll work on the octree stuff for now. Anyone have an idea what's going wrong with this? No matter where I initialize the octree. It basically shows none of my models.

Link to comment
Share on other sites

Soooo... gryff... now I'm getting triplication.

 

So now I can stop worrying about men in white coats coming to take me away :D

 

Read the report you filed The issue of the frames imported as I said above was due to the frame rate setting - older versions were set to 24fps newer versions set to 30fps - so that is not an issue.

 

Good luck - will be watching the result.

 

cheers, gryff :)

Link to comment
Share on other sites

For the octree you have to construct it AFTER having loaded every mesh :)

 

That worked.

 

I'm guessing there's no way to know for sure once the whole scene is loaded through BABYLON.SceneLoader.ImportMesh?

How would that work with incremental loading since everything isn't loaded from the start?

Link to comment
Share on other sites

Scene.isReady doesn't seem to work for this. I'll try scene.executeWhenReady(func)

 

This still causes nothing to render with BABYLON.SceneLoader.ImportMesh()

// Once the scene is loaded, just register a render loop to render itif (scene.isReady()){    //scene.createOrUpdateSelectionOctree();    engine.runRenderLoop(function() {        scene.render();          scene.createOrUpdateSelectionOctree();    }}

EDIT:

scene.executeWhenReady(func) seems to work. Now I'll play with it some.

Link to comment
Share on other sites

  • 3 weeks later...

Back to this...

 

I have a monster that loads now... no errors int he console, but I can't get the animation to start. Tap the back arrow key and you'll see the monster.

 

I even tried calling this from the execute when ready section, but you get an error "TypeError: b is null"

scene.beginAnimation(scene.getMeshByName("Boss_Pukui"), 0, 250, true);

Link to comment
Share on other sites

Are you sure this returns an object:

scene.getMeshByName("Boss_Pukui") ?

 

That's my point... I can't seem to reference an object int he scene by name.

 

 

 

From my point of view your object has no animations (mesh.animations.length == 0)

 

weird... I exported it from blender, and there's 250 frames of data in the *.babylon file...

Link to comment
Share on other sites

Red, well if the"monster is that pig-looking thing - I seemed to load right inside it !

 

I got no errors apart from "The character encoding of the HTML document was not declared  ... " and a warning about "Synchronous XMLHttpRequest on the main thread is deprecated ..."

 

Want to PM  a link to its .blend file for the monster?

 

Ohh, and reducing camera speed might help - I career all over the place.

 

cheers, gryff :)

Link to comment
Share on other sites

Well red, I opened the .blend file in Blender, exported the .babylon file then set it up with

BABYLON.SceneLoader.Load("", "Boss_Pukui.babylon", engine, function (newScene) {....});

Worked fine.

 

Inspection of the babylon file shows a 250 frame animation as you said.

 

Will investigate further using the "BABYLON.SceneLoader.ImportMesh" option.

 

cheers, gryff :)

 

 

Link to comment
Share on other sites

Well red, I tried using the same type of code as I used for my Desk and Book animation experiment :

 

And here is the result : Pukui. Click on the cubes to try and start the animation and in my FF web console I get :

TypeError: b is undefined

I have no idea what that means. Edit: with the correct syntax as outlined by DK below this is gone and it works like a charm. :)

 

I added a few lines to try and debug you will see them in the ImportMesh

BABYLON.SceneLoader.ImportMesh("", "", "Boss_Pukui.babylon", newScene, function (newMeshes,skeletons) {                                                thePig = newMeshes[0];                mySkeleton[0] = skeletons[0];                console.log(thePig);                console.log(thePig.name);                                console.log(thePig.animations);                //newScene.beginAnimation(mySkeleton[0], 1, 250, false, 1);                //thePig.position.x = 10;                                                });

and the results show up in the web console - most significantly is the empty animations array. If I use the "thePig.position.x = 10;" - that works.

 

Maybe I'm doing something wrong?

 

Well if you are - I'm must be doing it too. But as I'm using essentially the same code as the desk and book, I'm not sure what.

 

Will post again if I have a blinding flash of inspiration.

 

cheers, gryff :)

Link to comment
Share on other sites

awesome... it works.

now for the other problems...

1) can I control the frame speed?

2) the exporter for blender seems to have messed up the model's animations. if you look at his standing animation his legs suck up into his body and deform him (looks like this is happening at several points in the animation string). Could this be due to the merged animation matrix I defined from 3DS? He looks and plays correctly in 3DS and Blender (aside from the animations being too fast). His crown seems to rotate wrong too. it's just supposed to spin on his head, but instead, it's rotating on an arc (if that makes sense).

 

Gryff,

I figured out the XYZ "duplication" coming out of 3DS. It was actually defining each independent rotation of the bone separately per animation frame. If you merge the animation matrix on export to open collada, you only get one XYZ set.

 

DK,

Is merging the matrix the right thing to do? should the babylon blender export merge them on it's own if it sees them? should the babylon blender export support the multiple independent rotations, per bone, per frame of animation? I foresee others having similar problems, so it may be worth defining the scope so people will know.

Link to comment
Share on other sites

1) can I control the frame speed?

 

 

The last digit in this line ("1") controls the playback rate set it to .5 for example

newScene.beginAnimation(mySkeleton[0], 1, 250, false, 1);

By the way, what was the original framerate for the animation? I exported from Blender at 30fps - which maybe why it seems fast.

 

2) the exporter for blender seems to have messed up the model's animations.

 

It is a very curious rig It has a lot of "Dummy" bones. Blender recognizes them, though they have no bones shape,  and I have no idea what the exporter does with them. If you look at them in Blender they don't actually move any vertex directly but seem to act more like a control bone - controlling other bones - yet they are labeled as deform bones.

 

You might want to do a Google search on "fbx, dummy bones and 3dMax" as they seem to originate in Max and can cause issues with import and export.

 

The other suggestion I have is maybe try the fbx exporter that DK has been working on. I gather it now supports animations. Also take a look at my Desk example again - as the doors and drawers are animated just by selecting the translation/rotation for a single bone.

 

cheers, gryff :)

 

 

 

Link to comment
Share on other sites

Officially each animation (there's like 7 all pieced together) has it's own frame rate. The exporter (modified version of UEviewer) doesn't seem to export the official rate for each animation. It's fine though as long as I can control it, I'll just manually set it up when I define the animations available for each monster. The speed will have to fluctuate anyway based on speed power ups for walking or attacking anyway.

 

That's odd about the dummy bones, but there may not be anything I can really do about them given the exporter / 3DS importer I'm going to have to use to get them converted (without modifying hundreds of models by hand... no thanks)...

 

I think the FBX exporter supports animations, but not bones yet. DK will have to clarify.

 

The thing is, the animation plays fine in both 3DS and Blender without the distortion issues... so I'm not sure why Babylon would be any different unless there's something odd going on in the export script from Blender.

Link to comment
Share on other sites

Ah, I have however already export to FBX with 3ds max to import in Unity 3D and animation was well there.

But I believe the problem was bind the modifier 'physic' should not use and used instead the modifier 'skin'.

Link to comment
Share on other sites

 

Ah, I have however already export to FBX with 3ds max to import in Unity 3D and animation was well there.
But I believe the problem was bind the modifier 'physic' should not use and used instead the modifier 'skin'.

 

 

Where is that option on 3DS?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...