|
Tell us what you think of the site.
|
Autodesk Media & Entertainment User Community
|
Autodesk® 3ds Max®
|
|
Autodesk® Maya®
|
|
Autodesk® Softimage®
|
|
Autodesk® MotionBuilder®
|
|
Autodesk® Mudbox™
|
|
Autodesk® ImageModeler™
|
|
Autodesk® Sketchbook® Pro
|
|
Autodesk® Smoke on Mac®
|
| FBX SDK memory requirements and files with plotted takes
|
|
|
Hello,
I have run across a difficult problem implementing the FBX SDK in my application. I have derived my source from the ViewScene example, and I noticed that my app takes up 140 MB of RAM when I load 3 FBX files with 17 takes in total. Each file has a character with a rig and animation, and they are all plotted.
I have always needed to plot all takes when playing back animation from an FBX character in my viewer. If I load the normal, unplotted file, no animation is played. The trouble is, of course, plotted files usually take up more than double the original files size. It seems unnecessary to have to plot everything just so the animation will play in the application which uses the FBX SDK: hundreds is not thousands of keyframes are created, and this is probably what’s taking up so much memory.
Is there any way I can play back animation using the FBX SDK without having to plot everything? I am using MotionBuilder.
All help is appreciated!
|
|
|
|
Hi Albeif,
If I understand correctly, the issue here is that you have a scene from MotionBuilder with Characters, and you want to load that scene in your custom application using FBX SDK.
The FBX SDK will read all information in the fbx file, but it will not evaluate the Character animation. This is why you need to plot animation before saving the fbx file.
If you only want to view the fbx file, try the FBX QuickTime Viewer. Otherwise, a long-term solution would be to write your own character evaluator, that would read the information from the fbx file and make it move accordingly.
It depends on what you want to do in the end!
Viviane
Viviane Rochon
Maya Data Platform
Autodesk
|
|
|
|
Hi Viviane,
Yes, I am playing my characters in my FBX SDK application, which I animate in MotionBuilder. According to what you say, and my previous experience, applying a keyframing engine (i.e. a TCB keyframer) in my code would allow me to interpolate the keys used to animate the character in MB. Is this what you mean by a character evaluator?
Thanks a lot!
|
|
|
|
Hi Albeif,
When you plot animation in MotionBuilder, the animation is plotted on the bones of your model. If you don’t plot, the animation occurs on the character only, so you would have to find a way to tell the bones how to move according to the character animation. Personally I don’t know how to do that. It sounds like the solution you propose (keyframing engine) could work.
On the other side, maybe there are ways to export a smaller file from MotionBuilder? Have you tried applying animation filters? Saving only a selection of the scene? Are you using the latest available version of MotionBuilder? There might be improvements in the file size.
Viviane
Viviane Rochon
Maya Data Platform
Autodesk
|
|
|
|
Hi Viviane,
I realized that in fact the bones do not have transformations when I am playing a scene with the SDK without plotting the takes; if I plot them, the bones’ nodes have transformations. However, in both the plotted and non-plotted files, the effector nodes of the rig are transformed at each frame. It seems to me that I could use an IK solver (not a keyframing engine as I said before, because the node evaluators already do that), which would allow me to set the bones’ transformations at each frame by solving the IK chain: from the character rig’s effector, set the resulting matrices to the bones’ nodes. Is this true? If so, how do I fill up the nodes - should I go through all of them and set them, or use a KFbxPose? (I don’t know what a KFbxPose class is used for yet).
Another thing: in my code, when I animate a bone using KFbxNode::SetGeometricTranslation(), the character’s skin is not updated when I draw the scene. Do I have to fit in the SetGeometricTranslation somewhere immediately after the node’s transformation and before the mesh is skinned and drawn? In theory, this should work in the SDK.
Thank you,
albeif
|
|
|
|
|
Hi, albeif,
To fill up the nodes with transform at each frame you need to add animation curve to each transform attributes of these nodes, at least including LclTranslatio, LclRotation and LclScaling.
KFbxPose has nothing to do with this transform animation, it is only used to store bind pose: a snapshot of the bones/geometry’s transform at binding moment, or or rest pose: a snapshot of the bones/geometry’s transform at a given moment.
Refer to the KFbxNode::SetGeometricTranslation(), if you take a close look at its doc you will see it only affect something called “geometry translation”, which only represent an offset of the geometry to its pivot, it is not the one to do animation, if you want to animation the bone, you should add animation curves/keys on the bone’s LclTranslation attribute.
About how to add animation curves/keys on certain attributes, you may take a look at the public FBX SDK samples, ExportScene01.
Author: Jiayang Xu
|
| Replied: 26 December 2010 03:00 PM
|
|
|
|
|
Hi,
Unfortunately I have been trying since yesterday to animate using Lcl* to no avail! The only way I can get any animation so far is by using the SetGeometric*() functions. I try to set LclTranslation after creating a stack, a layer and getting the animation curve, but none of this gives me any real-time animation! Am I doing something wrong? I already looked at ExportScene01 and did as it showed, but no results.
Help!
|
|
|
|
Hi Albeif,
Animating Lcl properties is the way to go. If no animation is showing, it is either because the FBX scene is not created properly, or because the viewer is not reading the FBX file properly.
Here are some things you could try:
- Generate file ExportScene01.fbx, using example ExportScene01. See if your viewer is reading the FBX file properly.
- Generate your own animated fbx file. Then use example ViewScene to verify if the animation displays properly.
With those tests, you will be able to test if you need to tune the scene creation / animation, or if the problem is on the viewer’s side.
I hope this helps
Viviane
Autodesk
Viviane Rochon
Maya Data Platform
Autodesk
|
|
|
|
|
Hi Viviane,
Thanks for your reply. Indeed, the ViewScene example does not take into account the Lcl* properties that you might set procedurally to the frame’s transformation matrix. I had to change the DrawScene() and DrawNodeRecursive() of the DrawScene.cxx file to apply the Lcl* values. So now the bone transformations work fine.
Author: albeif
|
| Replied: 29 March 2011 05:59 AM
|
|
|
|
|