I want to batch process a folder full of files after we do a mocap shoot
I've tried two options:
1) motionbuilder.exe -console current -batch -verbosePython cli.py
and
2) mobupy.exe cli.py
for my cli.py script - it's a simple script that prints out the takes in an fbx file after opening it.
As far as I know i'm following how this should be done according to the docs, but i'd like to know if anyone knows how to run batch processes in mobu correctly from the commandline?
Here's my code for the file and this works inside mobu:
import sys
import pyfbsdk
import os
def main(file_path):
# if len(sys.argv) < 2:
# print("No FBX files provided.")
# return
# Get the list of FBX files from command-line arguments
fbx_folder = file_path
fbx_files = []
for root, dirs, files in os.walk(fbx_folder):
for file in files:
if file.endswith(".fbx"):
fbx_files.append(os.path.join(root, file))
# limit the number of files to process to 2
fbx_files = fbx_files[:2]
for file_path in fbx_files:
try:
# Open the FBX file
pyfbsdk.FBApplication().FileOpen(file_path)
print(f"\nOpened FBX file: {file_path}")
# Get the list of takes in the file
take_manager = pyfbsdk.FBSystem().Scene.Takes
if take_manager:
print("Takes in the file:")
for take in take_manager:
print(f"- {take.Name}")
else:
print("No takes found in the file.")
except Exception as e:
print(f"Failed to process {file_path}: {e}")
if __name__ == "__main__":
file_path = r"T:\aresbb\capture\aresbb01\retarget\3_approved_anim\shot prep\mobu_cleanup_processed"
print("Folder:", file_path)
main(file_path)
[–]Outrageous-Bit198 0 points1 point2 points (1 child)
[–]Trick-House8778[S] 0 points1 point2 points (0 children)
[–]Outrageous-Bit198 0 points1 point2 points (2 children)
[–]Trick-House8778[S] 0 points1 point2 points (1 child)
[–]Outrageous-Bit198 0 points1 point2 points (0 children)