2002-10-12 11:37:38 +00:00
|
|
|
/**
|
|
|
|
|
* $Id$
|
|
|
|
|
*
|
2008-04-16 22:40:48 +00:00
|
|
|
* ***** BEGIN GPL LICENSE BLOCK *****
|
2002-10-12 11:37:38 +00:00
|
|
|
*
|
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
2008-04-16 22:40:48 +00:00
|
|
|
* of the License, or (at your option) any later version.
|
2002-10-12 11:37:38 +00:00
|
|
|
*
|
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
|
*
|
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
|
* along with this program; if not, write to the Free Software Foundation,
|
|
|
|
|
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
|
*
|
|
|
|
|
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
|
|
|
|
|
* All rights reserved.
|
|
|
|
|
*
|
|
|
|
|
* The Original Code is: all of this file.
|
|
|
|
|
*
|
|
|
|
|
* Contributor(s): none yet.
|
|
|
|
|
*
|
2008-04-16 22:40:48 +00:00
|
|
|
* ***** END GPL LICENSE BLOCK *****
|
2004-06-18 22:53:06 +00:00
|
|
|
*
|
2002-10-12 11:37:38 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#ifndef BSE_SEQUENCE_H
|
|
|
|
|
#define BSE_SEQUENCE_H
|
|
|
|
|
|
Biiig commit! Thanks to 2-3 weeks of cvs freeze...
Render:
- New; support for dual CPU render (SDL thread)
Currently only works with alternating scanlines, but gives excellent
performance. For both normal render as unified implemented.
Note the "mutex" locks on z-transp buffer render and imbuf loads.
- This has been made possible by major cleanups in render code, especially
getting rid of globals (example Tin Tr Tg Tb Ta for textures) or struct
OSA or using Materials or Texture data to write to.
- Made normal render fully 4x32 floats too, and removed all old optimizes
with chars or shorts.
- Made normal render and unified render use same code for sky and halo
render, giving equal (and better) results for halo render. Old render
now also uses PostProcess options (brightness, mul, gamma)
- Added option ("FBuf") in F10 Output Panel, this keeps a 4x32 bits buffer
after render. Using PostProcess menu you will note an immediate re-
display of image too (32 bits RGBA)
- Added "Hue" and "Saturation" sliders to PostProcess options
- Render module is still not having a "nice" API, but amount of dependencies
went down a lot. Next todo: remove abusive "previewrender" code.
The last main global in Render (struct Render) now can be re-used for fully
controlling a render, to allow multiple "instances" of render to open.
- Renderwindow now displays a smal bar on top with the stats, and keeps the
stats after render too. Including "spare" page support.
Not only easier visible that way, but also to remove the awkward code that
was drawing stats in the Info header (extreme slow on some ATIs too)
- Cleaned up blendef.h and BKE_utildefines.h, these two had overlapping
defines.
- I might have forgotten stuff... and will write a nice doc on the architecture!
2004-12-27 19:28:52 +00:00
|
|
|
|
2002-10-12 11:37:38 +00:00
|
|
|
struct PluginSeq;
|
|
|
|
|
struct StripElem;
|
2007-11-18 17:39:30 +00:00
|
|
|
struct TStripElem;
|
2002-10-12 11:37:38 +00:00
|
|
|
struct Strip;
|
|
|
|
|
struct Sequence;
|
|
|
|
|
struct ListBase;
|
|
|
|
|
struct Editing;
|
|
|
|
|
struct ImBuf;
|
|
|
|
|
struct Scene;
|
|
|
|
|
|
2007-11-18 17:39:30 +00:00
|
|
|
void free_tstripdata(int len, struct TStripElem *se);
|
2002-10-12 11:37:38 +00:00
|
|
|
void free_strip(struct Strip *strip);
|
2007-11-18 17:39:30 +00:00
|
|
|
void new_tstripdata(struct Sequence *seq);
|
2002-10-12 11:37:38 +00:00
|
|
|
void free_sequence(struct Sequence *seq);
|
|
|
|
|
void build_seqar(struct ListBase *seqbase, struct Sequence ***seqar, int *totseq);
|
2007-12-25 20:31:07 +00:00
|
|
|
|
|
|
|
|
#define BUILD_SEQAR_COUNT_NOTHING 0
|
|
|
|
|
#define BUILD_SEQAR_COUNT_CURRENT 1
|
|
|
|
|
#define BUILD_SEQAR_COUNT_CHILDREN 2
|
|
|
|
|
|
|
|
|
|
void build_seqar_cb(struct ListBase *seqbase, struct Sequence ***seqar,
|
|
|
|
|
int *totseq, int (*test_func)(struct Sequence * seq));
|
2002-10-12 11:37:38 +00:00
|
|
|
void free_editing(struct Editing *ed);
|
|
|
|
|
void calc_sequence(struct Sequence *seq);
|
2007-10-17 23:24:09 +00:00
|
|
|
void calc_sequence_disp(struct Sequence *seq);
|
2007-12-26 19:30:49 +00:00
|
|
|
void reload_sequence_new_file(struct Sequence * seq);
|
2008-02-03 18:58:46 +00:00
|
|
|
void seq_proxy_rebuild(struct Sequence * seq);
|
2002-10-12 11:37:38 +00:00
|
|
|
void sort_seq(void);
|
|
|
|
|
void clear_scene_in_allseqs(struct Scene *sce);
|
2004-06-23 22:11:57 +00:00
|
|
|
|
== Sequencer ==
Attention! Rather large sequencer rewrite:
* Implemented layer blending using implicit effects. (works like layers
in "The Gimp" or Photoshop.)
* Fixed Space-Bar start-stop in preview windows.
You can start playback using spacebar within a preview-window and it _works_!
* Fixed Flip Y (didn't work for float)
* Fixed premul (didn't work for float)
* Added IPOs to _all_ tracks. In blend-mode REPLACE it drives the
"mul"-parameter in all other blend modes it drives the effect.
* you can meta single tracks.
* moved "mute track" from "M" to "Shift-M"
* added "Shift-L" for "lock track"
* changed inner workings for Metas. Now all ImBufs have to use the
reference counting mechanism. (Only interesting for coders :)
!!! Really important change, that affects current files!
Since you can mute tracks and now there is real layer blending capabilities
in place, I changed the silly behaviour that chose the output track.
Old behaviour: if we have an effect track visible, use the uppermost effect
track. If there is _no_ effect track visible, use the lowest input track.
New behaviour: always use the uppermost track. With blend modes active:
work our way down starting from the uppermost track to the first
"replace"-mode track. This is the way the gimp, photoshop, basically _all_
other applications work...
So if this change ruins your day: please try to fix your files using
"mute". If this doesn't work out, I can still restore the old behaviour,
but I really hope, that this is _not_ necessary!
Rational: most people won't get affected by this change, since you can't
really do anything usefull with the (old) sequencer without at least one
effect track and then you are on the safe side...
2008-01-01 11:44:42 +00:00
|
|
|
char *give_seqname_by_type(int type);
|
|
|
|
|
char *give_seqname(struct Sequence *seq);
|
|
|
|
|
|
2002-10-12 11:37:38 +00:00
|
|
|
int evaluate_seq_frame(int cfra);
|
|
|
|
|
struct StripElem *give_stripelem(struct Sequence *seq, int cfra);
|
2007-11-18 17:39:30 +00:00
|
|
|
struct TStripElem *give_tstripelem(struct Sequence *seq, int cfra);
|
2006-02-05 19:36:32 +00:00
|
|
|
struct ImBuf *give_ibuf_seq(int rectx, int recty, int cfra, int chansel);
|
|
|
|
|
/* chansel: render this channel. Default=0 (renders end result)*/
|
2007-11-18 17:39:30 +00:00
|
|
|
struct ImBuf *give_ibuf_seq_direct(int rectx, int recty, int cfra,
|
|
|
|
|
struct Sequence * seq);
|
2006-02-05 19:36:32 +00:00
|
|
|
|
2007-10-01 08:03:11 +00:00
|
|
|
/* sequence prefetch API */
|
|
|
|
|
void seq_start_threads();
|
|
|
|
|
void seq_stop_threads();
|
|
|
|
|
void give_ibuf_prefetch_request(int rectx, int recty, int cfra, int chanshown);
|
|
|
|
|
void seq_wait_for_prefetch_ready();
|
2007-11-18 17:39:30 +00:00
|
|
|
struct ImBuf * give_ibuf_seq_threaded(int rectx, int recty, int cfra,
|
|
|
|
|
int chanshown);
|
2007-10-01 08:03:11 +00:00
|
|
|
|
|
|
|
|
|
2002-10-12 11:37:38 +00:00
|
|
|
void free_imbuf_seq_except(int cfra);
|
== Sequencer ==
Added enhancements by blendix (Patch #4919: Insert sequence effect between)
It adds the following things:
- You can add a sequence strip afterwards in the middle of an effect chain
(you have to move strips around before, so that there is "room" for it.
Blender will ask you then, if you want to add in between or after the
selected strips)
- In the case you messed it up and want your effect strips to be reassigned in
a different way, there is the new "R"-key. Just select three arbitrary
strips and press "R". If you don't create a cycle, those will be connected
to a new effect chain.
- Fixed freeing of imbufs on changes to properly take into account dependencies. An example of a simple case that went wrong is one image strip with two
glow effects, changing the parameters of the first glow strip will not
result in any updates. Basically only direct dependencies were taken into
account, which resulted in the image preview not being updated in some cases.
- Let the sequencer detect an active sequence strip if none is defined, to
get rid of annoying error messages when trying to add an effect to a
selected sequence strip right after loading a file.
- Delete is less destructive. If you delete somewhere between other strips,
Blender now tries to relink in a reasonable way.
- The active sequence strip is now displayed with a light instead of a dark
outline, which makes it easier to spot, and is especially useful for the
tools using the active sequence strip.
- Ability to view the final result when editing inside meta strip.
The channel button was modified to also allow negative numbers,
where -n is n levels up the meta stack. There is probably a nicer way to
specify this, instead of (ab)using the channel button, but this seems to
work quite efficient.
- Also a small bugfix: don't crash on loading files from newer versions with
an unknown effect strip.
2006-11-09 18:58:02 +00:00
|
|
|
void free_imbuf_seq_with_ipo(struct Ipo * ipo);
|
2002-10-12 11:37:38 +00:00
|
|
|
void free_imbuf_seq(void);
|
Giant commit!
A full detailed description of this will be done later... is several days
of work. Here's a summary:
Render:
- Full cleanup of render code, removing *all* globals and bad level calls
all over blender. Render module is now not called abusive anymore
- API-fied calls to rendering
- Full recode of internal render pipeline. Is now rendering tiles by
default, prepared for much smarter 'bucket' render later.
- Each thread now can render a full part
- Renders were tested with 4 threads, goes fine, apart from some lookup
tables in softshadow and AO still
- Rendering is prepared to do multiple layers and passes
- No single 32 bits trick in render code anymore, all 100% floats now.
Writing images/movies
- moved writing images to blender kernel (bye bye 'schrijfplaatje'!)
- made a new Movie handle system, also in kernel. This will enable much
easier use of movies in Blender
PreviewRender:
- Using new render API, previewrender (in buttons) now uses regular render
code to generate images.
- new datafile 'preview.blend.c' has the preview scenes in it
- previews get rendered in exact displayed size (1 pixel = 1 pixel)
3D Preview render
- new; press Pkey in 3d window, for a panel that continuously renders
(pkey is for games, i know... but we dont do that in orange now!)
- this render works nearly identical to buttons-preview render, so it stops
rendering on any event (mouse, keyboard, etc)
- on moving/scaling the panel, the render code doesn't recreate all geometry
- same for shifting/panning view
- all other operations (now) regenerate the full render database still.
- this is WIP... but big fun, especially for simple scenes!
Compositor
- Using same node system as now in use for shaders, you can composit images
- works pretty straightforward... needs much more options/tools and integration
with rendering still
- is not threaded yet, nor is so smart to only recalculate changes... will be
done soon!
- the "Render Result" node will get all layers/passes as output sockets
- The "Output" node renders to a builtin image, which you can view in the Image
window. (yes, output nodes to render-result, and to files, is on the list!)
The Bad News
- "Unified Render" is removed. It might come back in some stage, but this
system should be built from scratch. I can't really understand this code...
I expect it is not much needed, especially with advanced layer/passes
control
- Panorama render, Field render, Motion blur, is not coded yet... (I had to
recode every single feature in render, so...!)
- Lens Flare is also not back... needs total revision, might become composit
effect though (using zbuffer for visibility)
- Part render is gone! (well, thats obvious, its default now).
- The render window is only restored with limited functionality... I am going
to check first the option to render to a Image window, so Blender can become
a true single-window application. :)
For example, the 'Spare render buffer' (jkey) doesnt work.
- Render with border, now default creates a smaller image
- No zbuffers are written yet... on the todo!
- Scons files and MSVC will need work to get compiling again
OK... thats what I can quickly recall. Now go compiling!
2006-01-23 22:05:47 +00:00
|
|
|
|
== Sequencer ==
Added enhancements by blendix (Patch #4919: Insert sequence effect between)
It adds the following things:
- You can add a sequence strip afterwards in the middle of an effect chain
(you have to move strips around before, so that there is "room" for it.
Blender will ask you then, if you want to add in between or after the
selected strips)
- In the case you messed it up and want your effect strips to be reassigned in
a different way, there is the new "R"-key. Just select three arbitrary
strips and press "R". If you don't create a cycle, those will be connected
to a new effect chain.
- Fixed freeing of imbufs on changes to properly take into account dependencies. An example of a simple case that went wrong is one image strip with two
glow effects, changing the parameters of the first glow strip will not
result in any updates. Basically only direct dependencies were taken into
account, which resulted in the image preview not being updated in some cases.
- Let the sequencer detect an active sequence strip if none is defined, to
get rid of annoying error messages when trying to add an effect to a
selected sequence strip right after loading a file.
- Delete is less destructive. If you delete somewhere between other strips,
Blender now tries to relink in a reasonable way.
- The active sequence strip is now displayed with a light instead of a dark
outline, which makes it easier to spot, and is especially useful for the
tools using the active sequence strip.
- Ability to view the final result when editing inside meta strip.
The channel button was modified to also allow negative numbers,
where -n is n levels up the meta stack. There is probably a nicer way to
specify this, instead of (ab)using the channel button, but this seems to
work quite efficient.
- Also a small bugfix: don't crash on loading files from newer versions with
an unknown effect strip.
2006-11-09 18:58:02 +00:00
|
|
|
void update_changed_seq_and_deps(struct Sequence *seq, int len_change, int ibuf_change);
|
|
|
|
|
|
Giant commit!
A full detailed description of this will be done later... is several days
of work. Here's a summary:
Render:
- Full cleanup of render code, removing *all* globals and bad level calls
all over blender. Render module is now not called abusive anymore
- API-fied calls to rendering
- Full recode of internal render pipeline. Is now rendering tiles by
default, prepared for much smarter 'bucket' render later.
- Each thread now can render a full part
- Renders were tested with 4 threads, goes fine, apart from some lookup
tables in softshadow and AO still
- Rendering is prepared to do multiple layers and passes
- No single 32 bits trick in render code anymore, all 100% floats now.
Writing images/movies
- moved writing images to blender kernel (bye bye 'schrijfplaatje'!)
- made a new Movie handle system, also in kernel. This will enable much
easier use of movies in Blender
PreviewRender:
- Using new render API, previewrender (in buttons) now uses regular render
code to generate images.
- new datafile 'preview.blend.c' has the preview scenes in it
- previews get rendered in exact displayed size (1 pixel = 1 pixel)
3D Preview render
- new; press Pkey in 3d window, for a panel that continuously renders
(pkey is for games, i know... but we dont do that in orange now!)
- this render works nearly identical to buttons-preview render, so it stops
rendering on any event (mouse, keyboard, etc)
- on moving/scaling the panel, the render code doesn't recreate all geometry
- same for shifting/panning view
- all other operations (now) regenerate the full render database still.
- this is WIP... but big fun, especially for simple scenes!
Compositor
- Using same node system as now in use for shaders, you can composit images
- works pretty straightforward... needs much more options/tools and integration
with rendering still
- is not threaded yet, nor is so smart to only recalculate changes... will be
done soon!
- the "Render Result" node will get all layers/passes as output sockets
- The "Output" node renders to a builtin image, which you can view in the Image
window. (yes, output nodes to render-result, and to files, is on the list!)
The Bad News
- "Unified Render" is removed. It might come back in some stage, but this
system should be built from scratch. I can't really understand this code...
I expect it is not much needed, especially with advanced layer/passes
control
- Panorama render, Field render, Motion blur, is not coded yet... (I had to
recode every single feature in render, so...!)
- Lens Flare is also not back... needs total revision, might become composit
effect though (using zbuffer for visibility)
- Part render is gone! (well, thats obvious, its default now).
- The render window is only restored with limited functionality... I am going
to check first the option to render to a Image window, so Blender can become
a true single-window application. :)
For example, the 'Spare render buffer' (jkey) doesnt work.
- Render with border, now default creates a smaller image
- No zbuffers are written yet... on the todo!
- Scons files and MSVC will need work to get compiling again
OK... thats what I can quickly recall. Now go compiling!
2006-01-23 22:05:47 +00:00
|
|
|
/* still bad level call... */
|
|
|
|
|
struct RenderResult;
|
2006-02-05 19:36:32 +00:00
|
|
|
void do_render_seq(struct RenderResult *rr, int cfra);
|
2002-10-12 11:37:38 +00:00
|
|
|
|
2008-04-25 16:09:16 +00:00
|
|
|
#define SEQ_HAS_PATH(seq) (seq->type==SEQ_MOVIE || seq->type==SEQ_HD_SOUND || seq->type==SEQ_RAM_SOUND || seq->type==SEQ_IMAGE)
|
2002-10-12 11:37:38 +00:00
|
|
|
|
|
|
|
|
#endif
|
2002-10-30 02:07:20 +00:00
|
|
|
|