On 19/12/2017 at 04:09, xxxxxxxx wrote:
OK, I've set a scene up exactly like that. I've set two keys for px,py,pz each. One at the beginning and one at the end of the document (0-10 frames). The project is saved using the save for Melange command. I've used this code to get the position in two ways. Firstly by getting the tracks responsible for the position and second by getting the .off vector of the object matrix and here are the results:
The code:
BaseObject* cube = C4Ddoc->GetFirstObject();
Int32 fps = C4Ddoc->GetFps();
BaseTime time = C4Ddoc->GetTime();
Int32 frame = time.GetFrame(fps);
// For getting the float components of the tracks
CTrack* track_x = cube->FindCTrack(DescID(DescLevel(ID_BASEOBJECT_REL_POSITION), DescLevel(VECTOR_X)));
CTrack* track_y = cube->FindCTrack(DescID(DescLevel(ID_BASEOBJECT_REL_POSITION), DescLevel(VECTOR_Y)));
CTrack* track_z = cube->FindCTrack(DescID(DescLevel(ID_BASEOBJECT_REL_POSITION), DescLevel(VECTOR_Z)));
for (int i=0; i<=10; i++) {
C4Ddoc->SetTime(BaseTime(i, fps));
time = C4Ddoc->GetTime();
printf("Frame : || %d \n", C4Ddoc->GetTime().GetFrame(fps));
Float32 px = track_x->GetValue(C4Ddoc,time);
Float32 py = track_y->GetValue(C4Ddoc,time);
Float32 pz = track_z->GetValue(C4Ddoc,time);
Vector p = Vector(px,py,pz);
printf("Position from track || x : %f , y : %f , z : %f \n", p.x,p.y,p.z);
Matrix cube_mat = cube->GetMg();
Vector mp = cube_mat.off;
printf("Position from matrix || x : %f , y : %f , z : %f \n", mp.x,mp.y,mp.z);
printf("=====================================================\n");
And this is what comes out in the console:
Frame : || 0
Position from track || x : 0.000000 , y : 0.000000 , z : 0.000000
Position from matrix || x : 0.000000 , y : 0.000000 , z : 0.000000
=====================================================
Frame : || 1
Position from track || x : 0.000000 , y : 0.279997 , z : 0.000000
Position from matrix || x : 0.000000 , y : 0.000000 , z : 0.000000
=====================================================
Frame : || 2
Position from track || x : 0.000000 , y : 1.039998 , z : 0.000000
Position from matrix || x : 0.000000 , y : 0.000000 , z : 0.000000
=====================================================
Frame : || 3
Position from track || x : 0.000000 , y : 2.160002 , z : 0.000000
Position from matrix || x : 0.000000 , y : 0.000000 , z : 0.000000
=====================================================
Frame : || 4
Position from track || x : 0.000000 , y : 3.520008 , z : 0.000000
Position from matrix || x : 0.000000 , y : 0.000000 , z : 0.000000
=====================================================
Frame : || 5
Position from track || x : 0.000000 , y : 4.999986 , z : 0.000000
Position from matrix || x : 0.000000 , y : 0.000000 , z : 0.000000
=====================================================
Frame : || 6
Position from track || x : 0.000000 , y : 6.479992 , z : 0.000000
Position from matrix || x : 0.000000 , y : 0.000000 , z : 0.000000
=====================================================
Frame : || 7
Position from track || x : 0.000000 , y : 7.839998 , z : 0.000000
Position from matrix || x : 0.000000 , y : 0.000000 , z : 0.000000
=====================================================
Frame : || 8
Position from track || x : 0.000000 , y : 8.960002 , z : 0.000000
Position from matrix || x : 0.000000 , y : 0.000000 , z : 0.000000
=====================================================
Frame : || 9
Position from track || x : 0.000000 , y : 9.720003 , z : 0.000000
Position from matrix || x : 0.000000 , y : 0.000000 , z : 0.000000
=====================================================
Frame : || 10
Position from track || x : 0.000000 , y : 10.000000 , z : 0.000000
Position from matrix || x : 0.000000 , y : 0.000000 , z : 0.000000
=====================================================
When you say 'querying for the object position' in your previous post, did you mean one of these methods or something different? - What might I be doing wrong to not see the position values from the matrix?
Thanks for bearing with me on this 
Adam