PDA

View Full Version : Skip duplicate frames



meatycheesyboy
03-01-2015, 11:03 PM
My work is primarily for corporate clients. As such there's a lot of text involved in the animation I generally do. Because of this, there are often times when an animation will pause for a second or two while text fades on or off. I'd like Lightwave to detect when nothing has changed in a scene while rendering and skip those frames. It should, of course, still generate the rendered images but there's no need to actually render those frames. Currently, I do this manually by just marking on piece of paper ranges of frames that I don't need to render but it would be great if LW would do it for me.

BeeVee
03-02-2015, 12:11 AM
That's a good idea. In your user page on lightwave3d.com make sure you add a feature request :)

B

Sensei
03-02-2015, 06:10 AM
That's not doable.
How can LW know that nothing changed?
Suppose so you're using randomizing node - change is, but until rendering LW can't know it.
Suppose so you're using Render Info > Frame/Time, it's not keyframed, but frames will render differently..

RudySchneider
03-02-2015, 07:43 AM
I had a similar problem, where I would keyframe several "pauses" in an animation. Since I knew where these pauses were, I would set up Layout to only render the frames where actual motion takes place. Then, I wrote a simple program outside of LightWave that allowed me to specify which rendered image to copy, what frame number to assign this first copy, and how many additional sequential copies to create, to "fill in the gap."

ernpchan
03-02-2015, 09:01 AM
AfterEffects has a rendering option to "skip existing frames" . Perhaps a feature like that is easier/more realistic to implement.

meatycheesyboy
03-02-2015, 11:37 AM
AfterEffects has a rendering option to "skip existing frames" . Perhaps a feature like that is easier/more realistic to implement.

That's another feature I would like as well, just so someone could set up a quick and dirty multi-machine rendering without having to muck about with ScreamerNet. In fact, the more I use After Effects, I see tons of features and ideas that I wish LW would just copy but those are topics for other threads.

meatycheesyboy
03-02-2015, 11:41 AM
I had a similar problem, where I would keyframe several "pauses" in an animation. Since I knew where these pauses were, I would set up Layout to only render the frames where actual motion takes place. Then, I wrote a simple program outside of LightWave that allowed me to specify which rendered image to copy, what frame number to assign this first copy, and how many additional sequential copies to create, to "fill in the gap."

Any chance you'd like to make that program available to the community? ;)

meatycheesyboy
03-02-2015, 01:55 PM
That's not doable.
How can LW know that nothing changed?
Suppose so you're using randomizing node - change is, but until rendering LW can't know it.
Suppose so you're using Render Info > Frame/Time, it's not keyframed, but frames will render differently..

Being a programmer who works directly with LW, you obviously know more about what is or is not possible than I would but if I can quickly scrub through a scene and mark down on a piece of paper which frames need to be rendered and which don't, surely a computer can do that as well I would think.

If nothing else then at least let me specify which frames are duplicates and have it copy and name those frames automatically, similar to how I suspect RudySchneider's program works.

RudySchneider
03-02-2015, 09:36 PM
Any chance you'd like to make that program available to the community? ;)

meatycheesy ---
I'm not certain how much value it will actually be to you, but here it is. Unfortunately (for you perhaps anyway), it's a batch file that relies on a PC-based utility called Take Command, which has some nice capabilities above and beyond what traditional command.exe programs offer:


@echo off
rem This utility (clone.bat) creates a specified number of 'clone'
rem copies of a single JPEG file. It requires that the existing
rem file use 4-digit numbering (i.e., 4Bar0105.jpg).
rem
input /D Enter the frame # to be cloned: %%fstart
set startnum=%@eval[%fstart]
input /D Enter the number of clones you require: %%fend
set endnum=%@eval[%fend]
input /D Enter the starting frame # for the clones: %%mirror
set mirrorstart=%@eval[%mirror]
set length=%@eval[%endnum]
dir *%fstart.* /b > clip:
rem echo %@clip[0]
set filestart$=%@clip[0]
set fileext$=%@right[3,%filestart$]
set filelen=%@len[%filestart$]
set lead$=%@left[%@eval[filelen-8],%filestart$]
rem echo %filestart$
rem echo %length
rem echo %lead$
rem echo %@format[04,%startnum]
set middle$=%@format[04,%startnum]
set out$=%lead$%%middle$%.jpg
rem echo %out$
gosub outloop
quit

