You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello,
I noticed the animations in my exported fbx files were stopping before the actual end of the animation, leaving some keys behind.
I believe this is due to this specific part of the code here in code/AssetLib/FBX/FBXExporter.cpp:
which causes the duration to be floored right before converting to k time units (if I understood correctly), losing the fractional part.
I changed it to this to make it work for my project:
Ah no, I didn't, I actually didn't even think about doing it. I know the k_time function with only the time as argument works too.
But now I'm wondering if I really should, I was under the impression that k_time is only used for fbx, so if I wanted to change the export format to dae (or make the user able to change it to dae), would it make sense to use k_time before the export function is called?
I believe the conversion itself is harmless but if the k_time is only intended for fbx I would prefer to keep the key time agnostic of any format if possible.
If you use the ktime(time) function in FBXExporter.cpp, you can see that the scale is different from the duration.
(my case is fbx to fbx. In other cases, I don't know.)
The problem seems to occur because the FBX importer uses the same formula for duration and ktime, but the FBX exporter uses different formulas.
Activity
Nor-s commentedon Aug 21, 2022
Did you change the transformation key times too?
to_ktime(k.mTime)=>to_ktime(k.mTime, anim)It work for my project.
Also, i did some testing and found that it only exports 24fps(FileGlobalSettings::FrameRate_CINEMA).
So the duration can be unstable, If it is an animation such as 30fps.
TwnKey commentedon Aug 21, 2022
Ah no, I didn't, I actually didn't even think about doing it. I know the k_time function with only the time as argument works too.
But now I'm wondering if I really should, I was under the impression that k_time is only used for fbx, so if I wanted to change the export format to dae (or make the user able to change it to dae), would it make sense to use k_time before the export function is called?
I believe the conversion itself is harmless but if the k_time is only intended for fbx I would prefer to keep the key time agnostic of any format if possible.
Nor-s commentedon Aug 21, 2022
What I meant was the conversion inside the fbx export function. not before the export function.
FBXExporter.cpp
If you use the
ktime(time)function in FBXExporter.cpp, you can see that the scale is different from the duration.(my case is fbx to fbx. In other cases, I don't know.)
The problem seems to occur because the FBX importer uses the same formula for duration and ktime, but the FBX exporter uses different formulas.
import::Converter::duration, import::Convert::mTime
CONVERT_FBX_TIME(start_time) * anim_fpsexport::duration
export::time
times.push_back(to_ktime(k.mTime));