Hi @Enric
I don’t think you can change the TrialFileName after the model has loaded. That helps specify which c3d file is read in the load process. There are two solutions to what you want to do:
You can either (1) use some path statements to set the trial name, or you can (2) structure you model with multiple main files so it isn’t necessary.
1)
Try to add the following to your TrialSpecificData.any file
#ifndef TRIAL_FILE_NAME
#path TRIAL_FILE_NAME "some_default_trial_name"
#endif
TrialFileName = TRIAL_FILE_NAME;
Now the model will use the trial name stored in the path statement TRIAL_FILE_NAME.
That statement can be controlled by AnyPyTools when you make the macro:
Macro = [
Load('FullBody.main.any', paths={"TRIAL_FILE_NAME": "Some_other_trial_name"})
...
]
2)
Alternatively, you can structure your code similar to the “Multi trial MoCap example”.
This is a nice way of doing things since it makes much easier to switch between trials when you are just debugging and setting up your models. I use this approach on most of my models. AnyPyTools also handles this very well. The start_macro() method has a search_subdirs argument which will allow you to search for all the main files, and hence to batch processing this way.
>>> app.start_macro(macro, folderlist, search_subdirs = "*.main.any")
See this link: https://anybody-research-group.github.io/anypytools-docs/Tutorial/04_Batch_processing_multiple_models.html