:outloop
set loopstart=%mirrorstart
set copynum=%startnum
do %length
set middlein$=%@format[04,%copynum]
set middleout$=%@format[04,%loopstart]
set out1$=%lead$%%middlein$%.%fileext$%
set out2$=%lead$%%middleout$%.%fileext$%
set loopstart=%@eval[%loopstart+1]
copy %out1$ %out2$
enddo

Sensei
03-02-2015, 10:01 PM
Being a programmer who works directly with LW, you obviously know more about what is or is not possible than I would but if I can quickly scrub through a scene and mark down on a piece of paper which frames need to be rendered and which don't, surely a computer can do that as well I would think.

Are you familiar with random numbers?
http://en.wikipedia.org/wiki/Random_number_generation

One frame can look to human eye to be equal to other frame, while at pixels RGB values it won't be because of small differences, which looks like grain/snow/noise while playing such animation.
Have not you heard about people complaining that after using some nodes and pressing F9 twice, they get different images? These changes are so little like f.e. +-1 in some RGB channel.
Are you familiar like light sources as area, spot light, soft shadows lights, GI works? They use randomization! Each frame different randomization. Frames, even if camera doesn't move, even if items don't move, is different than 2nd, and 3rd frame of same sequence..

You are talking about finding whether change between frame 1 and frame 2 is in key-frames. Obviously it's doable. But in 90% of cases it won't be useful, won't find changes introduced by randomization...

meatycheesyboy
03-03-2015, 12:00 AM
Thank you Sensei.

Another person in this very thread has said that he has done the same thing for a project in the past, leading me to believe that there are other people who may find this feature useful. You are probably right that it wouldn't be useful in very many situations but the number of times in a program where random numbers are used is finite and can be accounted for so something like this could be implemented and may be useful in a small number of cases.

Sensei
03-03-2015, 03:18 AM
I am just saying that Layout can compare and find when key-frames are different between current frame, and next frame,
but it cannot find automatically if something (which can be anything) is using randomization. Which will lead to skipping frames that are different without using keyframes.
That information will be known only after full render, not prior it, and comparison of two RGB buffers. Human (because of past experience) will know this in advance.

f.e. image sequence (used as bg/fg/texture), imported sequence of objects, sequence of MDD, animated procedural textures (ripple?) would be skipped (erroneously).



Another person in this very thread has said that he has done the same thing for a project in the past,

Rudy told LW to render frame 1-10,20-30, 40-50 for instance. And LW rendered just these frames (Render Globals > Range Type > Arbitrary).
Then his script just duplicated rendered image to fill gaps on disk in sequence. 10 frame file copied to 11-19, 30 to 31-39 etc.

Sorry, if you feel my reply was rude. That was not my intention.

Sensei
03-03-2015, 03:22 AM
Do you noticed 3rd option in Render Globals > Range Type > Keyframe?

You can set keys where frame should be rendered.
I picked up Camera,
made key at frame 1, 20, 50
and only 1,20 and 50 frames were rendered.

meatycheesyboy
03-03-2015, 09:15 AM
Sorry, if you feel my reply was rude. That was not my intention.

I am sorry I jumped to that conclusion and edited my post shortly afterwards.

I understand what you are saying, I really do. But, since you can make a list of the things that would make the feature not work, so could LW. If a project uses mdd sequences, disable the feature, if it uses animated procedurals, disable the feature, etc. You are right, it would make this feature not be used in most cases but there are still times when I still render objects with simple image maps, no area lights, no GI, no procedurals, etc. and in those cases the feature would and could be a small timesaver.

- - - Updated - - -


Do you noticed 3rd option in Render Globals > Range Type > Keyframe?

You can set keys where frame should be rendered.
I picked up Camera,
made key at frame 1, 20, 50
and only 1,20 and 50 frames were rendered.

Thank you, I didn't know this existed.

meatycheesyboy
03-03-2015, 09:17 AM
Rudy told LW to render frame 1-10,20-30, 40-50 for instance. And LW rendered just these frames (Render Globals > Range Type > Arbitrary).
Then his script just duplicated rendered image to fill gaps on disk in sequence. 10 frame file copied to 11-19, 30 to 31-39 etc.


I know it is not so what I am looking for in LW but it does automate some of what I am currently doing manually after rendering by copying, pasting, and renaming files.