Age | Commit message (Collapse) | Author |
|
|
|
|
|
Use <pre>..</pre> for pseudo-code.
|
|
Use a shorter/simpler license convention, stops the header taking so
much space.
Follow the SPDX license specification: https://spdx.org/licenses
- C/C++/objc/objc++
- Python
- Shell Scripts
- CMake, GNUmakefile
While most of the source tree has been included
- `./extern/` was left out.
- `./intern/cycles` & `./intern/atomic` are also excluded because they
use different header conventions.
doc/license/SPDX-license-identifiers.txt has been added to list SPDX all
used identifiers.
See P2788 for the script that automated these edits.
Reviewed By: brecht, mont29, sergey
Ref D14069
|
|
`BKE_collection_object_add` ensures given object is added to an editable
collection, and not e.g. a linked or override one.
However, some processes like do_version manipulate collections also from
libraries, i.e. linked collections, in those cases we need a version of
the code that unconditionnally adds the given object to the given
colleciton.
|
|
Own mistake in rB2ef192a55b2c. Did not seem to have any visible effect
though...
|
|
|
|
collection.
Fix is similar to how CollectionObject with NULL object pointers are handled.
Using one of the 'free' pad bytes in Object_Runtime struct instead of a
gset (or other external way to detect object duplicates), as this is
several times faster.
NOTE: This makes remapping slightly slower again (adds 10 extra seconds
to file case in T94059).
General improvements of remapping time complexity, especially when
remapping a lot of IDs at once, is a separate topic currently
investigated in D13615.
|
|
- Added space below non doc-string comments to make it clear
these aren't comments for the symbols directly below them.
- Use doxy sections for some headers.
- Minor improvements to doc-strings.
Ref T92709
|
|
The main goal of this refactor is to make BPath module use `IDTypeInfo`,
and move each ID-specific part of the `foreach_path` looper into their
own IDTypeInfo struct, using a new `foreach_path` callback.
Additionally, following improvements/cleanups are included:
* Attempt to get better, more consistent namings.
** In particular, move from `path_visitor` to more standard `foreach_path`.
* Update and extend documentation.
** API doc was moved to header, according to recent discussions on this
topic.
* Remove `BKE_bpath_relocate_visitor` from API, this is specific
callback that belongs in `lib_id.c` user code.
NOTE: This commit is expected to be 100% non-behavioral-change. This
implies that several potential further changes were only noted as
comments (like using a more generic solution for
`lib_id_library_local_paths`, addressing inconsistencies like path of
packed libraries always being skipped, regardless of the
`BKE_BPATH_FOREACH_PATH_SKIP_PACKED` `eBPathForeachFlag` flag value,
etc.).
NOTE: basic unittests were added to master already in
rBdcc500e5a265093bc9cc.
Reviewed By: brecht
Differential Revision: https://developer.blender.org/D13381
|
|
Two issues addressed here:
I) `asset_type_info` is sub-data, not a callback. Therefore, move it
before the callbacks in the `IDTypeInfo` struct.
II) More important, initialize this new attribute in *ALL* `IDTypeInfo`
instances. No member of this struct should ever be left implicitely
uninitilazed, ever.
Aftermath of rBa84f1c02d251.
|
|
rB43bc494892c3 switched `BKE_libblock_relink_to_newid` to use new ID
remapping and libquery code.
However, that new code does protect by default against remapping an
objects's data pointer when that object is in Edit mode, since this is
not a behavior that generic BKE code can handle (due to required editing
data for most obdata types when in edit mode).
So specific code that does create new IDs and need remapping in Edit
mode has to pass specific exception flags to remaping code.
This commit adds those remapping flags to `BKE_libblock_relink_to_newid`
and add said exception flag to the remapping call from
`ED_object_add_duplicate` when the object is in edit mode.
|
|
Move all usages to new `BKE_libblock_relink_to_newid_new`, and rename
that one to `BKE_libblock_relink_to_newid`.
Fix T91413.
|
|
|
|
`BKE_LIB_FOREACHID_PROCESS_IDSUPER`.
More in-line name with the rest of that macro-based API, especially
since this will be extended in the future.
|
|
Handling of RigidBody data in duplicate of scenes/collections was very
wrong. This commit:
- Add handling of duplication of RB collections when fully duplicating
a scene.
- Fix Object duplication trying to add duplicated RB objects to
matching RBW collections.
While the later behavior is desired when only duplicated objects, when
duplicating their collections and/or scenes it is actually very bad, as
it would add back new object duplicates to old (RBW) collections.
|
|
We need to separate the flag telling duplicate code to not handle
remapping to new IDs etc., from the one telling the code that we are
currently duplicating a 'root' ID (i.e. not a dependency of another
duplicated ID).
This whole duplicate code/logic is still fairly unsatisfying, think it
will need further refactor, or maybe even re-design, at some point...
|
|
callbacks.
This was not really useful, and added estra useless steps in case and ID
should not actually be written.
Further more, it prevented clearing the usercount on write, which can be
cause a false positive 'chanhged' detection in undo/redo case.
|
|
This function doesn't free the collection, only it's memory.
|
|
This makes the internal naming consistent with the public API. And also gives
us a visibility_flag rather than restrictflag that can be extended with more
flags.
|
|
This code was actually buggy (forcefully re-enabling excluded layers in some
cases).
Further more, it should not be needed now that layerCollection resync code
reuses as much as possible existing layers instead of deleting and
re-creating them all the time.
Differential Revision: https://developer.blender.org/D12016
|
|
This shows the text as part of the assertion message.
|
|
Collection"
Note that this name is essentially never used anywhere, besides as 'information'
mostly accessible from python console. Those embedded IDs are not in Main, so they
are not accessible by name ever, and mostly unusable from animation perspective
(either drivers or fcurves).
Therefore, no breakage is expected in user scripts or addons, nor when
loading in older versions of Blender.
Reviewed By: dfelinto, brecht
Differential Revision: https://developer.blender.org/D11812
|
|
Also use doxy style function reference `#` prefix chars when
referencing identifiers.
|
|
|
|
|
|
|
|
|
|
Also remove reference to function that never existed for adding `bNode`.
|
|
`BKE_main_collections_parent_relations_rebuild`,
`BKE_collection_parent_relations_rebuild` anf their internal
dependencies had two issues fixed by this commit:
* Main one was that a same collection could be processed several times,
sometimes even in an infinite loop (in some rare corner cases), by
`collection_parents_rebuild_recursive`.
* More exotic, code here would not ensure that the collections it was
processing were actually in Main (or a master one from a scene in
Main), which became an issue with some advanced ID management
processes involving partially out-of-main remapping, like liboverride
resync.
|
|
Code checking for potential collection loop dependencies can be called
in cases where we cannot guarantee that there is no NULL pointers, so we
need to check those. Was already done for objects.
|
|
It wasn't obvious this function cleared the tag as well.
|
|
This patch removes unnecessary calls to `BKE_main_id_tag_all` where the
same job is done by `BKE_main_id_clear_newpoins` on the following line.
Reviewed By: campbellbarton, mont29
Ref D11379
|
|
This fixes T87666 and T83252.
The boolean modifier and geometry nodes can depend on the geometry
of an entire collection. Before, the modifiers had to manually create relations
to all the objects in the collection. This worked for the most part, but was
cumbersome and did not solve all issues. For example, the modifiers were not
properly updated when objects were added/removed from the referenced collection.
This commit introduces the concept of "collection geometry" in the depsgraph.
The geometry of a collection depends on the transforms and geometry of all
the objects in it. The boolean modifier and geometry nodes can now just depend
on the collection geometry instead of creating all the dependencies themselves.
Differential Revision: https://developer.blender.org/D11053
|
|
This is complex situation. Tagged ID deletion (used to delete several
data-blocks at once) removes IDs to be deleted from Main.
But when we remove deleted IDs' usages of other IDs (using
`BKE_libblock_relink_ex`), some specific post-process is required on
some types, like Collections. Those post-processes would in some cases
rely on data actually being in Main.
That failing condition would lead in existing code on missing processing
the very ID (collection) we were working on, leading to missing removing
some child collection pointers, leading to the crash (later on in
LayerCollection resync process).
For now we go with an optimization & fix that avoids processing all
collections in Main when we actually know which one we are working one
(case of `BKE_libblock_relink_ex`, but not of
`BKE_libblock_remap_locked`).
This is however yet another demonstration of the need to rework that
whole collection/layer resync process, since it is not only extremely
inneficient currently, but it also requires valid Main/ID state way too
deep into the remapping code.
NOTE: This fix may very well not catch/address all possible fail cases
here, dealing with the double parent/child relationships of collections
is challenging...
Issue reported by @eyecandy from the studio, thanks.
|
|
|
|
Share macro for setting BLI_Iterator defaults to ensure
this doesn't happen again in cases the ITER_* macros aren't used.
Oversight in 14d74fb34174a91190d35d7fe595f8dd64cb79d1.
|
|
Use array allocation, and remove useless check.
|
|
scene's collections.
This is internaly using the code of `BKE_scene_objects_iterator` and
steals its gset. More efficient than using that iterator directly to
rebuild another GSet...
|
|
|
|
|
|
Code rebuilding/ensuring the sanity of the collection hierarchy was not
checking for a same collection being child of the same parent multiple
times.
This was already prevented to happen in code adding collections to other
collections, but not for the remapping case.
|
|
Issue was actually in some Collection management code, a bit too eager
to add collection to the scene master one when it was not actually
needed.
|
|
This adds the LineArt grease pencil modifier.
It takes objects or collections as input and generates various grease
pencil lines from these objects with the help of the active scene
camera. For example it can generate contour lines, intersection lines
and crease lines to name a few.
This is really useful as artists can then use 3D meshes to automatically
generate grease pencil lines for characters, enviroments or other
visualization purposes.
These lines can then be baked and edited as regular grease pencil lines.
Reviewed By: Sebastian Parborg, Antonio Vazquez, Matias Mendiola
Differential Revision: http://developer.blender.org/D8758
|
|
This concerns currently only collections (`master_collection` of scenes)
and root node trees. It removes the matching type-specific helpers
(`BKE_collection_master_scene_search` and `BKE_node_tree_find_owner_ID`).
No functional change expected here.
NOTE: Current implementation of `owner_get` is far from optimal, we
could probably do it better, see {T69169}.
NOTE: While it could also have it, shapekeys IDTypeInfo was left out of
this change for now. Mainly because it sould not be used currently, and
we ultimately want to demote shape keys from ID status anyway.
|
|
|
|
|
|
Currently this is needed to properly tag PointCache's for info update
(fixes an issue reported in T82503).
Suspect we may need this in more cases in the future though, RNA
assign/update processes are not always 100% enough to deal with
complicated corner cases.
|
|
No ID (even remotely) related to Main database should ever be created
directly through MEM_mallocN. Using `BKE_libblock_alloc` is the bare
minimum.
Note that there is no behavior change expected here.
|
|
|