how to save image sequence generated by script

jmg1

New member
I am taking first steps in animation by script in Cheetah3d. First try: a macro script modeled on RotateObject.js which translates e.g a box along the x-axis, called TranslateObject.js. Running this generates a sequence of still images seen in the right column of the render manager. So far, so good. The puzzle is this: it is not clear how to select the whole sequence of frames and either export them as a movie in Cheetah3d, or save them as a numbered sequence for Quicktime import. Advice strongly appreciated!
 
I don´t understand why scripting at all; rendered Animations are in essence PNG image sequences. Ctrl-click on the rendered thumbnail in the "Render Manager"->Show in Finder will open the specific folder containing all PNG images ordered by number. Saving from the Render Manager will let you safe into 9 different video codec containers incl. GIF. Good chance I totally misunderstood your query.
ImageSequence.jpg
 
Last edited:
Thank you for the prompt assistance; let me explain further. At this stage I don't have a rendered movie, only a sequence of still frames from my very simple script. In the render history each frame is in a folder titled with a random-looking number, containing a .png with no index at all, so no obvious way of exporting to Quicktime open image sequence or other video editing applications.


rendermanager.png
renderhistory.png




Another approach would be to compile the animation in the script itself, but I haven't learned how yet, if that is possible.
 
Last edited:
Seems I don't get it. Cheetah3D don't render movie files, it renders image sequences by default that can be put into movie containers with certain codecs when saved. Why you are rendering still after still escapes me and it's Cheetah3D which put rendered jobs into folder sorted by date. So I don't understand what you're aiming for with a script. QuickTime Pro once was able to generate movies from image sequence - but this feature is long gone if I recall correctly.
 
QuickTime Pro once was able to generate movies from image sequence - but this feature is long gone if I recall correctly.
Current Quicktime Player can still open image sequences, but only out of one folder, not many folders with single images.
It would be helpful if Martin could chime in, Hiroto has been silent for years and any person taking up scripting in C3D should be welcome here and get some help to start off ;)
 
Hello.

I am not deeply familiar with the TranslateObject script you are using… So I may be misunderstanding what exactly you are trying to do with it. But rather than ask you more questions about that script and how you are using it, I'll take a guess at a point of some confusion…

Your second post with the screen shots show that you are looking into the Render History folder which is organized exactly as you describe.

That folder isn't intended to be providing user-friendly access to the rendered files. And, as you found out, it is not.

Easy-access to rendered files is the purpose of Render Manager window within C3D.

You want to render an animation, so you have choices… By far the easiest/best is to set up a timeline and keyframes with your desired movement of your object(s), then click the Render animation (which is not the camera) icon.

Each of the frames of your animation will be rendered frame-by-frame. When the entire sequence is rendered, it will be displayed in the Render Manager as a "movie", which can then be saved into a variety of codecs/file types.

Hope this helps.

cheers,
gsb
 
Thanks for more thoughts on this issue.

My script "TranslateObject , a very simple modification of Martin Wengenmayer's macro "RotateObject", moves a box incrementally along the x-axis, rendering a still frame at each step, as a primitive exercise in algorithmic animation. So, the position of the object is computed by a mathematical process, not by interpolation between keyframes.The question is, what's the best way to collect the frames as a movie file, i.e., a numbered sequence of still images.

By the way, as has been mentioned, the latest Quicktime app has restored the open image sequence function-very useful.
 

Attachments

  • TranslateObject.txt
    1.2 KB · Views: 35
Last edited:
Hello again,

Rather than using the animation tools in C3D to easily accomplish an animated movie of moving objects, it seems you are focused on using javascript… Perhaps the following is a method.

Render your "frames" with your script

Have your script keep count the number of rendered frames.

Upon completion, don't do any more renders until finishing processing this job

Build a list of folders in the Render History folder starting with the newest one, going back the number of frames you've rendered.

Loop through that list, processing each of those folders by saving a copy of the target rendered file as a sequential name in your target folder.

Each folder in the Render History folder, that is the result of a single frame rendering job, only contains three files, thumbnail.png, info.plist, and image.png. You'll want to save a copy of the image.png file, as a unique sequential name, in the folder you have set up to receive the sequential frames for opening in QT Player.

Scripting still seems like a rather obscure/indirect way of creating an animated movie of 3D objects using C3D when decent animation tools are there.

Perhaps C3D's javascript API has features that more elegantly handles your quest. But if you really want to do this with a script, parsing, renaming and moving files seems more like a task for the Finder than it does a task for C3D.

cheers,
gsb
 
It seems some commenters have been misled by my simple "toy" script. It goes without saying that a brief linear motion can be animated with key frames and tweening. My goal is to eventually script "grown-up" animations involving more complicated functions of time and other scene parameters, and hundreds of frames- think, for example, of a simulation of three bodies in a gravitational field.

So I was searching for a solution internal to Cheetah3d along these lines:
A: In the render manager a range of images can be selected. One might naturally think that clicking "save" would export those as a .png sequence or in some video file format. That does not appear to work.
B: in the script itself a command exports each rendered image as numbered .png file to a designated folder.

Perhaps the are just ideas for a future version of C3D.

I'll think about gsb's suggestion, but I'm afraid that would involve a detour into bash scripting in the terminal, which I was hoping to avoid.
 
Last edited:
  • Like
Reactions: gsb
"grown-up" animations involving more complicated functions of time and other scene parameters, and hundreds of frames- think, for example, of a simulation of three bodies in a gravitational field.
Hello,

Perhaps it is just me, but the grown-up animations you allude-to seem far better suited for animating within C3D (where one can visualize as one is creating), than animating via a script (with no visualization available until after rendering is complete). Perhaps you are not aware of C3D's animation tools beyond those only suitable for a brief linear motion of a simple object?

I’m not suggesting that one would choose to animate a feature-length animation with C3D’s timeline and built-in tools, but certainly one can fairly easily accomplish a variety of physics-based animation within C3D. Additionally, most, if not all, of C3D’s parameters are recordable/key-framable, not just an object’s position in 3D space.

Perhaps you were already aware of these features and your preference is to animate a simulation of three bodies in a gravitational field, each with their own mass and gravity, perhaps one with an highly-active atmospheric storm, moving amongst a particle field of space dust via scripting and formulae. If so, your math and scripting skills far exceed mine. o_O Regardless, good luck and I look forward to the results of your efforts.

Cheers,
gsb
 
Back
Top