#Keyscript length
13 messages in this thread
I am at work on a project 10800 frames long for which I need to use a keyscript
with a line for every frame in the animation. What I want to know is whether
3ds'
text editors are limited as to the length of text files that can be edited
within them.
I have a machine with 37M RAM available to 3ds before swapping and i want to
know if I should anticipate any problems editing or executing a 10,000 + line
script in Keyscript. Any strategies for dealing with this situation would be
appreciated.
Thanks in advance: Jeff
Jeff:
Speaking as the developer of Keyscript, I will *NOT* promise you that Keyscript
will successfully execute a 10,000 line script. (I've seen someone else try
this to disasterous effect!)
I have a question for you: WHY do you think you need a line of script for every
frame?
Martin
Martin,
Thanks for your prompt reply.
I am creating an accident reconstruction for which I have position data for two
accelerating entities.
The client wants the animation to show the relationship between the two
entities over a distance of 6 miles at an average speed of 60mph.
Previous reconstructions done for this client have always used data for every
30th of a second when acceleration and deceleration are concerned. The
engineer is going to great lengths to calculate such position data for every
frame. ( at first I questioned why this level of detail was necessary in a
keyframe animation)
Since you do not believe that keyscript will handle the 10K line script I
described, can you offer a suggestion to get around the limitation and still
present the data as my client requires? I have thought of breaking the script
up into smaller managable segments and running separate scripts on copy objects
in scene so that the final result will be the same as a 10000 line script. If
this will work what is a manageable script length? About 900 frames is all
I've done before this project.
Thanks
Jeff
>> Since you do not believe that keyscript will handle the 10K line script I
described, can you offer a suggestion to get around the limitation and still
present the data as my client requires? <<
There is no reason for you to write a 10,000 line script under ANY
circumstances, especially this one. Your script will be ten to twenty lines of
code. Your raw position information will be compiled in an ascii file, which
your script will then load and parse into keyframes with a for/next loop.
Keyscript should accomplish this for you admirably. The whole point of the
script language is to SAVE you work. Generating a separate line of code for
each frame is not only a waste of your time, it presents a gargantuan
tokenization challenge for the language.
Martin
martin
can you give me any idea where I might find a reference for the 10 -20 lines of
code my script will require. The only other time I used keyscript was to
substitute my script for what nodefetch generates- a short cut approach
suggested by Jonas at ADESK. I am *not* a programmer. Forgive my naivete'.
Right now I need any reference for a script that will read data from an ascii
file completing 10800+ frames .
Once again thanks for your prompt response and any help
Jeff
Jeff,
PMJI. Are you familiar with the concept of using variables that
represent numerical values, rather than hard-coding in the actual # for each
line of code? What Martin suggests is that you execute the line of code you
planned (except you wanted 10,000 of them), using values read from a data file.
This description should roughly indicate how you want to perform the task.
Open data file
While not end-of-file (start loop)
Read line of data from file (x,y,z?)
Your code line here – move object – establish keyframe?
Wend – continue looping until you run out of data
Close file & end script
If you want, you can code in the # of lines you expect in the data file (or
have it as the first value read from the file. Then loop for the specific # of
data points/lines expected.
Kevin Krell – Computer Support Associates
kevin
Thanks for the explanation –
This looks similar to what nodefetch expects/does. The concept is clear to me,
its a matter of the syntax.- which is another matter
Thanks
Jeff
Jeff:
I'm going to defer to Kevin Krell and Jonas' feedback on your problem as I
haven't much to add. The program structure Kevin outlined (message #182621) is
precisely how to undertake the importation of your motion data into 3D Studio.
If you find you want to hire an experienced scriptor, I personally recommend
David Marks (72172,1036).
Martin
Martin,
Thanks for your input. I think I got what I need with nodefetch. (Very
useful)
Jeff
Thanks for the recommendation, Martin.
– Dave
You do understand that what I meant by a line of code for each frame was
identical to what nodefetch would produce: move, node, x,z,y,frame
Jeff
Martin,
Just what do you mean by " disasterous effect" ?
Jeff
>> Just what do you mean by " disasterous effect" ? <<
The individual created a script with 16,500 lines of code — at least one for
every frame of the animation — and 3D Studio crashed on execution. This is not
the fault of 3D Studio or Keyscript/TSE. This is a silly approach to scripting.