Hi everyone,
I am trying to fully automate the creation of a Motion Clip via Python, completely bypassing the UI popup from the "Add Motion Clip" command. I need to be able to set parameters through code.
I understand from previous threads that the NLA system might not be fully exposed in the Python API. I was successfully able to use branch traversal to find the NLA Base and allocate the MT_LAYER and MT_CLIP using c4d.BaseList2D().
This post was a good source of info:
http://developers.maxon.net/forum//post/55975
However, my roadblock is creating the actual Motion Source to link to the clip. When I try to allocate it, I get an allocation error.
Here is the exact line:
import c4d
MT_SOURCE = 465003004 # ID for Motion Source
def main():
# Attempting to create the Motion Source container
motion_source = c4d.BaseList2D(MT_SOURCE)
if __name__=='__main__':
main()
BaseException: the plugin 'c4d.BaseList2D' (ID 465003004) is missing. Could not allocate instance.
I have two questions:
-
Is there an undocumented helper function, message, or workaround to allocate a Motion Source (MT_SOURCE) in Python so I can manually insert CTrack data into it?
-
Alternatively, since "Add Motion Clip" is a CommandData plugin, is there any hidden way to pass a settings container to it via Python (similar to MSG_RETRIEVEPRIVATEDATA with SceneSavers) so it executes silently without the UI popup?
Any guidance or confirmation if this is strictly locked to the internal C++ core would be hugely appreciated!
Thank you,
Jaroslav