Batch import FBX motion files

Hello,

I am trying to batch import FBX motion files in iClone 8.75.5630.1 using the Python API, and save each one to my Motion library as .rlMotion.

The motions are already retargeted to the CC/Motion Dummy skeleton, and doing this manually works correctly — I import the FBX, the motion applies to my loaded Motion Dummy, and I can save it. My problem is only with scripting it. Doing 100+ motions one at a time by hand is time consuming.

I have tried three approaches and hit a different problem with each:

  1. RFileIO.LoadFbxFile(path, EImportFbxOption_StandardHumanCharacter, “”, “”, True)
    The FBX imports as a prop, not as an avatar, and it does not apply to the Motion Dummy already loaded in the scene. RScene.GetAvatars() does not list it. RFileIO.SaveFile(obj, ESaveFileType_Motion, path) then fails with “Failed to save file”, which I assume is because the object is a prop rather than an avatar. I also tried EImportFbxOption_Humanoid with the same result.

  2. RFileIO.LoadMotion(fbx_path, RTime(0), avatar)
    This accepts the FBX path and returns an RStatus that is not an error, but no motion is applied — saving afterwards produces the Motion Dummy’s rest pose. Every output file was exactly the same size. Should LoadMotion accept an FBX path, or only .rlMotion?

  3. RFileIO.ConvertFbxFileToRLMotion(src_fbx, dst_rlmotion)
    A progress dialog appears saying “Converting Fbx file to RLMotion” and reaches about 10%, but no output file is ever produced. I also tried the 5-argument overload with a float value, which returns immediately without showing any dialog and without writing a file.

An additional problem for batch use: the “FBX Import Settings” dialog (Keep Original / Force n fps) appears on import and waits for input, which blocks any unattended run.

My questions:

What is the correct API sequence to apply an FBX motion to an already-loaded CC character from Python, and then save it as .rlMotion?
Is there sample or reference code for a batch import-and-save loop?
Can the FBX Import Settings / frame-rate dialog be suppressed or answered from script, so a batch can run unattended?
Is ConvertFbxFileToRLMotion intended for this use case, and what are its remaining parameters?

Any reference code or documentation you can point me to would be very helpful.

Best regards,
Sydharth.

Hi, thanks for the detailed writeup!

The current API isn’t quite ready for a reliable unattended batch FBX→rlMotion workflow yet — you’re not missing an obvious approach. We’re actively extending the API to properly support this, hopefully by the next update. I’ll follow up on this thread once it’s available.

Hi Zach, thanks for your revert, i will look forward for this, it will make things really easier.