Depsgraph: Cleanup and code simplification
This is mainly a maintenance commit which was aimed to make work with
this module more pleasant and solve such issues as:
- Annoyance with looong files, which had craftload in them
- Usage of STL for the data structures we've got in BLI
- Possible symbol conflicts
- Not real clear layout of what is located where
So in this commit the following changes are done:
- STL is prohibited, it's not really predictable on various compilers,
with our BLI algorithms we can predict things much better.
There are still few usages of std::vector, but that we'll be
solving later once we've got similar thing in BLI.
- Simplify foreach loops, avoid using const_iterator all over the place.
- New directory layout, which is hopefully easier to follow.
- Some files were split, some of them will be split soon.
The idea of this is to split huge functions into own files with
good documentation and everything.
- Removed stuff which was planned for use in the future but was never
finished, tested or anything.
Let's wipe it out for now, and bring back once we really start using
it, so it'll be more clear if it solves our needs.
- All the internal routines were moved to DEG namespace to separate
them better from rest of blender.
Some places now annoyingly using DEG::foo, but that we can olve by
moving some utility functions inside of the namespace.
While working on this we've found some hotspot in updates flush, so
now playback of blenrig is few percent faster (something like 96fps
with previous master and around 99-100fps after this change).
Not saying it's something final, there is still room for cleanup and
API simplification, but those might happen as a regular development
now without doing any global changes.
2016-05-27 18:01:18 +02: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
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software Foundation,
|
|
|
|
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
*
|
|
|
|
* The Original Code is Copyright (C) 2013 Blender Foundation.
|
|
|
|
* All rights reserved.
|
|
|
|
*/
|
|
|
|
|
2019-02-18 08:08:12 +11:00
|
|
|
/** \file
|
|
|
|
* \ingroup depsgraph
|
Depsgraph: Cleanup and code simplification
This is mainly a maintenance commit which was aimed to make work with
this module more pleasant and solve such issues as:
- Annoyance with looong files, which had craftload in them
- Usage of STL for the data structures we've got in BLI
- Possible symbol conflicts
- Not real clear layout of what is located where
So in this commit the following changes are done:
- STL is prohibited, it's not really predictable on various compilers,
with our BLI algorithms we can predict things much better.
There are still few usages of std::vector, but that we'll be
solving later once we've got similar thing in BLI.
- Simplify foreach loops, avoid using const_iterator all over the place.
- New directory layout, which is hopefully easier to follow.
- Some files were split, some of them will be split soon.
The idea of this is to split huge functions into own files with
good documentation and everything.
- Removed stuff which was planned for use in the future but was never
finished, tested or anything.
Let's wipe it out for now, and bring back once we really start using
it, so it'll be more clear if it solves our needs.
- All the internal routines were moved to DEG namespace to separate
them better from rest of blender.
Some places now annoyingly using DEG::foo, but that we can olve by
moving some utility functions inside of the namespace.
While working on this we've found some hotspot in updates flush, so
now playback of blenrig is few percent faster (something like 96fps
with previous master and around 99-100fps after this change).
Not saying it's something final, there is still room for cleanup and
API simplification, but those might happen as a regular development
now without doing any global changes.
2016-05-27 18:01:18 +02:00
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2019-02-27 11:17:36 +01:00
|
|
|
#include "intern/builder/deg_builder.h"
|
2018-02-22 11:03:39 +01:00
|
|
|
#include "intern/builder/deg_builder_map.h"
|
2019-01-31 12:56:40 +01:00
|
|
|
#include "intern/depsgraph_type.h"
|
|
|
|
#include "intern/node/deg_node_id.h"
|
|
|
|
#include "intern/node/deg_node_operation.h"
|
2018-09-19 15:46:03 +02:00
|
|
|
|
2019-02-27 11:17:36 +01:00
|
|
|
#include "DEG_depsgraph.h"
|
|
|
|
|
Basic Alembic support
All in all, this patch adds an Alembic importer, an Alembic exporter,
and a new CacheFile data block which, for now, wraps around an Alembic
archive. This data block is made available through a new modifier ("Mesh
Sequence Cache") as well as a new constraint ("Transform Cache") to
somewhat properly support respectively geometric and transformation data
streaming from alembic caches.
A more in-depth documentation is to be found on the wiki, as well as a
guide to compile alembic: https://wiki.blender.org/index.php/
User:Kevindietrich/AlembicBasicIo.
Many thanks to everyone involved in this little project, and huge shout
out to "cgstrive" for the thorough testings with Maya, 3ds Max, Houdini
and Realflow as well as @fjuhec, @jensverwiebe and @jasperge for the
custom builds and compile fixes.
Reviewers: sergey, campbellbarton, mont29
Reviewed By: sergey, campbellbarton, mont29
Differential Revision: https://developer.blender.org/D2060
2016-08-06 06:20:37 +02:00
|
|
|
struct CacheFile;
|
2018-06-06 10:52:50 +02:00
|
|
|
struct Camera;
|
2019-01-28 21:08:24 +11:00
|
|
|
struct Collection;
|
|
|
|
struct FCurve;
|
2020-01-16 14:57:33 +01:00
|
|
|
struct FreestyleLineSet;
|
|
|
|
struct FreestyleLineStyle;
|
Depsgraph: Cleanup and code simplification
This is mainly a maintenance commit which was aimed to make work with
this module more pleasant and solve such issues as:
- Annoyance with looong files, which had craftload in them
- Usage of STL for the data structures we've got in BLI
- Possible symbol conflicts
- Not real clear layout of what is located where
So in this commit the following changes are done:
- STL is prohibited, it's not really predictable on various compilers,
with our BLI algorithms we can predict things much better.
There are still few usages of std::vector, but that we'll be
solving later once we've got similar thing in BLI.
- Simplify foreach loops, avoid using const_iterator all over the place.
- New directory layout, which is hopefully easier to follow.
- Some files were split, some of them will be split soon.
The idea of this is to split huge functions into own files with
good documentation and everything.
- Removed stuff which was planned for use in the future but was never
finished, tested or anything.
Let's wipe it out for now, and bring back once we really start using
it, so it'll be more clear if it solves our needs.
- All the internal routines were moved to DEG namespace to separate
them better from rest of blender.
Some places now annoyingly using DEG::foo, but that we can olve by
moving some utility functions inside of the namespace.
While working on this we've found some hotspot in updates flush, so
now playback of blenrig is few percent faster (something like 96fps
with previous master and around 99-100fps after this change).
Not saying it's something final, there is still room for cleanup and
API simplification, but those might happen as a regular development
now without doing any global changes.
2016-05-27 18:01:18 +02:00
|
|
|
struct ID;
|
2020-04-28 11:45:57 +02:00
|
|
|
struct IDProperty;
|
2016-11-03 11:31:49 +01:00
|
|
|
struct Image;
|
Depsgraph: Cleanup and code simplification
This is mainly a maintenance commit which was aimed to make work with
this module more pleasant and solve such issues as:
- Annoyance with looong files, which had craftload in them
- Usage of STL for the data structures we've got in BLI
- Possible symbol conflicts
- Not real clear layout of what is located where
So in this commit the following changes are done:
- STL is prohibited, it's not really predictable on various compilers,
with our BLI algorithms we can predict things much better.
There are still few usages of std::vector, but that we'll be
solving later once we've got similar thing in BLI.
- Simplify foreach loops, avoid using const_iterator all over the place.
- New directory layout, which is hopefully easier to follow.
- Some files were split, some of them will be split soon.
The idea of this is to split huge functions into own files with
good documentation and everything.
- Removed stuff which was planned for use in the future but was never
finished, tested or anything.
Let's wipe it out for now, and bring back once we really start using
it, so it'll be more clear if it solves our needs.
- All the internal routines were moved to DEG namespace to separate
them better from rest of blender.
Some places now annoyingly using DEG::foo, but that we can olve by
moving some utility functions inside of the namespace.
While working on this we've found some hotspot in updates flush, so
now playback of blenrig is few percent faster (something like 96fps
with previous master and around 99-100fps after this change).
Not saying it's something final, there is still room for cleanup and
API simplification, but those might happen as a regular development
now without doing any global changes.
2016-05-27 18:01:18 +02:00
|
|
|
struct Key;
|
2017-03-17 12:47:29 +01:00
|
|
|
struct LayerCollection;
|
2019-02-27 10:46:48 +11:00
|
|
|
struct Light;
|
2018-06-06 10:47:54 +02:00
|
|
|
struct LightProbe;
|
2019-01-28 21:08:24 +11:00
|
|
|
struct ListBase;
|
Depsgraph: Cleanup and code simplification
This is mainly a maintenance commit which was aimed to make work with
this module more pleasant and solve such issues as:
- Annoyance with looong files, which had craftload in them
- Usage of STL for the data structures we've got in BLI
- Possible symbol conflicts
- Not real clear layout of what is located where
So in this commit the following changes are done:
- STL is prohibited, it's not really predictable on various compilers,
with our BLI algorithms we can predict things much better.
There are still few usages of std::vector, but that we'll be
solving later once we've got similar thing in BLI.
- Simplify foreach loops, avoid using const_iterator all over the place.
- New directory layout, which is hopefully easier to follow.
- Some files were split, some of them will be split soon.
The idea of this is to split huge functions into own files with
good documentation and everything.
- Removed stuff which was planned for use in the future but was never
finished, tested or anything.
Let's wipe it out for now, and bring back once we really start using
it, so it'll be more clear if it solves our needs.
- All the internal routines were moved to DEG namespace to separate
them better from rest of blender.
Some places now annoyingly using DEG::foo, but that we can olve by
moving some utility functions inside of the namespace.
While working on this we've found some hotspot in updates flush, so
now playback of blenrig is few percent faster (something like 96fps
with previous master and around 99-100fps after this change).
Not saying it's something final, there is still room for cleanup and
API simplification, but those might happen as a regular development
now without doing any global changes.
2016-05-27 18:01:18 +02:00
|
|
|
struct Main;
|
2016-11-17 15:29:22 +01:00
|
|
|
struct Mask;
|
2019-01-28 21:08:24 +11:00
|
|
|
struct Material;
|
2016-11-17 16:37:25 +01:00
|
|
|
struct MovieClip;
|
Depsgraph: Cleanup and code simplification
This is mainly a maintenance commit which was aimed to make work with
this module more pleasant and solve such issues as:
- Annoyance with looong files, which had craftload in them
- Usage of STL for the data structures we've got in BLI
- Possible symbol conflicts
- Not real clear layout of what is located where
So in this commit the following changes are done:
- STL is prohibited, it's not really predictable on various compilers,
with our BLI algorithms we can predict things much better.
There are still few usages of std::vector, but that we'll be
solving later once we've got similar thing in BLI.
- Simplify foreach loops, avoid using const_iterator all over the place.
- New directory layout, which is hopefully easier to follow.
- Some files were split, some of them will be split soon.
The idea of this is to split huge functions into own files with
good documentation and everything.
- Removed stuff which was planned for use in the future but was never
finished, tested or anything.
Let's wipe it out for now, and bring back once we really start using
it, so it'll be more clear if it solves our needs.
- All the internal routines were moved to DEG namespace to separate
them better from rest of blender.
Some places now annoyingly using DEG::foo, but that we can olve by
moving some utility functions inside of the namespace.
While working on this we've found some hotspot in updates flush, so
now playback of blenrig is few percent faster (something like 96fps
with previous master and around 99-100fps after this change).
Not saying it's something final, there is still room for cleanup and
API simplification, but those might happen as a regular development
now without doing any global changes.
2016-05-27 18:01:18 +02:00
|
|
|
struct Object;
|
2017-07-18 12:12:15 +02:00
|
|
|
struct ParticleSettings;
|
Depsgraph: Cleanup and code simplification
This is mainly a maintenance commit which was aimed to make work with
this module more pleasant and solve such issues as:
- Annoyance with looong files, which had craftload in them
- Usage of STL for the data structures we've got in BLI
- Possible symbol conflicts
- Not real clear layout of what is located where
So in this commit the following changes are done:
- STL is prohibited, it's not really predictable on various compilers,
with our BLI algorithms we can predict things much better.
There are still few usages of std::vector, but that we'll be
solving later once we've got similar thing in BLI.
- Simplify foreach loops, avoid using const_iterator all over the place.
- New directory layout, which is hopefully easier to follow.
- Some files were split, some of them will be split soon.
The idea of this is to split huge functions into own files with
good documentation and everything.
- Removed stuff which was planned for use in the future but was never
finished, tested or anything.
Let's wipe it out for now, and bring back once we really start using
it, so it'll be more clear if it solves our needs.
- All the internal routines were moved to DEG namespace to separate
them better from rest of blender.
Some places now annoyingly using DEG::foo, but that we can olve by
moving some utility functions inside of the namespace.
While working on this we've found some hotspot in updates flush, so
now playback of blenrig is few percent faster (something like 96fps
with previous master and around 99-100fps after this change).
Not saying it's something final, there is still room for cleanup and
API simplification, but those might happen as a regular development
now without doing any global changes.
2016-05-27 18:01:18 +02:00
|
|
|
struct Scene;
|
2020-04-20 10:37:38 +02:00
|
|
|
struct Simulation;
|
2018-06-25 11:53:38 +02:00
|
|
|
struct Speaker;
|
Depsgraph: Cleanup and code simplification
This is mainly a maintenance commit which was aimed to make work with
this module more pleasant and solve such issues as:
- Annoyance with looong files, which had craftload in them
- Usage of STL for the data structures we've got in BLI
- Possible symbol conflicts
- Not real clear layout of what is located where
So in this commit the following changes are done:
- STL is prohibited, it's not really predictable on various compilers,
with our BLI algorithms we can predict things much better.
There are still few usages of std::vector, but that we'll be
solving later once we've got similar thing in BLI.
- Simplify foreach loops, avoid using const_iterator all over the place.
- New directory layout, which is hopefully easier to follow.
- Some files were split, some of them will be split soon.
The idea of this is to split huge functions into own files with
good documentation and everything.
- Removed stuff which was planned for use in the future but was never
finished, tested or anything.
Let's wipe it out for now, and bring back once we really start using
it, so it'll be more clear if it solves our needs.
- All the internal routines were moved to DEG namespace to separate
them better from rest of blender.
Some places now annoyingly using DEG::foo, but that we can olve by
moving some utility functions inside of the namespace.
While working on this we've found some hotspot in updates flush, so
now playback of blenrig is few percent faster (something like 96fps
with previous master and around 99-100fps after this change).
Not saying it's something final, there is still room for cleanup and
API simplification, but those might happen as a regular development
now without doing any global changes.
2016-05-27 18:01:18 +02:00
|
|
|
struct Tex;
|
|
|
|
struct World;
|
2019-01-28 21:08:24 +11:00
|
|
|
struct bAction;
|
|
|
|
struct bArmature;
|
|
|
|
struct bConstraint;
|
|
|
|
struct bGPdata;
|
2020-09-30 11:51:13 +10:00
|
|
|
struct bNodeSocket;
|
2019-01-28 21:08:24 +11:00
|
|
|
struct bNodeTree;
|
|
|
|
struct bPoseChannel;
|
2019-05-14 20:20:01 +10:00
|
|
|
struct bSound;
|
Depsgraph: Cleanup and code simplification
This is mainly a maintenance commit which was aimed to make work with
this module more pleasant and solve such issues as:
- Annoyance with looong files, which had craftload in them
- Usage of STL for the data structures we've got in BLI
- Possible symbol conflicts
- Not real clear layout of what is located where
So in this commit the following changes are done:
- STL is prohibited, it's not really predictable on various compilers,
with our BLI algorithms we can predict things much better.
There are still few usages of std::vector, but that we'll be
solving later once we've got similar thing in BLI.
- Simplify foreach loops, avoid using const_iterator all over the place.
- New directory layout, which is hopefully easier to follow.
- Some files were split, some of them will be split soon.
The idea of this is to split huge functions into own files with
good documentation and everything.
- Removed stuff which was planned for use in the future but was never
finished, tested or anything.
Let's wipe it out for now, and bring back once we really start using
it, so it'll be more clear if it solves our needs.
- All the internal routines were moved to DEG namespace to separate
them better from rest of blender.
Some places now annoyingly using DEG::foo, but that we can olve by
moving some utility functions inside of the namespace.
While working on this we've found some hotspot in updates flush, so
now playback of blenrig is few percent faster (something like 96fps
with previous master and around 99-100fps after this change).
Not saying it's something final, there is still room for cleanup and
API simplification, but those might happen as a regular development
now without doing any global changes.
2016-05-27 18:01:18 +02:00
|
|
|
|
2020-06-29 15:19:56 +02:00
|
|
|
namespace blender {
|
|
|
|
namespace deg {
|
Depsgraph: Cleanup and code simplification
This is mainly a maintenance commit which was aimed to make work with
this module more pleasant and solve such issues as:
- Annoyance with looong files, which had craftload in them
- Usage of STL for the data structures we've got in BLI
- Possible symbol conflicts
- Not real clear layout of what is located where
So in this commit the following changes are done:
- STL is prohibited, it's not really predictable on various compilers,
with our BLI algorithms we can predict things much better.
There are still few usages of std::vector, but that we'll be
solving later once we've got similar thing in BLI.
- Simplify foreach loops, avoid using const_iterator all over the place.
- New directory layout, which is hopefully easier to follow.
- Some files were split, some of them will be split soon.
The idea of this is to split huge functions into own files with
good documentation and everything.
- Removed stuff which was planned for use in the future but was never
finished, tested or anything.
Let's wipe it out for now, and bring back once we really start using
it, so it'll be more clear if it solves our needs.
- All the internal routines were moved to DEG namespace to separate
them better from rest of blender.
Some places now annoyingly using DEG::foo, but that we can olve by
moving some utility functions inside of the namespace.
While working on this we've found some hotspot in updates flush, so
now playback of blenrig is few percent faster (something like 96fps
with previous master and around 99-100fps after this change).
Not saying it's something final, there is still room for cleanup and
API simplification, but those might happen as a regular development
now without doing any global changes.
2016-05-27 18:01:18 +02:00
|
|
|
|
2019-01-31 12:56:40 +01:00
|
|
|
struct ComponentNode;
|
2019-01-28 21:08:24 +11:00
|
|
|
struct Depsgraph;
|
2019-04-29 12:55:29 +02:00
|
|
|
class DepsgraphBuilderCache;
|
2019-01-31 12:56:40 +01:00
|
|
|
struct IDNode;
|
|
|
|
struct OperationNode;
|
|
|
|
struct TimeSourceNode;
|
Depsgraph: Cleanup and code simplification
This is mainly a maintenance commit which was aimed to make work with
this module more pleasant and solve such issues as:
- Annoyance with looong files, which had craftload in them
- Usage of STL for the data structures we've got in BLI
- Possible symbol conflicts
- Not real clear layout of what is located where
So in this commit the following changes are done:
- STL is prohibited, it's not really predictable on various compilers,
with our BLI algorithms we can predict things much better.
There are still few usages of std::vector, but that we'll be
solving later once we've got similar thing in BLI.
- Simplify foreach loops, avoid using const_iterator all over the place.
- New directory layout, which is hopefully easier to follow.
- Some files were split, some of them will be split soon.
The idea of this is to split huge functions into own files with
good documentation and everything.
- Removed stuff which was planned for use in the future but was never
finished, tested or anything.
Let's wipe it out for now, and bring back once we really start using
it, so it'll be more clear if it solves our needs.
- All the internal routines were moved to DEG namespace to separate
them better from rest of blender.
Some places now annoyingly using DEG::foo, but that we can olve by
moving some utility functions inside of the namespace.
While working on this we've found some hotspot in updates flush, so
now playback of blenrig is few percent faster (something like 96fps
with previous master and around 99-100fps after this change).
Not saying it's something final, there is still room for cleanup and
API simplification, but those might happen as a regular development
now without doing any global changes.
2016-05-27 18:01:18 +02:00
|
|
|
|
2019-02-27 11:17:36 +01:00
|
|
|
class DepsgraphNodeBuilder : public DepsgraphBuilder {
|
|
|
|
public:
|
2019-04-29 12:55:29 +02:00
|
|
|
DepsgraphNodeBuilder(Main *bmain, Depsgraph *graph, DepsgraphBuilderCache *cache);
|
Depsgraph: Cleanup and code simplification
This is mainly a maintenance commit which was aimed to make work with
this module more pleasant and solve such issues as:
- Annoyance with looong files, which had craftload in them
- Usage of STL for the data structures we've got in BLI
- Possible symbol conflicts
- Not real clear layout of what is located where
So in this commit the following changes are done:
- STL is prohibited, it's not really predictable on various compilers,
with our BLI algorithms we can predict things much better.
There are still few usages of std::vector, but that we'll be
solving later once we've got similar thing in BLI.
- Simplify foreach loops, avoid using const_iterator all over the place.
- New directory layout, which is hopefully easier to follow.
- Some files were split, some of them will be split soon.
The idea of this is to split huge functions into own files with
good documentation and everything.
- Removed stuff which was planned for use in the future but was never
finished, tested or anything.
Let's wipe it out for now, and bring back once we really start using
it, so it'll be more clear if it solves our needs.
- All the internal routines were moved to DEG namespace to separate
them better from rest of blender.
Some places now annoyingly using DEG::foo, but that we can olve by
moving some utility functions inside of the namespace.
While working on this we've found some hotspot in updates flush, so
now playback of blenrig is few percent faster (something like 96fps
with previous master and around 99-100fps after this change).
Not saying it's something final, there is still room for cleanup and
API simplification, but those might happen as a regular development
now without doing any global changes.
2016-05-27 18:01:18 +02:00
|
|
|
~DepsgraphNodeBuilder();
|
|
|
|
|
2017-07-27 14:57:47 +02:00
|
|
|
/* For given original ID get ID which is created by CoW system. */
|
Depsgraph: Initial groundwork for copy-on-write support
< Dependency graph Copy-on-Write >
--------------------------------
\ ^__^
\ (oo)\_______
(__)\ )\/\
||----w |
|| ||
This is an initial commit of Copy-on-write support added to dependency graph.
Main priority for now: get playback (Alt-A) and all operators (selection,
transform etc) to work with the new concept of clear separation between
evaluated data coming from dependency graph and original data coming from
.blend file (and stored in bmain).
= How does this work? =
The idea is to support Copy-on-Write on the ID level. This means, we duplicate
the whole ID before we cann it's evaluaiton function. This is currently done
in the following way:
- At the depsgraph construction time we create "shallow" copy of the ID
datablock, just so we know it's pointer in memory and can use for function
bindings.
- At the evaluaiton time, the copy of ID get's "expanded" (needs a better
name internally, so it does not conflict with expanding datablocks during
library linking), which means the content of the datablock is being
copied over and all IDs are getting remapped to the copied ones.
Currently we do the whole copy, in the future we will support some tricks
here to prevent duplicating geometry arrays (verts, edges, loops, faces
and polys) when we don't need that.
- Evaluation functions are operating on copied datablocks and never touching
original datablock.
- There are some cases when we need to know non-ID pointers for function
bindings. This mainly applies to scene collections and armatures. The
idea of dealing with this is to "expand" copy-on-write datablock at
the dependency graph build time. This might introduce some slowdown to the
dependency graph construction time, but allows us to have minimal changes
in the code and avoid any hash look-up from evaluation function (one of
the ideas to avoid using pointers as function bindings is to pass name
of layer or a bone to the evaluation function and look up actual data based
on that name).
Currently there is a special function in depsgraph which does such a
synchronization, in the future we might want to make it more generic.
At some point we need to synchronize copy-on-write version of datablock with
the original version. This happens, i.e., when we change active object or
change selection. We don't want any actual evaluation of update flush happening
for such thins, so now we have a special update tag:
DEG_id_tag_update((id, DEG_TAG_COPY_ON_WRITE)
- For the render engines we now have special call for the dependency graph to
give evaluated datablock for the given original one. This isn't fully ideal
but allows to have Cycles viewport render.
This is definitely a subject for further investigation / improvement.
This call will tag copy-on-write component tagged for update without causing
updates to be flushed to any other objects, causing chain reaction of updates.
This tag is handy when selection in the scene changes.
This basically summarizes ideas underneath this commit. The code should be
reasonably documented.
Here is a demo of dependency graph with all copy-on-write stuff in it:
https://developer.blender.org/F635468
= What to expect to (not) work? =
- Only meshes are properly-ish aware of copy-on-write currently, Non-mesh
geometry will probably crash or will not work at all.
- Armatures will need similar depsgraph built-time expansion of the copied
datablock.
- There are some extra tags / relations added, to keep things demo-able but
which are slowing things down for evaluation.
- Edit mode works for until click selection is used (due to the selection
code using EditDerivedMesh created ad-hoc).
- Lots of tools will lack tagging synchronization of copied datablock for
sync with original ID.
= How to move forward? =
There is some tedious work related on going over all the tools, checking
whether they need to work with original or final evaluated object and make
the required changes.
Additionally, there need synchronization tag done in fair amount of tools
and operators as well. For example, currently it's not possible to change
render engine without re-opening the file or forcing dependency graph for
re-build via python console.
There is also now some thoughts required about copying evaluated properties
between objects or from collection to a new object. Perhaps easiest way
would be to move base flag flush to Object ID node and tag new objects for
update instead of doing manual copy.
here is some WIP patch which moves such evaluaiton / flush:
https://developer.blender.org/F635479
Lots of TODOs in the code, with possible optimization.
= How to test? =
This is a feature under heavy development, so obviously it is disabled by
default. The only reason it goes to 2.8 branch is to avoid possible merge
hell.
In order to enable this feature use WITH_DEPSGRAPH_COPY_ON_WRITE CMake
configuration option.
2017-06-14 10:26:24 +02:00
|
|
|
ID *get_cow_id(const ID *id_orig) const;
|
2017-07-27 14:57:47 +02:00
|
|
|
/* Similar to above, but for the cases when there is no ID node we create
|
2019-01-31 12:56:40 +01:00
|
|
|
* one. */
|
2017-07-27 14:57:47 +02:00
|
|
|
ID *ensure_cow_id(ID *id_orig);
|
|
|
|
|
|
|
|
/* Helper wrapper function which wraps get_cow_id with a needed type cast. */
|
2017-07-14 14:56:54 +02:00
|
|
|
template<typename T> T *get_cow_datablock(const T *orig) const
|
|
|
|
{
|
|
|
|
return (T *)get_cow_id(&orig->id);
|
|
|
|
}
|
2017-07-27 14:57:47 +02:00
|
|
|
|
|
|
|
/* For a given COW datablock get corresponding original one. */
|
2017-07-19 12:44:27 +02:00
|
|
|
template<typename T> T *get_orig_datablock(const T *cow) const
|
|
|
|
{
|
2018-05-31 13:42:55 +02:00
|
|
|
return (T *)cow->id.orig_id;
|
2017-07-19 12:44:27 +02:00
|
|
|
}
|
|
|
|
|
2019-09-20 16:42:04 +02:00
|
|
|
virtual void begin_build();
|
|
|
|
virtual void end_build();
|
2017-07-14 14:56:54 +02:00
|
|
|
|
2019-01-31 12:56:40 +01:00
|
|
|
IDNode *add_id_node(ID *id);
|
|
|
|
IDNode *find_id_node(ID *id);
|
|
|
|
TimeSourceNode *add_time_source();
|
Depsgraph: Cleanup and code simplification
This is mainly a maintenance commit which was aimed to make work with
this module more pleasant and solve such issues as:
- Annoyance with looong files, which had craftload in them
- Usage of STL for the data structures we've got in BLI
- Possible symbol conflicts
- Not real clear layout of what is located where
So in this commit the following changes are done:
- STL is prohibited, it's not really predictable on various compilers,
with our BLI algorithms we can predict things much better.
There are still few usages of std::vector, but that we'll be
solving later once we've got similar thing in BLI.
- Simplify foreach loops, avoid using const_iterator all over the place.
- New directory layout, which is hopefully easier to follow.
- Some files were split, some of them will be split soon.
The idea of this is to split huge functions into own files with
good documentation and everything.
- Removed stuff which was planned for use in the future but was never
finished, tested or anything.
Let's wipe it out for now, and bring back once we really start using
it, so it'll be more clear if it solves our needs.
- All the internal routines were moved to DEG namespace to separate
them better from rest of blender.
Some places now annoyingly using DEG::foo, but that we can olve by
moving some utility functions inside of the namespace.
While working on this we've found some hotspot in updates flush, so
now playback of blenrig is few percent faster (something like 96fps
with previous master and around 99-100fps after this change).
Not saying it's something final, there is still room for cleanup and
API simplification, but those might happen as a regular development
now without doing any global changes.
2016-05-27 18:01:18 +02:00
|
|
|
|
2019-01-31 12:56:40 +01:00
|
|
|
ComponentNode *add_component_node(ID *id, NodeType comp_type, const char *comp_name = "");
|
Depsgraph: Cleanup and code simplification
This is mainly a maintenance commit which was aimed to make work with
this module more pleasant and solve such issues as:
- Annoyance with looong files, which had craftload in them
- Usage of STL for the data structures we've got in BLI
- Possible symbol conflicts
- Not real clear layout of what is located where
So in this commit the following changes are done:
- STL is prohibited, it's not really predictable on various compilers,
with our BLI algorithms we can predict things much better.
There are still few usages of std::vector, but that we'll be
solving later once we've got similar thing in BLI.
- Simplify foreach loops, avoid using const_iterator all over the place.
- New directory layout, which is hopefully easier to follow.
- Some files were split, some of them will be split soon.
The idea of this is to split huge functions into own files with
good documentation and everything.
- Removed stuff which was planned for use in the future but was never
finished, tested or anything.
Let's wipe it out for now, and bring back once we really start using
it, so it'll be more clear if it solves our needs.
- All the internal routines were moved to DEG namespace to separate
them better from rest of blender.
Some places now annoyingly using DEG::foo, but that we can olve by
moving some utility functions inside of the namespace.
While working on this we've found some hotspot in updates flush, so
now playback of blenrig is few percent faster (something like 96fps
with previous master and around 99-100fps after this change).
Not saying it's something final, there is still room for cleanup and
API simplification, but those might happen as a regular development
now without doing any global changes.
2016-05-27 18:01:18 +02:00
|
|
|
|
2019-01-31 12:56:40 +01:00
|
|
|
OperationNode *add_operation_node(ComponentNode *comp_node,
|
|
|
|
OperationCode opcode,
|
2020-01-28 14:50:13 +01:00
|
|
|
const DepsEvalOperationCb &op = nullptr,
|
2019-01-31 12:56:40 +01:00
|
|
|
const char *name = "",
|
|
|
|
int name_tag = -1);
|
|
|
|
OperationNode *add_operation_node(ID *id,
|
|
|
|
NodeType comp_type,
|
|
|
|
const char *comp_name,
|
|
|
|
OperationCode opcode,
|
2020-01-28 14:50:13 +01:00
|
|
|
const DepsEvalOperationCb &op = nullptr,
|
2019-01-31 12:56:40 +01:00
|
|
|
const char *name = "",
|
|
|
|
int name_tag = -1);
|
|
|
|
OperationNode *add_operation_node(ID *id,
|
|
|
|
NodeType comp_type,
|
|
|
|
OperationCode opcode,
|
2020-01-28 14:50:13 +01:00
|
|
|
const DepsEvalOperationCb &op = nullptr,
|
2019-01-31 12:56:40 +01:00
|
|
|
const char *name = "",
|
|
|
|
int name_tag = -1);
|
Depsgraph: Cleanup and code simplification
This is mainly a maintenance commit which was aimed to make work with
this module more pleasant and solve such issues as:
- Annoyance with looong files, which had craftload in them
- Usage of STL for the data structures we've got in BLI
- Possible symbol conflicts
- Not real clear layout of what is located where
So in this commit the following changes are done:
- STL is prohibited, it's not really predictable on various compilers,
with our BLI algorithms we can predict things much better.
There are still few usages of std::vector, but that we'll be
solving later once we've got similar thing in BLI.
- Simplify foreach loops, avoid using const_iterator all over the place.
- New directory layout, which is hopefully easier to follow.
- Some files were split, some of them will be split soon.
The idea of this is to split huge functions into own files with
good documentation and everything.
- Removed stuff which was planned for use in the future but was never
finished, tested or anything.
Let's wipe it out for now, and bring back once we really start using
it, so it'll be more clear if it solves our needs.
- All the internal routines were moved to DEG namespace to separate
them better from rest of blender.
Some places now annoyingly using DEG::foo, but that we can olve by
moving some utility functions inside of the namespace.
While working on this we've found some hotspot in updates flush, so
now playback of blenrig is few percent faster (something like 96fps
with previous master and around 99-100fps after this change).
Not saying it's something final, there is still room for cleanup and
API simplification, but those might happen as a regular development
now without doing any global changes.
2016-05-27 18:01:18 +02:00
|
|
|
|
2019-01-31 12:56:40 +01:00
|
|
|
OperationNode *ensure_operation_node(ID *id,
|
|
|
|
NodeType comp_type,
|
|
|
|
OperationCode opcode,
|
2020-01-28 14:50:13 +01:00
|
|
|
const DepsEvalOperationCb &op = nullptr,
|
2019-01-31 12:56:40 +01:00
|
|
|
const char *name = "",
|
|
|
|
int name_tag = -1);
|
2018-03-02 14:35:19 +01:00
|
|
|
|
Depsgraph: Cleanup and code simplification
This is mainly a maintenance commit which was aimed to make work with
this module more pleasant and solve such issues as:
- Annoyance with looong files, which had craftload in them
- Usage of STL for the data structures we've got in BLI
- Possible symbol conflicts
- Not real clear layout of what is located where
So in this commit the following changes are done:
- STL is prohibited, it's not really predictable on various compilers,
with our BLI algorithms we can predict things much better.
There are still few usages of std::vector, but that we'll be
solving later once we've got similar thing in BLI.
- Simplify foreach loops, avoid using const_iterator all over the place.
- New directory layout, which is hopefully easier to follow.
- Some files were split, some of them will be split soon.
The idea of this is to split huge functions into own files with
good documentation and everything.
- Removed stuff which was planned for use in the future but was never
finished, tested or anything.
Let's wipe it out for now, and bring back once we really start using
it, so it'll be more clear if it solves our needs.
- All the internal routines were moved to DEG namespace to separate
them better from rest of blender.
Some places now annoyingly using DEG::foo, but that we can olve by
moving some utility functions inside of the namespace.
While working on this we've found some hotspot in updates flush, so
now playback of blenrig is few percent faster (something like 96fps
with previous master and around 99-100fps after this change).
Not saying it's something final, there is still room for cleanup and
API simplification, but those might happen as a regular development
now without doing any global changes.
2016-05-27 18:01:18 +02:00
|
|
|
bool has_operation_node(ID *id,
|
2019-01-31 12:56:40 +01:00
|
|
|
NodeType comp_type,
|
2016-11-03 12:14:47 +01:00
|
|
|
const char *comp_name,
|
2019-01-31 12:56:40 +01:00
|
|
|
OperationCode opcode,
|
2016-11-03 14:45:47 +01:00
|
|
|
const char *name = "",
|
2016-11-03 14:31:27 +01:00
|
|
|
int name_tag = -1);
|
Depsgraph: Cleanup and code simplification
This is mainly a maintenance commit which was aimed to make work with
this module more pleasant and solve such issues as:
- Annoyance with looong files, which had craftload in them
- Usage of STL for the data structures we've got in BLI
- Possible symbol conflicts
- Not real clear layout of what is located where
So in this commit the following changes are done:
- STL is prohibited, it's not really predictable on various compilers,
with our BLI algorithms we can predict things much better.
There are still few usages of std::vector, but that we'll be
solving later once we've got similar thing in BLI.
- Simplify foreach loops, avoid using const_iterator all over the place.
- New directory layout, which is hopefully easier to follow.
- Some files were split, some of them will be split soon.
The idea of this is to split huge functions into own files with
good documentation and everything.
- Removed stuff which was planned for use in the future but was never
finished, tested or anything.
Let's wipe it out for now, and bring back once we really start using
it, so it'll be more clear if it solves our needs.
- All the internal routines were moved to DEG namespace to separate
them better from rest of blender.
Some places now annoyingly using DEG::foo, but that we can olve by
moving some utility functions inside of the namespace.
While working on this we've found some hotspot in updates flush, so
now playback of blenrig is few percent faster (something like 96fps
with previous master and around 99-100fps after this change).
Not saying it's something final, there is still room for cleanup and
API simplification, but those might happen as a regular development
now without doing any global changes.
2016-05-27 18:01:18 +02:00
|
|
|
|
2019-01-31 12:56:40 +01:00
|
|
|
OperationNode *find_operation_node(ID *id,
|
|
|
|
NodeType comp_type,
|
|
|
|
const char *comp_name,
|
|
|
|
OperationCode opcode,
|
|
|
|
const char *name = "",
|
2016-11-03 14:31:27 +01:00
|
|
|
int name_tag = -1);
|
Depsgraph: Cleanup and code simplification
This is mainly a maintenance commit which was aimed to make work with
this module more pleasant and solve such issues as:
- Annoyance with looong files, which had craftload in them
- Usage of STL for the data structures we've got in BLI
- Possible symbol conflicts
- Not real clear layout of what is located where
So in this commit the following changes are done:
- STL is prohibited, it's not really predictable on various compilers,
with our BLI algorithms we can predict things much better.
There are still few usages of std::vector, but that we'll be
solving later once we've got similar thing in BLI.
- Simplify foreach loops, avoid using const_iterator all over the place.
- New directory layout, which is hopefully easier to follow.
- Some files were split, some of them will be split soon.
The idea of this is to split huge functions into own files with
good documentation and everything.
- Removed stuff which was planned for use in the future but was never
finished, tested or anything.
Let's wipe it out for now, and bring back once we really start using
it, so it'll be more clear if it solves our needs.
- All the internal routines were moved to DEG namespace to separate
them better from rest of blender.
Some places now annoyingly using DEG::foo, but that we can olve by
moving some utility functions inside of the namespace.
While working on this we've found some hotspot in updates flush, so
now playback of blenrig is few percent faster (something like 96fps
with previous master and around 99-100fps after this change).
Not saying it's something final, there is still room for cleanup and
API simplification, but those might happen as a regular development
now without doing any global changes.
2016-05-27 18:01:18 +02:00
|
|
|
|
2019-01-31 12:56:40 +01:00
|
|
|
OperationNode *find_operation_node(
|
|
|
|
ID *id, NodeType comp_type, OperationCode opcode, const char *name = "", int name_tag = -1);
|
Depsgraph: Cleanup and code simplification
This is mainly a maintenance commit which was aimed to make work with
this module more pleasant and solve such issues as:
- Annoyance with looong files, which had craftload in them
- Usage of STL for the data structures we've got in BLI
- Possible symbol conflicts
- Not real clear layout of what is located where
So in this commit the following changes are done:
- STL is prohibited, it's not really predictable on various compilers,
with our BLI algorithms we can predict things much better.
There are still few usages of std::vector, but that we'll be
solving later once we've got similar thing in BLI.
- Simplify foreach loops, avoid using const_iterator all over the place.
- New directory layout, which is hopefully easier to follow.
- Some files were split, some of them will be split soon.
The idea of this is to split huge functions into own files with
good documentation and everything.
- Removed stuff which was planned for use in the future but was never
finished, tested or anything.
Let's wipe it out for now, and bring back once we really start using
it, so it'll be more clear if it solves our needs.
- All the internal routines were moved to DEG namespace to separate
them better from rest of blender.
Some places now annoyingly using DEG::foo, but that we can olve by
moving some utility functions inside of the namespace.
While working on this we've found some hotspot in updates flush, so
now playback of blenrig is few percent faster (something like 96fps
with previous master and around 99-100fps after this change).
Not saying it's something final, there is still room for cleanup and
API simplification, but those might happen as a regular development
now without doing any global changes.
2016-05-27 18:01:18 +02:00
|
|
|
|
2019-09-20 16:42:04 +02:00
|
|
|
virtual void build_id(ID *id);
|
|
|
|
|
2020-04-28 11:45:57 +02:00
|
|
|
virtual void build_idproperties(IDProperty *id_property);
|
|
|
|
|
2019-09-20 16:42:04 +02:00
|
|
|
virtual void build_scene_render(Scene *scene, ViewLayer *view_layer);
|
|
|
|
virtual void build_scene_parameters(Scene *scene);
|
|
|
|
virtual void build_scene_compositor(Scene *scene);
|
|
|
|
|
|
|
|
virtual void build_layer_collections(ListBase *lb);
|
|
|
|
virtual void build_view_layer(Scene *scene,
|
|
|
|
ViewLayer *view_layer,
|
|
|
|
eDepsNode_LinkedState_Type linked_state);
|
|
|
|
virtual void build_collection(LayerCollection *from_layer_collection, Collection *collection);
|
|
|
|
virtual void build_object(int base_index,
|
|
|
|
Object *object,
|
|
|
|
eDepsNode_LinkedState_Type linked_state,
|
|
|
|
bool is_visible);
|
|
|
|
virtual void build_object_proxy_from(Object *object, bool is_object_visible);
|
|
|
|
virtual void build_object_proxy_group(Object *object, bool is_object_visible);
|
2020-03-23 11:38:07 +01:00
|
|
|
virtual void build_object_instance_collection(Object *object, bool is_object_visible);
|
2020-06-26 12:29:20 +02:00
|
|
|
virtual void build_object_from_layer(int base_index,
|
|
|
|
Object *object,
|
|
|
|
eDepsNode_LinkedState_Type linked_state);
|
2019-09-20 16:42:04 +02:00
|
|
|
virtual void build_object_flags(int base_index,
|
|
|
|
Object *object,
|
|
|
|
eDepsNode_LinkedState_Type linked_state);
|
|
|
|
virtual void build_object_data(Object *object, bool is_object_visible);
|
|
|
|
virtual void build_object_data_camera(Object *object);
|
|
|
|
virtual void build_object_data_geometry(Object *object, bool is_object_visible);
|
|
|
|
virtual void build_object_data_geometry_datablock(ID *obdata, bool is_object_visible);
|
|
|
|
virtual void build_object_data_light(Object *object);
|
|
|
|
virtual void build_object_data_lightprobe(Object *object);
|
|
|
|
virtual void build_object_data_speaker(Object *object);
|
|
|
|
virtual void build_object_transform(Object *object);
|
|
|
|
virtual void build_object_constraints(Object *object);
|
|
|
|
virtual void build_object_pointcache(Object *object);
|
|
|
|
virtual void build_pose_constraints(Object *object,
|
|
|
|
bPoseChannel *pchan,
|
|
|
|
int pchan_index,
|
|
|
|
bool is_object_visible);
|
|
|
|
virtual void build_rigidbody(Scene *scene);
|
|
|
|
virtual void build_particle_systems(Object *object, bool is_object_visible);
|
|
|
|
virtual void build_particle_settings(ParticleSettings *part);
|
|
|
|
virtual void build_animdata(ID *id);
|
|
|
|
virtual void build_animdata_nlastrip_targets(ListBase *strips);
|
|
|
|
virtual void build_animation_images(ID *id);
|
|
|
|
virtual void build_action(bAction *action);
|
|
|
|
virtual void build_driver(ID *id, FCurve *fcurve, int driver_index);
|
|
|
|
virtual void build_driver_variables(ID *id, FCurve *fcurve);
|
|
|
|
virtual void build_driver_id_property(ID *id, const char *rna_path);
|
|
|
|
virtual void build_parameters(ID *id);
|
2020-03-05 17:37:30 +01:00
|
|
|
virtual void build_dimensions(Object *object);
|
2019-09-20 16:42:04 +02:00
|
|
|
virtual void build_ik_pose(Object *object, bPoseChannel *pchan, bConstraint *con);
|
|
|
|
virtual void build_splineik_pose(Object *object, bPoseChannel *pchan, bConstraint *con);
|
|
|
|
virtual void build_rig(Object *object, bool is_object_visible);
|
2020-06-23 17:03:18 +02:00
|
|
|
virtual void build_proxy_rig(Object *object, bool is_object_visible);
|
2019-09-20 16:42:04 +02:00
|
|
|
virtual void build_armature(bArmature *armature);
|
2020-04-28 11:45:57 +02:00
|
|
|
virtual void build_armature_bones(ListBase *bones);
|
2019-09-20 16:42:04 +02:00
|
|
|
virtual void build_shapekeys(Key *key);
|
|
|
|
virtual void build_camera(Camera *camera);
|
|
|
|
virtual void build_light(Light *lamp);
|
|
|
|
virtual void build_nodetree(bNodeTree *ntree);
|
2020-07-22 19:12:44 +02:00
|
|
|
virtual void build_nodetree_socket(bNodeSocket *socket);
|
2019-09-20 16:42:04 +02:00
|
|
|
virtual void build_material(Material *ma);
|
|
|
|
virtual void build_materials(Material **materials, int num_materials);
|
2020-01-16 14:57:33 +01:00
|
|
|
virtual void build_freestyle_lineset(FreestyleLineSet *fls);
|
|
|
|
virtual void build_freestyle_linestyle(FreestyleLineStyle *linestyle);
|
2019-09-20 16:42:04 +02:00
|
|
|
virtual void build_texture(Tex *tex);
|
|
|
|
virtual void build_image(Image *image);
|
|
|
|
virtual void build_world(World *world);
|
|
|
|
virtual void build_gpencil(bGPdata *gpd);
|
|
|
|
virtual void build_cachefile(CacheFile *cache_file);
|
|
|
|
virtual void build_mask(Mask *mask);
|
|
|
|
virtual void build_movieclip(MovieClip *clip);
|
|
|
|
virtual void build_lightprobe(LightProbe *probe);
|
|
|
|
virtual void build_speaker(Speaker *speaker);
|
|
|
|
virtual void build_sound(bSound *sound);
|
2020-04-20 10:37:38 +02:00
|
|
|
virtual void build_simulation(Simulation *simulation);
|
2019-09-20 16:42:04 +02:00
|
|
|
virtual void build_scene_sequencer(Scene *scene);
|
|
|
|
virtual void build_scene_audio(Scene *scene);
|
|
|
|
virtual void build_scene_speakers(Scene *scene, ViewLayer *view_layer);
|
Depsgraph: Cleanup and code simplification
This is mainly a maintenance commit which was aimed to make work with
this module more pleasant and solve such issues as:
- Annoyance with looong files, which had craftload in them
- Usage of STL for the data structures we've got in BLI
- Possible symbol conflicts
- Not real clear layout of what is located where
So in this commit the following changes are done:
- STL is prohibited, it's not really predictable on various compilers,
with our BLI algorithms we can predict things much better.
There are still few usages of std::vector, but that we'll be
solving later once we've got similar thing in BLI.
- Simplify foreach loops, avoid using const_iterator all over the place.
- New directory layout, which is hopefully easier to follow.
- Some files were split, some of them will be split soon.
The idea of this is to split huge functions into own files with
good documentation and everything.
- Removed stuff which was planned for use in the future but was never
finished, tested or anything.
Let's wipe it out for now, and bring back once we really start using
it, so it'll be more clear if it solves our needs.
- All the internal routines were moved to DEG namespace to separate
them better from rest of blender.
Some places now annoyingly using DEG::foo, but that we can olve by
moving some utility functions inside of the namespace.
While working on this we've found some hotspot in updates flush, so
now playback of blenrig is few percent faster (something like 96fps
with previous master and around 99-100fps after this change).
Not saying it's something final, there is still room for cleanup and
API simplification, but those might happen as a regular development
now without doing any global changes.
2016-05-27 18:01:18 +02:00
|
|
|
|
2018-09-03 12:39:56 +02:00
|
|
|
/* Per-ID information about what was already in the dependency graph.
|
2019-01-31 12:56:40 +01:00
|
|
|
* Allows to re-use certain values, to speed up following evaluation. */
|
2018-09-03 12:39:56 +02:00
|
|
|
struct IDInfo {
|
|
|
|
/* Copy-on-written pointer of the corresponding ID. */
|
|
|
|
ID *id_cow;
|
2018-09-19 15:46:03 +02:00
|
|
|
/* Mask of visible components from previous state of the
|
2019-01-31 12:56:40 +01:00
|
|
|
* dependency graph. */
|
2018-09-19 15:46:03 +02:00
|
|
|
IDComponentsMask previously_visible_components_mask;
|
2018-10-24 19:38:50 +03:00
|
|
|
/* Special evaluation flag mask from the previous depsgraph. */
|
|
|
|
uint32_t previous_eval_flags;
|
2018-12-03 18:09:45 +03:00
|
|
|
/* Mesh CustomData mask from the previous depsgraph. */
|
Refactor CDData masks, to have one mask per mesh elem type.
We already have different storages for cddata of verts, edges etc.,
'simply' do the same for the mask flags we use all around Blender code
to request some data, or limit some operation to some layers, etc.
Reason we need this is that some cddata types (like Normals) are
actually shared between verts/polys/loops, and we don’t want to generate
clnors everytime we request vnors!
As a side note, this also does final fix to T59338, which was the
trigger for this patch (need to request computed loop normals for
another mesh than evaluated one).
Reviewers: brecht, campbellbarton, sergey
Differential Revision: https://developer.blender.org/D4407
2019-03-07 11:13:40 +01:00
|
|
|
DEGCustomDataMeshMasks previous_customdata_masks;
|
2018-09-03 12:39:56 +02:00
|
|
|
};
|
|
|
|
|
Depsgraph: Cleanup and code simplification
This is mainly a maintenance commit which was aimed to make work with
this module more pleasant and solve such issues as:
- Annoyance with looong files, which had craftload in them
- Usage of STL for the data structures we've got in BLI
- Possible symbol conflicts
- Not real clear layout of what is located where
So in this commit the following changes are done:
- STL is prohibited, it's not really predictable on various compilers,
with our BLI algorithms we can predict things much better.
There are still few usages of std::vector, but that we'll be
solving later once we've got similar thing in BLI.
- Simplify foreach loops, avoid using const_iterator all over the place.
- New directory layout, which is hopefully easier to follow.
- Some files were split, some of them will be split soon.
The idea of this is to split huge functions into own files with
good documentation and everything.
- Removed stuff which was planned for use in the future but was never
finished, tested or anything.
Let's wipe it out for now, and bring back once we really start using
it, so it'll be more clear if it solves our needs.
- All the internal routines were moved to DEG namespace to separate
them better from rest of blender.
Some places now annoyingly using DEG::foo, but that we can olve by
moving some utility functions inside of the namespace.
While working on this we've found some hotspot in updates flush, so
now playback of blenrig is few percent faster (something like 96fps
with previous master and around 99-100fps after this change).
Not saying it's something final, there is still room for cleanup and
API simplification, but those might happen as a regular development
now without doing any global changes.
2016-05-27 18:01:18 +02:00
|
|
|
protected:
|
2018-09-03 12:39:56 +02:00
|
|
|
/* Allows to identify an operation which was tagged for update at the time
|
|
|
|
* relations are being updated. We can not reuse operation node pointer
|
2019-01-31 12:56:40 +01:00
|
|
|
* since it will change during dependency graph construction. */
|
2017-11-24 15:07:09 +01:00
|
|
|
struct SavedEntryTag {
|
2018-09-03 12:57:04 +02:00
|
|
|
ID *id_orig;
|
2019-01-31 12:56:40 +01:00
|
|
|
NodeType component_type;
|
|
|
|
OperationCode opcode;
|
2019-02-18 16:24:51 +01:00
|
|
|
string name;
|
2018-10-29 20:52:32 +03:00
|
|
|
int name_tag;
|
2017-11-24 15:07:09 +01:00
|
|
|
};
|
2020-06-10 15:25:39 +02:00
|
|
|
Vector<SavedEntryTag> saved_entry_tags_;
|
2017-11-24 15:07:09 +01:00
|
|
|
|
2018-04-05 18:03:36 +02:00
|
|
|
struct BuilderWalkUserData {
|
|
|
|
DepsgraphNodeBuilder *builder;
|
2018-09-14 12:26:49 +02:00
|
|
|
/* Denotes whether object the walk is invoked from is visible. */
|
|
|
|
bool is_parent_visible;
|
2018-04-05 18:03:36 +02:00
|
|
|
};
|
|
|
|
static void modifier_walk(void *user_data,
|
|
|
|
struct Object *object,
|
|
|
|
struct ID **idpoin,
|
|
|
|
int cb_flag);
|
|
|
|
static void constraint_walk(bConstraint *constraint,
|
|
|
|
ID **idpoin,
|
|
|
|
bool is_reference,
|
|
|
|
void *user_data);
|
|
|
|
|
2017-11-08 18:06:51 +01:00
|
|
|
/* State which demotes currently built entities. */
|
|
|
|
Scene *scene_;
|
2018-04-11 12:39:36 +02:00
|
|
|
ViewLayer *view_layer_;
|
2018-04-19 12:03:02 +02:00
|
|
|
int view_layer_index_;
|
2018-08-23 16:17:06 +02:00
|
|
|
/* NOTE: Collection are possibly built recursively, so be careful when
|
2019-01-31 12:56:40 +01:00
|
|
|
* setting the current state. */
|
2018-08-23 16:17:06 +02:00
|
|
|
Collection *collection_;
|
2019-09-18 17:37:09 +02:00
|
|
|
/* Accumulated flag over the hierarchy of currently building collections.
|
2018-08-24 10:54:18 +02:00
|
|
|
* Denotes whether all the hierarchy from parent of collection_ to the
|
2019-01-31 12:56:40 +01:00
|
|
|
* very root is visible (aka not restricted.). */
|
2018-08-24 10:54:18 +02:00
|
|
|
bool is_parent_collection_visible_;
|
2017-11-09 10:59:15 +01:00
|
|
|
|
2021-01-12 17:12:27 +01:00
|
|
|
/* Indexed by original ID.session_uuid, values are IDInfo. */
|
|
|
|
Map<uint, IDInfo *> id_info_hash_;
|
2018-09-03 12:39:56 +02:00
|
|
|
|
|
|
|
/* Set of IDs which were already build. Makes it easier to keep track of
|
2019-01-31 12:56:40 +01:00
|
|
|
* what was already built and what was not. */
|
2018-02-22 11:03:39 +01:00
|
|
|
BuilderMap built_map_;
|
Depsgraph: Cleanup and code simplification
This is mainly a maintenance commit which was aimed to make work with
this module more pleasant and solve such issues as:
- Annoyance with looong files, which had craftload in them
- Usage of STL for the data structures we've got in BLI
- Possible symbol conflicts
- Not real clear layout of what is located where
So in this commit the following changes are done:
- STL is prohibited, it's not really predictable on various compilers,
with our BLI algorithms we can predict things much better.
There are still few usages of std::vector, but that we'll be
solving later once we've got similar thing in BLI.
- Simplify foreach loops, avoid using const_iterator all over the place.
- New directory layout, which is hopefully easier to follow.
- Some files were split, some of them will be split soon.
The idea of this is to split huge functions into own files with
good documentation and everything.
- Removed stuff which was planned for use in the future but was never
finished, tested or anything.
Let's wipe it out for now, and bring back once we really start using
it, so it'll be more clear if it solves our needs.
- All the internal routines were moved to DEG namespace to separate
them better from rest of blender.
Some places now annoyingly using DEG::foo, but that we can olve by
moving some utility functions inside of the namespace.
While working on this we've found some hotspot in updates flush, so
now playback of blenrig is few percent faster (something like 96fps
with previous master and around 99-100fps after this change).
Not saying it's something final, there is still room for cleanup and
API simplification, but those might happen as a regular development
now without doing any global changes.
2016-05-27 18:01:18 +02:00
|
|
|
};
|
|
|
|
|
2020-06-29 15:19:56 +02:00
|
|
|
} // namespace deg
|
|
|
|
} // namespace blender
|