Age | Commit message (Collapse) | Author |
|
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
|
|
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.
|
|
The new `BKE_LIB_FOREACHID_PROCESS_FUNCTION_CALL` execute the given
statement and then check status of `LibraryForeachIDData` data, and
return in case stop of iteration is requested.
This is very similar to the other `BKE_LIB_FOREACHID_PROCESS_` existing
macros, and allows us to properly break iteration when a sub-function
has requested it.
Part of T90922: Fix return policy inconsistency in `scene_foreach_id`.
|
|
This commit adds to ID struct a new optional 'weak reference' to a
linked ID (in the form of a blend file library path and full ID name).
This can then be used on next append to try to find a matching local ID
instead of re-making the linked data local again.
Ref. T90545
NOTE: ID re-use will be disabled for regular append for the time being
(3.0 release), and only used for assets. Therefore, this commit should
not change anything user-wise.
Differential Revision: https://developer.blender.org/D12545
|
|
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 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.
|
|
memfile undos
This is essentially adding that new callback, and using it only for already
existing Scene's 3DCursor.
Note that the place where this is called has been moved again, after all
have been lib-linked, such that those callbacks may also work on ID pointers.
Maniphest Tasks: T71759
Differential Revision: https://developer.blender.org/D9237
|
|
Better use higher-level code from common ID management when possible.
Helps to de-duplicate logic, and reduces outside usages of more
'dangerous' functions.
Note that we could get rid of many of those `BKE_<id_type>_add`
functions now, but on the other hand several of those take extra
parameters and perform additional actions, so think we can keep them all
for now as 'non-standard ID specific creation functions'.
|
|
Those were only shallow wrappers around `BKE_id_copy`, barely used (even
fully unused in some cases), and we want to get rid of those ID-specific
helpers for the common ID management tasks. Also prevents weird custom
behaviors (like `BKE_object_copy`, who was the only basic ID copy
function to reset user count of the new copy to zero).
Part of 71219.
|
|
No reasons to keep the new ID pointer as parameter here.
Part of T71219.
|
|
code.
Besides the NodeTree case (which remains unchanged), the localize code
is only used in one place (to generate previews of shading data-blocks).
This commit introduces a new `LIB_ID_CREATE_LOCAL` option for ID
creation/copying, which essentially implements the behavior of the
removed `BKE_XXX_localize()` functions into regular mainstream ID copy
code. When this option is set:
- new ID is tagged with `LIB_TAG_LOCALIZED`;
- Some ID copying callbacks have specific behaviors, mainly the root
nodetree of shading IDs gets duplicated with specialized
`ntreeLocalize()` function.
Note that I would not consider getting rid of `ntreeLocalize` for now,
this function is recursive, which should ideally never happen within ID
management copying code (this introduces all kind of complications).
No behavioral change expected from this commit.
|
|
|
|
This is part of T76372.
It adds the `blend_write`, `blend_read_data`, `blend_read_lib`
and `blend_read_expand` which correspond to the various
steps when reading and writing .blend files.
Having these callbacks allows us to decentralize the blenloader
code a lot more. This has the affect that code related to any
specific ID type is less scattered.
Reviewers: mont29
Differential Revision: https://developer.blender.org/D8670
|
|
The abbreviation 'init' is brief, unambiguous and already used
in thousands of places, also initialize is often accidentally
written with British spelling.
|
|
|
|
Lamps were not tagged with `ID_RECALC_SHADING` when they were updated
from drivers. As a result, Cycles considered the lamp as unchanged. This
is resolved by having a (seemingly non-functional) callback in a new
`LIGHT_UPDATE` depsgraph node.
This patch unconditionally adds the `LIGHT_UPDATE` node + the relation
from the lamp's PARAMETERS node.
Differential Revision: https://developer.blender.org/D7822
Reviewed by: brecht
|
|
|
|
Reviewers: mont29
Differential Revision: https://developer.blender.org/D7476
|
|
Keep IDType code at head of each ID file, instead of mixing it with more
specific API. Also do not define callbacks when defautl generic handling
is fine.
|
|
The `BKE_animsys.h` and `anim_sys.c` files already had a an "AnimData
API" section. The code in that section has now been split off, and
placed into `BKE_anim_data.h` and `anim_data.c`.
All files that used to include `BKE_animsys.h` have been adjusted to
only include the animation headers they need (sometimes none).
No functional changes.
|
|
|
|
This has been long standing TODO...
Note that remaining usages of BKE_xxx_delete should all be carefully
checked for and utilmately nuked in favor of `BKE_id_delete()`, think we
still have quiet a few bugs hidden in those (code seems to usually
assume those functions do a full ID deletion, which is not the case).
|
|
|
|
Instead of using anonymous booleans flags, also allows to keep the same
behavior in all cases, without needing special handling from calling
code for our beloved oddballs object proxies...
|
|
This info is now stored in ID tags themselves, so no need to pass an
extra anonymous boolean parameter around, yay!
|
|
Also removed some only used locally from the header, `BKE_lib_id.h`
is already way too big, no need to overload it with unused things.
|
|
Note that `BKE_library.h`/`library.c` were renamed to
`BKE_lib_id.h`/`lib_id.c` to avoid having a too generic name here.
Part of T72604.
|
|
Private ID data (nodetrees and scene collections...) need special care
and handling of their copy flags, and checks must be adapted too.
In that case, issue came from the fact that even though those IDs have
to be copied outside of bmain, we may still require usercount handling.
That commit also fixes a somewhat related issue - we cannot use the
non-id private data copying flag for private IDs copying, due to
difference in handling of usercount again.
|
|
|
|
copy functions.
Not sure exactly why that was working with nodetrees in depsgraph (could be some special
code in the despgraph), but we always want to allocate memory for the nodetrees here!
|
|
reference."
This reverts commits 54fd8176d7e91, 4c5becb6b1 and 8f578150e.
Those kind of commits must be reviewed and approved by project owners.
That one:
* Broke Collada building by not properly updating all calls to modified
function.
* Broke *whole* ID management by not properly updating library_query.c.
And in general, I am strongly against backward ID pointers, those are
*always* a serious PITA for ID management. Sometimes they cannot be
avoided, but in general other ways to get that kind of info should be
investigated first.
|
|
|
|
|
|
And also fix some RNA props defaults and ranges.
Fix T64452 Shadows not appearing in eevee
|
|
This is the angular diameter as seen from earth, which is between 0.526° and
0.545° in reality. Sharing the size with other light types did not make much
sense and meant the unit was unclear.
Differential Revision: https://developer.blender.org/D4819
|
|
|
|
|
|
Apply clang format as proposed in T53211.
For details on usage and instructions for migrating branches
without conflicts, see:
https://wiki.blender.org/wiki/Tools/ClangFormat
|
|
Use the term "AFTER" instead of "OFS" since it wasn't obvious these
macros operate on everything after the struct member passed.
Avoid casting to non-const types when only reading.
|
|
|