@m_adam Thank you for another detailed answer !
Latest posts made by q1w2ertyu
-
RE: Problems of copying position keyframs to another obj
-
RE: Problems of copying position keyframs to another obj
Thank you very much, your answer is detailed and the method is really overkill !
The reason why I don't use Ckey is that I got a lots of objects each one has its own animation. And these objects are in a hierachy, which means the motion of the object at the bottom of the hierachy is different from its reletive motion. I want to copy the ABS motion of the bottom object to another object.
And I have never found a DescID describing the global position of a object(such as "obj.GetMg().off" ). So I use the silly frame by frame method to copy the global position of an obj.
I'm a noob in C4D script, maybe the problem is silly, does C4d have a DescID containing the global position data ???
-
Problems of copying position keyframs to another obj
There are two box in the scene.I want to copy position keyframs of one box to another. My way of doing that is copy the position to the target box frame by frame.The problem is by using "doc.SetTime" or "SetDocumentTime(doc, time)",although the time is changed ,but the position of the source box remain the value when i execute the script and never update. So the result is that the target box get a lot of same frames.
Is there anyway to solve the problems??
test.c4dHere's my code,the source is box1 and the target is box2
import c4d smallbox=doc.SearchObject("box1") bigbox=doc.SearchObject("box2") for frame in range(60): doc.SetTime(c4d.BaseTime(frame,30)) bigbox.SetMg(smallbox.GetMg()) c4d.CallCommand(12410) # record active obj c4d.EventAdd(c4d.EVENT_ANIMATE)