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
|
|
- 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.
|
|
`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.
|
|
Add needed extra flag and utils to IDType to mark and check an ID type
as only appendable.
Note that this is only a loose user-level enforcement currently, in any
case you need to be able to link an ID to append it currently, so for
low-level code this does not really matter.
Currently only WorkSpace and Screen ID types are marked with the new
`IDTYPE_FLAGS_ONLY_APPEND` flag.
|
|
Essentially, Workspace (and Screen) types were defined as not
localizable.
In previous code it happended to work by mere chance (code path taken in
`BKE_library_make_local` was conviniently skipping the call to
`BKE_lib_id_make_local` in that case, hence not checking for
`IDTYPE_FLAGS_NO_MAKELOCAL` flag of the localized ID type).
This is a total abuse of this IDType flag, for now removing it.
That specific case (IDtype appendable but nor linkable) requires its own
proper flag, this will be tackled in a later commit.
Issue introduced in rB3be5ce4aad5e.
|
|
In the `FileList` struct, rename the `AssetLibraryReference
*asset_library` field to `asset_library_ref` -- it's a description of
which asset library is used, and not the asset library itself.
This is to make space for a future `AssetLibrary *asset_library` field,
which will point to an actual asset library struct/class.
No functional changes.
Reviewed by: Severin
Differential Revision: https://developer.blender.org/D12151
|
|
This new variable was introduced with 7898089de3f2. We don't usually use
an `active` prefix variable. Plus, this makes the name match the one of
the Asset Browser active library variable, so we can use the
`rna_def_asset_library_reference_common()` helper for both.
This will cause Asset Views to open with the default "Current File"
Asset Library. We could avoid that, but it's a minor issue really.
|
|
This per-workspace active asset library will be used by the asset views
later. Note that Asset Browsers have their own active asset library,
overriding the one from the workspace.
As part of this the `FileSelectAssetLibraryUID` type gets replaced by
`AssetLibraryReference` which is on the asset level now, not the
File/Asset Browser level. But some more work is needed to complete that,
which is better done in a separate commit.
This also moves the asset library from/to enum-value logic from RNA to
the editor asset level, which will later be used by the asset view.
|
|
|
|
This was included for `FILE *` which isn't used in the header.
Ref D10799
|
|
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
|
|
|
|
Follow our code style for doxygen sections.
|
|
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'.
|
|
This is part of T75724.
Reviewers: mont29
Differential Revision: https://developer.blender.org/D9134
|
|
.blend file.
Relying on pointer addresses across different data-blocks is extremely
not recommended (and should be strictly forbidden ideally), in
particular in direct_link step of blend file reading.
- It assumes a specific order in reading of data, which is not ensured
in future, and is in any case a very bad, non explicit, hidden
dependency on behaviors of other parts of the codebase.
- It is intrinsically unsafe (as in, it makes writing bad code and making
mistakes easy, see e.g. fix in rB84b3f6e049b35f9).
- It makes advanced handling of data-blocks harder (thinking about
partial undo code e.g., even though in this specific case it was not
an issue as we do not re-read neither windowmanagers nor worspaces
during undo).
New code uses windows' `winid` instead as 'anchor' to find again proper
workspace hook in windows at read time.
As a bonus, it will also cleanup the list of relations from any invalid
ones (afaict it was never done previously).
Differential Revision: https://developer.blender.org/D9073
|
|
This took more than a day to fully investigate and understand, one of
the reasons being that the probability of the issue to show up was
extremely low, and subjected to very specific random factors.
Root of the issue is that, in some very rare cases, a newly read ID
might get the exact same memory address as the one it had when the blend
file was saved.
In that case, `BKE_workspace_active_set` would return immediately, since
the pointer to the active workspace would remain unchanged. But that
lead to having an unset NULL active layout pointer, which would crash
when attempting to get e.g. the active screen.
For the record, I ran into this when running a specific build (master
with one flag added to the `LIB_ID_CREATE` ones, with value `1 << 3`),
using a specific set of options (`--background --factory-startup -noaudio`),
and passing the .blend file from T80090 as argument.
|
|
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
|
|
This addresses warnings from Clang-Tidy's `readability-else-after-return`
rule in the `source/blender/blenkernel` module.
No functional changes.
|
|
* Simplify workspace API a bit
* Comment on behavior of workspace-layout relations where exposed in API
* Remove annoying getters/setters
* Avoid lookups if we can early exit
* A NULL check is removed in `direct_link_workspace()` that I don't see
a need for. Am not 100% sure though, fingers crossed.
In general these changes should improve readability and make things
easier to reason about.
|
|
|
|
Note this only changes cases where the variable was declared inside
the for loop. To handle it outside as well is a different challenge.
Differential Revision: https://developer.blender.org/D7320
|
|
|
|
|
|
This does not seem to be an actual issue in current master code (as
creating a new ID will assign 1 user to it by default), but is breaking
generic usercount handling in future changes.
|
|
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.
|
|
Not sure how the WorkSpaceLayout.screen pointer could end up being NULL,
but apparently that happens, or at least happened with older files.
Rather than just adding NULL-checks, prefer not keeping around those
invalid layouts at all.
|
|
Loading a blendfile allocates one or more windows that need to be freed.
Freeing those windows also calls `BKE_workspace_instance_hook_free()` to
free workspaces. However, in the `BlendfileLoadingBaseTest` test there are
no workspaces allocated. This caused an assertion failure, which was worked
around by not asserting when Blender is running in background mode.
Reviewed by @Severin via pair programming
|
|
|
|
This also makes `IDP_CopyProperty` the "opposite"
of `IDP_FreeProperty`, which is what I'd expect.
Two refactoring steps:
* rename IDP_FreeProperty to IDP_FreePropertyContent
* new IDP_FreeProperty function that actually frees the property
Reviewers: brecht
Differential Revision: https://developer.blender.org/D4872
|
|
Workspaces refreshes tools multiple times when used by multiple windows.
Also improve comments.
|
|
Also move function in wrong category.
|
|
|
|
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
|
|
This is just not practical to do for the code as a whole, and having it as an
exception for one specific data structure is not that helpful. This has only
been in the way for me when refactoring code.
|
|
|
|
Convention was not to but after discussion on 918941483f7e we agree its
best to change the convention.
Names now mostly follow RNA.
Some exceptions:
- Use 'nodetrees' instead of 'nodegroups'
since the struct is called NodeTree.
- Use 'gpencils' instead of 'grease_pencil'
since 'gpencil' is a common abbreviation in the C code.
Other exceptions:
- Leave 'wm' as it's a list of one.
- Leave 'ipo' as is for versioning.
|
|
Rename latt to lattice and don't use plural names.
|
|
While \file doesn't need an argument, it can't have another doxy
command after it.
|
|
Move \ingroup onto same line to be more compact and
make it clear the file is in the group.
|
|
BF-admins agree to remove header information that isn't useful,
to reduce noise.
- BEGIN/END license blocks
Developers should add non license comments as separate comment blocks.
No need for separator text.
- Contributors
This is often invalid, outdated or misleading
especially when splitting files.
It's more useful to git-blame to find out who has developed the code.
See P901 for script to perform these edits.
|
|
|
|
|
|
Also clear tools for the default startup file
so changes to defaults apply to new files.
|
|
They are not directly accessible in the UI anymore, it's the workspaces
that we always keep until they are manually deleted now.
|
|
|