Updates:
Apr-21-07:
- Today i modified the code to store the metadata for my rendered stills to the files images directory. (assume stills were rendered from blendfile.blend /path/to/project/images/blendfile/blendfile.txt)
- Since my imageviewer script reads blendfile.txt, i also modified that script accordingly.
Apr-20-07:
- Assume that under project Foo (/path/to/Foo) I have two .blend
files named FooScene1.blend and FooScene2.blend. Still renders of the
blends will be saved in /path/to/Foo/images/FooScene1 and/path/to/Foo/images/FooScene2 respectively.
Why renderscript.py?
- I wrote this script so that during a blender session i can store my renders at a central location for later review.
- The script when hooked to any Scene's "Render" event, will be executed before and after a render.
- Right now, this script creates a tmp directory and image directory in the blender file's directory so that temporary files (.exr, quit.blend etc.,) go into tmp and rendered images go into image.
- The image files are stored with the following syntax filename_timestamp.png.
- Once the render finishes, the render window will be displayed for 2 seconds and close automatically.
- After the render window closes, you will be prompted to enter a description for the render. The image name and description are saved in text file right inside blender. [ TODO: Later i will add functionality to save the metadata file in the images directory. I then plan to implement a image browser script inside blender so that you can browse the images and also see the descriptions.]
- I will add more features to this gradually as a need arises. I also posted this script on BA for feedback.
- For more information on creating script links in Blender, read this.
TODO:
- Save the (imagename, imagedesc) data in the corresponding image directories of .blend files.
- Automatically generate html files with images and corresponding descriptions. This will help write tutorials basing on the generated file.
Just for kicks: My script helped me to quickly run tests on the new "Cast" modifier in blender and save images along with descriptions. [The "Cast" modifier allows one to project the vertices of a mesh into a Sphere, Cylinder or a Cuboid].
Here is the directory tree of one of my test project, Cast.
[blendernut@helljumper ~...blends/Modifier]$ ls -Rt Cast/
Cast/:
tmp untitled1.blend untitled1.blend1 images untitled.blend untitled.blend1
Cast/tmp:
quit.blend untitled1.blend_Scene.exr untitled.blend_Scene.exr
Cast/images:
untitled1 untitled
Cast/images/untitled1:
untitled1_99687.9052908.png untitled1_99390.2406258.png
untitled1_99649.1007863.png untitled1_99287.8281094.png
untitled1_99453.41296.png untitled1_99258.9916224.png
untitled1_99418.4673488.png untitled1_99222.8195139.png
Cast/images/untitled:
untitled_97360.765616.png untitled_97231.7761313.png
untitled_97340.0232368.png untitled_97209.1021102.png
untitled_97319.9993172.png untitled_97150.9371132.png
untitled_97251.3079805.png
Onto the code then! Shall we ...
Attach the renderscript.py to the Render event of a scene scriptlink as shown in the image to the left.
Code :
The latest code can be downloaded from here

