On 03/05/2013 at 03:05, xxxxxxxx wrote:
Hi littledevil,
I didn't include the GePrint's because the double line spacing was making the post very long. Here's what the two print's look like for the above code trials:
// INITIAL POSITION PRINTS:
GePrint("Pre-Positions:");
String temp = FormatNumber(X,FORMAT_REAL,NULL,NULL);
GePrint("X = " + temp);
temp = FormatNumber(Y,FORMAT_REAL,NULL,NULL);
GePrint("Y = " + temp);
temp = FormatNumber(Z,FORMAT_REAL,NULL,NULL);
GePrint("Z = " + temp);
// MAINOBJECTS EXECUTION RUN AGAIN
//POST/REFRESHED POSITION PRINTS
GePrint("Post-Positions:");
temp = FormatNumber(Th.x,FORMAT_REAL,NULL,NULL);
GePrint("X = " + temp);
temp = FormatNumber(Th.y,FORMAT_REAL,NULL,NULL);
GePrint("Y = " + temp);
temp = FormatNumber(Th.z,FORMAT_REAL,NULL,NULL);
GePrint("Z = " + temp);
GePrint(" ");
It's a bit awkward to explain it all without making it very long! The objects are moved by data stored in a vector array. When Cinema draws a new frame, the MainObject's Execution is run with the "if(Pattribute.ExecutionRefresh == 1)" this bool is then made false so that the execution function only runs that part of the code once. The Boolean is made TRUE on a new frame for example. This allows the user to then move the object freely without the execution running several times and returning the LinkedObject's postion over and over via the vector data. That is, the vector data is used only once per frame. Say the user can then move the object 100cm in the "X" axis. They can then hit the button and what 'should' happen is the position of the object is recorded (initial position), and then the Boolean is made TRUE so that the execution can run it's vector code again for that frame, moving the object back to where the vector data says it should be, and the position is taken again so that I should be left with two object positions that I can compare. But it's always returning the same values despite the object being moved in the viewport.
As for the GetRelPos() - I was just using that to try it. I've tried it a few ways and that just happened to be the last way I could think of 
Hope that clarifies things a bit..!
WP.