Jump to content

Always problem rotation object from Blender 2.79 in babylonJS 3.2.0


Zino54220
 Share

Recommended Posts

Hi everyone,

I always have a problem with a simple rotation animation.

In blender no problem, my object has the correct animation :

1.thumb.jpg.166e06fe3756811c9014aebc3c03a09c.jpg

After :

2.thumb.jpg.d7d6f5030279bcaf505bc7cf3dbfcae6.jpg

But in BabylonJs :

3.thumb.jpg.b8935eaff4304d58d4db753a3cca6991.jpg

After :

4.thumb.jpg.de15d42e5fc95e4e352835e1da81eb75.jpg

It seems like the center of the object has been set with the center of the scene and I don't understand why...

I tried many things like :

- update version of BabylonJs and Exporter Blender

use CTRl + A -> location and CTRL + A Rotation and Scale,

- use "Bake action" menu after creating animation

- use parenting

Unfortunatly, the problem is not fixed ...

For the moment, I can use location animation to progress in my project but I think that I must use a rotation animation early or later in this project. What I'm doing wrong please ???

 

Link to comment
Share on other sites

Hey! I think a good way to start to diagnose the problem, is to test that the pivot point of your mesh is actually the same as shown in Blender. I am still learning so it may not be the best approach but one way to do this is...

1. Create an object to visually show the pivot point

const pivotPoint = BABYLON.MeshBuilder.CreateBox("pivotPoint", {height: 3}, scene);

2. Set the mesh we just created to be positioned at your meshes pivot point

pivotPoint.position = mesh.getPivotPoint();

This will allow you to confirm whether the pivot point is indeed at the center of the screen and if so, can move onto the next test of your scene

Link to comment
Share on other sites

Fairly sure this similar to this topic.  Easiest way is to just delete the position property keys from the .babylon file.  Fixing this would require a large rework that directly read the animation keys in Blender to determine which properties (position, rotation, or scale) were involved.

I know from an experimental Blender-Kinect addin how to do this, but not much incentive.  First, as the exporter blocks up multiple Blender actions into the single animation capability of the .babylon format, there could be one action with rotation keys & another with location keys.  I also do not use Blender animations.

There is something called Animation. ANIMATIONLOOPMODE_RELATIVE.  I do not know how to call it, but if the behavior is to take keys and & add the value to existing, it would be another way to go.

Link to comment
Share on other sites

Thanks very much for your replies.

I don't know what is the better way to fixe this problem, I must create the animation directlly in BabylonJS or I must change manually the pivot point of the mesh before play animation ?

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...