Jump to content

Blender(Babylonjs exporter ver 5.2.1) - Animation - Two diffrent Action on two diffrent objects - Export problem


ian
 Share

Recommended Posts

Ok I make two animation actions. ElevatorComponent1 (timeframe 0-240) ->Elevator1Action  and ElevartorComponent2->Elevator2Action (timeframe 0-200).

In Blender it looks fine/OK. Each elevator animate (loop animation of each object 1.ElevatorComponent1 and 2.ElevartorComponent2)

Play look fine in blender. You can see it. (I attach blender file)

I use only (Visual Location) for both animations.

 

When I export from blender to .babylon. Exporter doesn't export as it should! Range and positions values are not OK !! WHY? IS THERE ANY BUG IN BLENDER->BABYLON EXPORTER ?

(IS THERE ANY WAY TO MAKE FOR EACH OBJECT ITS OWN TIME_LINE FOR ANIMATION? HOW?)

Can anybody take a look (ATTACHED FILE) and export it into babylon.js and see what is with range and positions values - is there bug???

Here is video https://www.dropbox.com/pri/get/Public/Screencast 2017-06-26 10%3A49%3A24.mp4?_subject_uid=20766916&w=AADvbTlbugqn3hWDvW0TvcKrFlvCsAGWkYMR1IlRIqyGdg

(if I export to .babylon (ATTACHED FILE) file and put load it or put in sandbox it is confusion !! 

@gryff @JCPalmer

@Deltakosh

 

Maybe we can fix with editor inside babylon file. BUT IF I BUILD MODEL OVER AND OVER (WORKFLOW) THAN IF EXPORTER DOES NOT WORK OK. THAN THIS IS USELESS.

Is possible to fix exporter?

Greetings

Ian

ModelFInish_1.blend.zip

ModelFInish.babylon

Link to comment
Share on other sites

What I have done in the past with Blender animations is to just create a _single_ animation in Blender that separates the animations by frames.

So for example, frames 0 to 30 are walking, 31 to 60 are standing, and 61 to 90 are jumping (example here - http://www.spritehand.com/2014/08/babylonjs-physics-and-character.html)

The exporter tries to combine the animations in some way, but as you can read below it can get complicated :)  So maybe easier to start with single animation in blender?

 

 

Link to comment
Share on other sites

I think the Towel of Babel exporter supports multiple Actions. You should check it out: https://github.com/BabylonJS/Extensions/blob/master/QueuedInterpolation/Blender/README.md

The difference between ToB and the Blender exporter is ToB export as .js rather than .babylon. As I personally use the Blender exporter and have no need for multiple Action so I havent tried ToB yet but it seems really cool.

Link to comment
Share on other sites

@ian: Morning Ian :)

Is this what you are looking for?

Two actions

Green cube and red cube rotate differently at different speeds.

The cube are set up as shown in the image below. Note the" -" in the names of the actions for each cube.

So cube0 has an animation called "cube0-Action" and cube 1 has an animation called cube1-action in the Dopesheet Action Editor.

cheers, gryff :)

2actions.png

Link to comment
Share on other sites

Can you share your blender file. So I can see it?

 

By the way. I setup scene and try ToB. And I think I found some problem maybe bug and probably fix for ToB. Problem around physics imposters and imposters on instances. I try Cannon and Oimo and both have problems and I change some code in exported .ja file and it looks better. I will report and send tomorrow project and exported js file and repaired js. 

 

See you tomorow

 

Greetings

Ian

Link to comment
Share on other sites

To clarify, Blender has problems identifying which meshes participate in what actions.  It cannot tell.  @gryff, is right, the exporters rely on hints embedded into the name of the action to know what to generate, when an action is specific to a certain mesh.

When it come to Tower of Babel, instead of JSON it generates inline javascript source code, & a d.ts file (for typescript integration).  It is for object oriented development in that it generates un-parented meshes as sub-classes. You also do not "load" meshes per say.  You instance them as "new blendname.mymesh('name', scene)".

You can also specify the base class to inherit from.  There is an alternate animation system, QueuedInterpolation, which has a couple Mesh subclasses( QI.Mesh, QI.Automaton, & QI.Hair).  You can still use Blender action animation (with the same name limitations), but QI meshes also have a more advanced morphing capability, and to skeleton animation from a Blender pose library.

Link to comment
Share on other sites

Had this exact same issue but simply added the dash character as @gryff suggested.

My action name went from SuzanneAction to Suzanne-Action and then it worked as expected! Thanks @gryff!

Previously I would have to go in and check the exported babylon file and see exactly what keyframes were used. The exporter aparently adds extra frames to the end of the current timeline. In this example I used the default 120 frames in blender. If I did not do this, then both meshes would use the entire combined timeline for the actions. With @gryff's suggestion, I can easily delete these lines from my code and just check the Auto Launch Animations inside Babylon Exporter options within Blender.

    const suzanne = scene.getMeshByID('Suzanne');
    scene.beginAnimation(suzanne, 131, 250, true);
    const iceberg = scene.getMeshByID('iceberg');
    scene.beginAnimation(iceberg, 1, 120, true);

 

Link to comment
Share on other sites

  • 2 months later...

So I test ToB exporter now. with two animation (auto).

If you have object name el1 and el2. If you make simple (location) animation. you should name it el1-action and el2-action. So name of object desh acttion. 
If you mark el1 as box collider and el2 as box collider with mass 0. You should mark thees to object el1 and el2 as Quaternion !!! And check "Auto launch animation " under mesh in Blender.

Then you export ToB. and these animations should work with collision.

Then if you

Greetings
Ian

Link to comment
Share on other sites

  • 1 month later...

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