Take the 2-minute tour ×
Blender Stack Exchange is a question and answer site for people who use Blender to create 3D graphics, animations, or games. It's 100% free, no registration required.

My addon renders frames whose names are not constant. How can I use Python to get the playback to work?

I'm working on a time remapping addon and wanted to give the user the option to include the true frame number in the filename, e.g.:

1.00_0001.png

1.25_0002.png

1.50_0003.png

But bpy.ops.render.play_rendered_anim() doesn't work on these, although importing these images into the Video Editor works fine.

share|improve this question
add comment

1 Answer

up vote 2 down vote accepted

The operator doesn't expose any options you could set, but this seems to be the command it uses:

'C:\\Program Files\\Blender Foundation\\Blender\\blender.exe -a -f 24 1.0 -s 1 -e 250 -j 1 C:\\tmp\\0001.png'

There's even a step / frame jump parameter:

http://wiki.blender.org/index.php/Doc:2.6/Manual/Render/Command_Line#Animation_Playback_Options:

But it doesn't really help in your case. You need to specify every single frame:

blender -a -f 24 1.0 00_0001.png 25_0002.png 50_0003.png 75_0004.png
share|improve this answer
    
That command helps. I suppose one option would be to modify the line in the file screen_play_rendered_anim.py where the command blender -a ... is defined and then bundle the modified file with my addon. I'll have to decide if this functionality is worth having an extra file. –  Garrett Feb 18 at 3:52
1  
You could change that script and submit to the patch tracker as proposal, to make it more generic. It could be changed to optionally accept a callback function to find the right files. –  CoDEmanX Feb 18 at 17:35
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.