Find animation associated with a take
On 03/01/2018 at 09:19, xxxxxxxx wrote:
is there a way to find the corresponding animation of data that is overriden in a certain take ?
From the documentation i know, that a BaseTake inherits from BaseList2D , so i should theoretically be able to use GetCTracks() on a Take. Since i get no result, i assume i am searching at the wrong place.
I think my basic problem is the wrong understanding of how the overrides are actually saved. So here are a few question i have:
1. when i invoke GetSceneNode() on an override, is this the actual reference to the object in the scene or to a copy ?
How does the **DescriptionID **of an override work, so that it finds the actual overriden parameter when i invoke GetParameter() ?
3. Where do i have to search for the animation data of an overriden parameter ?
I know these are many questions, but i hope that i have a better understanding when these are answered!
Update 1: Until now the only way to achieve my goal is to set each respective take as the currently active take, get the scene node for each overriden param, and check if there are any animations occuring on this parameter. I hope there is a better way to achieve this.
On 04/01/2018 at 07:42, xxxxxxxx wrote:
BaseOverride.GetSceneNode() returns a reference to the scene node.
The overridden parameters settings is stored in a BaseOverride. So the animation data for overridden parameters has to be retrieved on this kind of object.
The following script prints all the override DescIDs and associated tracks (if parameter is animated) for the current take and selected object:
import c4d def main() : if op is None: return takeData = doc.GetTakeData() if takeData is None: return take = takeData.GetCurrentTake() if take is None: return override = take.FindOverride(takeData, op) if override is None: return overridenIDs = override.GetAllOverrideDescID() for descid in overridenIDs: print descid print override.FindCTrack(descid) if __name__=='__main__': main()
See Take System Overview in the C++ SDK docs. The Takes API is mostly the same in both C++ and Python.
On 05/01/2018 at 07:29, xxxxxxxx wrote:
Thanks for the input, this approach make sense to me.
~~A last question on this concern: If i want to reassign the ctrack to the override again, is there a way to do it ? ~~
At the moment i perform objectToAllocateTackTo.InsertTrackSorted(ctrack).
This does not seem to be the right way, since the ctrack is visible in the dope sheet, even in the main take
Okay i found a solution just after posting this. Obviously i need to insert the track to the override, and not to the scene node.
Thanks for the help, everything is sorted now!