0

We have some animated objects in our 3DS Max file. Would it be possible to display these animations in the viewer? We've seen some examples from the Forge developers showcasing animated robots. Would really like to get information on how to achieve animations in the viewer.

T. Pex
  • 73
  • 9

2 Answers2

2

The model derivative translation of the .MAX file does not include animation. It uses the current keyframe state of the geometry to translate, and no animation is included. At the moment, only certain translation types include source animation. For example, the Fusion format can contain animation, and those can be played back in the Forge Viewer. See here for information on that aspect: https://forge.autodesk.com/blog/show-animation-and-cam-content.

Because the Forge Viewer is using three.js, you can add your own animation. This is how the robot was animated (assuming you are referring to these samples: interactive: http://mimikron-project.s3-website.us-east-2.amazonaws.com/ and preforming: http://mimikron-project.s3-website.us-east-2.amazonaws.com/cyberdancer.html)

There are two good blog posts that discuss this starting here: https://forge.autodesk.com/blog/know-how-complex-component-transformations-viewer-part-1-basics (and see end for part 2 link). Note the running sample of the gyro clock is posted here: http://giro-watch.tk/ You can see the time is animated based on the browser current time, and there are also controls for interactive animation/transforms.

Hope it helps, kevin

kevinvandecar
  • 176
  • 1
  • 3
  • Very interesting. Thanks for your thoroughly reply kevin. I will do some testing. By the way, do you happen to know if there's any other file than f3d that could contain animation? – T. Pex Jan 19 '18 at 17:59
  • At the moment only f3d animations are supported out of the box by Forge translators. – Felipe Jan 19 '18 at 20:45
  • Thanks. I created an animation inside Fusion and followed Step 3 (http://help.autodesk.com/view/fusion360/ENU/?guid=GUID-A3204116-91D7-4F57-B6DA-3CDF3C70C54E) to test it out (it worked). However, I would like to bring it into my app. So I downloaded the very same f3d file from the online Fusion Forge viewer and uploaded/translated it into my app. Can I somehow play the animation from my own app? – T. Pex Jan 19 '18 at 22:43
2

In addition to Kevin's answer, if you are using (or can use) .fbx then you could extract the animations data by using the FBX C++ SDK and load it in the viewer but the whole workflow has to be a custom implementation.

I just published a new sample that uses the hierarchical transforms approach exposed in the blog article. It also lets you save the transform state in the database and perform smooth animation to transition between two arbitrary states:

See the live demo here and the code at Viewing.Extension.Kinematics

enter image description here

Felipe
  • 4,325
  • 1
  • 14
  • 19
  • Great! I would definitely be able to use fbx. Do you happen to know of any tutorial on how to get the extracted animations into the viewer using the FBX C++ SDK? I am currently looking into its documentation. By the way your new demo is really impressive. I'll take a closer look at that one. – T. Pex Jan 19 '18 at 18:02
  • Unfortunately we don't have any tutorial on that topic. You would need to take a look a the FBX SDK documentation to extract animation data, the rest of the workflow would need to be a custom implementation, most likely store animation data in a custom database, then upon loading of the model fetch the data and animate the model using custom JavaScript logic. – Felipe Jan 19 '18 at 20:44