2011-10-10 09:38:02 +00:00
|
|
|
/*
|
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,
|
2010-02-12 13:34:04 +00:00
|
|
|
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
2002-10-12 11:37:38 +00:00
|
|
|
*
|
|
|
|
|
* 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 *****
|
2002-10-12 11:37:38 +00:00
|
|
|
*/
|
|
|
|
|
|
2011-02-27 20:40:57 +00:00
|
|
|
/** \file blender/blenkernel/intern/scene.c
|
|
|
|
|
* \ingroup bke
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
2009-12-11 05:23:00 +00:00
|
|
|
#include <stddef.h>
|
2002-10-12 11:37:38 +00:00
|
|
|
#include <stdio.h>
|
Phew, a lot of work, and no new features...
Main target was to make the inner rendering loop using no globals anymore.
This is essential for proper usage while raytracing, it caused a lot of
hacks in the raycode as well, which even didn't work correctly for all
situations (textures especially).
Done this by creating a new local struct RenderInput, which replaces usage
of the global struct Render R. The latter now only is used to denote
image size, viewmatrix, and the like.
Making the inner render loops using no globals caused 1000s of vars to
be changed... but the result definitely is much nicer code, which enables
making 'real' shaders in a next stage.
It also enabled me to remove the hacks from ray.c
Then i went to the task of removing redundant code. Especially the calculus
of texture coords took place (identical) in three locations.
Most obvious is the change in the unified render part, which is much less
code now; it uses the same rendering routines as normal render now.
(Note; not for halos yet!)
I also removed 6 files called 'shadowbuffer' something. This was experimen-
tal stuff from NaN days. And again saved a lot of double used code.
Finally I went over the blenkernel and blender/src calls to render stuff.
Here the same local data is used now, resulting in less dependency.
I also moved render-texture to the render module, this was still in Kernel.
(new file: texture.c)
So! After this commit I will check on the autofiles, to try to fix that.
MSVC people have to do it themselves.
This commit will need quite some testing help, but I'm around!
2003-12-21 21:52:51 +00:00
|
|
|
#include <string.h>
|
2002-10-12 11:37:38 +00:00
|
|
|
|
|
|
|
|
#ifndef WIN32
|
|
|
|
|
#include <unistd.h>
|
|
|
|
|
#else
|
|
|
|
|
#include <io.h>
|
|
|
|
|
#endif
|
|
|
|
|
|
2011-01-07 18:36:47 +00:00
|
|
|
#include "MEM_guardedalloc.h"
|
|
|
|
|
|
2009-09-18 22:25:49 +00:00
|
|
|
#include "DNA_anim_types.h"
|
Result of 2 weeks of quiet coding work in Greece :)
Aim was to get a total refresh of the animation system. This
is needed because;
- we need to upgrade it with 21st century features
- current code is spaghetti/hack combo, and hides good design
- it should become lag-free with using dependency graphs
A full log, with complete code API/structure/design explanation
will follow, that's a load of work... so here below the list with
hot changes;
- The entire object update system (matrices, geometry) is now
centralized. Calls to where_is_object and makeDispList are
forbidden, instead we tag objects 'changed' and let the
depgraph code sort it out
- Removed all old "Ika" code
- Depgraph is aware of all relationships, including meta balls,
constraints, bevelcurve, and so on.
- Made depgraph aware of relation types and layers, to do smart
flushing of 'changed' events. Nothing gets calculated too often!
- Transform uses depgraph to detect changes
- On frame-advance, depgraph flushes animated changes
Armatures;
Almost all armature related code has been fully built from scratch.
It now reveils the original design much better, with a very clean
implementation, lag free without even calculating each Bone more than
once. Result is quite a speedup yes!
Important to note is;
1) Armature is data containing the 'rest position'
2) Pose is the changes of rest position, and always on object level.
That way more Objects can use same Pose. Also constraints are in Pose
3) Actions only contain the Ipos to change values in Poses.
- Bones draw unrotated now
- Drawing bones speedup enormously (10-20 times)
- Bone selecting in EditMode, selection state is saved for PoseMode,
and vice-versa
- Undo in editmode
- Bone renaming does vertexgroups, constraints, posechannels, actions,
for all users of Armature in entire file
- Added Bone renaming in NKey panel
- Nkey PoseMode shows eulers now
- EditMode and PoseMode now have 'active' bone too (last clicked)
- Parenting in EditMode' CTRL+P, ALT+P, with nice options!
- Pose is added in Outliner now, with showing that constraints are in
the Pose, not Armature
- Disconnected IK solving from constraints. It's a separate phase now,
on top of the full Pose calculations
- Pose itself has a dependency graph too, so evaluation order is lag free.
TODO NOW;
- Rotating in Posemode has incorrect inverse transform (Martin will fix)
- Python Bone/Armature/Pose API disabled... needs full recode too
(wait for my doc!)
- Game engine will need upgrade too
- Depgraph code needs revision, cleanup, can be much faster!
(But, compliments for Jean-Luc, it works like a charm!)
- IK changed, it now doesnt use previous position to advance to next
position anymore. That system looks nice (no flips) but is not well
suited for NLA and background render.
TODO LATER;
We now can do loadsa new nifty features as well; like:
- Kill PoseMode (can be option for armatures itself)
- Make B-Bones (Bezier, Bspline, like for spines)
- Move all silly button level edit to 3d window (like CTRL+I = add
IK)
- Much better & informative drawing
- Fix action/nla editors
- Put all ipos in Actions (object, mesh key, lamp color)
- Add hooks
- Null bones
- Much more advanced constraints...
Bugfixes;
- OGL render (view3d header) had wrong first frame on anim render
- Ipo 'recording' mode had wrong playback speed
- Vertex-key mode now sticks to show 'active key', until frame change
-Ton-
2005-07-03 17:35:38 +00:00
|
|
|
#include "DNA_group_types.h"
|
2011-11-18 07:11:54 +00:00
|
|
|
#include "DNA_node_types.h"
|
2010-08-04 04:01:27 +00:00
|
|
|
#include "DNA_object_types.h"
|
2013-01-23 05:56:22 +00:00
|
|
|
#include "DNA_rigidbody_types.h"
|
Result of 2 weeks of quiet coding work in Greece :)
Aim was to get a total refresh of the animation system. This
is needed because;
- we need to upgrade it with 21st century features
- current code is spaghetti/hack combo, and hides good design
- it should become lag-free with using dependency graphs
A full log, with complete code API/structure/design explanation
will follow, that's a load of work... so here below the list with
hot changes;
- The entire object update system (matrices, geometry) is now
centralized. Calls to where_is_object and makeDispList are
forbidden, instead we tag objects 'changed' and let the
depgraph code sort it out
- Removed all old "Ika" code
- Depgraph is aware of all relationships, including meta balls,
constraints, bevelcurve, and so on.
- Made depgraph aware of relation types and layers, to do smart
flushing of 'changed' events. Nothing gets calculated too often!
- Transform uses depgraph to detect changes
- On frame-advance, depgraph flushes animated changes
Armatures;
Almost all armature related code has been fully built from scratch.
It now reveils the original design much better, with a very clean
implementation, lag free without even calculating each Bone more than
once. Result is quite a speedup yes!
Important to note is;
1) Armature is data containing the 'rest position'
2) Pose is the changes of rest position, and always on object level.
That way more Objects can use same Pose. Also constraints are in Pose
3) Actions only contain the Ipos to change values in Poses.
- Bones draw unrotated now
- Drawing bones speedup enormously (10-20 times)
- Bone selecting in EditMode, selection state is saved for PoseMode,
and vice-versa
- Undo in editmode
- Bone renaming does vertexgroups, constraints, posechannels, actions,
for all users of Armature in entire file
- Added Bone renaming in NKey panel
- Nkey PoseMode shows eulers now
- EditMode and PoseMode now have 'active' bone too (last clicked)
- Parenting in EditMode' CTRL+P, ALT+P, with nice options!
- Pose is added in Outliner now, with showing that constraints are in
the Pose, not Armature
- Disconnected IK solving from constraints. It's a separate phase now,
on top of the full Pose calculations
- Pose itself has a dependency graph too, so evaluation order is lag free.
TODO NOW;
- Rotating in Posemode has incorrect inverse transform (Martin will fix)
- Python Bone/Armature/Pose API disabled... needs full recode too
(wait for my doc!)
- Game engine will need upgrade too
- Depgraph code needs revision, cleanup, can be much faster!
(But, compliments for Jean-Luc, it works like a charm!)
- IK changed, it now doesnt use previous position to advance to next
position anymore. That system looks nice (no flips) but is not well
suited for NLA and background render.
TODO LATER;
We now can do loadsa new nifty features as well; like:
- Kill PoseMode (can be option for armatures itself)
- Make B-Bones (Bezier, Bspline, like for spines)
- Move all silly button level edit to 3d window (like CTRL+I = add
IK)
- Much better & informative drawing
- Fix action/nla editors
- Put all ipos in Actions (object, mesh key, lamp color)
- Add hooks
- Null bones
- Much more advanced constraints...
Bugfixes;
- OGL render (view3d header) had wrong first frame on anim render
- Ipo 'recording' mode had wrong playback speed
- Vertex-key mode now sticks to show 'active key', until frame change
-Ton-
2005-07-03 17:35:38 +00:00
|
|
|
#include "DNA_scene_types.h"
|
2009-09-18 22:25:49 +00:00
|
|
|
#include "DNA_screen_types.h"
|
2010-06-24 10:04:18 +00:00
|
|
|
#include "DNA_sequence_types.h"
|
2002-10-12 11:37:38 +00:00
|
|
|
|
2011-01-07 18:36:47 +00:00
|
|
|
#include "BLI_math.h"
|
|
|
|
|
#include "BLI_blenlib.h"
|
|
|
|
|
#include "BLI_utildefines.h"
|
2011-09-27 10:43:45 +00:00
|
|
|
#include "BLI_callbacks.h"
|
2012-10-08 06:38:34 +00:00
|
|
|
#include "BLI_string.h"
|
2010-08-16 05:46:10 +00:00
|
|
|
|
2002-10-12 11:37:38 +00:00
|
|
|
#include "BKE_anim.h"
|
2009-09-18 22:25:49 +00:00
|
|
|
#include "BKE_animsys.h"
|
2012-11-09 07:29:27 +00:00
|
|
|
#include "BKE_action.h"
|
Color Management, Stage 2: Switch color pipeline to use OpenColorIO
Replace old color pipeline which was supporting linear/sRGB color spaces
only with OpenColorIO-based pipeline.
This introduces two configurable color spaces:
- Input color space for images and movie clips. This space is used to convert
images/movies from color space in which file is saved to Blender's linear
space (for float images, byte images are not internally converted, only input
space is stored for such images and used later).
This setting could be found in image/clip data block settings.
- Display color space which defines space in which particular display is working.
This settings could be found in scene's Color Management panel.
When render result is being displayed on the screen, apart from converting image
to display space, some additional conversions could happen.
This conversions are:
- View, which defines tone curve applying before display transformation.
These are different ways to view the image on the same display device.
For example it could be used to emulate film view on sRGB display.
- Exposure affects on image exposure before tone map is applied.
- Gamma is post-display gamma correction, could be used to match particular
display gamma.
- RGB curves are user-defined curves which are applying before display
transformation, could be used for different purposes.
All this settings by default are only applying on render result and does not
affect on other images. If some particular image needs to be affected by this
transformation, "View as Render" setting of image data block should be set to
truth. Movie clips are always affected by all display transformations.
This commit also introduces configurable color space in which sequencer is
working. This setting could be found in scene's Color Management panel and
it should be used if such stuff as grading needs to be done in color space
different from sRGB (i.e. when Film view on sRGB display is use, using VD16
space as sequencer's internal space would make grading working in space
which is close to the space using for display).
Some technical notes:
- Image buffer's float buffer is now always in linear space, even if it was
created from 16bit byte images.
- Space of byte buffer is stored in image buffer's rect_colorspace property.
- Profile of image buffer was removed since it's not longer meaningful.
- OpenGL and GLSL is supposed to always work in sRGB space. It is possible
to support other spaces, but it's quite large project which isn't so
much important.
- Legacy Color Management option disabled is emulated by using None display.
It could have some regressions, but there's no clear way to avoid them.
- If OpenColorIO is disabled on build time, it should make blender behaving
in the same way as previous release with color management enabled.
More details could be found at this page (more details would be added soon):
http://wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.64/Color_Management
--
Thanks to Xavier Thomas, Lukas Toene for initial work on OpenColorIO
integration and to Brecht van Lommel for some further development and code/
usecase review!
2012-09-15 10:05:07 +00:00
|
|
|
#include "BKE_colortools.h"
|
Result of 2 weeks of quiet coding work in Greece :)
Aim was to get a total refresh of the animation system. This
is needed because;
- we need to upgrade it with 21st century features
- current code is spaghetti/hack combo, and hides good design
- it should become lag-free with using dependency graphs
A full log, with complete code API/structure/design explanation
will follow, that's a load of work... so here below the list with
hot changes;
- The entire object update system (matrices, geometry) is now
centralized. Calls to where_is_object and makeDispList are
forbidden, instead we tag objects 'changed' and let the
depgraph code sort it out
- Removed all old "Ika" code
- Depgraph is aware of all relationships, including meta balls,
constraints, bevelcurve, and so on.
- Made depgraph aware of relation types and layers, to do smart
flushing of 'changed' events. Nothing gets calculated too often!
- Transform uses depgraph to detect changes
- On frame-advance, depgraph flushes animated changes
Armatures;
Almost all armature related code has been fully built from scratch.
It now reveils the original design much better, with a very clean
implementation, lag free without even calculating each Bone more than
once. Result is quite a speedup yes!
Important to note is;
1) Armature is data containing the 'rest position'
2) Pose is the changes of rest position, and always on object level.
That way more Objects can use same Pose. Also constraints are in Pose
3) Actions only contain the Ipos to change values in Poses.
- Bones draw unrotated now
- Drawing bones speedup enormously (10-20 times)
- Bone selecting in EditMode, selection state is saved for PoseMode,
and vice-versa
- Undo in editmode
- Bone renaming does vertexgroups, constraints, posechannels, actions,
for all users of Armature in entire file
- Added Bone renaming in NKey panel
- Nkey PoseMode shows eulers now
- EditMode and PoseMode now have 'active' bone too (last clicked)
- Parenting in EditMode' CTRL+P, ALT+P, with nice options!
- Pose is added in Outliner now, with showing that constraints are in
the Pose, not Armature
- Disconnected IK solving from constraints. It's a separate phase now,
on top of the full Pose calculations
- Pose itself has a dependency graph too, so evaluation order is lag free.
TODO NOW;
- Rotating in Posemode has incorrect inverse transform (Martin will fix)
- Python Bone/Armature/Pose API disabled... needs full recode too
(wait for my doc!)
- Game engine will need upgrade too
- Depgraph code needs revision, cleanup, can be much faster!
(But, compliments for Jean-Luc, it works like a charm!)
- IK changed, it now doesnt use previous position to advance to next
position anymore. That system looks nice (no flips) but is not well
suited for NLA and background render.
TODO LATER;
We now can do loadsa new nifty features as well; like:
- Kill PoseMode (can be option for armatures itself)
- Make B-Bones (Bezier, Bspline, like for spines)
- Move all silly button level edit to 3d window (like CTRL+I = add
IK)
- Much better & informative drawing
- Fix action/nla editors
- Put all ipos in Actions (object, mesh key, lamp color)
- Add hooks
- Null bones
- Much more advanced constraints...
Bugfixes;
- OGL render (view3d header) had wrong first frame on anim render
- Ipo 'recording' mode had wrong playback speed
- Vertex-key mode now sticks to show 'active key', until frame change
-Ton-
2005-07-03 17:35:38 +00:00
|
|
|
#include "BKE_depsgraph.h"
|
2012-11-09 07:29:27 +00:00
|
|
|
#include "BKE_fcurve.h"
|
Result of 2 weeks of quiet coding work in Greece :)
Aim was to get a total refresh of the animation system. This
is needed because;
- we need to upgrade it with 21st century features
- current code is spaghetti/hack combo, and hides good design
- it should become lag-free with using dependency graphs
A full log, with complete code API/structure/design explanation
will follow, that's a load of work... so here below the list with
hot changes;
- The entire object update system (matrices, geometry) is now
centralized. Calls to where_is_object and makeDispList are
forbidden, instead we tag objects 'changed' and let the
depgraph code sort it out
- Removed all old "Ika" code
- Depgraph is aware of all relationships, including meta balls,
constraints, bevelcurve, and so on.
- Made depgraph aware of relation types and layers, to do smart
flushing of 'changed' events. Nothing gets calculated too often!
- Transform uses depgraph to detect changes
- On frame-advance, depgraph flushes animated changes
Armatures;
Almost all armature related code has been fully built from scratch.
It now reveils the original design much better, with a very clean
implementation, lag free without even calculating each Bone more than
once. Result is quite a speedup yes!
Important to note is;
1) Armature is data containing the 'rest position'
2) Pose is the changes of rest position, and always on object level.
That way more Objects can use same Pose. Also constraints are in Pose
3) Actions only contain the Ipos to change values in Poses.
- Bones draw unrotated now
- Drawing bones speedup enormously (10-20 times)
- Bone selecting in EditMode, selection state is saved for PoseMode,
and vice-versa
- Undo in editmode
- Bone renaming does vertexgroups, constraints, posechannels, actions,
for all users of Armature in entire file
- Added Bone renaming in NKey panel
- Nkey PoseMode shows eulers now
- EditMode and PoseMode now have 'active' bone too (last clicked)
- Parenting in EditMode' CTRL+P, ALT+P, with nice options!
- Pose is added in Outliner now, with showing that constraints are in
the Pose, not Armature
- Disconnected IK solving from constraints. It's a separate phase now,
on top of the full Pose calculations
- Pose itself has a dependency graph too, so evaluation order is lag free.
TODO NOW;
- Rotating in Posemode has incorrect inverse transform (Martin will fix)
- Python Bone/Armature/Pose API disabled... needs full recode too
(wait for my doc!)
- Game engine will need upgrade too
- Depgraph code needs revision, cleanup, can be much faster!
(But, compliments for Jean-Luc, it works like a charm!)
- IK changed, it now doesnt use previous position to advance to next
position anymore. That system looks nice (no flips) but is not well
suited for NLA and background render.
TODO LATER;
We now can do loadsa new nifty features as well; like:
- Kill PoseMode (can be option for armatures itself)
- Make B-Bones (Bezier, Bspline, like for spines)
- Move all silly button level edit to 3d window (like CTRL+I = add
IK)
- Much better & informative drawing
- Fix action/nla editors
- Put all ipos in Actions (object, mesh key, lamp color)
- Add hooks
- Null bones
- Much more advanced constraints...
Bugfixes;
- OGL render (view3d header) had wrong first frame on anim render
- Ipo 'recording' mode had wrong playback speed
- Vertex-key mode now sticks to show 'active key', until frame change
-Ton-
2005-07-03 17:35:38 +00:00
|
|
|
#include "BKE_global.h"
|
2010-03-26 10:52:55 +00:00
|
|
|
#include "BKE_group.h"
|
2008-05-11 20:40:55 +00:00
|
|
|
#include "BKE_idprop.h"
|
2002-10-12 11:37:38 +00:00
|
|
|
#include "BKE_library.h"
|
Result of 2 weeks of quiet coding work in Greece :)
Aim was to get a total refresh of the animation system. This
is needed because;
- we need to upgrade it with 21st century features
- current code is spaghetti/hack combo, and hides good design
- it should become lag-free with using dependency graphs
A full log, with complete code API/structure/design explanation
will follow, that's a load of work... so here below the list with
hot changes;
- The entire object update system (matrices, geometry) is now
centralized. Calls to where_is_object and makeDispList are
forbidden, instead we tag objects 'changed' and let the
depgraph code sort it out
- Removed all old "Ika" code
- Depgraph is aware of all relationships, including meta balls,
constraints, bevelcurve, and so on.
- Made depgraph aware of relation types and layers, to do smart
flushing of 'changed' events. Nothing gets calculated too often!
- Transform uses depgraph to detect changes
- On frame-advance, depgraph flushes animated changes
Armatures;
Almost all armature related code has been fully built from scratch.
It now reveils the original design much better, with a very clean
implementation, lag free without even calculating each Bone more than
once. Result is quite a speedup yes!
Important to note is;
1) Armature is data containing the 'rest position'
2) Pose is the changes of rest position, and always on object level.
That way more Objects can use same Pose. Also constraints are in Pose
3) Actions only contain the Ipos to change values in Poses.
- Bones draw unrotated now
- Drawing bones speedup enormously (10-20 times)
- Bone selecting in EditMode, selection state is saved for PoseMode,
and vice-versa
- Undo in editmode
- Bone renaming does vertexgroups, constraints, posechannels, actions,
for all users of Armature in entire file
- Added Bone renaming in NKey panel
- Nkey PoseMode shows eulers now
- EditMode and PoseMode now have 'active' bone too (last clicked)
- Parenting in EditMode' CTRL+P, ALT+P, with nice options!
- Pose is added in Outliner now, with showing that constraints are in
the Pose, not Armature
- Disconnected IK solving from constraints. It's a separate phase now,
on top of the full Pose calculations
- Pose itself has a dependency graph too, so evaluation order is lag free.
TODO NOW;
- Rotating in Posemode has incorrect inverse transform (Martin will fix)
- Python Bone/Armature/Pose API disabled... needs full recode too
(wait for my doc!)
- Game engine will need upgrade too
- Depgraph code needs revision, cleanup, can be much faster!
(But, compliments for Jean-Luc, it works like a charm!)
- IK changed, it now doesnt use previous position to advance to next
position anymore. That system looks nice (no flips) but is not well
suited for NLA and background render.
TODO LATER;
We now can do loadsa new nifty features as well; like:
- Kill PoseMode (can be option for armatures itself)
- Make B-Bones (Bezier, Bspline, like for spines)
- Move all silly button level edit to 3d window (like CTRL+I = add
IK)
- Much better & informative drawing
- Fix action/nla editors
- Put all ipos in Actions (object, mesh key, lamp color)
- Add hooks
- Null bones
- Much more advanced constraints...
Bugfixes;
- OGL render (view3d header) had wrong first frame on anim render
- Ipo 'recording' mode had wrong playback speed
- Vertex-key mode now sticks to show 'active key', until frame change
-Ton-
2005-07-03 17:35:38 +00:00
|
|
|
#include "BKE_main.h"
|
2012-06-04 16:42:58 +00:00
|
|
|
#include "BKE_mask.h"
|
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
|
|
|
#include "BKE_node.h"
|
Result of 2 weeks of quiet coding work in Greece :)
Aim was to get a total refresh of the animation system. This
is needed because;
- we need to upgrade it with 21st century features
- current code is spaghetti/hack combo, and hides good design
- it should become lag-free with using dependency graphs
A full log, with complete code API/structure/design explanation
will follow, that's a load of work... so here below the list with
hot changes;
- The entire object update system (matrices, geometry) is now
centralized. Calls to where_is_object and makeDispList are
forbidden, instead we tag objects 'changed' and let the
depgraph code sort it out
- Removed all old "Ika" code
- Depgraph is aware of all relationships, including meta balls,
constraints, bevelcurve, and so on.
- Made depgraph aware of relation types and layers, to do smart
flushing of 'changed' events. Nothing gets calculated too often!
- Transform uses depgraph to detect changes
- On frame-advance, depgraph flushes animated changes
Armatures;
Almost all armature related code has been fully built from scratch.
It now reveils the original design much better, with a very clean
implementation, lag free without even calculating each Bone more than
once. Result is quite a speedup yes!
Important to note is;
1) Armature is data containing the 'rest position'
2) Pose is the changes of rest position, and always on object level.
That way more Objects can use same Pose. Also constraints are in Pose
3) Actions only contain the Ipos to change values in Poses.
- Bones draw unrotated now
- Drawing bones speedup enormously (10-20 times)
- Bone selecting in EditMode, selection state is saved for PoseMode,
and vice-versa
- Undo in editmode
- Bone renaming does vertexgroups, constraints, posechannels, actions,
for all users of Armature in entire file
- Added Bone renaming in NKey panel
- Nkey PoseMode shows eulers now
- EditMode and PoseMode now have 'active' bone too (last clicked)
- Parenting in EditMode' CTRL+P, ALT+P, with nice options!
- Pose is added in Outliner now, with showing that constraints are in
the Pose, not Armature
- Disconnected IK solving from constraints. It's a separate phase now,
on top of the full Pose calculations
- Pose itself has a dependency graph too, so evaluation order is lag free.
TODO NOW;
- Rotating in Posemode has incorrect inverse transform (Martin will fix)
- Python Bone/Armature/Pose API disabled... needs full recode too
(wait for my doc!)
- Game engine will need upgrade too
- Depgraph code needs revision, cleanup, can be much faster!
(But, compliments for Jean-Luc, it works like a charm!)
- IK changed, it now doesnt use previous position to advance to next
position anymore. That system looks nice (no flips) but is not well
suited for NLA and background render.
TODO LATER;
We now can do loadsa new nifty features as well; like:
- Kill PoseMode (can be option for armatures itself)
- Make B-Bones (Bezier, Bspline, like for spines)
- Move all silly button level edit to 3d window (like CTRL+I = add
IK)
- Much better & informative drawing
- Fix action/nla editors
- Put all ipos in Actions (object, mesh key, lamp color)
- Add hooks
- Null bones
- Much more advanced constraints...
Bugfixes;
- OGL render (view3d header) had wrong first frame on anim render
- Ipo 'recording' mode had wrong playback speed
- Vertex-key mode now sticks to show 'active key', until frame change
-Ton-
2005-07-03 17:35:38 +00:00
|
|
|
#include "BKE_object.h"
|
2009-09-18 22:25:49 +00:00
|
|
|
#include "BKE_paint.h"
|
2009-12-10 11:08:38 +00:00
|
|
|
#include "BKE_pointcache.h"
|
2013-01-23 05:56:22 +00:00
|
|
|
#include "BKE_rigidbody.h"
|
2002-10-12 11:37:38 +00:00
|
|
|
#include "BKE_scene.h"
|
2009-12-13 14:56:45 +00:00
|
|
|
#include "BKE_sequencer.h"
|
2002-10-12 11:37:38 +00:00
|
|
|
#include "BKE_world.h"
|
2011-01-07 19:18:31 +00:00
|
|
|
|
2010-02-07 23:41:17 +00:00
|
|
|
#include "BKE_sound.h"
|
2002-10-12 11:37:38 +00:00
|
|
|
|
2011-11-02 19:24:30 +00:00
|
|
|
#include "RE_engine.h"
|
|
|
|
|
|
Color Management, Stage 2: Switch color pipeline to use OpenColorIO
Replace old color pipeline which was supporting linear/sRGB color spaces
only with OpenColorIO-based pipeline.
This introduces two configurable color spaces:
- Input color space for images and movie clips. This space is used to convert
images/movies from color space in which file is saved to Blender's linear
space (for float images, byte images are not internally converted, only input
space is stored for such images and used later).
This setting could be found in image/clip data block settings.
- Display color space which defines space in which particular display is working.
This settings could be found in scene's Color Management panel.
When render result is being displayed on the screen, apart from converting image
to display space, some additional conversions could happen.
This conversions are:
- View, which defines tone curve applying before display transformation.
These are different ways to view the image on the same display device.
For example it could be used to emulate film view on sRGB display.
- Exposure affects on image exposure before tone map is applied.
- Gamma is post-display gamma correction, could be used to match particular
display gamma.
- RGB curves are user-defined curves which are applying before display
transformation, could be used for different purposes.
All this settings by default are only applying on render result and does not
affect on other images. If some particular image needs to be affected by this
transformation, "View as Render" setting of image data block should be set to
truth. Movie clips are always affected by all display transformations.
This commit also introduces configurable color space in which sequencer is
working. This setting could be found in scene's Color Management panel and
it should be used if such stuff as grading needs to be done in color space
different from sRGB (i.e. when Film view on sRGB display is use, using VD16
space as sequencer's internal space would make grading working in space
which is close to the space using for display).
Some technical notes:
- Image buffer's float buffer is now always in linear space, even if it was
created from 16bit byte images.
- Space of byte buffer is stored in image buffer's rect_colorspace property.
- Profile of image buffer was removed since it's not longer meaningful.
- OpenGL and GLSL is supposed to always work in sRGB space. It is possible
to support other spaces, but it's quite large project which isn't so
much important.
- Legacy Color Management option disabled is emulated by using None display.
It could have some regressions, but there's no clear way to avoid them.
- If OpenColorIO is disabled on build time, it should make blender behaving
in the same way as previous release with color management enabled.
More details could be found at this page (more details would be added soon):
http://wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.64/Color_Management
--
Thanks to Xavier Thomas, Lukas Toene for initial work on OpenColorIO
integration and to Brecht van Lommel for some further development and code/
usecase review!
2012-09-15 10:05:07 +00:00
|
|
|
#include "IMB_colormanagement.h"
|
|
|
|
|
|
2009-09-18 22:25:49 +00:00
|
|
|
//XXX #include "BIF_previewrender.h"
|
|
|
|
|
//XXX #include "BIF_editseq.h"
|
2006-11-06 01:08:26 +00:00
|
|
|
|
2012-12-20 07:57:26 +00:00
|
|
|
#ifdef WITH_FREESTYLE
|
|
|
|
|
# include "FRS_freestyle_config.h"
|
|
|
|
|
#endif
|
2009-09-28 04:12:06 +00:00
|
|
|
|
2005-04-30 22:52:00 +00:00
|
|
|
#ifdef WIN32
|
2005-04-30 23:24:48 +00:00
|
|
|
#else
|
2005-04-30 21:27:05 +00:00
|
|
|
#include <sys/time.h>
|
2005-04-30 22:52:00 +00:00
|
|
|
#endif
|
2005-04-30 21:27:05 +00:00
|
|
|
|
2002-10-12 11:37:38 +00:00
|
|
|
void free_avicodecdata(AviCodecData *acd)
|
|
|
|
|
{
|
|
|
|
|
if (acd) {
|
2012-02-23 02:17:50 +00:00
|
|
|
if (acd->lpFormat) {
|
2002-10-12 11:37:38 +00:00
|
|
|
MEM_freeN(acd->lpFormat);
|
|
|
|
|
acd->lpFormat = NULL;
|
|
|
|
|
acd->cbFormat = 0;
|
|
|
|
|
}
|
2012-02-23 02:17:50 +00:00
|
|
|
if (acd->lpParms) {
|
2002-10-12 11:37:38 +00:00
|
|
|
MEM_freeN(acd->lpParms);
|
|
|
|
|
acd->lpParms = NULL;
|
|
|
|
|
acd->cbParms = 0;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2003-05-21 01:21:07 +00:00
|
|
|
void free_qtcodecdata(QuicktimeCodecData *qcd)
|
|
|
|
|
{
|
|
|
|
|
if (qcd) {
|
2012-02-23 02:17:50 +00:00
|
|
|
if (qcd->cdParms) {
|
2003-05-21 01:21:07 +00:00
|
|
|
MEM_freeN(qcd->cdParms);
|
|
|
|
|
qcd->cdParms = NULL;
|
|
|
|
|
qcd->cdSize = 0;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2012-11-09 07:29:27 +00:00
|
|
|
static void remove_sequencer_fcurves(Scene *sce)
|
|
|
|
|
{
|
2012-11-09 09:57:35 +00:00
|
|
|
AnimData *adt = BKE_animdata_from_id(&sce->id);
|
2012-11-09 07:29:27 +00:00
|
|
|
|
2012-11-09 09:57:35 +00:00
|
|
|
if (adt && adt->action) {
|
2012-11-09 07:29:27 +00:00
|
|
|
FCurve *fcu, *nextfcu;
|
2012-11-09 09:57:35 +00:00
|
|
|
|
|
|
|
|
for (fcu = adt->action->curves.first; fcu; fcu = nextfcu) {
|
2012-11-09 07:29:27 +00:00
|
|
|
nextfcu = fcu->next;
|
2012-11-09 09:57:35 +00:00
|
|
|
|
2012-11-09 07:29:27 +00:00
|
|
|
if ((fcu->rna_path) && strstr(fcu->rna_path, "sequences_all")) {
|
2012-11-09 09:57:35 +00:00
|
|
|
action_groups_remove_channel(adt->action, fcu);
|
2012-11-09 07:29:27 +00:00
|
|
|
free_fcurve(fcu);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2012-05-05 14:33:36 +00:00
|
|
|
Scene *BKE_scene_copy(Scene *sce, int type)
|
2009-09-18 22:25:49 +00:00
|
|
|
{
|
|
|
|
|
Scene *scen;
|
|
|
|
|
ToolSettings *ts;
|
|
|
|
|
Base *base, *obase;
|
|
|
|
|
|
2012-02-23 02:17:50 +00:00
|
|
|
if (type == SCE_COPY_EMPTY) {
|
2009-09-18 22:25:49 +00:00
|
|
|
ListBase lb;
|
2012-12-13 01:17:22 +00:00
|
|
|
/* XXX. main should become an arg */
|
|
|
|
|
scen = BKE_scene_add(G.main, sce->id.name + 2);
|
2009-09-18 22:25:49 +00:00
|
|
|
|
2012-05-06 15:15:33 +00:00
|
|
|
lb = scen->r.layers;
|
|
|
|
|
scen->r = sce->r;
|
|
|
|
|
scen->r.layers = lb;
|
|
|
|
|
scen->unit = sce->unit;
|
|
|
|
|
scen->physics_settings = sce->physics_settings;
|
|
|
|
|
scen->gm = sce->gm;
|
|
|
|
|
scen->audio = sce->audio;
|
2012-04-15 08:48:11 +00:00
|
|
|
|
|
|
|
|
MEM_freeN(scen->toolsettings);
|
2009-09-18 22:25:49 +00:00
|
|
|
}
|
|
|
|
|
else {
|
2012-05-06 15:15:33 +00:00
|
|
|
scen = BKE_libblock_copy(&sce->id);
|
2009-09-18 22:25:49 +00:00
|
|
|
BLI_duplicatelist(&(scen->base), &(sce->base));
|
|
|
|
|
|
|
|
|
|
clear_id_newpoins();
|
|
|
|
|
|
|
|
|
|
id_us_plus((ID *)scen->world);
|
|
|
|
|
id_us_plus((ID *)scen->set);
|
|
|
|
|
id_us_plus((ID *)scen->gm.dome.warptext);
|
|
|
|
|
|
2012-05-06 15:15:33 +00:00
|
|
|
scen->ed = NULL;
|
|
|
|
|
scen->theDag = NULL;
|
|
|
|
|
scen->obedit = NULL;
|
|
|
|
|
scen->stats = NULL;
|
|
|
|
|
scen->fps_info = NULL;
|
2009-09-18 22:25:49 +00:00
|
|
|
|
|
|
|
|
BLI_duplicatelist(&(scen->markers), &(sce->markers));
|
|
|
|
|
BLI_duplicatelist(&(scen->transform_spaces), &(sce->transform_spaces));
|
|
|
|
|
BLI_duplicatelist(&(scen->r.layers), &(sce->r.layers));
|
|
|
|
|
BKE_keyingsets_copy(&(scen->keyingsets), &(sce->keyingsets));
|
2010-08-05 10:50:38 +00:00
|
|
|
|
2012-02-23 02:17:50 +00:00
|
|
|
if (sce->nodetree) {
|
2012-08-22 09:10:16 +00:00
|
|
|
/* ID's are managed on both copy and switch */
|
|
|
|
|
scen->nodetree = ntreeCopyTree(sce->nodetree);
|
2010-08-05 10:50:38 +00:00
|
|
|
ntreeSwitchID(scen->nodetree, &sce->id, &scen->id);
|
|
|
|
|
}
|
|
|
|
|
|
2012-05-06 15:15:33 +00:00
|
|
|
obase = sce->base.first;
|
|
|
|
|
base = scen->base.first;
|
2012-02-23 02:17:50 +00:00
|
|
|
while (base) {
|
2009-09-18 22:25:49 +00:00
|
|
|
id_us_plus(&base->object->id);
|
2012-05-06 15:15:33 +00:00
|
|
|
if (obase == sce->basact) scen->basact = base;
|
2009-09-18 22:25:49 +00:00
|
|
|
|
2012-05-06 15:15:33 +00:00
|
|
|
obase = obase->next;
|
|
|
|
|
base = base->next;
|
2009-09-18 22:25:49 +00:00
|
|
|
}
|
Color Management, Stage 2: Switch color pipeline to use OpenColorIO
Replace old color pipeline which was supporting linear/sRGB color spaces
only with OpenColorIO-based pipeline.
This introduces two configurable color spaces:
- Input color space for images and movie clips. This space is used to convert
images/movies from color space in which file is saved to Blender's linear
space (for float images, byte images are not internally converted, only input
space is stored for such images and used later).
This setting could be found in image/clip data block settings.
- Display color space which defines space in which particular display is working.
This settings could be found in scene's Color Management panel.
When render result is being displayed on the screen, apart from converting image
to display space, some additional conversions could happen.
This conversions are:
- View, which defines tone curve applying before display transformation.
These are different ways to view the image on the same display device.
For example it could be used to emulate film view on sRGB display.
- Exposure affects on image exposure before tone map is applied.
- Gamma is post-display gamma correction, could be used to match particular
display gamma.
- RGB curves are user-defined curves which are applying before display
transformation, could be used for different purposes.
All this settings by default are only applying on render result and does not
affect on other images. If some particular image needs to be affected by this
transformation, "View as Render" setting of image data block should be set to
truth. Movie clips are always affected by all display transformations.
This commit also introduces configurable color space in which sequencer is
working. This setting could be found in scene's Color Management panel and
it should be used if such stuff as grading needs to be done in color space
different from sRGB (i.e. when Film view on sRGB display is use, using VD16
space as sequencer's internal space would make grading working in space
which is close to the space using for display).
Some technical notes:
- Image buffer's float buffer is now always in linear space, even if it was
created from 16bit byte images.
- Space of byte buffer is stored in image buffer's rect_colorspace property.
- Profile of image buffer was removed since it's not longer meaningful.
- OpenGL and GLSL is supposed to always work in sRGB space. It is possible
to support other spaces, but it's quite large project which isn't so
much important.
- Legacy Color Management option disabled is emulated by using None display.
It could have some regressions, but there's no clear way to avoid them.
- If OpenColorIO is disabled on build time, it should make blender behaving
in the same way as previous release with color management enabled.
More details could be found at this page (more details would be added soon):
http://wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.64/Color_Management
--
Thanks to Xavier Thomas, Lukas Toene for initial work on OpenColorIO
integration and to Brecht van Lommel for some further development and code/
usecase review!
2012-09-15 10:05:07 +00:00
|
|
|
|
|
|
|
|
/* copy color management settings */
|
|
|
|
|
BKE_color_managed_display_settings_copy(&scen->display_settings, &sce->display_settings);
|
|
|
|
|
BKE_color_managed_view_settings_copy(&scen->view_settings, &sce->view_settings);
|
2012-09-23 18:50:56 +00:00
|
|
|
BKE_color_managed_view_settings_copy(&scen->r.im_format.view_settings, &sce->r.im_format.view_settings);
|
2012-10-08 06:38:34 +00:00
|
|
|
|
|
|
|
|
BLI_strncpy(scen->sequencer_colorspace_settings.name, sce->sequencer_colorspace_settings.name,
|
|
|
|
|
sizeof(scen->sequencer_colorspace_settings.name));
|
2012-11-09 07:29:27 +00:00
|
|
|
|
|
|
|
|
/* remove animation used by sequencer */
|
|
|
|
|
if (type != SCE_COPY_FULL)
|
|
|
|
|
remove_sequencer_fcurves(scen);
|
2009-09-18 22:25:49 +00:00
|
|
|
}
|
2012-04-15 08:48:11 +00:00
|
|
|
|
|
|
|
|
/* tool settings */
|
2012-05-06 15:15:33 +00:00
|
|
|
scen->toolsettings = MEM_dupallocN(sce->toolsettings);
|
2012-04-15 08:48:11 +00:00
|
|
|
|
2012-05-06 15:15:33 +00:00
|
|
|
ts = scen->toolsettings;
|
2012-04-15 08:48:11 +00:00
|
|
|
if (ts) {
|
|
|
|
|
if (ts->vpaint) {
|
2012-05-06 15:15:33 +00:00
|
|
|
ts->vpaint = MEM_dupallocN(ts->vpaint);
|
|
|
|
|
ts->vpaint->paintcursor = NULL;
|
|
|
|
|
ts->vpaint->vpaint_prev = NULL;
|
|
|
|
|
ts->vpaint->wpaint_prev = NULL;
|
2012-07-25 22:37:52 +00:00
|
|
|
BKE_paint_copy(&ts->vpaint->paint, &ts->vpaint->paint);
|
2012-04-15 08:48:11 +00:00
|
|
|
}
|
|
|
|
|
if (ts->wpaint) {
|
2012-05-06 15:15:33 +00:00
|
|
|
ts->wpaint = MEM_dupallocN(ts->wpaint);
|
|
|
|
|
ts->wpaint->paintcursor = NULL;
|
|
|
|
|
ts->wpaint->vpaint_prev = NULL;
|
|
|
|
|
ts->wpaint->wpaint_prev = NULL;
|
2012-07-25 22:37:52 +00:00
|
|
|
BKE_paint_copy(&ts->wpaint->paint, &ts->wpaint->paint);
|
2012-04-15 08:48:11 +00:00
|
|
|
}
|
|
|
|
|
if (ts->sculpt) {
|
2012-05-06 15:15:33 +00:00
|
|
|
ts->sculpt = MEM_dupallocN(ts->sculpt);
|
2012-07-25 22:37:52 +00:00
|
|
|
BKE_paint_copy(&ts->sculpt->paint, &ts->sculpt->paint);
|
2012-04-15 08:48:11 +00:00
|
|
|
}
|
|
|
|
|
|
2012-07-25 22:37:52 +00:00
|
|
|
BKE_paint_copy(&ts->imapaint.paint, &ts->imapaint.paint);
|
2012-05-06 15:15:33 +00:00
|
|
|
ts->imapaint.paintcursor = NULL;
|
|
|
|
|
ts->particle.paintcursor = NULL;
|
2012-04-15 08:48:11 +00:00
|
|
|
}
|
2009-09-18 22:25:49 +00:00
|
|
|
|
|
|
|
|
/* make a private copy of the avicodecdata */
|
2012-02-23 02:17:50 +00:00
|
|
|
if (sce->r.avicodecdata) {
|
2009-09-18 22:25:49 +00:00
|
|
|
scen->r.avicodecdata = MEM_dupallocN(sce->r.avicodecdata);
|
|
|
|
|
scen->r.avicodecdata->lpFormat = MEM_dupallocN(scen->r.avicodecdata->lpFormat);
|
|
|
|
|
scen->r.avicodecdata->lpParms = MEM_dupallocN(scen->r.avicodecdata->lpParms);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* make a private copy of the qtcodecdata */
|
2012-02-23 02:17:50 +00:00
|
|
|
if (sce->r.qtcodecdata) {
|
2009-09-18 22:25:49 +00:00
|
|
|
scen->r.qtcodecdata = MEM_dupallocN(sce->r.qtcodecdata);
|
|
|
|
|
scen->r.qtcodecdata->cdParms = MEM_dupallocN(scen->r.qtcodecdata->cdParms);
|
|
|
|
|
}
|
|
|
|
|
|
2012-02-23 02:17:50 +00:00
|
|
|
if (sce->r.ffcodecdata.properties) { /* intentionally check scen not sce. */
|
2012-05-06 15:15:33 +00:00
|
|
|
scen->r.ffcodecdata.properties = IDP_CopyProperty(sce->r.ffcodecdata.properties);
|
2010-06-25 12:04:04 +00:00
|
|
|
}
|
|
|
|
|
|
2009-09-18 22:25:49 +00:00
|
|
|
/* NOTE: part of SCE_COPY_LINK_DATA and SCE_COPY_FULL operations
|
|
|
|
|
* are done outside of blenkernel with ED_objects_single_users! */
|
|
|
|
|
|
2010-03-22 09:30:00 +00:00
|
|
|
/* camera */
|
2012-02-23 02:17:50 +00:00
|
|
|
if (type == SCE_COPY_LINK_DATA || type == SCE_COPY_FULL) {
|
2010-03-22 09:30:00 +00:00
|
|
|
ID_NEW(scen->camera);
|
2009-09-18 22:25:49 +00:00
|
|
|
}
|
2010-10-04 15:31:04 +00:00
|
|
|
|
|
|
|
|
/* before scene copy */
|
|
|
|
|
sound_create_scene(scen);
|
2009-09-18 22:25:49 +00:00
|
|
|
|
|
|
|
|
/* world */
|
2012-02-23 02:17:50 +00:00
|
|
|
if (type == SCE_COPY_FULL) {
|
2010-11-09 09:53:17 +00:00
|
|
|
BKE_copy_animdata_id_action((ID *)scen);
|
2012-02-23 02:17:50 +00:00
|
|
|
if (scen->world) {
|
2010-03-22 09:30:00 +00:00
|
|
|
id_us_plus((ID *)scen->world);
|
2012-05-06 15:15:33 +00:00
|
|
|
scen->world = BKE_world_copy(scen->world);
|
2010-11-09 09:53:17 +00:00
|
|
|
BKE_copy_animdata_id_action((ID *)scen->world);
|
2010-03-22 09:30:00 +00:00
|
|
|
}
|
2010-06-25 12:04:04 +00:00
|
|
|
|
2012-02-23 02:17:50 +00:00
|
|
|
if (sce->ed) {
|
2012-05-06 15:15:33 +00:00
|
|
|
scen->ed = MEM_callocN(sizeof(Editing), "addseq");
|
|
|
|
|
scen->ed->seqbasep = &scen->ed->seqbase;
|
2012-08-08 11:15:40 +00:00
|
|
|
BKE_sequence_base_dupli_recursive(sce, scen, &scen->ed->seqbase, &sce->ed->seqbase, SEQ_DUPE_ALL);
|
2010-06-25 12:04:04 +00:00
|
|
|
}
|
2009-09-18 22:25:49 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return scen;
|
|
|
|
|
}
|
Orange; more render & compo stuff!
-> Rendering in RenderLayers
It's important to distinguish a 'render layer' from a 'pass'. The first is
control over the main pipeline itself, to indicate what geometry is being
is rendered. The 'pass' (not in this commit!) is related to internal
shading code, like shadow/spec/AO/normals/etc.
Options for RenderLayers now are:
- Indicate which 3d 'view layers' have to be included (so you can render
front and back separately)
- "Solid", all solid faces, includes sky at the moment too
- "ZTransp", all transparent faces
- "Halo", the halos
- "Strand", the particle strands (not coded yet...)
Currently only 2 'passes' are exported for render, which is the "Combined"
buffer and the "Z. The latter now works, and can be turned on/off.
Note that all layers are still fully kept in memory now, saving the tiles
and layers to disk (in exr) is also todo.
-> New Blur options
The existing Blur Node (compositor) now has an optional input image. This
has to be a 'value buffer', which can be a Zbuffer, or any mask you can
think of. The input values have to be in the 0-1 range, so another new
node was added too "Map Value".
The value input can also be used to tweak blur size with the (todo)
Time Node.
Temporal screenies:
http://www.blender.org/bf/rt.jpg
http://www.blender.org/bf/rt1.jpg
http://www.blender.org/bf/rt2.jpg
BTW: The compositor is very slow still, it recalulates all nodes on each
change still. Persistant memory and dependency checks is coming!
2006-01-26 22:18:46 +00:00
|
|
|
|
2003-04-26 13:07:59 +00:00
|
|
|
/* do not free scene itself */
|
2012-05-05 14:03:12 +00:00
|
|
|
void BKE_scene_free(Scene *sce)
|
2002-10-12 11:37:38 +00:00
|
|
|
{
|
|
|
|
|
Base *base;
|
2012-12-11 22:00:22 +00:00
|
|
|
|
2012-05-06 15:15:33 +00:00
|
|
|
base = sce->base.first;
|
2012-02-23 02:17:50 +00:00
|
|
|
while (base) {
|
2002-10-12 11:37:38 +00:00
|
|
|
base->object->id.us--;
|
2012-05-06 15:15:33 +00:00
|
|
|
base = base->next;
|
2002-10-12 11:37:38 +00:00
|
|
|
}
|
2003-04-26 13:07:59 +00:00
|
|
|
/* do not free objects! */
|
2009-09-18 22:25:49 +00:00
|
|
|
|
2012-02-23 02:17:50 +00:00
|
|
|
if (sce->gpd) {
|
2012-07-07 22:51:57 +00:00
|
|
|
#if 0 /* removed since this can be invalid memory when freeing everything */
|
|
|
|
|
/* since the grease pencil data is freed before the scene.
|
|
|
|
|
* since grease pencil data is not (yet?), shared between objects
|
|
|
|
|
* its probably safe not to do this, some save and reload will free this. */
|
2009-09-18 22:25:49 +00:00
|
|
|
sce->gpd->id.us--;
|
2009-12-25 23:50:35 +00:00
|
|
|
#endif
|
2012-05-06 15:15:33 +00:00
|
|
|
sce->gpd = NULL;
|
2009-09-18 22:25:49 +00:00
|
|
|
}
|
2002-10-12 11:37:38 +00:00
|
|
|
|
|
|
|
|
BLI_freelistN(&sce->base);
|
2012-05-11 10:04:55 +00:00
|
|
|
BKE_sequencer_editing_free(sce);
|
2009-09-18 22:25:49 +00:00
|
|
|
|
|
|
|
|
BKE_free_animdata((ID *)sce);
|
|
|
|
|
BKE_keyingsets_free(&sce->keyingsets);
|
2008-10-28 20:26:38 +00:00
|
|
|
|
2013-01-23 05:56:22 +00:00
|
|
|
if (sce->rigidbody_world)
|
|
|
|
|
BKE_rigidbody_free_world(sce->rigidbody_world);
|
|
|
|
|
|
2002-10-12 11:37:38 +00:00
|
|
|
if (sce->r.avicodecdata) {
|
|
|
|
|
free_avicodecdata(sce->r.avicodecdata);
|
|
|
|
|
MEM_freeN(sce->r.avicodecdata);
|
|
|
|
|
sce->r.avicodecdata = NULL;
|
2003-05-21 01:21:07 +00:00
|
|
|
}
|
|
|
|
|
if (sce->r.qtcodecdata) {
|
|
|
|
|
free_qtcodecdata(sce->r.qtcodecdata);
|
|
|
|
|
MEM_freeN(sce->r.qtcodecdata);
|
|
|
|
|
sce->r.qtcodecdata = NULL;
|
2002-10-12 11:37:38 +00:00
|
|
|
}
|
2008-05-11 20:40:55 +00:00
|
|
|
if (sce->r.ffcodecdata.properties) {
|
|
|
|
|
IDP_FreeProperty(sce->r.ffcodecdata.properties);
|
|
|
|
|
MEM_freeN(sce->r.ffcodecdata.properties);
|
|
|
|
|
sce->r.ffcodecdata.properties = NULL;
|
|
|
|
|
}
|
Added the new Timeline Window, copied from Tuhopuu, coded by Matt Ebb.
Main change is that it's an own Space type now, not part of the Audio
window... the audio window should restrict to own options. This way
functionality is nicely separated.
Since it's the first time I added a new space (since long!) I've made an
extensive tutorial as well. You can find that here:
http://www.blender3d.org/cms/Adding_new_Space_Window.557.0.html
Notes for using timewindow;
- Add time markers with MKey
- CTRL+M gives option to name Marker
- Markers cannot be moved yet...
- Pageup-Pagedown keys moves current frame to next-prev Marker
- Xkey removes Markers
- If an object has Ipos or an Action, it draws key lines
- CTRL+Pageup-Pagedown moves current frame to next-prev Key
- Press S or E to set start/end frame for playback
Notes about the implementation in Tuhopuu:
- Add new Marker now selects new, deselects others
- Selecting Marker didn't work like elsewhere in Blender, on click it
should deselect all, except the indicated Marker. Not when holding SHIFT
of course
- Not exported functions are static now
- Removed unused defines (MARKER_NONE NEXT_AVAIL)
- Drawing order was confusing, doing too many matrix calls
- Removed not needed scrollbar, added new function to draw time values.
(Has advantage the MMB scroll works not confusing on a scrollbar)
- Added proper support for 'frame mapping'
- The string button (name Marker) had a bug (checked str[64] while str
was only 64 long)
- String button itself didn't allow "OK on enter"
- Made frame buttons in header larger, the arrows overlapped
- Removed support for negative frame values, that won't work so simple!
2005-05-05 17:19:21 +00:00
|
|
|
|
2012-12-20 07:57:26 +00:00
|
|
|
#ifdef WITH_FREESTYLE
|
|
|
|
|
{
|
|
|
|
|
SceneRenderLayer *srl;
|
|
|
|
|
|
|
|
|
|
for (srl = sce->r.layers.first; srl; srl = srl->next) {
|
|
|
|
|
FRS_free_freestyle_config(srl);
|
|
|
|
|
}
|
2009-10-07 07:18:50 +00:00
|
|
|
}
|
2012-12-20 07:57:26 +00:00
|
|
|
#endif
|
2009-10-07 07:18:50 +00:00
|
|
|
|
Added the new Timeline Window, copied from Tuhopuu, coded by Matt Ebb.
Main change is that it's an own Space type now, not part of the Audio
window... the audio window should restrict to own options. This way
functionality is nicely separated.
Since it's the first time I added a new space (since long!) I've made an
extensive tutorial as well. You can find that here:
http://www.blender3d.org/cms/Adding_new_Space_Window.557.0.html
Notes for using timewindow;
- Add time markers with MKey
- CTRL+M gives option to name Marker
- Markers cannot be moved yet...
- Pageup-Pagedown keys moves current frame to next-prev Marker
- Xkey removes Markers
- If an object has Ipos or an Action, it draws key lines
- CTRL+Pageup-Pagedown moves current frame to next-prev Key
- Press S or E to set start/end frame for playback
Notes about the implementation in Tuhopuu:
- Add new Marker now selects new, deselects others
- Selecting Marker didn't work like elsewhere in Blender, on click it
should deselect all, except the indicated Marker. Not when holding SHIFT
of course
- Not exported functions are static now
- Removed unused defines (MARKER_NONE NEXT_AVAIL)
- Drawing order was confusing, doing too many matrix calls
- Removed not needed scrollbar, added new function to draw time values.
(Has advantage the MMB scroll works not confusing on a scrollbar)
- Added proper support for 'frame mapping'
- The string button (name Marker) had a bug (checked str[64] while str
was only 64 long)
- String button itself didn't allow "OK on enter"
- Made frame buttons in header larger, the arrows overlapped
- Removed support for negative frame values, that won't work so simple!
2005-05-05 17:19:21 +00:00
|
|
|
BLI_freelistN(&sce->markers);
|
=== Custom Transform Orientation ===
Custom Orientations can be added with Ctrl-Shift-C (hotkey suggestions are welcomed), this adds and select the new alignment. Custom Orientations can also be added, deleted, selected from the Transform Orientations panel (View -> Transform Orientations). Standard orientations (global, local, normal, view) can also be selected from this panel.
If you plan on using only a single custom orientation and don't really need a list, I suggest you use the hotkey as it adds and selects at the same time.
Custom Orientations are save in the scene and are selected per 3D view (like normal orientation).
Adding from an object, the orientation is a normalized version of the object's orientation.
Adding from mesh data, a single element (vertex, edge, face) must be selected in its respective selection mode. Vertex orientation Z-axis is based on the normal, edge Z-axis on the edge itself (X-axis is on the XoY plane when possible, Y-axis is perpendicular to the rest). Face orientation Z-axis is the face normal, X-axis is perpendicular to the first edge, Y-axis is perpendicular to the rest.
(More logical orientations can be suggested).
I plan to add: 2 vertice (connected or not) => edge orientation , 3 vertice = face orientation
Differences from the patch:
- orientations no longer link back to the object they came from, everything is copy on creation.
- orientations are overwritten based on name (if you add an orientation with the same name as one that already exists, it overwrites the old one)
2008-01-13 18:24:09 +00:00
|
|
|
BLI_freelistN(&sce->transform_spaces);
|
Orange; more render & compo stuff!
-> Rendering in RenderLayers
It's important to distinguish a 'render layer' from a 'pass'. The first is
control over the main pipeline itself, to indicate what geometry is being
is rendered. The 'pass' (not in this commit!) is related to internal
shading code, like shadow/spec/AO/normals/etc.
Options for RenderLayers now are:
- Indicate which 3d 'view layers' have to be included (so you can render
front and back separately)
- "Solid", all solid faces, includes sky at the moment too
- "ZTransp", all transparent faces
- "Halo", the halos
- "Strand", the particle strands (not coded yet...)
Currently only 2 'passes' are exported for render, which is the "Combined"
buffer and the "Z. The latter now works, and can be turned on/off.
Note that all layers are still fully kept in memory now, saving the tiles
and layers to disk (in exr) is also todo.
-> New Blur options
The existing Blur Node (compositor) now has an optional input image. This
has to be a 'value buffer', which can be a Zbuffer, or any mask you can
think of. The input values have to be in the 0-1 range, so another new
node was added too "Map Value".
The value input can also be used to tweak blur size with the (todo)
Time Node.
Temporal screenies:
http://www.blender.org/bf/rt.jpg
http://www.blender.org/bf/rt1.jpg
http://www.blender.org/bf/rt2.jpg
BTW: The compositor is very slow still, it recalulates all nodes on each
change still. Persistant memory and dependency checks is coming!
2006-01-26 22:18:46 +00:00
|
|
|
BLI_freelistN(&sce->r.layers);
|
Added the new Timeline Window, copied from Tuhopuu, coded by Matt Ebb.
Main change is that it's an own Space type now, not part of the Audio
window... the audio window should restrict to own options. This way
functionality is nicely separated.
Since it's the first time I added a new space (since long!) I've made an
extensive tutorial as well. You can find that here:
http://www.blender3d.org/cms/Adding_new_Space_Window.557.0.html
Notes for using timewindow;
- Add time markers with MKey
- CTRL+M gives option to name Marker
- Markers cannot be moved yet...
- Pageup-Pagedown keys moves current frame to next-prev Marker
- Xkey removes Markers
- If an object has Ipos or an Action, it draws key lines
- CTRL+Pageup-Pagedown moves current frame to next-prev Key
- Press S or E to set start/end frame for playback
Notes about the implementation in Tuhopuu:
- Add new Marker now selects new, deselects others
- Selecting Marker didn't work like elsewhere in Blender, on click it
should deselect all, except the indicated Marker. Not when holding SHIFT
of course
- Not exported functions are static now
- Removed unused defines (MARKER_NONE NEXT_AVAIL)
- Drawing order was confusing, doing too many matrix calls
- Removed not needed scrollbar, added new function to draw time values.
(Has advantage the MMB scroll works not confusing on a scrollbar)
- Added proper support for 'frame mapping'
- The string button (name Marker) had a bug (checked str[64] while str
was only 64 long)
- String button itself didn't allow "OK on enter"
- Made frame buttons in header larger, the arrows overlapped
- Removed support for negative frame values, that won't work so simple!
2005-05-05 17:19:21 +00:00
|
|
|
|
2012-02-23 02:17:50 +00:00
|
|
|
if (sce->toolsettings) {
|
|
|
|
|
if (sce->toolsettings->vpaint) {
|
2012-07-25 22:37:52 +00:00
|
|
|
BKE_paint_free(&sce->toolsettings->vpaint->paint);
|
2009-09-18 22:25:49 +00:00
|
|
|
MEM_freeN(sce->toolsettings->vpaint);
|
|
|
|
|
}
|
2012-02-23 02:17:50 +00:00
|
|
|
if (sce->toolsettings->wpaint) {
|
2012-07-25 22:37:52 +00:00
|
|
|
BKE_paint_free(&sce->toolsettings->wpaint->paint);
|
2009-09-18 22:25:49 +00:00
|
|
|
MEM_freeN(sce->toolsettings->wpaint);
|
|
|
|
|
}
|
2012-02-23 02:17:50 +00:00
|
|
|
if (sce->toolsettings->sculpt) {
|
2012-07-25 22:37:52 +00:00
|
|
|
BKE_paint_free(&sce->toolsettings->sculpt->paint);
|
2009-09-18 22:25:49 +00:00
|
|
|
MEM_freeN(sce->toolsettings->sculpt);
|
|
|
|
|
}
|
2012-02-23 02:17:50 +00:00
|
|
|
if (sce->toolsettings->uvsculpt) {
|
2012-07-25 22:37:52 +00:00
|
|
|
BKE_paint_free(&sce->toolsettings->uvsculpt->paint);
|
2012-01-17 16:31:13 +00:00
|
|
|
MEM_freeN(sce->toolsettings->uvsculpt);
|
|
|
|
|
}
|
2012-07-25 22:37:52 +00:00
|
|
|
BKE_paint_free(&sce->toolsettings->imapaint.paint);
|
2009-09-18 22:25:49 +00:00
|
|
|
|
2005-08-24 20:37:25 +00:00
|
|
|
MEM_freeN(sce->toolsettings);
|
2012-10-21 05:46:41 +00:00
|
|
|
sce->toolsettings = NULL;
|
2005-08-24 20:37:25 +00:00
|
|
|
}
|
|
|
|
|
|
2005-04-30 21:27:05 +00:00
|
|
|
if (sce->theDag) {
|
|
|
|
|
free_forest(sce->theDag);
|
|
|
|
|
MEM_freeN(sce->theDag);
|
|
|
|
|
}
|
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
|
|
|
|
2012-02-23 02:17:50 +00:00
|
|
|
if (sce->nodetree) {
|
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
|
|
|
ntreeFreeTree(sce->nodetree);
|
|
|
|
|
MEM_freeN(sce->nodetree);
|
|
|
|
|
}
|
2006-11-06 01:08:26 +00:00
|
|
|
|
2012-02-23 02:17:50 +00:00
|
|
|
if (sce->stats)
|
2009-09-18 22:25:49 +00:00
|
|
|
MEM_freeN(sce->stats);
|
2012-02-23 02:17:50 +00:00
|
|
|
if (sce->fps_info)
|
2010-02-12 00:44:26 +00:00
|
|
|
MEM_freeN(sce->fps_info);
|
2010-02-07 23:41:17 +00:00
|
|
|
|
|
|
|
|
sound_destroy_scene(sce);
|
Color Management, Stage 2: Switch color pipeline to use OpenColorIO
Replace old color pipeline which was supporting linear/sRGB color spaces
only with OpenColorIO-based pipeline.
This introduces two configurable color spaces:
- Input color space for images and movie clips. This space is used to convert
images/movies from color space in which file is saved to Blender's linear
space (for float images, byte images are not internally converted, only input
space is stored for such images and used later).
This setting could be found in image/clip data block settings.
- Display color space which defines space in which particular display is working.
This settings could be found in scene's Color Management panel.
When render result is being displayed on the screen, apart from converting image
to display space, some additional conversions could happen.
This conversions are:
- View, which defines tone curve applying before display transformation.
These are different ways to view the image on the same display device.
For example it could be used to emulate film view on sRGB display.
- Exposure affects on image exposure before tone map is applied.
- Gamma is post-display gamma correction, could be used to match particular
display gamma.
- RGB curves are user-defined curves which are applying before display
transformation, could be used for different purposes.
All this settings by default are only applying on render result and does not
affect on other images. If some particular image needs to be affected by this
transformation, "View as Render" setting of image data block should be set to
truth. Movie clips are always affected by all display transformations.
This commit also introduces configurable color space in which sequencer is
working. This setting could be found in scene's Color Management panel and
it should be used if such stuff as grading needs to be done in color space
different from sRGB (i.e. when Film view on sRGB display is use, using VD16
space as sequencer's internal space would make grading working in space
which is close to the space using for display).
Some technical notes:
- Image buffer's float buffer is now always in linear space, even if it was
created from 16bit byte images.
- Space of byte buffer is stored in image buffer's rect_colorspace property.
- Profile of image buffer was removed since it's not longer meaningful.
- OpenGL and GLSL is supposed to always work in sRGB space. It is possible
to support other spaces, but it's quite large project which isn't so
much important.
- Legacy Color Management option disabled is emulated by using None display.
It could have some regressions, but there's no clear way to avoid them.
- If OpenColorIO is disabled on build time, it should make blender behaving
in the same way as previous release with color management enabled.
More details could be found at this page (more details would be added soon):
http://wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.64/Color_Management
--
Thanks to Xavier Thomas, Lukas Toene for initial work on OpenColorIO
integration and to Brecht van Lommel for some further development and code/
usecase review!
2012-09-15 10:05:07 +00:00
|
|
|
|
|
|
|
|
BKE_color_managed_view_settings_free(&sce->view_settings);
|
2002-10-12 11:37:38 +00:00
|
|
|
}
|
|
|
|
|
|
Holiday coding log :)
Nice formatted version (pictures soon):
http://wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.66/Usability
Short list of main changes:
- Transparent region option (over main region), added code to blend in/out such panels.
- Min size window now 640 x 480
- Fixed DPI for ui - lots of cleanup and changes everywhere. Icon image need correct size still, layer-in-use icon needs remake.
- Macbook retina support, use command line --no-native-pixels to disable it
- Timeline Marker label was drawing wrong
- Trackpad and magic mouse: supports zoom (hold ctrl)
- Fix for splash position: removed ghost function and made window size update after creation immediate
- Fast undo buffer save now adds UI as well. Could be checked for regular file save even...
Quit.blend and temp file saving use this now.
- Dixed filename in window on reading quit.blend or temp saves, and they now add a warning in window title: "(Recovered)"
- New Userpref option "Keep Session" - this always saves quit.blend, and loads on start.
This allows keeping UI and data without actual saves, until you actually save.
When you load startup.blend and quit, it recognises the quit.blend as a startup (no file name in header)
- Added 3D view copy/paste buffers (selected objects). Shortcuts ctrl-c, ctrl-v (OSX, cmd-c, cmd-v).
Coded partial file saving for it. Could be used for other purposes. Todo: use OS clipboards.
- User preferences (themes, keymaps, user settings) now can be saved as a separate file.
Old option is called "Save Startup File" the new one "Save User Settings".
To visualise this difference, the 'save startup file' button has been removed from user preferences window. That option is available as CTRL+U and in File menu still.
- OSX: fixed bug that stopped giving mouse events outside window.
This also fixes "Continuous Grab" for OSX. (error since 2009)
2012-12-12 18:58:11 +00:00
|
|
|
static Scene *scene_add(Main *bmain, const char *name)
|
2002-10-12 11:37:38 +00:00
|
|
|
{
|
|
|
|
|
Scene *sce;
|
Particles
=========
Merge of the famous particle patch by Janne Karhu, a full rewrite
of the Blender particle system. This includes:
- Emitter, Hair and Reactor particle types.
- Newtonian, Keyed and Boids physics.
- Various particle visualisation and rendering types.
- Vertex group and texture control for various properties.
- Interpolated child particles from parents.
- Hair editing with combing, growing, cutting, .. .
- Explode modifier.
- Harmonic, Magnetic fields, and multiple falloff types.
.. and lots of other things, some more info is here:
http://wiki.blender.org/index.php/BlenderDev/Particles_Rewrite
http://wiki.blender.org/index.php/BlenderDev/Particles_Rewrite_Doc
The new particle system cannot be backwards compatible. Old particle
systems are being converted to the new system, but will require
tweaking to get them looking the same as before.
Point Cache
===========
The new system to replace manual baking, based on automatic caching
on disk. This is currently used by softbodies and the particle system.
See the Cache API section on:
http://wiki.blender.org/index.php/BlenderDev/PhysicsSprint
Documentation
=============
These new features still need good docs for the release logs, help
for this is appreciated.
2007-11-26 22:09:57 +00:00
|
|
|
ParticleEditSettings *pset;
|
|
|
|
|
int a;
|
2012-10-08 06:38:34 +00:00
|
|
|
const char *colorspace_name;
|
2004-01-04 22:10:36 +00:00
|
|
|
|
2012-05-06 15:15:33 +00:00
|
|
|
sce = BKE_libblock_alloc(&bmain->scene, ID_SCE, name);
|
|
|
|
|
sce->lay = sce->layact = 1;
|
2009-09-18 22:25:49 +00:00
|
|
|
|
2012-05-06 15:15:33 +00:00
|
|
|
sce->r.mode = R_GAMMA | R_OSA | R_SHADOW | R_SSS | R_ENVMAP | R_RAYTRACE;
|
|
|
|
|
sce->r.cfra = 1;
|
|
|
|
|
sce->r.sfra = 1;
|
|
|
|
|
sce->r.efra = 250;
|
|
|
|
|
sce->r.frame_step = 1;
|
|
|
|
|
sce->r.xsch = 1920;
|
|
|
|
|
sce->r.ysch = 1080;
|
|
|
|
|
sce->r.xasp = 1;
|
|
|
|
|
sce->r.yasp = 1;
|
2012-11-05 08:05:14 +00:00
|
|
|
sce->r.tilex = 256;
|
|
|
|
|
sce->r.tiley = 256;
|
2012-05-06 15:15:33 +00:00
|
|
|
sce->r.mblur_samples = 1;
|
|
|
|
|
sce->r.filtertype = R_FILTER_MITCH;
|
|
|
|
|
sce->r.size = 50;
|
|
|
|
|
|
|
|
|
|
sce->r.im_format.planes = R_IMF_PLANES_RGB;
|
|
|
|
|
sce->r.im_format.imtype = R_IMF_IMTYPE_PNG;
|
2012-12-31 14:02:33 +00:00
|
|
|
sce->r.im_format.depth = R_IMF_CHAN_DEPTH_8;
|
2012-05-06 15:15:33 +00:00
|
|
|
sce->r.im_format.quality = 90;
|
2012-12-04 09:45:38 +00:00
|
|
|
sce->r.im_format.compress = 90;
|
2012-05-06 15:15:33 +00:00
|
|
|
|
|
|
|
|
sce->r.displaymode = R_OUTPUT_AREA;
|
|
|
|
|
sce->r.framapto = 100;
|
|
|
|
|
sce->r.images = 100;
|
|
|
|
|
sce->r.framelen = 1.0;
|
|
|
|
|
sce->r.blurfac = 0.5;
|
|
|
|
|
sce->r.frs_sec = 24;
|
|
|
|
|
sce->r.frs_sec_base = 1;
|
|
|
|
|
sce->r.edgeint = 10;
|
2007-09-10 22:52:32 +00:00
|
|
|
sce->r.ocres = 128;
|
Color Management, Stage 2: Switch color pipeline to use OpenColorIO
Replace old color pipeline which was supporting linear/sRGB color spaces
only with OpenColorIO-based pipeline.
This introduces two configurable color spaces:
- Input color space for images and movie clips. This space is used to convert
images/movies from color space in which file is saved to Blender's linear
space (for float images, byte images are not internally converted, only input
space is stored for such images and used later).
This setting could be found in image/clip data block settings.
- Display color space which defines space in which particular display is working.
This settings could be found in scene's Color Management panel.
When render result is being displayed on the screen, apart from converting image
to display space, some additional conversions could happen.
This conversions are:
- View, which defines tone curve applying before display transformation.
These are different ways to view the image on the same display device.
For example it could be used to emulate film view on sRGB display.
- Exposure affects on image exposure before tone map is applied.
- Gamma is post-display gamma correction, could be used to match particular
display gamma.
- RGB curves are user-defined curves which are applying before display
transformation, could be used for different purposes.
All this settings by default are only applying on render result and does not
affect on other images. If some particular image needs to be affected by this
transformation, "View as Render" setting of image data block should be set to
truth. Movie clips are always affected by all display transformations.
This commit also introduces configurable color space in which sequencer is
working. This setting could be found in scene's Color Management panel and
it should be used if such stuff as grading needs to be done in color space
different from sRGB (i.e. when Film view on sRGB display is use, using VD16
space as sequencer's internal space would make grading working in space
which is close to the space using for display).
Some technical notes:
- Image buffer's float buffer is now always in linear space, even if it was
created from 16bit byte images.
- Space of byte buffer is stored in image buffer's rect_colorspace property.
- Profile of image buffer was removed since it's not longer meaningful.
- OpenGL and GLSL is supposed to always work in sRGB space. It is possible
to support other spaces, but it's quite large project which isn't so
much important.
- Legacy Color Management option disabled is emulated by using None display.
It could have some regressions, but there's no clear way to avoid them.
- If OpenColorIO is disabled on build time, it should make blender behaving
in the same way as previous release with color management enabled.
More details could be found at this page (more details would be added soon):
http://wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.64/Color_Management
--
Thanks to Xavier Thomas, Lukas Toene for initial work on OpenColorIO
integration and to Brecht van Lommel for some further development and code/
usecase review!
2012-09-15 10:05:07 +00:00
|
|
|
|
2012-09-26 20:05:38 +00:00
|
|
|
/* OCIO_TODO: for forwards compatibility only, so if no tonecurve are used,
|
Color Management, Stage 2: Switch color pipeline to use OpenColorIO
Replace old color pipeline which was supporting linear/sRGB color spaces
only with OpenColorIO-based pipeline.
This introduces two configurable color spaces:
- Input color space for images and movie clips. This space is used to convert
images/movies from color space in which file is saved to Blender's linear
space (for float images, byte images are not internally converted, only input
space is stored for such images and used later).
This setting could be found in image/clip data block settings.
- Display color space which defines space in which particular display is working.
This settings could be found in scene's Color Management panel.
When render result is being displayed on the screen, apart from converting image
to display space, some additional conversions could happen.
This conversions are:
- View, which defines tone curve applying before display transformation.
These are different ways to view the image on the same display device.
For example it could be used to emulate film view on sRGB display.
- Exposure affects on image exposure before tone map is applied.
- Gamma is post-display gamma correction, could be used to match particular
display gamma.
- RGB curves are user-defined curves which are applying before display
transformation, could be used for different purposes.
All this settings by default are only applying on render result and does not
affect on other images. If some particular image needs to be affected by this
transformation, "View as Render" setting of image data block should be set to
truth. Movie clips are always affected by all display transformations.
This commit also introduces configurable color space in which sequencer is
working. This setting could be found in scene's Color Management panel and
it should be used if such stuff as grading needs to be done in color space
different from sRGB (i.e. when Film view on sRGB display is use, using VD16
space as sequencer's internal space would make grading working in space
which is close to the space using for display).
Some technical notes:
- Image buffer's float buffer is now always in linear space, even if it was
created from 16bit byte images.
- Space of byte buffer is stored in image buffer's rect_colorspace property.
- Profile of image buffer was removed since it's not longer meaningful.
- OpenGL and GLSL is supposed to always work in sRGB space. It is possible
to support other spaces, but it's quite large project which isn't so
much important.
- Legacy Color Management option disabled is emulated by using None display.
It could have some regressions, but there's no clear way to avoid them.
- If OpenColorIO is disabled on build time, it should make blender behaving
in the same way as previous release with color management enabled.
More details could be found at this page (more details would be added soon):
http://wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.64/Color_Management
--
Thanks to Xavier Thomas, Lukas Toene for initial work on OpenColorIO
integration and to Brecht van Lommel for some further development and code/
usecase review!
2012-09-15 10:05:07 +00:00
|
|
|
* images would look in the same way as in current blender
|
|
|
|
|
*
|
|
|
|
|
* perhaps at some point should be completely deprecated?
|
|
|
|
|
*/
|
2009-09-18 22:25:49 +00:00
|
|
|
sce->r.color_mgt_flag |= R_COLOR_MANAGEMENT;
|
Color Management, Stage 2: Switch color pipeline to use OpenColorIO
Replace old color pipeline which was supporting linear/sRGB color spaces
only with OpenColorIO-based pipeline.
This introduces two configurable color spaces:
- Input color space for images and movie clips. This space is used to convert
images/movies from color space in which file is saved to Blender's linear
space (for float images, byte images are not internally converted, only input
space is stored for such images and used later).
This setting could be found in image/clip data block settings.
- Display color space which defines space in which particular display is working.
This settings could be found in scene's Color Management panel.
When render result is being displayed on the screen, apart from converting image
to display space, some additional conversions could happen.
This conversions are:
- View, which defines tone curve applying before display transformation.
These are different ways to view the image on the same display device.
For example it could be used to emulate film view on sRGB display.
- Exposure affects on image exposure before tone map is applied.
- Gamma is post-display gamma correction, could be used to match particular
display gamma.
- RGB curves are user-defined curves which are applying before display
transformation, could be used for different purposes.
All this settings by default are only applying on render result and does not
affect on other images. If some particular image needs to be affected by this
transformation, "View as Render" setting of image data block should be set to
truth. Movie clips are always affected by all display transformations.
This commit also introduces configurable color space in which sequencer is
working. This setting could be found in scene's Color Management panel and
it should be used if such stuff as grading needs to be done in color space
different from sRGB (i.e. when Film view on sRGB display is use, using VD16
space as sequencer's internal space would make grading working in space
which is close to the space using for display).
Some technical notes:
- Image buffer's float buffer is now always in linear space, even if it was
created from 16bit byte images.
- Space of byte buffer is stored in image buffer's rect_colorspace property.
- Profile of image buffer was removed since it's not longer meaningful.
- OpenGL and GLSL is supposed to always work in sRGB space. It is possible
to support other spaces, but it's quite large project which isn't so
much important.
- Legacy Color Management option disabled is emulated by using None display.
It could have some regressions, but there's no clear way to avoid them.
- If OpenColorIO is disabled on build time, it should make blender behaving
in the same way as previous release with color management enabled.
More details could be found at this page (more details would be added soon):
http://wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.64/Color_Management
--
Thanks to Xavier Thomas, Lukas Toene for initial work on OpenColorIO
integration and to Brecht van Lommel for some further development and code/
usecase review!
2012-09-15 10:05:07 +00:00
|
|
|
|
2012-05-06 15:15:33 +00:00
|
|
|
sce->r.gauss = 1.0;
|
2010-11-18 03:03:17 +00:00
|
|
|
|
|
|
|
|
/* deprecated but keep for upwards compat */
|
2012-05-06 15:15:33 +00:00
|
|
|
sce->r.postgamma = 1.0;
|
|
|
|
|
sce->r.posthue = 0.0;
|
|
|
|
|
sce->r.postsat = 1.0;
|
|
|
|
|
|
|
|
|
|
sce->r.bake_mode = 1; /* prevent to include render stuff here */
|
|
|
|
|
sce->r.bake_filter = 2;
|
|
|
|
|
sce->r.bake_osa = 5;
|
|
|
|
|
sce->r.bake_flag = R_BAKE_CLEAR;
|
|
|
|
|
sce->r.bake_normal_space = R_BAKE_SPACE_TANGENT;
|
2012-12-19 12:30:39 +00:00
|
|
|
sce->r.bake_samples = 256;
|
2012-12-22 18:31:05 +00:00
|
|
|
sce->r.bake_biasdist = 0.001;
|
2012-05-06 15:15:33 +00:00
|
|
|
sce->r.scemode = R_DOCOMP | R_DOSEQ | R_EXTENSION;
|
|
|
|
|
sce->r.stamp = R_STAMP_TIME | R_STAMP_FRAME | R_STAMP_DATE | R_STAMP_CAMERA | R_STAMP_SCENE | R_STAMP_FILENAME | R_STAMP_RENDERTIME;
|
|
|
|
|
sce->r.stamp_font_id = 12;
|
|
|
|
|
sce->r.fg_stamp[0] = sce->r.fg_stamp[1] = sce->r.fg_stamp[2] = 0.8f;
|
|
|
|
|
sce->r.fg_stamp[3] = 1.0f;
|
|
|
|
|
sce->r.bg_stamp[0] = sce->r.bg_stamp[1] = sce->r.bg_stamp[2] = 0.0f;
|
|
|
|
|
sce->r.bg_stamp[3] = 0.25f;
|
Raytrace modifications from the Render Branch.
These should not have any effect on render results, except in some cases with
you have overlapping faces, where the noise seems to be slightly reduced.
There are some performance improvements, for simple scenes I wouldn't expect
more than 5-10% to be cut off the render time, for sintel scenes we got about
50% on average, that's with millions of polygons on intel quad cores. This
because memory access / cache misses were the main bottleneck for those scenes,
and the optimizations improve that.
Interal changes:
* Remove RE_raytrace.h, raytracer is now only used by render engine again.
* Split non-public parts rayobject.h into rayobject_internal.h, hopefully
makes it clearer how the API is used.
* Added rayintersection.h to contain some of the stuff from RE_raytrace.h
* Change Isect.vec/labda to Isect.dir/dist, previously vec was sometimes
normalized and sometimes not, confusing... now dir is always normalized
and dist contains the distance.
* Change VECCOPY and similar to BLI_math functions.
* Force inlining of auxiliary functions for ray-triangle/quad intersection,
helps a few percentages.
* Reorganize svbvh code so all the traversal functions are in one file
* Don't do test for root so that push_childs can be inlined
* Make shadow a template parameter so it doesn't need to be runtime checked
* Optimization in raytree building, was computing bounding boxes more often
than necessary.
* Leave out logf() factor in SAH, makes tree build quicker with no
noticeable influence on raytracing on performance?
* Set max childs to 4, simplifies traversal code a bit, but also seems
to help slightly in general.
* Store child pointers and child bb just as fixed arrays of size 4 in nodes,
nearly all nodes have this many children, so overall it actually reduces
memory usage a bit and avoids a pointer indirection.
2011-02-05 13:41:29 +00:00
|
|
|
sce->r.raytrace_options = R_RAYTRACE_USE_INSTANCES;
|
2010-03-16 17:37:34 +00:00
|
|
|
|
2012-05-06 15:15:33 +00:00
|
|
|
sce->r.seq_prev_type = OB_SOLID;
|
|
|
|
|
sce->r.seq_rend_type = OB_SOLID;
|
|
|
|
|
sce->r.seq_flag = R_SEQ_GL_PREV;
|
2010-03-16 17:37:34 +00:00
|
|
|
|
2012-05-06 15:15:33 +00:00
|
|
|
sce->r.threads = 1;
|
2002-10-12 11:37:38 +00:00
|
|
|
|
2012-05-06 15:15:33 +00:00
|
|
|
sce->r.simplify_subsurf = 6;
|
|
|
|
|
sce->r.simplify_particles = 1.0f;
|
|
|
|
|
sce->r.simplify_shadowsamples = 16;
|
|
|
|
|
sce->r.simplify_aosss = 1.0f;
|
2008-02-13 11:18:08 +00:00
|
|
|
|
2012-03-24 02:51:46 +00:00
|
|
|
sce->r.border.xmin = 0.0f;
|
|
|
|
|
sce->r.border.ymin = 0.0f;
|
|
|
|
|
sce->r.border.xmax = 1.0f;
|
|
|
|
|
sce->r.border.ymax = 1.0f;
|
2008-03-10 11:39:37 +00:00
|
|
|
|
2012-04-29 15:47:02 +00:00
|
|
|
sce->toolsettings = MEM_callocN(sizeof(struct ToolSettings), "Tool Settings Struct");
|
2012-05-06 15:15:33 +00:00
|
|
|
sce->toolsettings->cornertype = 1;
|
2005-08-24 20:37:25 +00:00
|
|
|
sce->toolsettings->degr = 90;
|
|
|
|
|
sce->toolsettings->step = 9;
|
2012-10-21 05:46:41 +00:00
|
|
|
sce->toolsettings->turn = 1;
|
2005-08-24 20:37:25 +00:00
|
|
|
sce->toolsettings->extr_offs = 1;
|
|
|
|
|
sce->toolsettings->doublimit = 0.001;
|
|
|
|
|
sce->toolsettings->segments = 32;
|
|
|
|
|
sce->toolsettings->rings = 32;
|
|
|
|
|
sce->toolsettings->vertices = 32;
|
2006-02-05 14:12:45 +00:00
|
|
|
sce->toolsettings->uvcalc_radius = 1.0f;
|
|
|
|
|
sce->toolsettings->uvcalc_cubesize = 1.0f;
|
|
|
|
|
sce->toolsettings->uvcalc_mapdir = 1;
|
|
|
|
|
sce->toolsettings->uvcalc_mapalign = 1;
|
2012-10-15 17:56:51 +00:00
|
|
|
sce->toolsettings->uvcalc_margin = 0.001f;
|
2006-06-10 20:06:41 +00:00
|
|
|
sce->toolsettings->unwrapper = 1;
|
2012-05-06 15:15:33 +00:00
|
|
|
sce->toolsettings->select_thresh = 0.01f;
|
2007-09-10 22:52:32 +00:00
|
|
|
sce->toolsettings->jointrilimit = 0.8f;
|
Particles
=========
Merge of the famous particle patch by Janne Karhu, a full rewrite
of the Blender particle system. This includes:
- Emitter, Hair and Reactor particle types.
- Newtonian, Keyed and Boids physics.
- Various particle visualisation and rendering types.
- Vertex group and texture control for various properties.
- Interpolated child particles from parents.
- Hair editing with combing, growing, cutting, .. .
- Explode modifier.
- Harmonic, Magnetic fields, and multiple falloff types.
.. and lots of other things, some more info is here:
http://wiki.blender.org/index.php/BlenderDev/Particles_Rewrite
http://wiki.blender.org/index.php/BlenderDev/Particles_Rewrite_Doc
The new particle system cannot be backwards compatible. Old particle
systems are being converted to the new system, but will require
tweaking to get them looking the same as before.
Point Cache
===========
The new system to replace manual baking, based on automatic caching
on disk. This is currently used by softbodies and the particle system.
See the Cache API section on:
http://wiki.blender.org/index.php/BlenderDev/PhysicsSprint
Documentation
=============
These new features still need good docs for the release logs, help
for this is appreciated.
2007-11-26 22:09:57 +00:00
|
|
|
|
2012-05-06 15:15:33 +00:00
|
|
|
sce->toolsettings->selectmode = SCE_SELECT_VERTEX;
|
|
|
|
|
sce->toolsettings->uv_selectmode = UV_SELECT_VERTEX;
|
|
|
|
|
sce->toolsettings->normalsize = 0.1;
|
|
|
|
|
sce->toolsettings->autokey_mode = U.autokey_mode;
|
2009-09-18 22:25:49 +00:00
|
|
|
|
2008-08-12 19:56:03 +00:00
|
|
|
sce->toolsettings->skgen_resolution = 100;
|
2012-05-06 15:15:33 +00:00
|
|
|
sce->toolsettings->skgen_threshold_internal = 0.01f;
|
|
|
|
|
sce->toolsettings->skgen_threshold_external = 0.01f;
|
|
|
|
|
sce->toolsettings->skgen_angle_limit = 45.0f;
|
|
|
|
|
sce->toolsettings->skgen_length_ratio = 1.3f;
|
|
|
|
|
sce->toolsettings->skgen_length_limit = 1.5f;
|
|
|
|
|
sce->toolsettings->skgen_correlation_limit = 0.98f;
|
|
|
|
|
sce->toolsettings->skgen_symmetry_limit = 0.1f;
|
2008-08-12 19:56:03 +00:00
|
|
|
sce->toolsettings->skgen_postpro = SKGEN_SMOOTH;
|
|
|
|
|
sce->toolsettings->skgen_postpro_passes = 1;
|
2012-05-06 15:15:33 +00:00
|
|
|
sce->toolsettings->skgen_options = SKGEN_FILTER_INTERNAL | SKGEN_FILTER_EXTERNAL | SKGEN_FILTER_SMART | SKGEN_HARMONIC | SKGEN_SUB_CORRELATION | SKGEN_STICK_TO_EMBEDDING;
|
2008-08-12 19:56:03 +00:00
|
|
|
sce->toolsettings->skgen_subdivisions[0] = SKGEN_SUB_CORRELATION;
|
|
|
|
|
sce->toolsettings->skgen_subdivisions[1] = SKGEN_SUB_LENGTH;
|
|
|
|
|
sce->toolsettings->skgen_subdivisions[2] = SKGEN_SUB_ANGLE;
|
|
|
|
|
|
2009-09-18 22:25:49 +00:00
|
|
|
sce->toolsettings->proportional_size = 1.0f;
|
|
|
|
|
|
Unified effector functionality for particles, cloth and softbody
* Unified scene wide gravity (currently in scene buttons)
instead of each simulation having it's own gravity.
* Weight parameters for all effectors and an effector group
setting.
* Every effector can use noise.
* Most effectors have "shapes" point, plane, surface, every point.
- "Point" is most like the old effectors and uses the
effector location as the effector point.
- "Plane" uses the closest point on effectors local xy-plane
as the effector point.
- "Surface" uses the closest point on an effector object's
surface as the effector point.
- "Every Point" uses every point in a mesh effector object
as an effector point.
- The falloff is calculated from this point, so for example
with "surface" shape and "use only negative z axis" it's
possible to apply force only "inside" the effector object.
* Spherical effector is now renamed as "force" as it's no longer
just spherical.
* New effector parameter "flow", which makes the effector act as
surrounding air velocity, so the resulting force is
proportional to the velocity difference of the point and "air
velocity". For example a wind field with flow=1.0 results in
proper non-accelerating wind.
* New effector fields "turbulence", which creates nice random
flow paths, and "drag", which slows the points down.
* Much improved vortex field.
* Effectors can now effect particle rotation as well as location.
* Use full, or only positive/negative z-axis to apply force
(note. the z-axis is the surface normal in the case of
effector shape "surface")
* New "force field" submenu in add menu, which adds an empty
with the chosen effector (curve object for corve guides).
* Other dynamics should be quite easy to add to the effector
system too if wanted.
* "Unified" doesn't mean that force fields give the exact same results for
particles, softbody & cloth, since their final effect depends on many external
factors, like for example the surface area of the effected faces.
Code changes
* Subversion bump for correct handling of global gravity.
* Separate ui py file for common dynamics stuff.
* Particle settings updating is flushed with it's id through
DAG_id_flush_update(..).
Known issues
* Curve guides don't yet have all ui buttons in place, but they
should work none the less.
* Hair dynamics don't yet respect force fields.
Other changes
* Particle emission defaults now to frames 1-200 with life of 50
frames to fill the whole default timeline.
* Many particles drawing related crashes fixed.
* Sometimes particles didn't update on first frame properly.
* Hair with object/group visualization didn't work properly.
* Memory leaks with PointCacheID lists (Genscher, remember to
free pidlists after use :).
2009-09-30 22:10:14 +00:00
|
|
|
sce->physics_settings.gravity[0] = 0.0f;
|
|
|
|
|
sce->physics_settings.gravity[1] = 0.0f;
|
|
|
|
|
sce->physics_settings.gravity[2] = -9.81f;
|
|
|
|
|
sce->physics_settings.flag = PHYS_GLOBAL_GRAVITY;
|
2009-09-18 22:25:49 +00:00
|
|
|
|
|
|
|
|
sce->unit.scale_length = 1.0f;
|
|
|
|
|
|
2012-05-06 15:15:33 +00:00
|
|
|
pset = &sce->toolsettings->particle;
|
|
|
|
|
pset->flag = PE_KEEP_LENGTHS | PE_LOCK_FIRST | PE_DEFLECT_EMITTER | PE_AUTO_VELOCITY;
|
|
|
|
|
pset->emitterdist = 0.25f;
|
|
|
|
|
pset->totrekey = 5;
|
|
|
|
|
pset->totaddkey = 5;
|
|
|
|
|
pset->brushtype = PE_BRUSH_NONE;
|
|
|
|
|
pset->draw_step = 2;
|
|
|
|
|
pset->fade_frames = 2;
|
|
|
|
|
pset->selectmode = SCE_SELECT_PATH;
|
|
|
|
|
for (a = 0; a < PE_TOT_BRUSH; a++) {
|
|
|
|
|
pset->brush[a].strength = 0.5;
|
|
|
|
|
pset->brush[a].size = 50;
|
|
|
|
|
pset->brush[a].step = 10;
|
|
|
|
|
pset->brush[a].count = 10;
|
Particles
=========
Merge of the famous particle patch by Janne Karhu, a full rewrite
of the Blender particle system. This includes:
- Emitter, Hair and Reactor particle types.
- Newtonian, Keyed and Boids physics.
- Various particle visualisation and rendering types.
- Vertex group and texture control for various properties.
- Interpolated child particles from parents.
- Hair editing with combing, growing, cutting, .. .
- Explode modifier.
- Harmonic, Magnetic fields, and multiple falloff types.
.. and lots of other things, some more info is here:
http://wiki.blender.org/index.php/BlenderDev/Particles_Rewrite
http://wiki.blender.org/index.php/BlenderDev/Particles_Rewrite_Doc
The new particle system cannot be backwards compatible. Old particle
systems are being converted to the new system, but will require
tweaking to get them looking the same as before.
Point Cache
===========
The new system to replace manual baking, based on automatic caching
on disk. This is currently used by softbodies and the particle system.
See the Cache API section on:
http://wiki.blender.org/index.php/BlenderDev/PhysicsSprint
Documentation
=============
These new features still need good docs for the release logs, help
for this is appreciated.
2007-11-26 22:09:57 +00:00
|
|
|
}
|
2012-05-06 15:15:33 +00:00
|
|
|
pset->brush[PE_BRUSH_CUT].strength = 100;
|
2010-11-09 10:40:03 +00:00
|
|
|
|
2009-09-20 14:00:00 +00:00
|
|
|
sce->r.ffcodecdata.audio_mixrate = 44100;
|
2010-11-18 03:03:17 +00:00
|
|
|
sce->r.ffcodecdata.audio_volume = 1.0f;
|
2011-05-30 18:57:28 +00:00
|
|
|
sce->r.ffcodecdata.audio_bitrate = 192;
|
2011-06-21 20:39:41 +00:00
|
|
|
sce->r.ffcodecdata.audio_channels = 2;
|
2010-11-18 03:03:17 +00:00
|
|
|
|
|
|
|
|
BLI_strncpy(sce->r.engine, "BLENDER_RENDER", sizeof(sce->r.engine));
|
2005-08-24 20:37:25 +00:00
|
|
|
|
3D Audio GSoC:
Implemented basic audio animation.
* AnimatableProperty: Propper cache writing and spline interpolation for reading (the solution for stair steps in audio animation)
* Animatable properties so far are: volume, pitch, panning
* Users note: Changing the pitch of a sound results in wrong seeking, due to the resulting playback length difference.
* Users note: Panning only works for mono sources, values are in the range [-2..2], this basically controls the angle of the sound, 0 is front, -1 left, 1 right and 2 and -2 are back. Typical stereo panning only supports [-1..1].
* Disabled animation of audio related ffmpeg output parameters.
* Scene Audio Panel: 3D Listener settings also for Renderer, new Volume property (animatable!), Update/Bake buttons for animation problems, moved sampling rate and channel count here
2011-07-28 13:58:59 +00:00
|
|
|
sce->audio.distance_model = 2.0f;
|
|
|
|
|
sce->audio.doppler_factor = 1.0f;
|
|
|
|
|
sce->audio.speed_of_sound = 343.3f;
|
|
|
|
|
sce->audio.volume = 1.0f;
|
2005-08-24 20:37:25 +00:00
|
|
|
|
2011-06-10 10:13:50 +00:00
|
|
|
BLI_strncpy(sce->r.pic, U.renderdir, sizeof(sce->r.pic));
|
2006-11-06 01:08:26 +00:00
|
|
|
|
2012-07-12 08:31:23 +00:00
|
|
|
BLI_rctf_init(&sce->r.safety, 0.1f, 0.9f, 0.1f, 0.9f);
|
2012-05-06 15:15:33 +00:00
|
|
|
sce->r.osa = 8;
|
2006-11-06 01:08:26 +00:00
|
|
|
|
2006-02-14 11:28:13 +00:00
|
|
|
/* note; in header_info.c the scene copy happens..., if you add more to renderdata it has to be checked there */
|
2012-05-05 14:33:36 +00:00
|
|
|
BKE_scene_add_render_layer(sce, NULL);
|
Orange; more render & compo stuff!
-> Rendering in RenderLayers
It's important to distinguish a 'render layer' from a 'pass'. The first is
control over the main pipeline itself, to indicate what geometry is being
is rendered. The 'pass' (not in this commit!) is related to internal
shading code, like shadow/spec/AO/normals/etc.
Options for RenderLayers now are:
- Indicate which 3d 'view layers' have to be included (so you can render
front and back separately)
- "Solid", all solid faces, includes sky at the moment too
- "ZTransp", all transparent faces
- "Halo", the halos
- "Strand", the particle strands (not coded yet...)
Currently only 2 'passes' are exported for render, which is the "Combined"
buffer and the "Z. The latter now works, and can be turned on/off.
Note that all layers are still fully kept in memory now, saving the tiles
and layers to disk (in exr) is also todo.
-> New Blur options
The existing Blur Node (compositor) now has an optional input image. This
has to be a 'value buffer', which can be a Zbuffer, or any mask you can
think of. The input values have to be in the 0-1 range, so another new
node was added too "Map Value".
The value input can also be used to tweak blur size with the (todo)
Time Node.
Temporal screenies:
http://www.blender.org/bf/rt.jpg
http://www.blender.org/bf/rt1.jpg
http://www.blender.org/bf/rt2.jpg
BTW: The compositor is very slow still, it recalulates all nodes on each
change still. Persistant memory and dependency checks is coming!
2006-01-26 22:18:46 +00:00
|
|
|
|
2009-09-18 22:25:49 +00:00
|
|
|
/* game data */
|
|
|
|
|
sce->gm.stereoflag = STEREO_NOSTEREO;
|
|
|
|
|
sce->gm.stereomode = STEREO_ANAGLYPH;
|
2009-12-29 15:47:20 +00:00
|
|
|
sce->gm.eyeseparation = 0.10;
|
|
|
|
|
|
2009-09-18 22:25:49 +00:00
|
|
|
sce->gm.dome.angle = 180;
|
|
|
|
|
sce->gm.dome.mode = DOME_FISHEYE;
|
|
|
|
|
sce->gm.dome.res = 4;
|
|
|
|
|
sce->gm.dome.resbuf = 1.0f;
|
|
|
|
|
sce->gm.dome.tilt = 0;
|
|
|
|
|
|
2012-05-06 15:15:33 +00:00
|
|
|
sce->gm.xplay = 640;
|
|
|
|
|
sce->gm.yplay = 480;
|
|
|
|
|
sce->gm.freqplay = 60;
|
|
|
|
|
sce->gm.depth = 32;
|
2009-09-18 22:25:49 +00:00
|
|
|
|
2012-05-06 15:15:33 +00:00
|
|
|
sce->gm.gravity = 9.8f;
|
|
|
|
|
sce->gm.physicsEngine = WOPHY_BULLET;
|
2009-09-18 22:25:49 +00:00
|
|
|
sce->gm.mode = 32; //XXX ugly harcoding, still not sure we should drop mode. 32 == 1 << 5 == use_occlusion_culling
|
|
|
|
|
sce->gm.occlusionRes = 128;
|
|
|
|
|
sce->gm.ticrate = 60;
|
|
|
|
|
sce->gm.maxlogicstep = 5;
|
|
|
|
|
sce->gm.physubstep = 1;
|
|
|
|
|
sce->gm.maxphystep = 5;
|
2012-05-29 20:30:33 +00:00
|
|
|
sce->gm.lineardeactthreshold = 0.8f;
|
|
|
|
|
sce->gm.angulardeactthreshold = 1.0f;
|
|
|
|
|
sce->gm.deactivationtime = 0.0f;
|
2009-09-18 22:25:49 +00:00
|
|
|
|
|
|
|
|
sce->gm.flag = GAME_DISPLAY_LISTS;
|
|
|
|
|
sce->gm.matmode = GAME_MAT_MULTITEX;
|
|
|
|
|
|
2012-05-06 15:15:33 +00:00
|
|
|
sce->gm.obstacleSimulation = OBSTSIMULATION_NONE;
|
2010-06-18 23:48:52 +00:00
|
|
|
sce->gm.levelHeight = 2.f;
|
2010-06-10 00:19:06 +00:00
|
|
|
|
2010-07-09 22:16:52 +00:00
|
|
|
sce->gm.recastData.cellsize = 0.3f;
|
|
|
|
|
sce->gm.recastData.cellheight = 0.2f;
|
2012-05-06 15:15:33 +00:00
|
|
|
sce->gm.recastData.agentmaxslope = M_PI / 2;
|
2010-07-09 22:16:52 +00:00
|
|
|
sce->gm.recastData.agentmaxclimb = 0.9f;
|
|
|
|
|
sce->gm.recastData.agentheight = 2.0f;
|
|
|
|
|
sce->gm.recastData.agentradius = 0.6f;
|
|
|
|
|
sce->gm.recastData.edgemaxlen = 12.0f;
|
|
|
|
|
sce->gm.recastData.edgemaxerror = 1.3f;
|
2011-09-29 21:38:57 +00:00
|
|
|
sce->gm.recastData.regionminsize = 8.f;
|
2010-07-09 22:16:52 +00:00
|
|
|
sce->gm.recastData.regionmergesize = 20.f;
|
|
|
|
|
sce->gm.recastData.vertsperpoly = 6;
|
|
|
|
|
sce->gm.recastData.detailsampledist = 6.0f;
|
|
|
|
|
sce->gm.recastData.detailsamplemaxerror = 1.0f;
|
|
|
|
|
|
2012-01-25 01:39:38 +00:00
|
|
|
sce->gm.exitkey = 218; // Blender key code for ESC
|
|
|
|
|
|
2010-02-07 23:41:17 +00:00
|
|
|
sound_create_scene(sce);
|
|
|
|
|
|
2012-10-08 06:38:34 +00:00
|
|
|
/* color management */
|
|
|
|
|
colorspace_name = IMB_colormanagement_role_colorspace_name_get(COLOR_ROLE_DEFAULT_SEQUENCER);
|
|
|
|
|
|
Color Management, Stage 2: Switch color pipeline to use OpenColorIO
Replace old color pipeline which was supporting linear/sRGB color spaces
only with OpenColorIO-based pipeline.
This introduces two configurable color spaces:
- Input color space for images and movie clips. This space is used to convert
images/movies from color space in which file is saved to Blender's linear
space (for float images, byte images are not internally converted, only input
space is stored for such images and used later).
This setting could be found in image/clip data block settings.
- Display color space which defines space in which particular display is working.
This settings could be found in scene's Color Management panel.
When render result is being displayed on the screen, apart from converting image
to display space, some additional conversions could happen.
This conversions are:
- View, which defines tone curve applying before display transformation.
These are different ways to view the image on the same display device.
For example it could be used to emulate film view on sRGB display.
- Exposure affects on image exposure before tone map is applied.
- Gamma is post-display gamma correction, could be used to match particular
display gamma.
- RGB curves are user-defined curves which are applying before display
transformation, could be used for different purposes.
All this settings by default are only applying on render result and does not
affect on other images. If some particular image needs to be affected by this
transformation, "View as Render" setting of image data block should be set to
truth. Movie clips are always affected by all display transformations.
This commit also introduces configurable color space in which sequencer is
working. This setting could be found in scene's Color Management panel and
it should be used if such stuff as grading needs to be done in color space
different from sRGB (i.e. when Film view on sRGB display is use, using VD16
space as sequencer's internal space would make grading working in space
which is close to the space using for display).
Some technical notes:
- Image buffer's float buffer is now always in linear space, even if it was
created from 16bit byte images.
- Space of byte buffer is stored in image buffer's rect_colorspace property.
- Profile of image buffer was removed since it's not longer meaningful.
- OpenGL and GLSL is supposed to always work in sRGB space. It is possible
to support other spaces, but it's quite large project which isn't so
much important.
- Legacy Color Management option disabled is emulated by using None display.
It could have some regressions, but there's no clear way to avoid them.
- If OpenColorIO is disabled on build time, it should make blender behaving
in the same way as previous release with color management enabled.
More details could be found at this page (more details would be added soon):
http://wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.64/Color_Management
--
Thanks to Xavier Thomas, Lukas Toene for initial work on OpenColorIO
integration and to Brecht van Lommel for some further development and code/
usecase review!
2012-09-15 10:05:07 +00:00
|
|
|
BKE_color_managed_display_settings_init(&sce->display_settings);
|
|
|
|
|
BKE_color_managed_view_settings_init(&sce->view_settings);
|
2012-10-08 06:38:34 +00:00
|
|
|
BLI_strncpy(sce->sequencer_colorspace_settings.name, colorspace_name,
|
|
|
|
|
sizeof(sce->sequencer_colorspace_settings.name));
|
Color Management, Stage 2: Switch color pipeline to use OpenColorIO
Replace old color pipeline which was supporting linear/sRGB color spaces
only with OpenColorIO-based pipeline.
This introduces two configurable color spaces:
- Input color space for images and movie clips. This space is used to convert
images/movies from color space in which file is saved to Blender's linear
space (for float images, byte images are not internally converted, only input
space is stored for such images and used later).
This setting could be found in image/clip data block settings.
- Display color space which defines space in which particular display is working.
This settings could be found in scene's Color Management panel.
When render result is being displayed on the screen, apart from converting image
to display space, some additional conversions could happen.
This conversions are:
- View, which defines tone curve applying before display transformation.
These are different ways to view the image on the same display device.
For example it could be used to emulate film view on sRGB display.
- Exposure affects on image exposure before tone map is applied.
- Gamma is post-display gamma correction, could be used to match particular
display gamma.
- RGB curves are user-defined curves which are applying before display
transformation, could be used for different purposes.
All this settings by default are only applying on render result and does not
affect on other images. If some particular image needs to be affected by this
transformation, "View as Render" setting of image data block should be set to
truth. Movie clips are always affected by all display transformations.
This commit also introduces configurable color space in which sequencer is
working. This setting could be found in scene's Color Management panel and
it should be used if such stuff as grading needs to be done in color space
different from sRGB (i.e. when Film view on sRGB display is use, using VD16
space as sequencer's internal space would make grading working in space
which is close to the space using for display).
Some technical notes:
- Image buffer's float buffer is now always in linear space, even if it was
created from 16bit byte images.
- Space of byte buffer is stored in image buffer's rect_colorspace property.
- Profile of image buffer was removed since it's not longer meaningful.
- OpenGL and GLSL is supposed to always work in sRGB space. It is possible
to support other spaces, but it's quite large project which isn't so
much important.
- Legacy Color Management option disabled is emulated by using None display.
It could have some regressions, but there's no clear way to avoid them.
- If OpenColorIO is disabled on build time, it should make blender behaving
in the same way as previous release with color management enabled.
More details could be found at this page (more details would be added soon):
http://wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.64/Color_Management
--
Thanks to Xavier Thomas, Lukas Toene for initial work on OpenColorIO
integration and to Brecht van Lommel for some further development and code/
usecase review!
2012-09-15 10:05:07 +00:00
|
|
|
|
2002-10-12 11:37:38 +00:00
|
|
|
return sce;
|
|
|
|
|
}
|
|
|
|
|
|
2012-12-13 01:17:22 +00:00
|
|
|
Scene *BKE_scene_add(Main *bmain, const char *name)
|
Holiday coding log :)
Nice formatted version (pictures soon):
http://wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.66/Usability
Short list of main changes:
- Transparent region option (over main region), added code to blend in/out such panels.
- Min size window now 640 x 480
- Fixed DPI for ui - lots of cleanup and changes everywhere. Icon image need correct size still, layer-in-use icon needs remake.
- Macbook retina support, use command line --no-native-pixels to disable it
- Timeline Marker label was drawing wrong
- Trackpad and magic mouse: supports zoom (hold ctrl)
- Fix for splash position: removed ghost function and made window size update after creation immediate
- Fast undo buffer save now adds UI as well. Could be checked for regular file save even...
Quit.blend and temp file saving use this now.
- Dixed filename in window on reading quit.blend or temp saves, and they now add a warning in window title: "(Recovered)"
- New Userpref option "Keep Session" - this always saves quit.blend, and loads on start.
This allows keeping UI and data without actual saves, until you actually save.
When you load startup.blend and quit, it recognises the quit.blend as a startup (no file name in header)
- Added 3D view copy/paste buffers (selected objects). Shortcuts ctrl-c, ctrl-v (OSX, cmd-c, cmd-v).
Coded partial file saving for it. Could be used for other purposes. Todo: use OS clipboards.
- User preferences (themes, keymaps, user settings) now can be saved as a separate file.
Old option is called "Save Startup File" the new one "Save User Settings".
To visualise this difference, the 'save startup file' button has been removed from user preferences window. That option is available as CTRL+U and in File menu still.
- OSX: fixed bug that stopped giving mouse events outside window.
This also fixes "Continuous Grab" for OSX. (error since 2009)
2012-12-12 18:58:11 +00:00
|
|
|
{
|
|
|
|
|
return scene_add(bmain, name);
|
|
|
|
|
}
|
|
|
|
|
|
2012-05-05 14:33:36 +00:00
|
|
|
Base *BKE_scene_base_find(Scene *scene, Object *ob)
|
2002-10-12 11:37:38 +00:00
|
|
|
{
|
2012-08-18 16:16:13 +00:00
|
|
|
return BLI_findptr(&scene->base, ob, offsetof(Base, object));
|
2002-10-12 11:37:38 +00:00
|
|
|
}
|
|
|
|
|
|
2012-05-05 14:33:36 +00:00
|
|
|
void BKE_scene_set_background(Main *bmain, Scene *scene)
|
2002-10-12 11:37:38 +00:00
|
|
|
{
|
2009-09-18 22:25:49 +00:00
|
|
|
Scene *sce;
|
2002-10-12 11:37:38 +00:00
|
|
|
Base *base;
|
|
|
|
|
Object *ob;
|
|
|
|
|
Group *group;
|
|
|
|
|
GroupObject *go;
|
|
|
|
|
int flag;
|
|
|
|
|
|
2006-05-15 10:46:04 +00:00
|
|
|
/* check for cyclic sets, for reading old files but also for definite security (py?) */
|
2012-05-05 14:33:36 +00:00
|
|
|
BKE_scene_validate_setscene(bmain, scene);
|
2006-05-15 10:46:04 +00:00
|
|
|
|
2010-07-23 18:42:15 +00:00
|
|
|
/* can happen when switching modes in other scenes */
|
2012-02-23 02:17:50 +00:00
|
|
|
if (scene->obedit && !(scene->obedit->mode & OB_MODE_EDIT))
|
2012-05-06 15:15:33 +00:00
|
|
|
scene->obedit = NULL;
|
2010-07-23 18:42:15 +00:00
|
|
|
|
2003-04-26 13:07:59 +00:00
|
|
|
/* deselect objects (for dataselect) */
|
2012-05-06 15:15:33 +00:00
|
|
|
for (ob = bmain->object.first; ob; ob = ob->id.next)
|
|
|
|
|
ob->flag &= ~(SELECT | OB_FROMGROUP);
|
2002-10-12 11:37:38 +00:00
|
|
|
|
|
|
|
|
/* group flags again */
|
2012-05-06 15:15:33 +00:00
|
|
|
for (group = bmain->group.first; group; group = group->id.next) {
|
2012-08-18 16:16:13 +00:00
|
|
|
for (go = group->gobject.first; go; go = go->next) {
|
|
|
|
|
if (go->ob) {
|
|
|
|
|
go->ob->flag |= OB_FROMGROUP;
|
|
|
|
|
}
|
2002-10-12 11:37:38 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2003-04-26 13:07:59 +00:00
|
|
|
/* sort baselist */
|
2010-08-01 12:57:01 +00:00
|
|
|
DAG_scene_sort(bmain, scene);
|
2006-11-30 15:54:21 +00:00
|
|
|
|
|
|
|
|
/* ensure dags are built for sets */
|
2012-05-06 15:15:33 +00:00
|
|
|
for (sce = scene->set; sce; sce = sce->set)
|
|
|
|
|
if (sce->theDag == NULL)
|
2010-08-01 12:57:01 +00:00
|
|
|
DAG_scene_sort(bmain, sce);
|
2002-10-12 11:37:38 +00:00
|
|
|
|
2003-04-26 13:07:59 +00:00
|
|
|
/* copy layers and flags from bases to objects */
|
2012-05-06 15:15:33 +00:00
|
|
|
for (base = scene->base.first; base; base = base->next) {
|
|
|
|
|
ob = base->object;
|
|
|
|
|
ob->lay = base->lay;
|
2002-10-12 11:37:38 +00:00
|
|
|
|
2004-06-17 18:31:42 +00:00
|
|
|
/* group patch... */
|
Result of 2 weeks of quiet coding work in Greece :)
Aim was to get a total refresh of the animation system. This
is needed because;
- we need to upgrade it with 21st century features
- current code is spaghetti/hack combo, and hides good design
- it should become lag-free with using dependency graphs
A full log, with complete code API/structure/design explanation
will follow, that's a load of work... so here below the list with
hot changes;
- The entire object update system (matrices, geometry) is now
centralized. Calls to where_is_object and makeDispList are
forbidden, instead we tag objects 'changed' and let the
depgraph code sort it out
- Removed all old "Ika" code
- Depgraph is aware of all relationships, including meta balls,
constraints, bevelcurve, and so on.
- Made depgraph aware of relation types and layers, to do smart
flushing of 'changed' events. Nothing gets calculated too often!
- Transform uses depgraph to detect changes
- On frame-advance, depgraph flushes animated changes
Armatures;
Almost all armature related code has been fully built from scratch.
It now reveils the original design much better, with a very clean
implementation, lag free without even calculating each Bone more than
once. Result is quite a speedup yes!
Important to note is;
1) Armature is data containing the 'rest position'
2) Pose is the changes of rest position, and always on object level.
That way more Objects can use same Pose. Also constraints are in Pose
3) Actions only contain the Ipos to change values in Poses.
- Bones draw unrotated now
- Drawing bones speedup enormously (10-20 times)
- Bone selecting in EditMode, selection state is saved for PoseMode,
and vice-versa
- Undo in editmode
- Bone renaming does vertexgroups, constraints, posechannels, actions,
for all users of Armature in entire file
- Added Bone renaming in NKey panel
- Nkey PoseMode shows eulers now
- EditMode and PoseMode now have 'active' bone too (last clicked)
- Parenting in EditMode' CTRL+P, ALT+P, with nice options!
- Pose is added in Outliner now, with showing that constraints are in
the Pose, not Armature
- Disconnected IK solving from constraints. It's a separate phase now,
on top of the full Pose calculations
- Pose itself has a dependency graph too, so evaluation order is lag free.
TODO NOW;
- Rotating in Posemode has incorrect inverse transform (Martin will fix)
- Python Bone/Armature/Pose API disabled... needs full recode too
(wait for my doc!)
- Game engine will need upgrade too
- Depgraph code needs revision, cleanup, can be much faster!
(But, compliments for Jean-Luc, it works like a charm!)
- IK changed, it now doesnt use previous position to advance to next
position anymore. That system looks nice (no flips) but is not well
suited for NLA and background render.
TODO LATER;
We now can do loadsa new nifty features as well; like:
- Kill PoseMode (can be option for armatures itself)
- Make B-Bones (Bezier, Bspline, like for spines)
- Move all silly button level edit to 3d window (like CTRL+I = add
IK)
- Much better & informative drawing
- Fix action/nla editors
- Put all ipos in Actions (object, mesh key, lamp color)
- Add hooks
- Null bones
- Much more advanced constraints...
Bugfixes;
- OGL render (view3d header) had wrong first frame on anim render
- Ipo 'recording' mode had wrong playback speed
- Vertex-key mode now sticks to show 'active key', until frame change
-Ton-
2005-07-03 17:35:38 +00:00
|
|
|
base->flag &= ~(OB_FROMGROUP);
|
2012-05-06 15:15:33 +00:00
|
|
|
flag = ob->flag & (OB_FROMGROUP);
|
2002-10-12 11:37:38 +00:00
|
|
|
base->flag |= flag;
|
|
|
|
|
|
2006-11-30 16:44:34 +00:00
|
|
|
/* not too nice... for recovering objects with lost data */
|
2012-05-27 19:40:36 +00:00
|
|
|
//if (ob->pose == NULL) base->flag &= ~OB_POSEMODE;
|
2012-05-06 15:15:33 +00:00
|
|
|
ob->flag = base->flag;
|
2002-10-12 11:37:38 +00:00
|
|
|
}
|
More work on render stuff!
- Scene support in RenderLayers
You now can indicate in Compositor to use RenderLayer(s) from other scenes.
Use the new dropdown menu in the "Render Result" node. It will change the
title of the node to indicate that.
The other Scenes are rendered fully separate, creating own databases (and
octrees) after the current scene was finished. They use their own render
settings, with as exception the render output size (and optional border).
This makes the option an interesting memory saver and speedup.
Also note that the render-results of other scenes are kept in memory while
you work. So, after a render, you can tweak all composit effects.
- Render Stats
Added an 'info string' to stats, printed in renderwindow header. It gives
info now on steps "creating database", "shadow buffers", and "octree".
- Bug fixes
Added redraw event for Image window, when using compositor render.
Text objects were not rendered using background render (probably a bug
since depsgraph was added)
Dropdown buttons in Node editor were not refreshed after usage
Sometimes render window did not open, this due to wrong check for 'esc'.
Removed option that renders view-layers on F12, with mouse in 3d window.
Not only was it confusing, it's now more efficient with the Preview Panel,
which does this nicely.
2006-02-04 13:28:50 +00:00
|
|
|
/* no full animation update, this to enable render code to work (render code calls own animation updates) */
|
2002-10-12 11:37:38 +00:00
|
|
|
}
|
|
|
|
|
|
More work on render stuff!
- Scene support in RenderLayers
You now can indicate in Compositor to use RenderLayer(s) from other scenes.
Use the new dropdown menu in the "Render Result" node. It will change the
title of the node to indicate that.
The other Scenes are rendered fully separate, creating own databases (and
octrees) after the current scene was finished. They use their own render
settings, with as exception the render output size (and optional border).
This makes the option an interesting memory saver and speedup.
Also note that the render-results of other scenes are kept in memory while
you work. So, after a render, you can tweak all composit effects.
- Render Stats
Added an 'info string' to stats, printed in renderwindow header. It gives
info now on steps "creating database", "shadow buffers", and "octree".
- Bug fixes
Added redraw event for Image window, when using compositor render.
Text objects were not rendered using background render (probably a bug
since depsgraph was added)
Dropdown buttons in Node editor were not refreshed after usage
Sometimes render window did not open, this due to wrong check for 'esc'.
Removed option that renders view-layers on F12, with mouse in 3d window.
Not only was it confusing, it's now more efficient with the Preview Panel,
which does this nicely.
2006-02-04 13:28:50 +00:00
|
|
|
/* called from creator.c */
|
2012-05-05 14:33:36 +00:00
|
|
|
Scene *BKE_scene_set_name(Main *bmain, const char *name)
|
2002-10-12 11:37:38 +00:00
|
|
|
{
|
2012-05-05 17:00:11 +00:00
|
|
|
Scene *sce = (Scene *)BKE_libblock_find_name(ID_SCE, name);
|
2012-02-23 02:17:50 +00:00
|
|
|
if (sce) {
|
2012-05-05 14:33:36 +00:00
|
|
|
BKE_scene_set_background(bmain, sce);
|
2010-10-18 06:41:16 +00:00
|
|
|
printf("Scene switch: '%s' in file: '%s'\n", name, G.main->name);
|
2010-07-05 00:00:40 +00:00
|
|
|
return sce;
|
2002-10-12 11:37:38 +00:00
|
|
|
}
|
2010-07-05 00:00:40 +00:00
|
|
|
|
2010-10-18 06:41:16 +00:00
|
|
|
printf("Can't find scene: '%s' in file: '%s'\n", name, G.main->name);
|
2010-07-05 00:00:40 +00:00
|
|
|
return NULL;
|
2009-09-18 22:25:49 +00:00
|
|
|
}
|
|
|
|
|
|
2012-05-05 14:33:36 +00:00
|
|
|
void BKE_scene_unlink(Main *bmain, Scene *sce, Scene *newsce)
|
2009-09-18 22:25:49 +00:00
|
|
|
{
|
|
|
|
|
Scene *sce1;
|
|
|
|
|
bScreen *sc;
|
|
|
|
|
|
|
|
|
|
/* check all sets */
|
2012-05-06 15:15:33 +00:00
|
|
|
for (sce1 = bmain->scene.first; sce1; sce1 = sce1->id.next)
|
2012-02-23 02:17:50 +00:00
|
|
|
if (sce1->set == sce)
|
2012-05-06 15:15:33 +00:00
|
|
|
sce1->set = NULL;
|
2009-09-18 22:25:49 +00:00
|
|
|
|
|
|
|
|
/* check all sequences */
|
2012-08-08 11:15:40 +00:00
|
|
|
BKE_sequencer_clear_scene_in_allseqs(bmain, sce);
|
2009-09-18 22:25:49 +00:00
|
|
|
|
|
|
|
|
/* check render layer nodes in other scenes */
|
|
|
|
|
clear_scene_in_nodes(bmain, sce);
|
|
|
|
|
|
|
|
|
|
/* al screens */
|
2012-05-06 15:15:33 +00:00
|
|
|
for (sc = bmain->screen.first; sc; sc = sc->id.next)
|
2012-02-23 02:17:50 +00:00
|
|
|
if (sc->scene == sce)
|
2012-05-06 15:15:33 +00:00
|
|
|
sc->scene = newsce;
|
2009-09-18 22:25:49 +00:00
|
|
|
|
2012-05-05 14:03:12 +00:00
|
|
|
BKE_libblock_free(&bmain->scene, sce);
|
2002-10-12 11:37:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* used by metaballs
|
|
|
|
|
* doesnt return the original duplicated object, only dupli's
|
|
|
|
|
*/
|
2012-05-05 14:33:36 +00:00
|
|
|
int BKE_scene_base_iter_next(Scene **scene, int val, Base **base, Object **ob)
|
2002-10-12 11:37:38 +00:00
|
|
|
{
|
2012-05-06 15:15:33 +00:00
|
|
|
static ListBase *duplilist = NULL;
|
Big commit with work on Groups & Libraries:
-> Any Group Duplicate now can get local timing and local NLA override. This
enables to control the entire animation system of the Group.
Two methods for this have been implemented.
1) The quick way: just give the duplicator a "Startframe" offset.
2) Advanced: in the NLA Editor you can add ActionStrips to the duplicator
to override NLA/action of any Grouped Object.
For "Group NLA" to work, an ActionStrip needs to know which Object in a
group it controls. On adding a strip, the code checks if an Action was
already used by an Object in the Group, and assigns it automatic to that
Object.
You can also set this in the Nkey "Properties" panel for the strip.
Change in NLA: the SHIFT+A "Add strip" command now always adds strips to
the active Object. (It used to check where mouse was). This allows to add
NLA strips to Objects that didn't have actions/nla yet.
Important note: In Blender, duplicates are fully procedural and generated
on the fly for each redraw. This means that redraw speed equals to stepping
through frames, when using animated Duplicated Groups.
-> Recoded entire duplicator system
The old method was antique and clumsy, using globals and full temporal
copies of Object. The new system is nicer in control, faster, and since it
doesn't use temporal object copies anymore, it works better with Derived
Mesh and DisplayList and rendering.
By centralizing the code for duplicating, more options can be easier added.
Features to note:
- Duplicates now draw selected/unselected based on its Duplicator setting.
- Same goes for the drawtype (wire, solid, selection outline, etc)
- Duplicated Groups can be normally selected too
Bonus goodie: SHIFT+A (Toolbox) now has entry "Add group" too, with a
listing of all groups, allowing to add Group instances immediate.
-> Library System
- SHIFT+F4 data browse now shows the entire path for linked data
- Outliner draws Library Icons to denote linked data
- Outliner operation added: "Make Local" for library data.
- Outliner now also draws Groups in regular view, allowing to unlink too.
-> Fixes
- depsgraph missed signal update for bone-parented Objects
- on reading file, the entire database was tagged to "recalc" fully,
causing unnecessary slowdown on reading.
Might have missed stuff... :)
2005-12-11 13:23:30 +00:00
|
|
|
static DupliObject *dupob;
|
2012-05-06 15:15:33 +00:00
|
|
|
static int fase = F_START, in_next_object = 0;
|
|
|
|
|
int run_again = 1;
|
2002-10-12 11:37:38 +00:00
|
|
|
|
|
|
|
|
/* init */
|
2012-05-06 15:15:33 +00:00
|
|
|
if (val == 0) {
|
|
|
|
|
fase = F_START;
|
|
|
|
|
dupob = NULL;
|
2009-09-18 22:25:49 +00:00
|
|
|
|
|
|
|
|
/* XXX particle systems with metas+dupligroups call this recursively */
|
|
|
|
|
/* see bug #18725 */
|
2012-02-23 02:17:50 +00:00
|
|
|
if (in_next_object) {
|
2012-03-02 21:14:37 +00:00
|
|
|
printf("ERROR: Metaball generation called recursively, not supported\n");
|
2009-09-18 22:25:49 +00:00
|
|
|
|
|
|
|
|
return F_ERROR;
|
|
|
|
|
}
|
2002-10-12 11:37:38 +00:00
|
|
|
}
|
|
|
|
|
else {
|
2012-05-06 15:15:33 +00:00
|
|
|
in_next_object = 1;
|
2009-09-18 22:25:49 +00:00
|
|
|
|
2002-10-12 11:37:38 +00:00
|
|
|
/* run_again is set when a duplilist has been ended */
|
2012-02-23 02:17:50 +00:00
|
|
|
while (run_again) {
|
2012-05-06 15:15:33 +00:00
|
|
|
run_again = 0;
|
2004-01-04 22:10:36 +00:00
|
|
|
|
2003-04-26 13:07:59 +00:00
|
|
|
/* the first base */
|
2012-05-06 15:15:33 +00:00
|
|
|
if (fase == F_START) {
|
|
|
|
|
*base = (*scene)->base.first;
|
2012-02-23 02:17:50 +00:00
|
|
|
if (*base) {
|
2012-05-06 15:15:33 +00:00
|
|
|
*ob = (*base)->object;
|
|
|
|
|
fase = F_SCENE;
|
2002-10-12 11:37:38 +00:00
|
|
|
}
|
|
|
|
|
else {
|
2010-03-22 09:30:00 +00:00
|
|
|
/* exception: empty scene */
|
2012-02-23 02:17:50 +00:00
|
|
|
while ((*scene)->set) {
|
2012-05-06 15:15:33 +00:00
|
|
|
(*scene) = (*scene)->set;
|
2012-02-23 02:17:50 +00:00
|
|
|
if ((*scene)->base.first) {
|
2012-05-06 15:15:33 +00:00
|
|
|
*base = (*scene)->base.first;
|
|
|
|
|
*ob = (*base)->object;
|
|
|
|
|
fase = F_SCENE;
|
2010-07-13 16:06:51 +00:00
|
|
|
break;
|
|
|
|
|
}
|
2002-10-12 11:37:38 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else {
|
2012-05-06 15:15:33 +00:00
|
|
|
if (*base && fase != F_DUPLI) {
|
|
|
|
|
*base = (*base)->next;
|
|
|
|
|
if (*base) *ob = (*base)->object;
|
2002-10-12 11:37:38 +00:00
|
|
|
else {
|
2012-05-06 15:15:33 +00:00
|
|
|
if (fase == F_SCENE) {
|
2010-07-13 16:06:51 +00:00
|
|
|
/* (*scene) is finished, now do the set */
|
2012-02-23 02:17:50 +00:00
|
|
|
while ((*scene)->set) {
|
2012-05-06 15:15:33 +00:00
|
|
|
(*scene) = (*scene)->set;
|
2012-02-23 02:17:50 +00:00
|
|
|
if ((*scene)->base.first) {
|
2012-05-06 15:15:33 +00:00
|
|
|
*base = (*scene)->base.first;
|
|
|
|
|
*ob = (*base)->object;
|
2010-07-13 16:06:51 +00:00
|
|
|
break;
|
|
|
|
|
}
|
2002-10-12 11:37:38 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2012-05-06 15:15:33 +00:00
|
|
|
if (*base == NULL) fase = F_START;
|
2002-10-12 11:37:38 +00:00
|
|
|
else {
|
2012-05-06 15:15:33 +00:00
|
|
|
if (fase != F_DUPLI) {
|
2012-02-23 02:17:50 +00:00
|
|
|
if ( (*base)->object->transflag & OB_DUPLI) {
|
2006-11-03 12:38:21 +00:00
|
|
|
/* groups cannot be duplicated for mballs yet,
|
2012-03-03 20:19:11 +00:00
|
|
|
* this enters eternal loop because of
|
|
|
|
|
* makeDispListMBall getting called inside of group_duplilist */
|
2012-02-23 02:17:50 +00:00
|
|
|
if ((*base)->object->dup_group == NULL) {
|
2012-10-04 21:40:39 +00:00
|
|
|
duplilist = object_duplilist((*scene), (*base)->object, FALSE);
|
2006-11-03 12:38:21 +00:00
|
|
|
|
2012-05-06 15:15:33 +00:00
|
|
|
dupob = duplilist->first;
|
2008-04-12 14:30:17 +00:00
|
|
|
|
2012-02-23 02:17:50 +00:00
|
|
|
if (!dupob)
|
2008-04-12 14:30:17 +00:00
|
|
|
free_object_duplilist(duplilist);
|
2006-11-03 12:38:21 +00:00
|
|
|
}
|
2002-10-12 11:37:38 +00:00
|
|
|
}
|
|
|
|
|
}
|
2003-04-26 13:07:59 +00:00
|
|
|
/* handle dupli's */
|
2012-02-23 02:17:50 +00:00
|
|
|
if (dupob) {
|
2002-10-12 11:37:38 +00:00
|
|
|
|
2009-11-10 20:43:45 +00:00
|
|
|
copy_m4_m4(dupob->ob->obmat, dupob->mat);
|
Big commit with work on Groups & Libraries:
-> Any Group Duplicate now can get local timing and local NLA override. This
enables to control the entire animation system of the Group.
Two methods for this have been implemented.
1) The quick way: just give the duplicator a "Startframe" offset.
2) Advanced: in the NLA Editor you can add ActionStrips to the duplicator
to override NLA/action of any Grouped Object.
For "Group NLA" to work, an ActionStrip needs to know which Object in a
group it controls. On adding a strip, the code checks if an Action was
already used by an Object in the Group, and assigns it automatic to that
Object.
You can also set this in the Nkey "Properties" panel for the strip.
Change in NLA: the SHIFT+A "Add strip" command now always adds strips to
the active Object. (It used to check where mouse was). This allows to add
NLA strips to Objects that didn't have actions/nla yet.
Important note: In Blender, duplicates are fully procedural and generated
on the fly for each redraw. This means that redraw speed equals to stepping
through frames, when using animated Duplicated Groups.
-> Recoded entire duplicator system
The old method was antique and clumsy, using globals and full temporal
copies of Object. The new system is nicer in control, faster, and since it
doesn't use temporal object copies anymore, it works better with Derived
Mesh and DisplayList and rendering.
By centralizing the code for duplicating, more options can be easier added.
Features to note:
- Duplicates now draw selected/unselected based on its Duplicator setting.
- Same goes for the drawtype (wire, solid, selection outline, etc)
- Duplicated Groups can be normally selected too
Bonus goodie: SHIFT+A (Toolbox) now has entry "Add group" too, with a
listing of all groups, allowing to add Group instances immediate.
-> Library System
- SHIFT+F4 data browse now shows the entire path for linked data
- Outliner draws Library Icons to denote linked data
- Outliner operation added: "Make Local" for library data.
- Outliner now also draws Groups in regular view, allowing to unlink too.
-> Fixes
- depsgraph missed signal update for bone-parented Objects
- on reading file, the entire database was tagged to "recalc" fully,
causing unnecessary slowdown on reading.
Might have missed stuff... :)
2005-12-11 13:23:30 +00:00
|
|
|
|
|
|
|
|
(*base)->flag |= OB_FROMDUPLI;
|
2012-05-06 15:15:33 +00:00
|
|
|
*ob = dupob->ob;
|
|
|
|
|
fase = F_DUPLI;
|
2002-10-12 11:37:38 +00:00
|
|
|
|
2012-05-06 15:15:33 +00:00
|
|
|
dupob = dupob->next;
|
2002-10-12 11:37:38 +00:00
|
|
|
}
|
2012-05-06 15:15:33 +00:00
|
|
|
else if (fase == F_DUPLI) {
|
|
|
|
|
fase = F_SCENE;
|
Big commit with work on Groups & Libraries:
-> Any Group Duplicate now can get local timing and local NLA override. This
enables to control the entire animation system of the Group.
Two methods for this have been implemented.
1) The quick way: just give the duplicator a "Startframe" offset.
2) Advanced: in the NLA Editor you can add ActionStrips to the duplicator
to override NLA/action of any Grouped Object.
For "Group NLA" to work, an ActionStrip needs to know which Object in a
group it controls. On adding a strip, the code checks if an Action was
already used by an Object in the Group, and assigns it automatic to that
Object.
You can also set this in the Nkey "Properties" panel for the strip.
Change in NLA: the SHIFT+A "Add strip" command now always adds strips to
the active Object. (It used to check where mouse was). This allows to add
NLA strips to Objects that didn't have actions/nla yet.
Important note: In Blender, duplicates are fully procedural and generated
on the fly for each redraw. This means that redraw speed equals to stepping
through frames, when using animated Duplicated Groups.
-> Recoded entire duplicator system
The old method was antique and clumsy, using globals and full temporal
copies of Object. The new system is nicer in control, faster, and since it
doesn't use temporal object copies anymore, it works better with Derived
Mesh and DisplayList and rendering.
By centralizing the code for duplicating, more options can be easier added.
Features to note:
- Duplicates now draw selected/unselected based on its Duplicator setting.
- Same goes for the drawtype (wire, solid, selection outline, etc)
- Duplicated Groups can be normally selected too
Bonus goodie: SHIFT+A (Toolbox) now has entry "Add group" too, with a
listing of all groups, allowing to add Group instances immediate.
-> Library System
- SHIFT+F4 data browse now shows the entire path for linked data
- Outliner draws Library Icons to denote linked data
- Outliner operation added: "Make Local" for library data.
- Outliner now also draws Groups in regular view, allowing to unlink too.
-> Fixes
- depsgraph missed signal update for bone-parented Objects
- on reading file, the entire database was tagged to "recalc" fully,
causing unnecessary slowdown on reading.
Might have missed stuff... :)
2005-12-11 13:23:30 +00:00
|
|
|
(*base)->flag &= ~OB_FROMDUPLI;
|
|
|
|
|
|
2012-05-06 15:15:33 +00:00
|
|
|
for (dupob = duplilist->first; dupob; dupob = dupob->next) {
|
2009-11-10 20:43:45 +00:00
|
|
|
copy_m4_m4(dupob->ob->obmat, dupob->omat);
|
Big commit with work on Groups & Libraries:
-> Any Group Duplicate now can get local timing and local NLA override. This
enables to control the entire animation system of the Group.
Two methods for this have been implemented.
1) The quick way: just give the duplicator a "Startframe" offset.
2) Advanced: in the NLA Editor you can add ActionStrips to the duplicator
to override NLA/action of any Grouped Object.
For "Group NLA" to work, an ActionStrip needs to know which Object in a
group it controls. On adding a strip, the code checks if an Action was
already used by an Object in the Group, and assigns it automatic to that
Object.
You can also set this in the Nkey "Properties" panel for the strip.
Change in NLA: the SHIFT+A "Add strip" command now always adds strips to
the active Object. (It used to check where mouse was). This allows to add
NLA strips to Objects that didn't have actions/nla yet.
Important note: In Blender, duplicates are fully procedural and generated
on the fly for each redraw. This means that redraw speed equals to stepping
through frames, when using animated Duplicated Groups.
-> Recoded entire duplicator system
The old method was antique and clumsy, using globals and full temporal
copies of Object. The new system is nicer in control, faster, and since it
doesn't use temporal object copies anymore, it works better with Derived
Mesh and DisplayList and rendering.
By centralizing the code for duplicating, more options can be easier added.
Features to note:
- Duplicates now draw selected/unselected based on its Duplicator setting.
- Same goes for the drawtype (wire, solid, selection outline, etc)
- Duplicated Groups can be normally selected too
Bonus goodie: SHIFT+A (Toolbox) now has entry "Add group" too, with a
listing of all groups, allowing to add Group instances immediate.
-> Library System
- SHIFT+F4 data browse now shows the entire path for linked data
- Outliner draws Library Icons to denote linked data
- Outliner operation added: "Make Local" for library data.
- Outliner now also draws Groups in regular view, allowing to unlink too.
-> Fixes
- depsgraph missed signal update for bone-parented Objects
- on reading file, the entire database was tagged to "recalc" fully,
causing unnecessary slowdown on reading.
Might have missed stuff... :)
2005-12-11 13:23:30 +00:00
|
|
|
}
|
|
|
|
|
|
2006-02-02 19:31:15 +00:00
|
|
|
free_object_duplilist(duplilist);
|
2012-05-06 15:15:33 +00:00
|
|
|
duplilist = NULL;
|
|
|
|
|
run_again = 1;
|
2002-10-12 11:37:38 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2012-03-03 20:19:11 +00:00
|
|
|
|
|
|
|
|
#if 0
|
|
|
|
|
if (ob && *ob) {
|
2012-05-06 15:15:33 +00:00
|
|
|
printf("Scene: '%s', '%s'\n", (*scene)->id.name + 2, (*ob)->id.name + 2);
|
2012-03-03 20:19:11 +00:00
|
|
|
}
|
|
|
|
|
#endif
|
2010-07-13 16:06:51 +00:00
|
|
|
|
2009-09-18 22:25:49 +00:00
|
|
|
/* reset recursion test */
|
2012-05-06 15:15:33 +00:00
|
|
|
in_next_object = 0;
|
2009-09-18 22:25:49 +00:00
|
|
|
|
2002-10-12 11:37:38 +00:00
|
|
|
return fase;
|
|
|
|
|
}
|
|
|
|
|
|
2012-05-05 14:33:36 +00:00
|
|
|
Object *BKE_scene_camera_find(Scene *sc)
|
2002-10-12 11:37:38 +00:00
|
|
|
{
|
|
|
|
|
Base *base;
|
|
|
|
|
|
2012-05-06 15:15:33 +00:00
|
|
|
for (base = sc->base.first; base; base = base->next)
|
|
|
|
|
if (base->object->type == OB_CAMERA)
|
2002-10-12 11:37:38 +00:00
|
|
|
return base->object;
|
|
|
|
|
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
|
2009-12-16 19:49:33 +00:00
|
|
|
#ifdef DURIAN_CAMERA_SWITCH
|
2012-05-05 14:33:36 +00:00
|
|
|
Object *BKE_scene_camera_switch_find(Scene *scene)
|
2009-12-16 19:49:33 +00:00
|
|
|
{
|
|
|
|
|
TimeMarker *m;
|
|
|
|
|
int cfra = scene->r.cfra;
|
|
|
|
|
int frame = -(MAXFRAME + 1);
|
2012-05-06 15:15:33 +00:00
|
|
|
Object *camera = NULL;
|
2009-12-16 19:49:33 +00:00
|
|
|
|
2012-05-06 15:15:33 +00:00
|
|
|
for (m = scene->markers.first; m; m = m->next) {
|
|
|
|
|
if (m->camera && (m->camera->restrictflag & OB_RESTRICT_RENDER) == 0 && (m->frame <= cfra) && (m->frame > frame)) {
|
|
|
|
|
camera = m->camera;
|
|
|
|
|
frame = m->frame;
|
2009-12-16 19:49:33 +00:00
|
|
|
|
2012-02-23 02:17:50 +00:00
|
|
|
if (frame == cfra)
|
2009-12-16 19:49:33 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return camera;
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
2012-05-05 14:33:36 +00:00
|
|
|
int BKE_scene_camera_switch_update(Scene *scene)
|
2010-03-09 07:41:04 +00:00
|
|
|
{
|
|
|
|
|
#ifdef DURIAN_CAMERA_SWITCH
|
2012-05-06 15:15:33 +00:00
|
|
|
Object *camera = BKE_scene_camera_switch_find(scene);
|
2012-02-23 02:17:50 +00:00
|
|
|
if (camera) {
|
2012-05-06 15:15:33 +00:00
|
|
|
scene->camera = camera;
|
2010-03-09 07:41:04 +00:00
|
|
|
return 1;
|
|
|
|
|
}
|
2011-11-05 14:26:18 +00:00
|
|
|
#else
|
|
|
|
|
(void)scene;
|
2010-03-09 07:41:04 +00:00
|
|
|
#endif
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
2012-05-05 14:33:36 +00:00
|
|
|
char *BKE_scene_find_marker_name(Scene *scene, int frame)
|
2009-12-16 19:49:33 +00:00
|
|
|
{
|
2012-05-06 15:15:33 +00:00
|
|
|
ListBase *markers = &scene->markers;
|
2009-12-16 19:49:33 +00:00
|
|
|
TimeMarker *m1, *m2;
|
|
|
|
|
|
|
|
|
|
/* search through markers for match */
|
2012-05-06 15:15:33 +00:00
|
|
|
for (m1 = markers->first, m2 = markers->last; m1 && m2; m1 = m1->next, m2 = m2->prev) {
|
|
|
|
|
if (m1->frame == frame)
|
2009-12-16 19:49:33 +00:00
|
|
|
return m1->name;
|
|
|
|
|
|
|
|
|
|
if (m1 == m2)
|
|
|
|
|
break;
|
|
|
|
|
|
2012-05-06 15:15:33 +00:00
|
|
|
if (m2->frame == frame)
|
2009-12-16 19:49:33 +00:00
|
|
|
return m2->name;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
2002-10-12 11:37:38 +00:00
|
|
|
|
2010-02-06 14:56:25 +00:00
|
|
|
/* return the current marker for this frame,
|
2012-03-03 20:19:11 +00:00
|
|
|
* we can have more then 1 marker per frame, this just returns the first :/ */
|
2012-05-05 14:33:36 +00:00
|
|
|
char *BKE_scene_find_last_marker_name(Scene *scene, int frame)
|
2010-02-06 14:56:25 +00:00
|
|
|
{
|
|
|
|
|
TimeMarker *marker, *best_marker = NULL;
|
2012-05-06 15:15:33 +00:00
|
|
|
int best_frame = -MAXFRAME * 2;
|
|
|
|
|
for (marker = scene->markers.first; marker; marker = marker->next) {
|
|
|
|
|
if (marker->frame == frame) {
|
2010-02-07 09:52:43 +00:00
|
|
|
return marker->name;
|
2010-02-06 14:56:25 +00:00
|
|
|
}
|
|
|
|
|
|
2012-05-06 15:15:33 +00:00
|
|
|
if (marker->frame > best_frame && marker->frame < frame) {
|
2010-02-06 14:56:25 +00:00
|
|
|
best_marker = marker;
|
|
|
|
|
best_frame = marker->frame;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return best_marker ? best_marker->name : NULL;
|
|
|
|
|
}
|
|
|
|
|
|
2010-11-18 05:05:06 +00:00
|
|
|
|
2012-05-05 14:33:36 +00:00
|
|
|
Base *BKE_scene_base_add(Scene *sce, Object *ob)
|
2002-10-12 11:37:38 +00:00
|
|
|
{
|
2012-05-06 15:15:33 +00:00
|
|
|
Base *b = MEM_callocN(sizeof(*b), "BKE_scene_base_add");
|
2002-10-12 11:37:38 +00:00
|
|
|
BLI_addhead(&sce->base, b);
|
|
|
|
|
|
2012-05-06 15:15:33 +00:00
|
|
|
b->object = ob;
|
|
|
|
|
b->flag = ob->flag;
|
|
|
|
|
b->lay = ob->lay;
|
2002-10-12 11:37:38 +00:00
|
|
|
|
|
|
|
|
return b;
|
|
|
|
|
}
|
|
|
|
|
|
2013-01-26 17:38:45 +00:00
|
|
|
void BKE_scene_base_unlink(Scene *sce, Base *base)
|
2013-01-23 05:56:22 +00:00
|
|
|
{
|
2013-01-23 05:56:56 +00:00
|
|
|
/* remove rigid body constraint from world before removing object */
|
|
|
|
|
if (base->object->rigidbody_constraint)
|
|
|
|
|
BKE_rigidbody_remove_constraint(sce, base->object);
|
2013-01-23 05:56:22 +00:00
|
|
|
/* remove rigid body object from world before removing object */
|
|
|
|
|
if (base->object->rigidbody_object)
|
|
|
|
|
BKE_rigidbody_remove_object(sce, base->object);
|
|
|
|
|
|
|
|
|
|
BLI_remlink(&sce->base, base);
|
|
|
|
|
}
|
|
|
|
|
|
2012-05-05 14:33:36 +00:00
|
|
|
void BKE_scene_base_deselect_all(Scene *sce)
|
2002-10-12 11:37:38 +00:00
|
|
|
{
|
|
|
|
|
Base *b;
|
|
|
|
|
|
2012-05-06 15:15:33 +00:00
|
|
|
for (b = sce->base.first; b; b = b->next) {
|
|
|
|
|
b->flag &= ~SELECT;
|
|
|
|
|
b->object->flag = b->flag;
|
2002-10-12 11:37:38 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2012-05-05 14:33:36 +00:00
|
|
|
void BKE_scene_base_select(Scene *sce, Base *selbase)
|
2002-10-12 11:37:38 +00:00
|
|
|
{
|
|
|
|
|
selbase->flag |= SELECT;
|
2012-05-06 15:15:33 +00:00
|
|
|
selbase->object->flag = selbase->flag;
|
2002-10-12 11:37:38 +00:00
|
|
|
|
2012-05-06 15:15:33 +00:00
|
|
|
sce->basact = selbase;
|
2002-10-12 11:37:38 +00:00
|
|
|
}
|
Result of 2 weeks of quiet coding work in Greece :)
Aim was to get a total refresh of the animation system. This
is needed because;
- we need to upgrade it with 21st century features
- current code is spaghetti/hack combo, and hides good design
- it should become lag-free with using dependency graphs
A full log, with complete code API/structure/design explanation
will follow, that's a load of work... so here below the list with
hot changes;
- The entire object update system (matrices, geometry) is now
centralized. Calls to where_is_object and makeDispList are
forbidden, instead we tag objects 'changed' and let the
depgraph code sort it out
- Removed all old "Ika" code
- Depgraph is aware of all relationships, including meta balls,
constraints, bevelcurve, and so on.
- Made depgraph aware of relation types and layers, to do smart
flushing of 'changed' events. Nothing gets calculated too often!
- Transform uses depgraph to detect changes
- On frame-advance, depgraph flushes animated changes
Armatures;
Almost all armature related code has been fully built from scratch.
It now reveils the original design much better, with a very clean
implementation, lag free without even calculating each Bone more than
once. Result is quite a speedup yes!
Important to note is;
1) Armature is data containing the 'rest position'
2) Pose is the changes of rest position, and always on object level.
That way more Objects can use same Pose. Also constraints are in Pose
3) Actions only contain the Ipos to change values in Poses.
- Bones draw unrotated now
- Drawing bones speedup enormously (10-20 times)
- Bone selecting in EditMode, selection state is saved for PoseMode,
and vice-versa
- Undo in editmode
- Bone renaming does vertexgroups, constraints, posechannels, actions,
for all users of Armature in entire file
- Added Bone renaming in NKey panel
- Nkey PoseMode shows eulers now
- EditMode and PoseMode now have 'active' bone too (last clicked)
- Parenting in EditMode' CTRL+P, ALT+P, with nice options!
- Pose is added in Outliner now, with showing that constraints are in
the Pose, not Armature
- Disconnected IK solving from constraints. It's a separate phase now,
on top of the full Pose calculations
- Pose itself has a dependency graph too, so evaluation order is lag free.
TODO NOW;
- Rotating in Posemode has incorrect inverse transform (Martin will fix)
- Python Bone/Armature/Pose API disabled... needs full recode too
(wait for my doc!)
- Game engine will need upgrade too
- Depgraph code needs revision, cleanup, can be much faster!
(But, compliments for Jean-Luc, it works like a charm!)
- IK changed, it now doesnt use previous position to advance to next
position anymore. That system looks nice (no flips) but is not well
suited for NLA and background render.
TODO LATER;
We now can do loadsa new nifty features as well; like:
- Kill PoseMode (can be option for armatures itself)
- Make B-Bones (Bezier, Bspline, like for spines)
- Move all silly button level edit to 3d window (like CTRL+I = add
IK)
- Much better & informative drawing
- Fix action/nla editors
- Put all ipos in Actions (object, mesh key, lamp color)
- Add hooks
- Null bones
- Much more advanced constraints...
Bugfixes;
- OGL render (view3d header) had wrong first frame on anim render
- Ipo 'recording' mode had wrong playback speed
- Vertex-key mode now sticks to show 'active key', until frame change
-Ton-
2005-07-03 17:35:38 +00:00
|
|
|
|
2006-05-15 10:46:04 +00:00
|
|
|
/* checks for cycle, returns 1 if it's all OK */
|
2012-05-05 14:33:36 +00:00
|
|
|
int BKE_scene_validate_setscene(Main *bmain, Scene *sce)
|
2006-05-15 10:46:04 +00:00
|
|
|
{
|
|
|
|
|
Scene *scene;
|
2008-02-29 13:29:15 +00:00
|
|
|
int a, totscene;
|
2006-05-15 10:46:04 +00:00
|
|
|
|
2012-05-06 15:15:33 +00:00
|
|
|
if (sce->set == NULL) return 1;
|
2006-05-15 10:46:04 +00:00
|
|
|
|
2012-05-06 15:15:33 +00:00
|
|
|
totscene = 0;
|
|
|
|
|
for (scene = bmain->scene.first; scene; scene = scene->id.next)
|
2008-02-29 13:29:15 +00:00
|
|
|
totscene++;
|
|
|
|
|
|
2012-05-06 15:15:33 +00:00
|
|
|
for (a = 0, scene = sce; scene->set; scene = scene->set, a++) {
|
2008-02-29 13:29:15 +00:00
|
|
|
/* more iterations than scenes means we have a cycle */
|
2012-02-23 02:17:50 +00:00
|
|
|
if (a > totscene) {
|
2008-02-29 13:29:15 +00:00
|
|
|
/* the tested scene gets zero'ed, that's typically current scene */
|
2012-05-06 15:15:33 +00:00
|
|
|
sce->set = NULL;
|
2008-02-29 13:29:15 +00:00
|
|
|
return 0;
|
|
|
|
|
}
|
2006-05-15 10:46:04 +00:00
|
|
|
}
|
2008-02-29 13:29:15 +00:00
|
|
|
|
2006-05-15 10:46:04 +00:00
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
|
2010-06-27 05:39:55 +00:00
|
|
|
/* This function is needed to cope with fractional frames - including two Blender rendering features
|
2011-11-06 06:08:18 +00:00
|
|
|
* mblur (motion blur that renders 'subframes' and blurs them together), and fields rendering.
|
|
|
|
|
*/
|
2012-05-05 14:33:36 +00:00
|
|
|
float BKE_scene_frame_get(Scene *scene)
|
2009-09-18 22:25:49 +00:00
|
|
|
{
|
2012-05-05 14:33:36 +00:00
|
|
|
return BKE_scene_frame_get_from_ctime(scene, scene->r.cfra);
|
2011-11-06 06:08:18 +00:00
|
|
|
}
|
2010-06-27 05:39:55 +00:00
|
|
|
|
2011-11-06 12:12:14 +00:00
|
|
|
/* This function is used to obtain arbitrary fractional frames */
|
2012-05-05 14:33:36 +00:00
|
|
|
float BKE_scene_frame_get_from_ctime(Scene *scene, const float frame)
|
2011-11-06 06:08:18 +00:00
|
|
|
{
|
2011-11-06 12:12:14 +00:00
|
|
|
float ctime = frame;
|
2011-11-06 06:08:18 +00:00
|
|
|
ctime += scene->r.subframe;
|
2012-10-21 05:46:41 +00:00
|
|
|
ctime *= scene->r.framelen;
|
2011-11-06 12:12:14 +00:00
|
|
|
|
2009-09-18 22:25:49 +00:00
|
|
|
return ctime;
|
|
|
|
|
}
|
|
|
|
|
|
2011-02-07 12:28:04 +00:00
|
|
|
/* drivers support/hacks
|
2012-05-06 15:15:33 +00:00
|
|
|
* - this method is called from scene_update_tagged_recursive(), so gets included in viewport + render
|
2011-02-07 12:28:04 +00:00
|
|
|
* - these are always run since the depsgraph can't handle non-object data
|
|
|
|
|
* - these happen after objects are all done so that we can read in their final transform values,
|
|
|
|
|
* though this means that objects can't refer to scene info for guidance...
|
|
|
|
|
*/
|
|
|
|
|
static void scene_update_drivers(Main *UNUSED(bmain), Scene *scene)
|
|
|
|
|
{
|
2012-05-05 14:33:36 +00:00
|
|
|
float ctime = BKE_scene_frame_get(scene);
|
2011-02-07 12:28:04 +00:00
|
|
|
|
|
|
|
|
/* scene itself */
|
|
|
|
|
if (scene->adt && scene->adt->drivers.first) {
|
== RNA Property Updates get called by Animation System now ==
This fixes bug #26764 and several others like it, where modifier
properties (and others, but most visibly modifiers) would not do
anything when animated or driven, as modifier properties require the
RNA update calls to tag the modifiers to get recalculated.
While just adding a call to RNA_property_update() could have gotten
this working (as per the Campbell's patch attached in the report, and
also my own attempt #25881). However, on production rigs, the
performance cost of this is untenatable (on my own tests, without
these updates, I was getting ~5fps on such a rig, but only 0.9fps or
possibly even worse with the updates added).
Hence, this commit adds a property-update caching system to the RNA
level, which aims to reduce to the number of times that the update
functions end up needing to get called.
While this is much faster than without the caching, I also added an
optimisation for pose bones (which are numerous in production rigs) so
that their property updates are skipped, since they are useless to the
animsys (they only tag the depsgraph for updating). This gets things
moving at a more acceptable framerate.
2011-07-24 04:34:46 +00:00
|
|
|
BKE_animsys_evaluate_animdata(scene, &scene->id, scene->adt, ctime, ADT_RECALC_DRIVERS);
|
2011-02-07 12:28:04 +00:00
|
|
|
}
|
2012-07-06 23:56:59 +00:00
|
|
|
|
2011-02-07 12:28:04 +00:00
|
|
|
/* world */
|
2012-07-06 23:56:59 +00:00
|
|
|
/* TODO: what about world textures? but then those have nodes too... */
|
2011-02-07 12:28:04 +00:00
|
|
|
if (scene->world) {
|
|
|
|
|
ID *wid = (ID *)scene->world;
|
2012-05-06 15:15:33 +00:00
|
|
|
AnimData *adt = BKE_animdata_from_id(wid);
|
2011-02-07 12:28:04 +00:00
|
|
|
|
|
|
|
|
if (adt && adt->drivers.first)
|
== RNA Property Updates get called by Animation System now ==
This fixes bug #26764 and several others like it, where modifier
properties (and others, but most visibly modifiers) would not do
anything when animated or driven, as modifier properties require the
RNA update calls to tag the modifiers to get recalculated.
While just adding a call to RNA_property_update() could have gotten
this working (as per the Campbell's patch attached in the report, and
also my own attempt #25881). However, on production rigs, the
performance cost of this is untenatable (on my own tests, without
these updates, I was getting ~5fps on such a rig, but only 0.9fps or
possibly even worse with the updates added).
Hence, this commit adds a property-update caching system to the RNA
level, which aims to reduce to the number of times that the update
functions end up needing to get called.
While this is much faster than without the caching, I also added an
optimisation for pose bones (which are numerous in production rigs) so
that their property updates are skipped, since they are useless to the
animsys (they only tag the depsgraph for updating). This gets things
moving at a more acceptable framerate.
2011-07-24 04:34:46 +00:00
|
|
|
BKE_animsys_evaluate_animdata(scene, wid, adt, ctime, ADT_RECALC_DRIVERS);
|
2011-02-07 12:28:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* nodes */
|
|
|
|
|
if (scene->nodetree) {
|
|
|
|
|
ID *nid = (ID *)scene->nodetree;
|
2012-05-06 15:15:33 +00:00
|
|
|
AnimData *adt = BKE_animdata_from_id(nid);
|
2011-02-07 12:28:04 +00:00
|
|
|
|
|
|
|
|
if (adt && adt->drivers.first)
|
== RNA Property Updates get called by Animation System now ==
This fixes bug #26764 and several others like it, where modifier
properties (and others, but most visibly modifiers) would not do
anything when animated or driven, as modifier properties require the
RNA update calls to tag the modifiers to get recalculated.
While just adding a call to RNA_property_update() could have gotten
this working (as per the Campbell's patch attached in the report, and
also my own attempt #25881). However, on production rigs, the
performance cost of this is untenatable (on my own tests, without
these updates, I was getting ~5fps on such a rig, but only 0.9fps or
possibly even worse with the updates added).
Hence, this commit adds a property-update caching system to the RNA
level, which aims to reduce to the number of times that the update
functions end up needing to get called.
While this is much faster than without the caching, I also added an
optimisation for pose bones (which are numerous in production rigs) so
that their property updates are skipped, since they are useless to the
animsys (they only tag the depsgraph for updating). This gets things
moving at a more acceptable framerate.
2011-07-24 04:34:46 +00:00
|
|
|
BKE_animsys_evaluate_animdata(scene, nid, adt, ctime, ADT_RECALC_DRIVERS);
|
2011-02-07 12:28:04 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2013-01-10 18:20:29 +00:00
|
|
|
/* deps hack - do extra recalcs at end */
|
|
|
|
|
static void scene_depsgraph_hack(Scene *scene, Scene *scene_parent)
|
|
|
|
|
{
|
|
|
|
|
Base *base;
|
|
|
|
|
|
|
|
|
|
scene->customdata_mask = scene_parent->customdata_mask;
|
|
|
|
|
|
|
|
|
|
/* sets first, we allow per definition current scene to have
|
|
|
|
|
* dependencies on sets, but not the other way around. */
|
|
|
|
|
if (scene->set)
|
|
|
|
|
scene_depsgraph_hack(scene->set, scene_parent);
|
|
|
|
|
|
|
|
|
|
for (base = scene->base.first; base; base = base->next) {
|
|
|
|
|
Object *ob = base->object;
|
|
|
|
|
|
|
|
|
|
if (ob->depsflag) {
|
|
|
|
|
int recalc = 0;
|
|
|
|
|
// printf("depshack %s\n", ob->id.name+2);
|
|
|
|
|
|
|
|
|
|
if (ob->depsflag & OB_DEPS_EXTRA_OB_RECALC)
|
|
|
|
|
recalc |= OB_RECALC_OB;
|
|
|
|
|
if (ob->depsflag & OB_DEPS_EXTRA_DATA_RECALC)
|
|
|
|
|
recalc |= OB_RECALC_DATA;
|
|
|
|
|
|
|
|
|
|
ob->recalc |= recalc;
|
|
|
|
|
BKE_object_handle_update(scene_parent, ob);
|
|
|
|
|
|
|
|
|
|
if (ob->dup_group && (ob->transflag & OB_DUPLIGROUP)) {
|
|
|
|
|
GroupObject *go;
|
|
|
|
|
|
|
|
|
|
for (go = ob->dup_group->gobject.first; go; go = go->next) {
|
|
|
|
|
if (go->ob)
|
|
|
|
|
go->ob->recalc |= recalc;
|
|
|
|
|
}
|
|
|
|
|
group_handle_recalc_and_update(scene_parent, ob, ob->dup_group);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
2010-08-01 12:47:49 +00:00
|
|
|
static void scene_update_tagged_recursive(Main *bmain, Scene *scene, Scene *scene_parent)
|
Result of 2 weeks of quiet coding work in Greece :)
Aim was to get a total refresh of the animation system. This
is needed because;
- we need to upgrade it with 21st century features
- current code is spaghetti/hack combo, and hides good design
- it should become lag-free with using dependency graphs
A full log, with complete code API/structure/design explanation
will follow, that's a load of work... so here below the list with
hot changes;
- The entire object update system (matrices, geometry) is now
centralized. Calls to where_is_object and makeDispList are
forbidden, instead we tag objects 'changed' and let the
depgraph code sort it out
- Removed all old "Ika" code
- Depgraph is aware of all relationships, including meta balls,
constraints, bevelcurve, and so on.
- Made depgraph aware of relation types and layers, to do smart
flushing of 'changed' events. Nothing gets calculated too often!
- Transform uses depgraph to detect changes
- On frame-advance, depgraph flushes animated changes
Armatures;
Almost all armature related code has been fully built from scratch.
It now reveils the original design much better, with a very clean
implementation, lag free without even calculating each Bone more than
once. Result is quite a speedup yes!
Important to note is;
1) Armature is data containing the 'rest position'
2) Pose is the changes of rest position, and always on object level.
That way more Objects can use same Pose. Also constraints are in Pose
3) Actions only contain the Ipos to change values in Poses.
- Bones draw unrotated now
- Drawing bones speedup enormously (10-20 times)
- Bone selecting in EditMode, selection state is saved for PoseMode,
and vice-versa
- Undo in editmode
- Bone renaming does vertexgroups, constraints, posechannels, actions,
for all users of Armature in entire file
- Added Bone renaming in NKey panel
- Nkey PoseMode shows eulers now
- EditMode and PoseMode now have 'active' bone too (last clicked)
- Parenting in EditMode' CTRL+P, ALT+P, with nice options!
- Pose is added in Outliner now, with showing that constraints are in
the Pose, not Armature
- Disconnected IK solving from constraints. It's a separate phase now,
on top of the full Pose calculations
- Pose itself has a dependency graph too, so evaluation order is lag free.
TODO NOW;
- Rotating in Posemode has incorrect inverse transform (Martin will fix)
- Python Bone/Armature/Pose API disabled... needs full recode too
(wait for my doc!)
- Game engine will need upgrade too
- Depgraph code needs revision, cleanup, can be much faster!
(But, compliments for Jean-Luc, it works like a charm!)
- IK changed, it now doesnt use previous position to advance to next
position anymore. That system looks nice (no flips) but is not well
suited for NLA and background render.
TODO LATER;
We now can do loadsa new nifty features as well; like:
- Kill PoseMode (can be option for armatures itself)
- Make B-Bones (Bezier, Bspline, like for spines)
- Move all silly button level edit to 3d window (like CTRL+I = add
IK)
- Much better & informative drawing
- Fix action/nla editors
- Put all ipos in Actions (object, mesh key, lamp color)
- Add hooks
- Null bones
- Much more advanced constraints...
Bugfixes;
- OGL render (view3d header) had wrong first frame on anim render
- Ipo 'recording' mode had wrong playback speed
- Vertex-key mode now sticks to show 'active key', until frame change
-Ton-
2005-07-03 17:35:38 +00:00
|
|
|
{
|
|
|
|
|
Base *base;
|
2011-02-07 12:28:04 +00:00
|
|
|
|
|
|
|
|
|
2012-05-06 15:15:33 +00:00
|
|
|
scene->customdata_mask = scene_parent->customdata_mask;
|
2010-06-18 14:14:13 +00:00
|
|
|
|
|
|
|
|
/* sets first, we allow per definition current scene to have
|
2012-03-03 20:19:11 +00:00
|
|
|
* dependencies on sets, but not the other way around. */
|
2011-02-07 12:28:04 +00:00
|
|
|
if (scene->set)
|
2010-08-01 12:47:49 +00:00
|
|
|
scene_update_tagged_recursive(bmain, scene->set, scene_parent);
|
2011-02-07 12:28:04 +00:00
|
|
|
|
|
|
|
|
/* scene objects */
|
2012-05-06 15:15:33 +00:00
|
|
|
for (base = scene->base.first; base; base = base->next) {
|
|
|
|
|
Object *ob = base->object;
|
2011-02-07 12:28:04 +00:00
|
|
|
|
2012-05-05 14:03:12 +00:00
|
|
|
BKE_object_handle_update(scene_parent, ob);
|
2011-02-07 12:28:04 +00:00
|
|
|
|
2012-02-23 02:17:50 +00:00
|
|
|
if (ob->dup_group && (ob->transflag & OB_DUPLIGROUP))
|
2010-06-18 14:14:13 +00:00
|
|
|
group_handle_recalc_and_update(scene_parent, ob, ob->dup_group);
|
2010-07-05 01:11:25 +00:00
|
|
|
|
2012-11-06 18:07:17 +00:00
|
|
|
/* always update layer, so that animating layers works (joshua july 2010) */
|
|
|
|
|
/* XXX commented out, this has depsgraph issues anyway - and this breaks setting scenes
|
2012-11-18 01:22:31 +00:00
|
|
|
* (on scene-set, the base-lay is copied to ob-lay (ton nov 2012) */
|
2012-11-06 18:07:17 +00:00
|
|
|
// base->lay = ob->lay;
|
Result of 2 weeks of quiet coding work in Greece :)
Aim was to get a total refresh of the animation system. This
is needed because;
- we need to upgrade it with 21st century features
- current code is spaghetti/hack combo, and hides good design
- it should become lag-free with using dependency graphs
A full log, with complete code API/structure/design explanation
will follow, that's a load of work... so here below the list with
hot changes;
- The entire object update system (matrices, geometry) is now
centralized. Calls to where_is_object and makeDispList are
forbidden, instead we tag objects 'changed' and let the
depgraph code sort it out
- Removed all old "Ika" code
- Depgraph is aware of all relationships, including meta balls,
constraints, bevelcurve, and so on.
- Made depgraph aware of relation types and layers, to do smart
flushing of 'changed' events. Nothing gets calculated too often!
- Transform uses depgraph to detect changes
- On frame-advance, depgraph flushes animated changes
Armatures;
Almost all armature related code has been fully built from scratch.
It now reveils the original design much better, with a very clean
implementation, lag free without even calculating each Bone more than
once. Result is quite a speedup yes!
Important to note is;
1) Armature is data containing the 'rest position'
2) Pose is the changes of rest position, and always on object level.
That way more Objects can use same Pose. Also constraints are in Pose
3) Actions only contain the Ipos to change values in Poses.
- Bones draw unrotated now
- Drawing bones speedup enormously (10-20 times)
- Bone selecting in EditMode, selection state is saved for PoseMode,
and vice-versa
- Undo in editmode
- Bone renaming does vertexgroups, constraints, posechannels, actions,
for all users of Armature in entire file
- Added Bone renaming in NKey panel
- Nkey PoseMode shows eulers now
- EditMode and PoseMode now have 'active' bone too (last clicked)
- Parenting in EditMode' CTRL+P, ALT+P, with nice options!
- Pose is added in Outliner now, with showing that constraints are in
the Pose, not Armature
- Disconnected IK solving from constraints. It's a separate phase now,
on top of the full Pose calculations
- Pose itself has a dependency graph too, so evaluation order is lag free.
TODO NOW;
- Rotating in Posemode has incorrect inverse transform (Martin will fix)
- Python Bone/Armature/Pose API disabled... needs full recode too
(wait for my doc!)
- Game engine will need upgrade too
- Depgraph code needs revision, cleanup, can be much faster!
(But, compliments for Jean-Luc, it works like a charm!)
- IK changed, it now doesnt use previous position to advance to next
position anymore. That system looks nice (no flips) but is not well
suited for NLA and background render.
TODO LATER;
We now can do loadsa new nifty features as well; like:
- Kill PoseMode (can be option for armatures itself)
- Make B-Bones (Bezier, Bspline, like for spines)
- Move all silly button level edit to 3d window (like CTRL+I = add
IK)
- Much better & informative drawing
- Fix action/nla editors
- Put all ipos in Actions (object, mesh key, lamp color)
- Add hooks
- Null bones
- Much more advanced constraints...
Bugfixes;
- OGL render (view3d header) had wrong first frame on anim render
- Ipo 'recording' mode had wrong playback speed
- Vertex-key mode now sticks to show 'active key', until frame change
-Ton-
2005-07-03 17:35:38 +00:00
|
|
|
}
|
2011-02-07 12:28:04 +00:00
|
|
|
|
|
|
|
|
/* scene drivers... */
|
|
|
|
|
scene_update_drivers(bmain, scene);
|
2011-08-09 08:38:14 +00:00
|
|
|
|
|
|
|
|
/* update sound system animation */
|
2011-08-28 14:21:44 +00:00
|
|
|
sound_update_scene(scene);
|
2012-06-04 16:42:58 +00:00
|
|
|
|
|
|
|
|
/* update masking curves */
|
|
|
|
|
BKE_mask_update_scene(bmain, scene, FALSE);
|
2013-01-10 18:20:29 +00:00
|
|
|
|
Result of 2 weeks of quiet coding work in Greece :)
Aim was to get a total refresh of the animation system. This
is needed because;
- we need to upgrade it with 21st century features
- current code is spaghetti/hack combo, and hides good design
- it should become lag-free with using dependency graphs
A full log, with complete code API/structure/design explanation
will follow, that's a load of work... so here below the list with
hot changes;
- The entire object update system (matrices, geometry) is now
centralized. Calls to where_is_object and makeDispList are
forbidden, instead we tag objects 'changed' and let the
depgraph code sort it out
- Removed all old "Ika" code
- Depgraph is aware of all relationships, including meta balls,
constraints, bevelcurve, and so on.
- Made depgraph aware of relation types and layers, to do smart
flushing of 'changed' events. Nothing gets calculated too often!
- Transform uses depgraph to detect changes
- On frame-advance, depgraph flushes animated changes
Armatures;
Almost all armature related code has been fully built from scratch.
It now reveils the original design much better, with a very clean
implementation, lag free without even calculating each Bone more than
once. Result is quite a speedup yes!
Important to note is;
1) Armature is data containing the 'rest position'
2) Pose is the changes of rest position, and always on object level.
That way more Objects can use same Pose. Also constraints are in Pose
3) Actions only contain the Ipos to change values in Poses.
- Bones draw unrotated now
- Drawing bones speedup enormously (10-20 times)
- Bone selecting in EditMode, selection state is saved for PoseMode,
and vice-versa
- Undo in editmode
- Bone renaming does vertexgroups, constraints, posechannels, actions,
for all users of Armature in entire file
- Added Bone renaming in NKey panel
- Nkey PoseMode shows eulers now
- EditMode and PoseMode now have 'active' bone too (last clicked)
- Parenting in EditMode' CTRL+P, ALT+P, with nice options!
- Pose is added in Outliner now, with showing that constraints are in
the Pose, not Armature
- Disconnected IK solving from constraints. It's a separate phase now,
on top of the full Pose calculations
- Pose itself has a dependency graph too, so evaluation order is lag free.
TODO NOW;
- Rotating in Posemode has incorrect inverse transform (Martin will fix)
- Python Bone/Armature/Pose API disabled... needs full recode too
(wait for my doc!)
- Game engine will need upgrade too
- Depgraph code needs revision, cleanup, can be much faster!
(But, compliments for Jean-Luc, it works like a charm!)
- IK changed, it now doesnt use previous position to advance to next
position anymore. That system looks nice (no flips) but is not well
suited for NLA and background render.
TODO LATER;
We now can do loadsa new nifty features as well; like:
- Kill PoseMode (can be option for armatures itself)
- Make B-Bones (Bezier, Bspline, like for spines)
- Move all silly button level edit to 3d window (like CTRL+I = add
IK)
- Much better & informative drawing
- Fix action/nla editors
- Put all ipos in Actions (object, mesh key, lamp color)
- Add hooks
- Null bones
- Much more advanced constraints...
Bugfixes;
- OGL render (view3d header) had wrong first frame on anim render
- Ipo 'recording' mode had wrong playback speed
- Vertex-key mode now sticks to show 'active key', until frame change
-Ton-
2005-07-03 17:35:38 +00:00
|
|
|
}
|
Orange; more render & compo stuff!
-> Rendering in RenderLayers
It's important to distinguish a 'render layer' from a 'pass'. The first is
control over the main pipeline itself, to indicate what geometry is being
is rendered. The 'pass' (not in this commit!) is related to internal
shading code, like shadow/spec/AO/normals/etc.
Options for RenderLayers now are:
- Indicate which 3d 'view layers' have to be included (so you can render
front and back separately)
- "Solid", all solid faces, includes sky at the moment too
- "ZTransp", all transparent faces
- "Halo", the halos
- "Strand", the particle strands (not coded yet...)
Currently only 2 'passes' are exported for render, which is the "Combined"
buffer and the "Z. The latter now works, and can be turned on/off.
Note that all layers are still fully kept in memory now, saving the tiles
and layers to disk (in exr) is also todo.
-> New Blur options
The existing Blur Node (compositor) now has an optional input image. This
has to be a 'value buffer', which can be a Zbuffer, or any mask you can
think of. The input values have to be in the 0-1 range, so another new
node was added too "Map Value".
The value input can also be used to tweak blur size with the (todo)
Time Node.
Temporal screenies:
http://www.blender.org/bf/rt.jpg
http://www.blender.org/bf/rt1.jpg
http://www.blender.org/bf/rt2.jpg
BTW: The compositor is very slow still, it recalulates all nodes on each
change still. Persistant memory and dependency checks is coming!
2006-01-26 22:18:46 +00:00
|
|
|
|
2009-12-10 11:08:38 +00:00
|
|
|
/* this is called in main loop, doing tagged updates before redraw */
|
2012-05-05 14:33:36 +00:00
|
|
|
void BKE_scene_update_tagged(Main *bmain, Scene *scene)
|
2009-12-10 11:08:38 +00:00
|
|
|
{
|
2011-11-03 16:41:48 +00:00
|
|
|
/* keep this first */
|
2012-05-05 00:23:55 +00:00
|
|
|
BLI_callback_exec(bmain, &scene->id, BLI_CB_EVT_SCENE_UPDATE_PRE);
|
2011-11-02 20:56:52 +00:00
|
|
|
|
2011-11-03 16:41:48 +00:00
|
|
|
/* flush recalc flags to dependencies */
|
2010-12-05 18:59:23 +00:00
|
|
|
DAG_ids_flush_tagged(bmain);
|
|
|
|
|
|
2012-10-23 14:07:32 +00:00
|
|
|
/* removed calls to quick_cache, see pointcache.c */
|
Bugfix [#32017] Infinite recursion in depsgraph material/node driver handling
When initially coding this functionality, I was aware of the potential for
infinite recursion here, just not how frequently such setups are actually
used/created out in the wild (nodetree.ma_node -> ma -> ma.nodetree is all too
common, and often even with several levels of indirection!).
However, the best fix for these problems was not immediately clear. Alternatives
considered included...
1) checking for common recursive cases. This was the solution employed for one
of the early patches committed to try and get around this. However, it's all too
easy to defeat these measures (with all the possible combinations of indirection
node groups bring).
2) arbitrarily restricting recursion to only go down 2/3 levels? Has the risk
of missing some deeply chained/nested drivers, but at least we're guaranteed to
not get too bad. (Plus, who creates such setups anyway ;)
*3) using the generic LIB_DOIT flag (check for tagged items and not recurse down
there). Not as future-proof if some new code suddenly decides to start adding
these tags to materials along the way, but is easiest to add, and should be
flexible enough to catch most cases, since we only care that at some point those
drivers will be evaluated if they're attached to stuff we're interested in.
4) introducing a separate flag for Materials indicating they've been checked
already. Similar to 3) and solves the future-proofing, but this leads to...
5) why bother with remembering to clear flags before traversing for drivers to
evaluate, when they should be tagged for evaluation like everything else?
Downside - requires depsgraph refactor so that we can actually track the fact
that there are dependencies to/from the material datablock, and not just to the
object using said material. (i.e. Currently infeasible)
2012-07-22 16:14:57 +00:00
|
|
|
|
|
|
|
|
/* clear "LIB_DOIT" flag from all materials, to prevent infinite recursion problems later
|
|
|
|
|
* when trying to find materials with drivers that need evaluating [#32017]
|
|
|
|
|
*/
|
|
|
|
|
tag_main_idcode(bmain, ID_MA, FALSE);
|
2012-11-09 13:57:09 +00:00
|
|
|
tag_main_idcode(bmain, ID_LA, FALSE);
|
2010-04-13 20:06:55 +00:00
|
|
|
|
2009-12-10 11:08:38 +00:00
|
|
|
/* update all objects: drivers, matrices, displists, etc. flags set
|
2012-03-03 20:19:11 +00:00
|
|
|
* by depgraph or manual, no layer check here, gets correct flushed
|
|
|
|
|
*
|
|
|
|
|
* in the future this should handle updates for all datablocks, not
|
|
|
|
|
* only objects and scenes. - brecht */
|
2010-08-01 12:47:49 +00:00
|
|
|
scene_update_tagged_recursive(bmain, scene, scene);
|
2009-12-10 11:08:38 +00:00
|
|
|
|
2011-11-03 16:41:48 +00:00
|
|
|
/* extra call here to recalc scene animation (for sequencer) */
|
2009-12-10 11:08:38 +00:00
|
|
|
{
|
2012-05-06 15:15:33 +00:00
|
|
|
AnimData *adt = BKE_animdata_from_id(&scene->id);
|
2012-05-05 14:33:36 +00:00
|
|
|
float ctime = BKE_scene_frame_get(scene);
|
2011-02-07 12:28:04 +00:00
|
|
|
|
|
|
|
|
if (adt && (adt->recalc & ADT_RECALC_ANIM))
|
== RNA Property Updates get called by Animation System now ==
This fixes bug #26764 and several others like it, where modifier
properties (and others, but most visibly modifiers) would not do
anything when animated or driven, as modifier properties require the
RNA update calls to tag the modifiers to get recalculated.
While just adding a call to RNA_property_update() could have gotten
this working (as per the Campbell's patch attached in the report, and
also my own attempt #25881). However, on production rigs, the
performance cost of this is untenatable (on my own tests, without
these updates, I was getting ~5fps on such a rig, but only 0.9fps or
possibly even worse with the updates added).
Hence, this commit adds a property-update caching system to the RNA
level, which aims to reduce to the number of times that the update
functions end up needing to get called.
While this is much faster than without the caching, I also added an
optimisation for pose bones (which are numerous in production rigs) so
that their property updates are skipped, since they are useless to the
animsys (they only tag the depsgraph for updating). This gets things
moving at a more acceptable framerate.
2011-07-24 04:34:46 +00:00
|
|
|
BKE_animsys_evaluate_animdata(scene, &scene->id, adt, ctime, 0);
|
2009-12-10 11:08:38 +00:00
|
|
|
}
|
2011-02-07 12:28:04 +00:00
|
|
|
|
2011-11-28 14:55:35 +00:00
|
|
|
/* notify editors and python about recalc */
|
2012-05-05 00:23:55 +00:00
|
|
|
BLI_callback_exec(bmain, &scene->id, BLI_CB_EVT_SCENE_UPDATE_POST);
|
2011-11-28 14:55:35 +00:00
|
|
|
DAG_ids_check_recalc(bmain, scene, FALSE);
|
2.5: Blender "Animato" - New Animation System
Finally, here is the basic (functional) prototype of the new animation system which will allow for the infamous "everything is animatable", and which also addresses several of the more serious shortcomings of the old system. Unfortunately, this will break old animation files (especially right now, as I haven't written the version patching code yet), however, this is for the future.
Highlights of the new system:
* Scrapped IPO-Curves/IPO/(Action+Constraint-Channels)/Action system, and replaced it with F-Curve/Action.
- F-Curves (animators from other packages will feel at home with this name) replace IPO-Curves.
- The 'new' Actions, act as the containers for F-Curves, so that they can be reused. They are therefore more akin to the old 'IPO' blocks, except they do not have the blocktype restriction, so you can store materials/texture/geometry F-Curves in the same Action as Object transforms, etc.
* F-Curves use RNA-paths for Data Access, hence allowing "every" (where sensible/editable that is) user-accessible setting from RNA to be animated.
* Drivers are no longer mixed with Animation Data, so rigs will not be that easily broken and several dependency problems can be eliminated. (NOTE: drivers haven't been hooked up yet, but the code is in place)
* F-Curve modifier system allows useful 'large-scale' manipulation of F-Curve values, including (I've only included implemented ones here): envelope deform (similar to lattices to allow broad-scale reshaping of curves), curve generator (polynomial or py-expression), cycles (replacing the old cyclic extrapolation modes, giving more control over this). (NOTE: currently this cannot be tested, as there's not access to them, but the code is all in place)
* NLA system with 'tracks' (i.e. layers), and multiple strips per track. (NOTE: NLA system is not yet functional, as it's only partially coded still)
There are more nice things that I will be preparing some nice docs for soon, but for now, check for more details:
http://lists.blender.org/pipermail/bf-taskforce25/2009-January/000260.html
So, what currently works:
* I've implemented two basic operators for the 3D-view only to Insert and Delete Keyframes. These are tempolary ones only that will be replaced in due course with 'proper' code.
* Object Loc/Rot/Scale can be keyframed. Also, the colour of the 'active' material (Note: this should really be for nth material instead, but that doesn't work yet in RNA) can also be keyframed into the same datablock.
* Standard animation refresh (i.e. animation resulting from NLA and Action evaluation) is now done completely separate from drivers before anything else is done after a frame change. Drivers are handled after this in a separate pass, as dictated by depsgraph flags, etc.
Notes:
* Drivers haven't been hooked up yet
* Only objects and data directly linked to objects can be animated.
* Depsgraph will need further tweaks. Currently, I've only made sure that it will update some things in the most basic cases (i.e. frame change).
* Animation Editors are currently broken (in terms of editing stuff). This will be my next target (priority to get Dopesheet working first, then F-Curve editor - i.e. old IPO Editor)
* I've had to put in large chunks of XXX sandboxing for old animation system code all around the place. This will be cleaned up in due course, as some places need special review.
In particular, the particles and sequencer code have far too many manual calls to calculate + flush animation info, which is really bad (this is a 'please explain yourselves' call to Physics coders!).
2009-01-17 03:12:50 +00:00
|
|
|
|
2011-11-28 14:55:35 +00:00
|
|
|
/* clear recalc flags */
|
2011-11-02 20:56:52 +00:00
|
|
|
DAG_ids_clear_recalc(bmain);
|
2009-12-10 11:08:38 +00:00
|
|
|
}
|
2009-09-18 22:25:49 +00:00
|
|
|
|
2007-01-31 10:59:39 +00:00
|
|
|
/* applies changes right away, does all sets too */
|
2012-05-05 14:33:36 +00:00
|
|
|
void BKE_scene_update_for_newframe(Main *bmain, Scene *sce, unsigned int lay)
|
2007-01-31 10:59:39 +00:00
|
|
|
{
|
2012-05-05 14:33:36 +00:00
|
|
|
float ctime = BKE_scene_frame_get(sce);
|
2010-02-19 13:13:21 +00:00
|
|
|
Scene *sce_iter;
|
3D Audio GSoC:
Implemented basic audio animation.
* AnimatableProperty: Propper cache writing and spline interpolation for reading (the solution for stair steps in audio animation)
* Animatable properties so far are: volume, pitch, panning
* Users note: Changing the pitch of a sound results in wrong seeking, due to the resulting playback length difference.
* Users note: Panning only works for mono sources, values are in the range [-2..2], this basically controls the angle of the sound, 0 is front, -1 left, 1 right and 2 and -2 are back. Typical stereo panning only supports [-1..1].
* Disabled animation of audio related ffmpeg output parameters.
* Scene Audio Panel: 3D Listener settings also for Renderer, new Volume property (animatable!), Update/Bake buttons for animation problems, moved sampling rate and channel count here
2011-07-28 13:58:59 +00:00
|
|
|
|
2011-09-27 10:43:45 +00:00
|
|
|
/* keep this first */
|
2012-05-05 00:23:55 +00:00
|
|
|
BLI_callback_exec(bmain, &sce->id, BLI_CB_EVT_FRAME_CHANGE_PRE);
|
|
|
|
|
BLI_callback_exec(bmain, &sce->id, BLI_CB_EVT_SCENE_UPDATE_PRE);
|
2011-09-27 10:43:45 +00:00
|
|
|
|
3D Audio GSoC:
Implemented basic audio animation.
* AnimatableProperty: Propper cache writing and spline interpolation for reading (the solution for stair steps in audio animation)
* Animatable properties so far are: volume, pitch, panning
* Users note: Changing the pitch of a sound results in wrong seeking, due to the resulting playback length difference.
* Users note: Panning only works for mono sources, values are in the range [-2..2], this basically controls the angle of the sound, 0 is front, -1 left, 1 right and 2 and -2 are back. Typical stereo panning only supports [-1..1].
* Disabled animation of audio related ffmpeg output parameters.
* Scene Audio Panel: 3D Listener settings also for Renderer, new Volume property (animatable!), Update/Bake buttons for animation problems, moved sampling rate and channel count here
2011-07-28 13:58:59 +00:00
|
|
|
sound_set_cfra(sce->r.cfra);
|
2007-01-31 10:59:39 +00:00
|
|
|
|
2009-09-18 22:25:49 +00:00
|
|
|
/* clear animation overrides */
|
2012-07-07 22:51:57 +00:00
|
|
|
/* XXX TODO... */
|
2010-02-19 13:13:21 +00:00
|
|
|
|
2012-05-06 15:15:33 +00:00
|
|
|
for (sce_iter = sce; sce_iter; sce_iter = sce_iter->set) {
|
|
|
|
|
if (sce_iter->theDag == NULL)
|
2010-08-01 12:47:49 +00:00
|
|
|
DAG_scene_sort(bmain, sce_iter);
|
2010-02-19 13:13:21 +00:00
|
|
|
}
|
|
|
|
|
|
2011-11-03 16:41:48 +00:00
|
|
|
/* flush recalc flags to dependencies, if we were only changing a frame
|
2012-03-03 20:19:11 +00:00
|
|
|
* this would not be necessary, but if a user or a script has modified
|
2012-05-05 14:33:36 +00:00
|
|
|
* some datablock before BKE_scene_update_tagged was called, we need the flush */
|
2011-11-03 16:41:48 +00:00
|
|
|
DAG_ids_flush_tagged(bmain);
|
2010-02-19 13:13:21 +00:00
|
|
|
|
|
|
|
|
/* Following 2 functions are recursive
|
2012-03-18 07:38:51 +00:00
|
|
|
* so don't call within 'scene_update_tagged_recursive' */
|
2010-12-16 19:26:54 +00:00
|
|
|
DAG_scene_update_flags(bmain, sce, lay, TRUE); // only stuff that moves or needs display still
|
2010-02-19 13:13:21 +00:00
|
|
|
|
2012-06-04 16:42:58 +00:00
|
|
|
BKE_mask_evaluate_all_masks(bmain, ctime, TRUE);
|
|
|
|
|
|
2010-02-19 13:13:21 +00:00
|
|
|
/* All 'standard' (i.e. without any dependencies) animation is handled here,
|
|
|
|
|
* with an 'local' to 'macro' order of evaluation. This should ensure that
|
|
|
|
|
* settings stored nestled within a hierarchy (i.e. settings in a Texture block
|
|
|
|
|
* can be overridden by settings from Scene, which owns the Texture through a hierarchy
|
|
|
|
|
* such as Scene->World->MTex/Texture) can still get correctly overridden.
|
|
|
|
|
*/
|
== RNA Property Updates get called by Animation System now ==
This fixes bug #26764 and several others like it, where modifier
properties (and others, but most visibly modifiers) would not do
anything when animated or driven, as modifier properties require the
RNA update calls to tag the modifiers to get recalculated.
While just adding a call to RNA_property_update() could have gotten
this working (as per the Campbell's patch attached in the report, and
also my own attempt #25881). However, on production rigs, the
performance cost of this is untenatable (on my own tests, without
these updates, I was getting ~5fps on such a rig, but only 0.9fps or
possibly even worse with the updates added).
Hence, this commit adds a property-update caching system to the RNA
level, which aims to reduce to the number of times that the update
functions end up needing to get called.
While this is much faster than without the caching, I also added an
optimisation for pose bones (which are numerous in production rigs) so
that their property updates are skipped, since they are useless to the
animsys (they only tag the depsgraph for updating). This gets things
moving at a more acceptable framerate.
2011-07-24 04:34:46 +00:00
|
|
|
BKE_animsys_evaluate_all_animation(bmain, sce, ctime);
|
2010-02-19 13:13:21 +00:00
|
|
|
/*...done with recusrive funcs */
|
|
|
|
|
|
2013-01-23 05:56:44 +00:00
|
|
|
/* run rigidbody sim */
|
|
|
|
|
// XXX: this position may still change, objects not being updated correctly before simulation is run
|
|
|
|
|
// NOTE: current position is so that rigidbody sim affects other objects
|
|
|
|
|
if (BKE_scene_check_rigidbody_active(sce))
|
|
|
|
|
BKE_rigidbody_do_simulation(sce, ctime);
|
|
|
|
|
|
2012-10-22 19:45:16 +00:00
|
|
|
/* clear "LIB_DOIT" flag from all materials, to prevent infinite recursion problems later
|
|
|
|
|
* when trying to find materials with drivers that need evaluating [#32017]
|
|
|
|
|
*/
|
|
|
|
|
tag_main_idcode(bmain, ID_MA, FALSE);
|
2012-11-09 13:57:09 +00:00
|
|
|
tag_main_idcode(bmain, ID_LA, FALSE);
|
2012-10-22 19:45:16 +00:00
|
|
|
|
2012-05-05 14:03:12 +00:00
|
|
|
/* BKE_object_handle_update() on all objects, groups and sets */
|
2010-08-01 12:47:49 +00:00
|
|
|
scene_update_tagged_recursive(bmain, sce, sce);
|
2011-09-27 10:43:45 +00:00
|
|
|
|
2013-01-10 18:20:29 +00:00
|
|
|
scene_depsgraph_hack(sce, sce);
|
|
|
|
|
|
2011-11-28 14:55:35 +00:00
|
|
|
/* notify editors and python about recalc */
|
2012-05-05 00:23:55 +00:00
|
|
|
BLI_callback_exec(bmain, &sce->id, BLI_CB_EVT_SCENE_UPDATE_POST);
|
|
|
|
|
BLI_callback_exec(bmain, &sce->id, BLI_CB_EVT_FRAME_CHANGE_POST);
|
2011-11-03 10:03:08 +00:00
|
|
|
|
2011-11-28 14:55:35 +00:00
|
|
|
DAG_ids_check_recalc(bmain, sce, TRUE);
|
|
|
|
|
|
|
|
|
|
/* clear recalc flags */
|
2011-11-03 10:03:08 +00:00
|
|
|
DAG_ids_clear_recalc(bmain);
|
2007-01-31 10:59:39 +00:00
|
|
|
}
|
|
|
|
|
|
Orange; more render & compo stuff!
-> Rendering in RenderLayers
It's important to distinguish a 'render layer' from a 'pass'. The first is
control over the main pipeline itself, to indicate what geometry is being
is rendered. The 'pass' (not in this commit!) is related to internal
shading code, like shadow/spec/AO/normals/etc.
Options for RenderLayers now are:
- Indicate which 3d 'view layers' have to be included (so you can render
front and back separately)
- "Solid", all solid faces, includes sky at the moment too
- "ZTransp", all transparent faces
- "Halo", the halos
- "Strand", the particle strands (not coded yet...)
Currently only 2 'passes' are exported for render, which is the "Combined"
buffer and the "Z. The latter now works, and can be turned on/off.
Note that all layers are still fully kept in memory now, saving the tiles
and layers to disk (in exr) is also todo.
-> New Blur options
The existing Blur Node (compositor) now has an optional input image. This
has to be a 'value buffer', which can be a Zbuffer, or any mask you can
think of. The input values have to be in the 0-1 range, so another new
node was added too "Map Value".
The value input can also be used to tweak blur size with the (todo)
Time Node.
Temporal screenies:
http://www.blender.org/bf/rt.jpg
http://www.blender.org/bf/rt1.jpg
http://www.blender.org/bf/rt2.jpg
BTW: The compositor is very slow still, it recalulates all nodes on each
change still. Persistant memory and dependency checks is coming!
2006-01-26 22:18:46 +00:00
|
|
|
/* return default layer, also used to patch old files */
|
2012-05-05 14:33:36 +00:00
|
|
|
SceneRenderLayer *BKE_scene_add_render_layer(Scene *sce, const char *name)
|
Orange; more render & compo stuff!
-> Rendering in RenderLayers
It's important to distinguish a 'render layer' from a 'pass'. The first is
control over the main pipeline itself, to indicate what geometry is being
is rendered. The 'pass' (not in this commit!) is related to internal
shading code, like shadow/spec/AO/normals/etc.
Options for RenderLayers now are:
- Indicate which 3d 'view layers' have to be included (so you can render
front and back separately)
- "Solid", all solid faces, includes sky at the moment too
- "ZTransp", all transparent faces
- "Halo", the halos
- "Strand", the particle strands (not coded yet...)
Currently only 2 'passes' are exported for render, which is the "Combined"
buffer and the "Z. The latter now works, and can be turned on/off.
Note that all layers are still fully kept in memory now, saving the tiles
and layers to disk (in exr) is also todo.
-> New Blur options
The existing Blur Node (compositor) now has an optional input image. This
has to be a 'value buffer', which can be a Zbuffer, or any mask you can
think of. The input values have to be in the 0-1 range, so another new
node was added too "Map Value".
The value input can also be used to tweak blur size with the (todo)
Time Node.
Temporal screenies:
http://www.blender.org/bf/rt.jpg
http://www.blender.org/bf/rt1.jpg
http://www.blender.org/bf/rt2.jpg
BTW: The compositor is very slow still, it recalulates all nodes on each
change still. Persistant memory and dependency checks is coming!
2006-01-26 22:18:46 +00:00
|
|
|
{
|
|
|
|
|
SceneRenderLayer *srl;
|
2011-11-18 07:11:54 +00:00
|
|
|
|
2012-02-23 02:17:50 +00:00
|
|
|
if (!name)
|
2012-05-06 15:15:33 +00:00
|
|
|
name = "RenderLayer";
|
2011-11-18 07:11:54 +00:00
|
|
|
|
2012-05-06 15:15:33 +00:00
|
|
|
srl = MEM_callocN(sizeof(SceneRenderLayer), "new render layer");
|
2011-11-18 08:42:44 +00:00
|
|
|
BLI_strncpy(srl->name, name, sizeof(srl->name));
|
2010-02-18 10:14:49 +00:00
|
|
|
BLI_uniquename(&sce->r.layers, srl, "RenderLayer", '.', offsetof(SceneRenderLayer, name), sizeof(srl->name));
|
Orange; more render & compo stuff!
-> Rendering in RenderLayers
It's important to distinguish a 'render layer' from a 'pass'. The first is
control over the main pipeline itself, to indicate what geometry is being
is rendered. The 'pass' (not in this commit!) is related to internal
shading code, like shadow/spec/AO/normals/etc.
Options for RenderLayers now are:
- Indicate which 3d 'view layers' have to be included (so you can render
front and back separately)
- "Solid", all solid faces, includes sky at the moment too
- "ZTransp", all transparent faces
- "Halo", the halos
- "Strand", the particle strands (not coded yet...)
Currently only 2 'passes' are exported for render, which is the "Combined"
buffer and the "Z. The latter now works, and can be turned on/off.
Note that all layers are still fully kept in memory now, saving the tiles
and layers to disk (in exr) is also todo.
-> New Blur options
The existing Blur Node (compositor) now has an optional input image. This
has to be a 'value buffer', which can be a Zbuffer, or any mask you can
think of. The input values have to be in the 0-1 range, so another new
node was added too "Map Value".
The value input can also be used to tweak blur size with the (todo)
Time Node.
Temporal screenies:
http://www.blender.org/bf/rt.jpg
http://www.blender.org/bf/rt1.jpg
http://www.blender.org/bf/rt2.jpg
BTW: The compositor is very slow still, it recalulates all nodes on each
change still. Persistant memory and dependency checks is coming!
2006-01-26 22:18:46 +00:00
|
|
|
BLI_addtail(&sce->r.layers, srl);
|
2006-01-28 15:21:04 +00:00
|
|
|
|
|
|
|
|
/* note, this is also in render, pipeline.c, to make layer when scenedata doesnt have it */
|
2012-05-06 15:15:33 +00:00
|
|
|
srl->lay = (1 << 20) - 1;
|
|
|
|
|
srl->layflag = 0x7FFF; /* solid ztra halo edge strand */
|
|
|
|
|
srl->passflag = SCE_PASS_COMBINED | SCE_PASS_Z;
|
2012-12-20 07:57:26 +00:00
|
|
|
#ifdef WITH_FREESTYLE
|
|
|
|
|
FRS_add_freestyle_config(srl);
|
|
|
|
|
#endif
|
2011-11-18 07:11:54 +00:00
|
|
|
|
|
|
|
|
return srl;
|
|
|
|
|
}
|
|
|
|
|
|
2012-05-05 14:33:36 +00:00
|
|
|
int BKE_scene_remove_render_layer(Main *bmain, Scene *scene, SceneRenderLayer *srl)
|
2011-11-18 07:11:54 +00:00
|
|
|
{
|
2012-05-06 15:15:33 +00:00
|
|
|
const int act = BLI_findindex(&scene->r.layers, srl);
|
2011-11-18 07:11:54 +00:00
|
|
|
Scene *sce;
|
|
|
|
|
|
2011-11-18 08:42:44 +00:00
|
|
|
if (act == -1) {
|
2011-11-18 07:11:54 +00:00
|
|
|
return 0;
|
2011-11-18 08:42:44 +00:00
|
|
|
}
|
|
|
|
|
else if ( (scene->r.layers.first == scene->r.layers.last) &&
|
|
|
|
|
(scene->r.layers.first == srl))
|
|
|
|
|
{
|
|
|
|
|
/* ensure 1 layer is kept */
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
2011-11-18 07:11:54 +00:00
|
|
|
|
|
|
|
|
BLI_remlink(&scene->r.layers, srl);
|
|
|
|
|
MEM_freeN(srl);
|
|
|
|
|
|
2012-05-06 15:15:33 +00:00
|
|
|
scene->r.actlay = 0;
|
2011-11-18 07:11:54 +00:00
|
|
|
|
2012-02-23 02:17:50 +00:00
|
|
|
for (sce = bmain->scene.first; sce; sce = sce->id.next) {
|
|
|
|
|
if (sce->nodetree) {
|
2011-11-18 07:11:54 +00:00
|
|
|
bNode *node;
|
2012-02-23 02:17:50 +00:00
|
|
|
for (node = sce->nodetree->nodes.first; node; node = node->next) {
|
2012-05-06 15:15:33 +00:00
|
|
|
if (node->type == CMP_NODE_R_LAYERS && (Scene *)node->id == scene) {
|
|
|
|
|
if (node->custom1 == act)
|
|
|
|
|
node->custom1 = 0;
|
|
|
|
|
else if (node->custom1 > act)
|
2011-11-18 07:11:54 +00:00
|
|
|
node->custom1--;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return 1;
|
2007-12-26 22:40:56 +00:00
|
|
|
}
|
2008-02-13 11:18:08 +00:00
|
|
|
|
|
|
|
|
/* render simplification */
|
|
|
|
|
|
|
|
|
|
int get_render_subsurf_level(RenderData *r, int lvl)
|
|
|
|
|
{
|
2012-02-23 02:17:50 +00:00
|
|
|
if (r->mode & R_SIMPLIFY)
|
2012-10-27 11:18:54 +00:00
|
|
|
return min_ii(r->simplify_subsurf, lvl);
|
2008-02-13 11:18:08 +00:00
|
|
|
else
|
|
|
|
|
return lvl;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int get_render_child_particle_number(RenderData *r, int num)
|
|
|
|
|
{
|
2012-02-23 02:17:50 +00:00
|
|
|
if (r->mode & R_SIMPLIFY)
|
2012-05-06 15:15:33 +00:00
|
|
|
return (int)(r->simplify_particles * num);
|
2008-02-13 11:18:08 +00:00
|
|
|
else
|
|
|
|
|
return num;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int get_render_shadow_samples(RenderData *r, int samples)
|
|
|
|
|
{
|
2012-02-23 02:17:50 +00:00
|
|
|
if ((r->mode & R_SIMPLIFY) && samples > 0)
|
2012-10-27 11:18:54 +00:00
|
|
|
return min_ii(r->simplify_shadowsamples, samples);
|
2008-02-13 11:18:08 +00:00
|
|
|
else
|
|
|
|
|
return samples;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
float get_render_aosss_error(RenderData *r, float error)
|
|
|
|
|
{
|
2012-02-23 02:17:50 +00:00
|
|
|
if (r->mode & R_SIMPLIFY)
|
2012-05-06 15:15:33 +00:00
|
|
|
return ((1.0f - r->simplify_aosss) * 10.0f + 1.0f) * error;
|
2008-02-13 11:18:08 +00:00
|
|
|
else
|
|
|
|
|
return error;
|
|
|
|
|
}
|
|
|
|
|
|
2010-04-02 13:43:56 +00:00
|
|
|
/* helper function for the SETLOOPER macro */
|
2010-12-17 15:37:59 +00:00
|
|
|
Base *_setlooper_base_step(Scene **sce_iter, Base *base)
|
2010-04-02 13:43:56 +00:00
|
|
|
{
|
2012-02-23 02:17:50 +00:00
|
|
|
if (base && base->next) {
|
2011-04-21 13:11:51 +00:00
|
|
|
/* common case, step to the next */
|
|
|
|
|
return base->next;
|
|
|
|
|
}
|
2012-05-06 15:15:33 +00:00
|
|
|
else if (base == NULL && (*sce_iter)->base.first) {
|
2011-04-21 13:11:51 +00:00
|
|
|
/* first time looping, return the scenes first base */
|
2010-12-17 15:37:59 +00:00
|
|
|
return (Base *)(*sce_iter)->base.first;
|
2011-04-21 13:11:51 +00:00
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
/* reached the end, get the next base in the set */
|
2012-05-06 15:15:33 +00:00
|
|
|
while ((*sce_iter = (*sce_iter)->set)) {
|
|
|
|
|
base = (Base *)(*sce_iter)->base.first;
|
2012-02-23 02:17:50 +00:00
|
|
|
if (base) {
|
2011-04-21 13:11:51 +00:00
|
|
|
return base;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2010-04-02 13:43:56 +00:00
|
|
|
|
2011-04-21 13:11:51 +00:00
|
|
|
return NULL;
|
2010-04-02 13:43:56 +00:00
|
|
|
}
|
2011-11-02 19:24:30 +00:00
|
|
|
|
2012-05-05 14:33:36 +00:00
|
|
|
int BKE_scene_use_new_shading_nodes(Scene *scene)
|
2011-11-02 19:24:30 +00:00
|
|
|
{
|
2012-05-06 15:15:33 +00:00
|
|
|
RenderEngineType *type = RE_engines_find(scene->r.engine);
|
2011-11-15 07:30:26 +00:00
|
|
|
return (type && type->flag & RE_USE_SHADING_NODES);
|
2011-11-02 19:24:30 +00:00
|
|
|
}
|
|
|
|
|
|
2012-05-05 14:33:36 +00:00
|
|
|
void BKE_scene_base_flag_to_objects(struct Scene *scene)
|
2012-05-05 14:03:12 +00:00
|
|
|
{
|
2012-05-06 15:15:33 +00:00
|
|
|
Base *base = scene->base.first;
|
2012-05-05 14:03:12 +00:00
|
|
|
|
|
|
|
|
while (base) {
|
2012-05-06 15:15:33 +00:00
|
|
|
base->object->flag = base->flag;
|
|
|
|
|
base = base->next;
|
2012-05-05 14:03:12 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2012-05-05 14:33:36 +00:00
|
|
|
void BKE_scene_base_flag_from_objects(struct Scene *scene)
|
2012-05-05 14:03:12 +00:00
|
|
|
{
|
2012-05-06 15:15:33 +00:00
|
|
|
Base *base = scene->base.first;
|
2012-05-05 14:03:12 +00:00
|
|
|
|
|
|
|
|
while (base) {
|
2012-05-06 15:15:33 +00:00
|
|
|
base->flag = base->object->flag;
|
|
|
|
|
base = base->next;
|
2012-05-05 14:03:12 +00:00
|
|
|
}
|
|
|
|
|
}
|
Color Management, Stage 2: Switch color pipeline to use OpenColorIO
Replace old color pipeline which was supporting linear/sRGB color spaces
only with OpenColorIO-based pipeline.
This introduces two configurable color spaces:
- Input color space for images and movie clips. This space is used to convert
images/movies from color space in which file is saved to Blender's linear
space (for float images, byte images are not internally converted, only input
space is stored for such images and used later).
This setting could be found in image/clip data block settings.
- Display color space which defines space in which particular display is working.
This settings could be found in scene's Color Management panel.
When render result is being displayed on the screen, apart from converting image
to display space, some additional conversions could happen.
This conversions are:
- View, which defines tone curve applying before display transformation.
These are different ways to view the image on the same display device.
For example it could be used to emulate film view on sRGB display.
- Exposure affects on image exposure before tone map is applied.
- Gamma is post-display gamma correction, could be used to match particular
display gamma.
- RGB curves are user-defined curves which are applying before display
transformation, could be used for different purposes.
All this settings by default are only applying on render result and does not
affect on other images. If some particular image needs to be affected by this
transformation, "View as Render" setting of image data block should be set to
truth. Movie clips are always affected by all display transformations.
This commit also introduces configurable color space in which sequencer is
working. This setting could be found in scene's Color Management panel and
it should be used if such stuff as grading needs to be done in color space
different from sRGB (i.e. when Film view on sRGB display is use, using VD16
space as sequencer's internal space would make grading working in space
which is close to the space using for display).
Some technical notes:
- Image buffer's float buffer is now always in linear space, even if it was
created from 16bit byte images.
- Space of byte buffer is stored in image buffer's rect_colorspace property.
- Profile of image buffer was removed since it's not longer meaningful.
- OpenGL and GLSL is supposed to always work in sRGB space. It is possible
to support other spaces, but it's quite large project which isn't so
much important.
- Legacy Color Management option disabled is emulated by using None display.
It could have some regressions, but there's no clear way to avoid them.
- If OpenColorIO is disabled on build time, it should make blender behaving
in the same way as previous release with color management enabled.
More details could be found at this page (more details would be added soon):
http://wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.64/Color_Management
--
Thanks to Xavier Thomas, Lukas Toene for initial work on OpenColorIO
integration and to Brecht van Lommel for some further development and code/
usecase review!
2012-09-15 10:05:07 +00:00
|
|
|
|
|
|
|
|
void BKE_scene_disable_color_management(Scene *scene)
|
|
|
|
|
{
|
|
|
|
|
ColorManagedDisplaySettings *display_settings = &scene->display_settings;
|
|
|
|
|
ColorManagedViewSettings *view_settings = &scene->view_settings;
|
|
|
|
|
const char *view;
|
2012-09-26 13:17:47 +00:00
|
|
|
const char *none_display_name;
|
Color Management, Stage 2: Switch color pipeline to use OpenColorIO
Replace old color pipeline which was supporting linear/sRGB color spaces
only with OpenColorIO-based pipeline.
This introduces two configurable color spaces:
- Input color space for images and movie clips. This space is used to convert
images/movies from color space in which file is saved to Blender's linear
space (for float images, byte images are not internally converted, only input
space is stored for such images and used later).
This setting could be found in image/clip data block settings.
- Display color space which defines space in which particular display is working.
This settings could be found in scene's Color Management panel.
When render result is being displayed on the screen, apart from converting image
to display space, some additional conversions could happen.
This conversions are:
- View, which defines tone curve applying before display transformation.
These are different ways to view the image on the same display device.
For example it could be used to emulate film view on sRGB display.
- Exposure affects on image exposure before tone map is applied.
- Gamma is post-display gamma correction, could be used to match particular
display gamma.
- RGB curves are user-defined curves which are applying before display
transformation, could be used for different purposes.
All this settings by default are only applying on render result and does not
affect on other images. If some particular image needs to be affected by this
transformation, "View as Render" setting of image data block should be set to
truth. Movie clips are always affected by all display transformations.
This commit also introduces configurable color space in which sequencer is
working. This setting could be found in scene's Color Management panel and
it should be used if such stuff as grading needs to be done in color space
different from sRGB (i.e. when Film view on sRGB display is use, using VD16
space as sequencer's internal space would make grading working in space
which is close to the space using for display).
Some technical notes:
- Image buffer's float buffer is now always in linear space, even if it was
created from 16bit byte images.
- Space of byte buffer is stored in image buffer's rect_colorspace property.
- Profile of image buffer was removed since it's not longer meaningful.
- OpenGL and GLSL is supposed to always work in sRGB space. It is possible
to support other spaces, but it's quite large project which isn't so
much important.
- Legacy Color Management option disabled is emulated by using None display.
It could have some regressions, but there's no clear way to avoid them.
- If OpenColorIO is disabled on build time, it should make blender behaving
in the same way as previous release with color management enabled.
More details could be found at this page (more details would be added soon):
http://wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.64/Color_Management
--
Thanks to Xavier Thomas, Lukas Toene for initial work on OpenColorIO
integration and to Brecht van Lommel for some further development and code/
usecase review!
2012-09-15 10:05:07 +00:00
|
|
|
|
2012-09-26 13:17:47 +00:00
|
|
|
none_display_name = IMB_colormanagement_display_get_none_name();
|
|
|
|
|
|
|
|
|
|
BLI_strncpy(display_settings->display_device, none_display_name, sizeof(display_settings->display_device));
|
Color Management, Stage 2: Switch color pipeline to use OpenColorIO
Replace old color pipeline which was supporting linear/sRGB color spaces
only with OpenColorIO-based pipeline.
This introduces two configurable color spaces:
- Input color space for images and movie clips. This space is used to convert
images/movies from color space in which file is saved to Blender's linear
space (for float images, byte images are not internally converted, only input
space is stored for such images and used later).
This setting could be found in image/clip data block settings.
- Display color space which defines space in which particular display is working.
This settings could be found in scene's Color Management panel.
When render result is being displayed on the screen, apart from converting image
to display space, some additional conversions could happen.
This conversions are:
- View, which defines tone curve applying before display transformation.
These are different ways to view the image on the same display device.
For example it could be used to emulate film view on sRGB display.
- Exposure affects on image exposure before tone map is applied.
- Gamma is post-display gamma correction, could be used to match particular
display gamma.
- RGB curves are user-defined curves which are applying before display
transformation, could be used for different purposes.
All this settings by default are only applying on render result and does not
affect on other images. If some particular image needs to be affected by this
transformation, "View as Render" setting of image data block should be set to
truth. Movie clips are always affected by all display transformations.
This commit also introduces configurable color space in which sequencer is
working. This setting could be found in scene's Color Management panel and
it should be used if such stuff as grading needs to be done in color space
different from sRGB (i.e. when Film view on sRGB display is use, using VD16
space as sequencer's internal space would make grading working in space
which is close to the space using for display).
Some technical notes:
- Image buffer's float buffer is now always in linear space, even if it was
created from 16bit byte images.
- Space of byte buffer is stored in image buffer's rect_colorspace property.
- Profile of image buffer was removed since it's not longer meaningful.
- OpenGL and GLSL is supposed to always work in sRGB space. It is possible
to support other spaces, but it's quite large project which isn't so
much important.
- Legacy Color Management option disabled is emulated by using None display.
It could have some regressions, but there's no clear way to avoid them.
- If OpenColorIO is disabled on build time, it should make blender behaving
in the same way as previous release with color management enabled.
More details could be found at this page (more details would be added soon):
http://wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.64/Color_Management
--
Thanks to Xavier Thomas, Lukas Toene for initial work on OpenColorIO
integration and to Brecht van Lommel for some further development and code/
usecase review!
2012-09-15 10:05:07 +00:00
|
|
|
|
|
|
|
|
view = IMB_colormanagement_view_get_default_name(display_settings->display_device);
|
|
|
|
|
|
|
|
|
|
if (view) {
|
|
|
|
|
BLI_strncpy(view_settings->view_transform, view, sizeof(view_settings->view_transform));
|
|
|
|
|
}
|
|
|
|
|
}
|
2012-10-01 11:14:02 +00:00
|
|
|
|
|
|
|
|
int BKE_scene_check_color_management_enabled(const Scene *scene)
|
|
|
|
|
{
|
|
|
|
|
return strcmp(scene->display_settings.display_device, "None") != 0;
|
|
|
|
|
}
|
2013-01-23 05:56:22 +00:00
|
|
|
|
|
|
|
|
int BKE_scene_check_rigidbody_active(const Scene *scene)
|
|
|
|
|
{
|
|
|
|
|
return scene && scene->rigidbody_world && scene->rigidbody_world->group && !(scene->rigidbody_world->flag & RBW_FLAG_MUTED);
|
|
|
|
|
}
|