I previously created separate tracks for each position component and then used CKey::SetValue to set the floating point value of each position component in a keyframe.
This correctly marked the keyframed position coordinates red in the C4D GUI, but the code becomes more messy and unreadable.

Is there a way to create keyframes using vector data and still have the coordinates being marked as red?

Edit:
I think that there might be some fundamental diference between "Value Keys" and "Data Keys"(the ones I'm creating).
It's as if "Data Keys" happens behind the scenes, even if they only affect GUI-accessible parameters such as position coordinates.

I'm still using R13. So maybe they changed in in later versions. But I'm surprised your code works at all. Because AFAIK. You can't create a position track in one line. You need to create each track individually like this:

I'm still using R13. So maybe they changed in in later versions. But I'm surprised your code works at all. Because AFAIK. You can't create a position track in one line. You need to create each track individually like this:

When I do this and use DrawViews(c4d.DRAWFLAGS_FORCEFULLREDRAW). The dots turn from yellow to red as expected when using SetGeData().

-ScottA

Originally posted by xxxxxxxx

I previously created separate tracks for each position component and then used CKey::SetValue to set the floating point value of each position component in a keyframe.
This correctly marked the keyframed position coordinates red in the C4D GUI, but the code becomes more messy and unreadable.

As stated in OP, I did this at first and I want to avoid it since it's an ugly solution.

That SDK example seems to be talking about special tracks.
I have fallen way behind to the most recent changes and additions. So I can't say for sure it can't be done.
The support guys might have a different answer for you on Monday.

indeed it looks like that you have to animate each vector component individually to properly create the needed tracks. Only then the animation dots appear. It shouldn't be too hard to come up with a simple utility function to handle this. Since R18 the API contains BaseObject::GetVectorTracks() that gives easy access to the actual vector component tracks. See BaseObject Manual.

With the tracks created you have to call EventAdd() to inform Cinema about the update.