THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 02/10/2010 at 15:57, xxxxxxxx wrote:
Cinema 4D Version:
Language(s) : C.O.F.F.E.E ;
In R11.5 and lower I use scripts to export and import animation to text files
(ie chan export and import).
In R12 only the PSR values are keyframed (CallCommand(12410)) correct
but not object parameters when importing.
Using "Add Keyframe Selection", keys are set but no animation are set.
Values are simply not recognized.
Could this be connected to the pointselection/linkfield issue (no update until Event)?
Below is the part in the loop that sets FocalLength and Aperture (R11.5 OK, R12 not).
// asize is the amount of columns in txt file
// warray is the column used
if(op->IsInstanceOf(Ocamera) && asize > 7 )
var apert = op#CAMERAOBJECT_APERTURE / aspect;
if(format == 0 && warray!=NULL) op#CAMERA_FOCUS = apert/(2*tan(Radians(warray)/2)); // chan verticalFOV
if(format == 1 && warray!=NULL && warray!=NULL)
op#CAMERA_FOCUS = (warray); // chan TG 2.1 Focal Length
op#CAMERAOBJECT_APERTURE = warray; // chan TG 2.1 Aperture Width mm
if(format == 2 && warray!=NULL) op#CAMERA_FOCUS = (warray); // ASCII Focal Length
if(format == 2 && warray!=NULL) op#CAMERAOBJECT_APERTURE = (warray); // ASCII Aperture mm
EventAdd(EVENT_ANIMATE); // <- tried but no go
op->Message(MSG_UPDATE); // <- tried but no go
On 02/10/2010 at 17:49, xxxxxxxx wrote:
I also just tried setting the values to the base container of op
instead of using the # operator, but still no go I'm afraid.
On 04/10/2010 at 02:27, xxxxxxxx wrote:
Sorry, I can't confirm.
This simple test code will record keyframes of a sphere's radius. Of course you have to make the radius a key frame selection before running the script. The Cinema 4D help does say so too.
var op = doc->GetActiveObject();
var time = new(BaseTime);
for (i=0; i<10; i++)
op#PRIM_SPHERE_RAD = i*10.0;
When in this mode, in conjunction with Key-Selections, only the selected parameters will be applied when recording keyframes. This works both in the Autokeying mode as well as when recording keyframes manually (Record Active Objects).**
On 04/10/2010 at 10:16, xxxxxxxx wrote:
Thanks Matthias for checking and the example.
Yes I know that and that is what I do (use KeyFrame Selection)
As I mentioned, keys -are- set for the camera parameters
but no correct values are set.
However, what I found out was:
First, the DrawViews(DRAWFLAGS_FORCEFULLREDRAW) isn't called
at the "same" moment as the R11 "DrawViews(DA_STATICBREAK)".
I need to put the DrawView Command before the Record command
or I get some very erratic keys (wrong values at wrong time).
In R11, to check a valid value in a column from the txt file I use,
if(array[n] != NULL)
In R12 I need to use,
if(array[n] != NOTOK)
So far it seems to work as it should.