Age | Commit message (Collapse) | Author |
|
We were never removing the parent collection from a collection upon removal
of the parent.
Reviewers: mont29
Differential Revision: https://developer.blender.org/D4099
|
|
|
|
|
|
collection.
We have to ensure objects get expected RB data, when they are added to a
RB collection...
|
|
|
|
There were at least three copies of those:
- OB_RECALC* family of flags, which are rudiment of an old
dependency graph system.
- PSYS_RECALC* which were used by old dependency graph system
as a separate set since the graph itself did not handle
particle systems.
- DEG_TAG_* which was used to tag IDs.
Now there is a single set, which defines what can be tagged
and queried for an update. It also has some aggregate flags
to make queries simpler.
Lets once and for all solve the madness of those flags, stick
to a single set, which will not overlap with anything or require
any extra conversion.
Technically, shouldn't be measurable user difference, but some
of the agregate flags for few dependency graph components did
change.
Fixes T58632: Particle don't update rotation settings
|
|
Logical flaw in `BKE_scene_objects_iterator_begin()` code (two errors
actually, wrong handling of first object of Master collection, and
missing call to `object_base_unique()` to 'register' that first object
and avoid getting it returned a second time).
Simply fixed by always calling `BKE_scene_objects_iterator_next()`
after minimal proper init, that one knows how to do the things. ;)
|
|
Note we still have hardcoded IFACE_("Scene Collection") in the outliner.
I'm ok with getting of them as well, though no strong feelings here.
|
|
|
|
Hope this time we are done for good (root of the issue was that master
collections are not in bmain...).
|
|
Related to T57372: Second full scene copy crashes on deletion (fixes
deleting second copy, but now it crashes on deleting the first copy...).
|
|
|
|
Copying an ID also add a default user to new one (just like creating an
ID), by default...
|
|
Reviewers: brecht
Differential Revision: https://developer.blender.org/D3814
|
|
Differential Revision: https://developer.blender.org/D3719
|
|
Object bases hash always needs to be freed on library remapping.
|
|
Simplify library remapping code to handle special collection/object links
in postprocess. Previously base contained the actual object link which
needed special handling in preprocess, now objects are linked through
collection and the base cache can be updated in postprocess.
|
|
|
|
Most of these were mismatched const qualifiers
|
|
|
|
Because looping over the scene is unsafe and slow.
|
|
|
|
Note this is now separate from H key hiding, and meant for more persistent
ways to define which objects are relevant to the viewport or render.
This avoids some cases where you'd have to create collection specifically
to hide objects for viewport/render.
|
|
I moved some code from ED_rigidbody_object_remove() to
BKE_rigidbody_remove_object(), so that calling the latter doesn't leave
the object in rbw->group (causing a crash later on when rebuilding the
depsgraph).
|
|
For physics simulation it's still fuzzy though, but this needs bigger
design for how it works with view layers and visibility.
|
|
Before that copied collection in copy-on-write were running out
of sync with original ones. This was causing crash with the
following scenario:
- Delete some objects from scene
- Add particle system to an object
- Change particle mode to Hair
Thanks Dalai for debug session! Pair programming ftw!
|
|
This caused crashes in some cases, and should be fully handled by
the depsgraph now.
|
|
|
|
|
|
|
|
|
|
OVERVIEW
* In 2.7 terminology, all layers and groups are now collection datablocks.
* These collections are nestable, linkable, instanceable, overrideable, ..
which opens up new ways to set up scenes and link + override data.
* Viewport/render visibility and selectability are now a part of the collection
and shared across all view layers and linkable.
* View layers define which subset of the scene collection hierarchy is excluded
for each. For many workflows one view layer can be used, these are more of an
advanced feature now.
OUTLINER
* The outliner now has a "View Layer" display mode instead of "Collections",
which can display the collections and/or objects in the view layer.
* In this display mode, collections can be excluded with the right click menu.
These will then be greyed out and their objects will be excluded.
* To view collections not linked to any scene, the "Blender File" display mode
can be used, with the new filtering option to just see Colleciton datablocks.
* The outliner right click menus for collections and objects were reorganized.
* Drag and drop still needs to be improved. Like before, dragging the icon or
text gives different results, we'll unify this later.
LINKING AND OVERRIDES
* Collections can now be linked into the scene without creating an instance,
with the link/append operator or from the collections view in the outliner.
* Collections can get static overrides with the right click menu in the outliner,
but this is rather unreliable and not clearly communicated at the moment.
* We still need to improve the make override operator to turn collection instances
into collections with overrides directly in the scene.
PERFORMANCE
* We tried to make performance not worse than before and improve it in some
cases. The main thing that's still a bit slower is multiple scenes, we have to
change the layer syncing to only updated affected scenes.
* Collections keep a list of their parent collections for faster incremental
updates in syncing and caching.
* View layer bases are now in a object -> base hash to avoid quadratic time
lookups internally and in API functions like visible_get().
VERSIONING
* Compatibility with 2.7 files should be improved due to the new visibility
controls. Of course users may not want to set up their scenes differently
now to avoid having separate layers and groups.
* Compatibility with 2.8 is mostly there, and was tested on Eevee demo and Hero
files. There's a few things which are know to be not quite compatible, like
nested layer collections inside groups.
* The versioning code for 2.8 files is quite complicated, and isolated behind
#ifdef so it can be removed at the end of the release cycle.
KNOWN ISSUES
* The G-key group operators in the 3D viewport were left mostly as is, they
need to be modified still to fit better.
* Same for the groups panel in the object properties. This needs to be updated
still, or perhaps replaced by something better.
* Collections must all have a unique name. Less restrictive namespacing is to
be done later, we'll have to see how important this is as all objects within
the collections must also have a unique name anyway.
* Full scene copy and delete scene are exactly doing the right thing yet.
Differential Revision: https://developer.blender.org/D3383
https://code.blender.org/2018/05/collections-and-groups/
|
|
This will be handled by the new view layer override system which will
store data elsewhere, removing the code already for easier refactoring.
|
|
|
|
|
|
|
|
|
|
How to use: Select a few objects, and press "M" in the viewport.
If you hold ctrl the objects will be added to the selected collection.
Otherwise they are removed from all their original collections and moved
to the selected one instead.
Development Notes
=================
The ideal solution would be to implement an elegant generic multi-level
menu system similar to toolbox_generic() in 2.49.
Instead I used `uiItemMenuF` to acchieve the required nesting of the menus.
The downside is that `uiItemMenuF` requires the data its callback uses to be
always valid until the menu is discarded. But since there is no callback we
can call when the menu is discarded for operators that exited with
`OPERATOR_INTERFACE`.
That means we are using static allocated data, that is only freed next time
the operator is called. Which also means there will always be some
memory leakage.
Reviewers: campbellbarton
Differential Revision: https://developer.blender.org/D3117
|
|
- put render iterator in own scope
(would shadow it's own variable if used multiple times).
- enforce semicolon at end of iterator macros.
- no need to typedef one-off macro structs.
|
|
Convention from 2.7x, since some looping macros don't need an '_END',
it avoids confusion to keep this.
|
|
Warning introduced on: 73079e01fd4.
|
|
|
|
We were not passing a scene collection parent to the BKE_collection_add
function, which in turn made syncing not work.
Right now we:
* Explicitly pass the master collection in this case
* Fallback to the master collection in other cases
With unittest.
|
|
When duplicating a layer collection directly linked to the view layer we copy
the collection and link it.
For all the not directly linked layer collectionns, we try to sync the layer
collection flags, overrides, ...
Also we make sure the new collection is right after the original collection.
We also expose this in RNA, via collection.duplicate().
|
|
This was not implemented yet. So it's a bit pointless to have all this
placeholder code around without any functionality coming out of it.
|
|
We were not checking for uniqueness after moving. And in some cases the new
siblings of our collection may have conflicting names.
|
|
Reported via IRC by Vuk Gardašević (lijenstina).
|
|
Bug introduced on fb4cd136a7c (multi-object drag-and-drop).
How to reproduce the bug:
* Create a new collection
* Move the Cube to the new collection
* Move the Camera to the new collection (Cube disappears)
* Move the Lamp to the new collection (Camera disappears)
Explanation of the bug:
The moved object was still selected, so we were trying to add the object to the
collection were the object was already inserted (which would fail silently) and
then remove it.
|
|
This fixes any function that relied on these iterators such as:
* Outliner Same Type
* Metaballs
* scene.objects
We were not considering the collections when there was collections nested
to the collections nested to the master collection.
It includes a unittest.
|
|
If the collection to be deleted has a nested collection that is directly linked
to a view layer, we were getting a crash.
|