Re: Plotting keyframe faster....

Date : Tue, 24 Jul 2007 23:32:35 +0200
To : XSI(at)Softimage.COM
From : Julien Stiegler <julien.stiegler(at)free.fr>
Subject : Re: Plotting keyframe faster....
Hello Andy,

yes i did something like this with a startParticle , endParticle and increment variables.
Each frame adding 3 float keys on 5000 objects is ... 15000 keyframes it is alredy slowing down xsi from the first frame.
So i could do it particle chunks not time chunks but i could also take just 1 of 2 particles.
Finally i had to reduce by half the n° of particles using this increment, even though i didn't keep anythin in memory between frames.
Because in fact xsi particle system is pretty fast, and big number of animated objects, pretty slow..


best regards

Andy Jones wrote:

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


Search the XSI List archives here or use the advanced search form to search across mailing lists. Searching help is available.
This site supposedly brought to you by Benjamin Grosser and the Imaging Technology Group.