4

I am currently working on creating a 3D scene using JavaFX. In the scene I would like to show some more complex 3D models. I, therefore, used the InteractiveMesh importers for importing some OBJ/STL models, which worked fine. I would also like to include an animated model (walk cycle). I found the JavaFX sample application 3DViewer which includes a Maya-Importer. As I am not that familiar with Maya and 3D modelling in general I tried to find some free models, which are animated or at least rigged, online. Unfortunately, I could not find a single model, neither suitable for creating an animated walk cycle (rigged) nor already animated, I could successfully open in 3DViewer. The import usually fails due to Nullpointer- or IndexOutOfBoundsExceptions while loading the Maya model.

I am now wondering if somebody has already managed to open an animated Maya model in 3DViewer? I highly appreciate references to models, which can successfully be imported.

Additionally, are there other ways of importing animated 3D models (not necessarily Maya models) into JavaFX?

user1803551
  • 12,965
  • 5
  • 47
  • 74
Alex
  • 41
  • 1
  • 4
  • FYI the Duke maya files for the chess demo have been [released](http://hg.openjdk.java.net/duke/duke/file/e71b60779736/3D) recently, and you can use [3D Viewer](https://github.com/javafxports/openjdk-jfx/tree/develop/apps/samples/3DViewer) to open them and play the animations. – José Pereda Jul 30 '18 at 17:02

2 Answers2

4

You can have a look at this project: https://github.com/jperedadnr/RiggedHand

It is not exactly doing what you want (import an animated 3D model), but it manages to animate a given 3D model, in this case using Leap Motion.

You can have a look at the result on this video.

If you check HandImporter class, it is based in the creation of a SkinningMesh, as it is defined under the 3DViewer project you already mentioned. This will contain the 3D mesh for the hand, the weights and the tree of joints.

RiggedHand

This is the same technic as the one used for the Duke chess animation:

RiggedDuke

José Pereda
  • 44,311
  • 7
  • 104
  • 132
  • Hi and thanks for your reply. I really like your RiggedHand-project - great work. I'll check if I can use your ideas for animating my walking character. I would have really liked to use the maya importer for importing full animations though as this appeared to be a rather simple approach. Thanks again. – Alex Jun 07 '16 at 07:06
  • Importers found here: https://mvnrepository.com/artifact/org.fxyz3d/fxyz3d-importers/ – Terran Aug 22 '19 at 16:16
  • 2
    Yes, @Terran, we have recently added to FXyz the .OBJ and .MA (Maya) importers from the 3DViewer project. You can actually play the Duke chess animation above if you run the FXyz [Sampler](https://github.com/FXyz/FXyz#fxsampler) – José Pereda Aug 22 '19 at 16:21
2

Additionally, are there other ways of importing animated 3D models (not necessarily Maya models) into JavaFX?

and the bounty's

I would like to see a solution for importing any readied animated 3D model into JavaFX.

It appears that the 3D viewer's support for .ma files is the only readily available way to import 3D animated models.

InteractiveMesh's importers do not import animation, as well as Tesis Dynaware's FBX importer.

Edit:

OpenJDK lists that it will not provide importers:

Loader support

  • Many 3D file formats exist, such as:
    • Obj, Maya, 3D Studio Max, Collada, KRML
  • We will not provide a loader as part of the JavaFX runtime
  • We will make sample code available for one or two popular formats

See the comments there as well as this enhancement request.

user1803551
  • 12,965
  • 5
  • 47
  • 74
  • @Mark Something like that. A lot of searching and asking a few people (like the FBX importer writer). Unfortunately there are no plans to provide importers/loaders - see my edit. – user1803551 Nov 01 '16 at 16:12