That's a good suggestion Andy,
I've had memory allocation problems with scripting the plotting of long
mocap sequences, so this idea might just be the solution.
Andre
-----Original Message-----
From: owner-xsi(at)Softimage.COM [mailto:owner-xsi(at)Softimage.COM] On Behalf
Of Andy Jones
Sent: July 24, 2007 5:20 PM
To: XSI(at)Softimage.COM
Subject: Re: Plotting keyframe faster....
I think the usual solution to not being able to allocate a big enough
array for something like this is to break it up into chunks. So,
instead of frame-by-frame, you do, like 100 frames-by-100 frames. So,
you'd just keep the text file open, read 100 lines into the array, put
them on the curve, read the next 100 lines, put them on the curve, etc.
A little more coding, but it should be workable.
- Andy
Julien Stiegler wrote:
> Salut Guillaume,
>
> using array is fast like the PlotParticle script.
> But it takes too much memory to store the whole sequence in an array
> in one row.
> I had to bake a 500 frame simulation with 5000 fish and had to write a
> frame by frame script because PlotParticle (array based) script would
> crash (due to memory)
>
> Anyway there is so many keyframes to store, it's really slow....
>
> best regards.
>
>
> Guillaume Laforge wrote:
>
>>Hi Raffaele,
>>
>>I made a test with object model and it looks really fast.
>>
>>Code Snipet :
>>
>>for(var i=0; i<100; i++)
>>{
>> // Create a null
>> var nullobj = ActiveSceneRoot.AddNull();
>>
>> //position
>> var posxArray = [0,5,10,50];
>> var posyArray = [0,7,9,500];
>> var poszArray = [0,15,9,12];
>>
>> CreateCurveThenAddKeys( nullobj.posx, posxArray );
>> CreateCurveThenAddKeys( nullobj.posy, posyArray );
>> CreateCurveThenAddKeys( nullobj.posz, posyArray );
>>}
>>
>>function CreateCurveThenAddKeys( channel, arrayValues )
>>{
>> // Create empty fcurves
>> var fcurve = channel.AddFCurve();
>>
>> // Define the number of keys
>> var nbkeys = arrayValues.length ;
>>
>> // Start editing the fcurve
>> fcurve.BeginEdit();
>>
>> // Add keys to the fcurve
>> for ( var i=0; i<nbkeys; i++ )
>> {
>> fcurve.AddKey( i, arrayValues[i] );
>> }
>>
>> //End editing the fcurves and put the undo event onto
>> // the undo/redo stack
>> fcurve.EndEdit();
>>
>> return fcurve;
>>}
>>
>>
>>
>>Cheers
>>
>>--
>>Guillaume Laforge | La Maison
>>
>>
>>
>>On Tue, 24 Jul 2007 14:31:10 -0400 (EDT), Raffaele Scaduto-Medola
<raffaele(at)inch.com> wrote:
>>
>>
>>>Hello all,
>>>
>>>I was wondering if anyone on the list might have run into this
problem
>>>before.
>>>I am trying to apply some x,y,z position values to a set of nulls,
and
>>>keyframe that set of nulls. Unfortunately, the technique I am using
now
>>>(with JScript is still slow). But I was wondering if anyone might
have a
>>>faster "object" based approach to applying and keyframing data onto a
>>>group of null (or any objects).
>>>
>>>Right now I use
>>>
>>>var $o_obj = ActiveSceneRoot.findChild("null128") ;
>>>
>>>//============================================== set x,y,z position
>>>$o_obj.Kinematics.Global.Parameters("posx").value = $valueX ;
>>>$o_obj.Kinematics.Global.Parameters("posy").value = $valueY ;
>>>$o_obj.Kinematics.Global.Parameters("posz").value = $valueZ ;
>>>
>>>//============================================== save the keyframe
>>>savekeyOnKeyable($o_obj, $frame );
>>>
>>>
>>>The problem is I have to do 266 of this operation for 300-500 frames.
>>>If anyone knows a faster technique I could use, any hints and sample
code
>>>would be much appreciated.
>>>
>>>
>>>
>>>THX
>>>RSM
>>>
>>>_____________________________________________________
>>>Raffaele Scaduto-Mendola - www.turbolinea.com
>>> raffaele(at)turbolinea.com
>>>-
>>>
>>>
>>
>>
>>---
>>Unsubscribe? Mail Majordomo(at)Softimage.COM with the following text in
body:
>>unsubscribe xsi
>>
>>
>>
>>
>
---
Unsubscribe? Mail Majordomo(at)Softimage.COM with the following text in
body:
unsubscribe xsi
---
Unsubscribe? Mail Majordomo(at)Softimage.COM with the following text in body:
unsubscribe xsi