Hi @blastframe, unfortunately, there is no way to call the command without open the Motion Clips Dialogs.
However, it's pretty easy to reproduce since it's only retrieving the content of NLA Root (aka where Motion Source are stored see Placing Motion Sources at Timeline Markers with Python - r19.
So here its what the Save Motion Source do:
def ExportMotionSource(path, motionSourceObject):
"motionSourceObject is None to save all MotionSource or pass the returned obj from GetMotionSourceByName"
doc = c4d.documents.GetActiveDocument()
docNew = c4d.documents.BaseDocument()
# Copy settings
docNew.SetData(c4d.DOCUMENTSETTINGS_DOCUMENT, doc.GetData(c4d.DOCUMENTSETTINGS_DOCUMENT))
docNew.SetData(c4d.DOCUMENTSETTINGS_GENERAL, doc.GetData(c4d.DOCUMENTSETTINGS_GENERAL))
docNla = doc.GetNLARoot()
docNewNla = docNew.GetNLARoot()
if motionSourceObject is None:
docNla.CopyTo(docNewNla, c4d.COPYFLAGS_NONE, None)
else:
copyNewObj = motionSourceObject.GetClone(c4d.COPYFLAGS_NONE, None)
docNewNla.InsertLast(copyNewObj)
c4d.documents.SaveDocument(docNew, savePath, c4d.SAVEDOCUMENTFLAGS_NONE, c4d.FORMAT_C4DEXPORT)
def LoadExportMotionSource(path):
doc = c4d.documents.GetActiveDocument()
c4d.documents.MergeDocument(doc, path, c4d.SCENEFILTER_MERGESCENE, None)
def GetMotionSourceByName(name):
root = doc.GetNLARoot()
obj = root.GetDown()
while obj:
if obj.GetName() == name:
return obj
obj = obj.GetNext()
Regarding the c4dsrc extension, as you can see internally this is just a BaseDocument saved, the extension is just used to mark this as a motion source file template.
Cheers,
Maxime.