First of all, I would like to present my apologies, for the time we ask to solve your issue. Moreover, I would like to point you, to our Q&A functionality in order to use as best as we can the new features offered by the forum.
I have setup your first post as a question and put tags to the topic.
With that's said, Motion Layer and Motion Clip are stored in some particular branch of the Motion Tag and there is currently no way to directly access Motion Clip or Motion Layer so you have to do it manually.
To know exactly how a scene is structured you can use the C++ example activeobject.cpp to help you.
Here it's an example of how to access to motion clip named "a,b,c or d" and move them to the 20th frame.
def getListHeadFromBranches(op, branchName):
branches = op.GetBranchInfo()
for branch in branches:
if branch["name"] == branchName:
# Main function
obj = op
if not obj: return
# Get the motion Tag (all the data are stored in it)
tag = obj.GetTag(465003000)
if not tag: return
# Get the motion system list head from the motion tag
motionSystemListHead = getListHeadFromBranches(tag, "Motion System")
if not motionSystemListHead: return
# Get Motion layers
motionLayers = list()
motionLayer = motionSystemListHead.GetDown()
motionLayer = motionLayer.GetNext()
if not motionLayers:
# Get Motion clip from the Motion layer
motionClips = list()
motionClipsNameAllowed = ["a", "b", "c", "d"]
for motionLayer in motionLayers:
# Get the motion Layer list head from the Layer object
motionLayerListHead = getListHeadFromBranches(motionLayer, "Motion Layer")
if not motionLayerListHead: return
motionClip = motionLayerListHead.GetDown()
if not motionClip: continue
name = motionClip.GetName()
displayedName = motionClip[c4d.ID_MT_CLIP_SOURCE].GetName() # Name displayed in the timeline in the rectangle of the motion clip
if name in motionClipsNameAllowed:
# Move all our motions clips
for motionClip in motionClips:
duration = motionClip[c4d.ID_MT_CLIP_VIEWEND] - motionClip[c4d.ID_MT_CLIP_VIEWSTART]
startFrame = c4d.BaseTime(20, doc.GetFps())
motionClip[c4d.ID_MT_CLIP_VIEWSTART] = startFrame
motionClip[c4d.ID_MT_CLIP_VIEWEND] = startFrame + duration
# Execute main()
But take care when modifying motionClip, and the value you enter. Since you have to modify the basecontainer directly, there is no check done and you can screw up c4d, so be sure values you enter are correct!
Moreover about marker you can find example about how to use them in this example.
Hope it makes sense if you need help, or you have any questions please let me know!
Again, all my apologies for the delay.