Commit Graph

130 Commits

Author SHA1 Message Date
Sybren A. Stüvel 90ef46baa1 Anim: DNA for `Animation` data-block
Introduce new DNA for the `Animation` data-block and its sub-data.

This includes the blenkernel code for reading & writing to blend files,
and for memory management (freeing, duplicating). Minimal C++ wrappers
are included, with just the functionality needed for blenkernel to do
its job.

The Outliner code is extended so that it knows about the new data-type,
nothing more.

For more info, see issue #113594.

Pull Request: https://projects.blender.org/blender/blender/pulls/119077
2024-03-07 16:41:25 +01:00
Campbell Barton 76867ad4c2 Cleanup: redundant "void" in function declarations for C++ 2024-03-05 11:25:35 +11:00
Campbell Barton 3dbbc013de Cleanup: spelling in comments 2024-02-10 22:35:35 +11:00
Bastien Montagne 45e7827898 Clenup: Move BLT headers to Cpp.
Noisy but fairly straight forward.
2024-02-09 18:59:42 +01:00
Brecht Van Lommel e0ff7731e0 Core: make BKE_appdir functions thread safe, using optional<string>
The static variables can cause the wrong path to be used, for example
when asset indexing in a thread affects loading toolbar icons.

Fix #117416: toolbar icon randomly missing

Pull Request: https://projects.blender.org/blender/blender/pulls/117419
2024-01-23 18:38:15 +01:00
Bastien Montagne d8d44a62f7 Cleanup: Move `BKE_appdir.h` to full Cpp header `BKE_appdir.hh`. 2024-01-21 19:42:13 +01:00
Aras Pranckevicius a705259b4b Cleanup: move imbuf .h files to .hh 2024-01-19 20:29:38 +01:00
Campbell Barton c48283edcb Cleanup: quiet enum conversion warning 2024-01-18 10:38:23 +11:00
Damien Picard 5db82be74f Fix #76101: I18n: add new preference to translate reports
Translation of the UI is currently split into 3 preferences:
interface, tooltips, and new data. The distinction between interface
and tooltips is currently unclear as tooltips also include a lot of
messages not displayed in the actual tooltips on mouse hover.

These include reports to the Info Editor, information in editor
headers and footers, and statuses in panels.

In order to limit the use of `TIP_()` to actual tooltips, this commit
introduces a new preference for this extra information: "Reports".

New translation macros are introduced: `RPT_()` and `CTX_RPT_()`, as
well as their equivalent for the Python API, `pgettext_rpt_()`, to be
imported as `rpt_()`.

Pull Request: https://projects.blender.org/blender/blender/pulls/116804
2024-01-12 13:37:29 +01:00
Brecht Van Lommel d377ef2543 Clang Format: bump to version 17
Along with the 4.1 libraries upgrade, we are bumping the clang-format
version from 8-12 to 17. This affects quite a few files.

If not already the case, you may consider pointing your IDE to the
clang-format binary bundled with the Blender precompiled libraries.
2024-01-03 13:38:14 +01:00
Jeroen Bakker 65e58fe574 CMake: Fix Compiling Shader Builder on macOS
Due to changes in the build environment shader_builder wasn't able to
compile on macOs. This patch reverts several recent changes to CMake files.

* dbb2844ed9
* 94817f64b9
* 1b6cd937ff

The idea is that in the near future shader_builder will run on the buildbot as
part of any regular build to ensure that changes to the CMake doesn't break
shader_builder and we only detect it after a few days.

Pull Request: https://projects.blender.org/blender/blender/pulls/115929
2023-12-08 15:47:14 +01:00
Ray Molenkamp 1b6cd937ff Cleanup: CMake: Modernize bf_imbuf dependencies
Pretty straightforward

- Remove any bf_imbuf paths from INC
- Add a dependency though LIB when missing

context: https://devtalk.blender.org/t/cmake-cleanup/30260

Pull Request: https://projects.blender.org/blender/blender/pulls/115425
2023-11-25 23:37:24 +01:00
Campbell Barton 3e26a1a39c Cleanup: set WITH_INPUT_IME=OFF when unsupported
This avoids having to do platform checks before checking WITH_INPUT_IME.
2023-10-18 22:04:25 +11:00
Bastien Montagne 0ce02355c1 I18N module: updates for transition to weblate.
Remove `es_ES` language.
Rename `uz_UZ` to `uz_UZ@latin`
Rename `zh_CN` to `zh_HANS`
Rename `zh_TW` to `zh_HANT`

Add support for lowercase chars in `country` part of the locale code
(although in the end it is not needed, since `boost::locale` backend
does not supports lowercase 'country' part in locales identifiers
currently) .

Related to https://projects.blender.org/infrastructure/blender-projects-platform/issues/65
2023-09-15 18:08:52 +02:00
Damien Picard 564bbdf6e7 I18n: disambiguate and extract a few messages
This commit disambiguates the following messages:

- Sequencer effect strip types: use "Sequence" context in relevant
  places, as that is already extracted as part of the
  `sequencer_prop_effect_types` enum, and more specific.
- "Language" (a natural or programming language)
- "Flat" (gender)
- "Smooth" (action or amount -- very partial disambiguation for now
  because this is all over the place)

It also extracts these messages:

- Newly created Freestyle data
  - LineStyle
  - LineSet
  - Modifiers
- "Registering panel class:" error message from RNA registration
- "Node must be run as tool" error message from tool geometry nodes

Ref #43295

Pull Request: https://projects.blender.org/blender/blender/pulls/111146
2023-09-04 16:16:26 +02:00
Campbell Barton e955c94ed3 License Headers: Set copyright to "Blender Authors", add AUTHORS
Listing the "Blender Foundation" as copyright holder implied the Blender
Foundation holds copyright to files which may include work from many
developers.

While keeping copyright on headers makes sense for isolated libraries,
Blender's own code may be refactored or moved between files in a way
that makes the per file copyright holders less meaningful.

Copyright references to the "Blender Foundation" have been replaced with
"Blender Authors", with the exception of `./extern/` since these this
contains libraries which are more isolated, any changed to license
headers there can be handled on a case-by-case basis.

Some directories in `./intern/` have also been excluded:

- `./intern/cycles/` it's own `AUTHORS` file is planned.
- `./intern/opensubdiv/`.

An "AUTHORS" file has been added, using the chromium projects authors
file as a template.

Design task: #110784

Ref !110783.
2023-08-16 00:20:26 +10:00
Jacques Lucke cc4d5c432c RNA: move headers to C++
Also see #103343.

Pull Request: https://projects.blender.org/blender/blender/pulls/111022
2023-08-10 22:40:27 +02:00
Campbell Barton b9d785d0a8 Cleanup: replace NULL with nullptr in freestyle, makesrna & other files 2023-08-01 21:15:52 +10:00
Ray molenkamp 4ea2baf4ae CMake: revert last weeks modernizations
The cleanup of blenkernel last weeks , caused the house of cards to
collapse on  top of bf_gpu's shader_builder, which is off by default
but used on a daily basis by the rendering team.

Given the fixes forward in #110394 ran into a ODR violation in OSL that
was hiding there for years, I don't see another way forward without
impeding the rendering teams productivity for "quite a while" as there
is no guarantee the OSL issue would be the end of it.

the only way forward appears to be back.

this reverts :

19422044ed
a670b53abe
0f541db97c
be516e8c81
3e88a2f44c
4e64b772f5
9547e7a317
07fe6c5a57

The problematic commit was 07fe6c5a57
as blenkernel links most of blender, it's a bit of a link order issue
magnet. Given all these commits stack, it's near impossible to revert
just that one without spending a significant amount of time resolving
merge conflicts. 99% of that work was automated, so easier to just
revert all of them, and re-do the work, than it is to deal with the
merge conflicts.

Pull Request: https://projects.blender.org/blender/blender/pulls/110438
2023-07-25 16:43:21 +02:00
Campbell Barton b8ea968929 Cleanup: simplify struct & enum declarations for C++ 2023-07-24 10:13:31 +10:00
Campbell Barton 81ee130063 Cleanup: use C++ system headers
Apply clang-tidy modernize-deprecated-headers to source/
2023-07-22 11:27:25 +10:00
Ray molenkamp be516e8c81 Cleanup: CMake: Modernize bf_blentranslation dependencies
Pretty straightforward:

- Remove any blentranslation paths from INC
- Add a dependency though LIB when needed

Slightly different than usual:

blentranslation still had a dependency on imbuf, from a time long
gone, cleaned that up since I was in the area

context: https://devtalk.blender.org/t/cmake-cleanup/30260

Pull Request: https://projects.blender.org/blender/blender/pulls/110324
2023-07-21 16:22:10 +02:00
Campbell Barton 549848a0d8 Cleanup: various non-functional changes for C++
- Remove redundant void, struct.
- Use function style casts.
2023-07-20 20:35:49 +10:00
Jacques Lucke a236b8130b I18n: move to C++
Also see #103343.

Pull Request: https://projects.blender.org/blender/blender/pulls/110269
2023-07-20 09:49:10 +02:00
Ray molenkamp 07fe6c5a57 Cleanup: CMake: Modernize bf_blenkernel dependencies
Pretty straightforward

- Remove any blenkernel paths from INC
- Add a dependency though LIB

context: https://devtalk.blender.org/t/cmake-cleanup/30260

Pull Request: https://projects.blender.org/blender/blender/pulls/109939
2023-07-11 19:28:01 +02:00
Ray Molenkamp 04235d0e55 Cleanup: CMake: Modernize bf_blenlib dependencies
Pretty straightforward

- Remove any blenlib paths from INC
- Add a dependency though LIB

Pull Request: https://projects.blender.org/blender/blender/pulls/109934
2023-07-10 22:04:18 +02:00
Ray Molenkamp 57ad866d81 Cleanup: CMake: Modernize bf_guardedalloc dependencies
Pretty straightforward

- Removes any guardedalloc paths from INC
- Adds a dependency though LIB

Pull Request: https://projects.blender.org/blender/blender/pulls/109925
2023-07-10 18:44:19 +02:00
Ray Molenkamp 7cebb61486 Cleanup: CMake: Modernize bf_dna dependencies
There's quite a few libraries that depend on dna_type_offsets.h
but had gotten to it by just adding the folder that contains it to
their includes INC section without declaring a dependency to
bf_dna in the LIB section.

which occasionally lead to the lib building before bf_dna and the
header being missing, while this generally gets fixed in CMake by
adding bf_dna to the LIB section of the lib, however until last
week all libraries in the LIB section were linked as INTERFACE so
adding it in there did not resolve the build issue.

To make things still build, we sprinkled add_dependencies wherever
we needed it to force a build order.

This diff :

Declares public include folders for the bf_dna target so there's
no more fudging the INC section required to get to them.

Removes all dna related paths from the INC section for all
libraries.

Adds an alias target bf:dna to signify it has been updated to
modern cmake

Declares a dependency on bf::dna for all libraries that require it

Removes (almost) all calls to add_dependencies for bf_dna

Future work:

Because of the manual dependency management that was done, there is
now some "clutter" with libs depending on bf_dna that realistically
don't. Example bf_intern_opencolorio itself has no dependency on
bf_dna at all, doesn't need it, doesn't use it. However the
dna include folder had been added to it in the past since bf_blenlib
uses dna headers in some of its public headers and
bf_intern_opencolorio does use those blenlib headers.

Given bf_blenlib now correctly declares the dependency on bf_dna
as public bf_intern_opencolorio will get the dna header directory
automatically from CMake, hence some cleanup could be done for
bf_intern_opencolorio

Because 99% of the changes in this diff have been automated, this diff
does not seek to address these issues as there is no easy way to
determine why a certain dependency is in place. A developer will have
to make a pass a this at some later point in time. As I'd rather not
mix automated and manual labour.

There are a few libraries that could not be automatically processed
(ie bf_blendthumb) that also will need this manual look-over.

Pull Request: https://projects.blender.org/blender/blender/pulls/109835
2023-07-10 15:07:37 +02:00
Bastien Montagne ace8875014 Merge branch 'blender-v3.6-release' 2023-06-07 11:46:20 +02:00
Bastien Montagne 7ceb33e06e I18N: Revert part of d95486af95 removing check for main thread.
Part of the checks to see if translating a UI string is allowed or not
is that current thread is the main one. This was a requirement years ago
of the Boost backend for translations.

Not sure whether this can be removed or not now, but it needs to be
carefully checked, done it as its own commit, and not in a beta release
branch. ;)

Sorry for the noise, totally missed this during the patch review
yesterday.
2023-06-07 11:31:34 +02:00
Bastien Montagne 6c7354a69a Merge branch 'blender-v3.6-release' 2023-06-06 17:38:42 +02:00
Damien Picard d95486af95 18n: Use fmt::format() to replace string concatenation in nodes
The UI code for nodes uses `stringstream`s a few times to format
strings. In some cases it is fine, but in others it makes localization
hard or impossible to do properly, as explained in #92758.

This commit replaces some `stringstreams` by `fmt::format()`, a
library that is already used in other parts of Blender and was
suggested by Hans Goudey (@hooglyboogly) in
[D15996](https://archive.blender.org/developer/differential/0015/0015996/#inline-138440).

Pull Request: https://projects.blender.org/blender/blender/pulls/107260
2023-06-06 16:27:49 +02:00
Sergey Sharybin c1bc70b711 Cleanup: Add a copyright notice to files and use SPDX format
A lot of files were missing copyright field in the header and
the Blender Foundation contributed to them in a sense of bug
fixing and general maintenance.

This change makes it explicit that those files are at least
partially copyrighted by the Blender Foundation.

Note that this does not make it so the Blender Foundation is
the only holder of the copyright in those files, and developers
who do not have a signed contract with the foundation still
hold the copyright as well.

Another aspect of this change is using SPDX format for the
header. We already used it for the license specification,
and now we state it for the copyright as well, following the
FAQ:

    https://reuse.software/faq/
2023-05-31 16:19:06 +02:00
Campbell Barton 13c815085b Cleanup: spelling in comments 2023-05-24 11:21:18 +10:00
Damien Picard b905b02222 Remove newly added "Theme" i18n context, replace its use by "Color"
Pull Request: https://projects.blender.org/blender/blender/pulls/107139
2023-05-16 14:52:05 +02:00
Damien Picard dc999d83b4 I18n: disambiguate a few messages
- "Out" meaning "one end of a bone". Same as in 9120c86c3f.
- "Canvas" meaning a painting support for Dynamic Paint.
- "Twist" meaning an action verb, as opposed to an amount.
- "Solid" meaning a textureless, single-color material.
- "Blend mode" meaning material opacity blending, as opposed to color
  blending.
- "Pixel Size" meaning "a size measured using pixels as the unit".
- "Light" meaning "not dark", as in "Light Theme".

Ref #43295
2023-05-16 14:51:52 +02:00
Damien Picard c40ce3baae Cleanup: I18n: sort disambiguation contexts from BLT_translation.h
The contexts appear twice, in the list of #defines and in the
BLT_I18NCONTEXTS_DESC. Both had gotten out of alphabetical order, and
out of sync.

Pull Request: https://projects.blender.org/blender/blender/pulls/106718
2023-04-12 15:09:21 +02:00
Damien Picard 5cf365554b I18n: disambiguate a few messages
- "Lens" can be a transparent object used in cameras, or specifically
  its property of focal length
- "Empty" can be an adjective meaning void, or an object type. The
  latter is already disambiguated using `ID_ID`
- "New" and "Old" are adjectives that can have agreements in some
  languages
- "Modified" is an adjective that can have agreement in some languages
- "Clipping" can be a property of a camera, or a behavior of the
  mirror modifier
- "Value" in HSV nodes, see #105113
- "Area" in the Face Area geometry node, can mean a measurement or a
  window type
- "New" is an adjective that can have agreement
- "Tab" can be a UI element or a whitespace character
- "Volume" can mean a measurement or an object type. The latter is
  already disambiguated using `ID_ID`

These changes introduce the new `BLT_I18NCONTEXT_TIME` translation
context.

They also remove `BLT_I18NCONTEXT_VIRTUAL_REALITY`, which I added at
one point but then couldn't find which messages I wanted to fix with
it.

Ref #43295

Pull Request: #106718
2023-04-12 15:09:17 +02:00
Sergey Sharybin a12a8a71bb Remove "All Rights Reserved" from Blender Foundation copyright code
The goal is to solve confusion of the "All rights reserved" for licensing
code under an open-source license.

The phrase "All rights reserved" comes from a historical convention that
required this phrase for the copyright protection to apply. This convention
is no longer relevant.

However, even though the phrase has no meaning in establishing the copyright
it has not lost meaning in terms of licensing.

This change makes it so code under the Blender Foundation copyright does
not use "all rights reserved". This is also how the GPL license itself
states how to apply it to the source code:

    <one line to give the program's name and a brief idea of what it does.>
    Copyright (C) <year>  <name of author>

    This program is free software ...

This change does not change copyright notice in cases when the copyright
is dual (BF and an author), or just an author of the code. It also does
mot change copyright which is inherited from NaN Holding BV as it needs
some further investigation about what is the proper way to handle it.
2023-03-30 10:51:59 +02:00
Chris Blackbourn 894dcfbb41 Cleanup: format 2023-03-08 09:50:03 +13:00
Damien Picard ae530592fe I18n: disambiguate messages
- "Lines" in the sense of number of lines
- "Number" can mean "amount, count" or "index, offset"
- "Second" can be an ordinal number or a unit
- "Root": add the brush curve to the "square root falloff" sense
- "Strip" can be a sequence or a type of hair rendering
- "Constant" in the sense of a value, for the Geometry Nodes add
  submenu (#105447).

Additionally, extract:
- "Press a key" from the Keymap preferences.
- "MaskLayer", upon new mask layer creation

Ref #43295, #105447
2023-03-07 12:31:59 +01:00
Damien Picard c5bbc5db6f I18n: disambiguate a few messages
- "Value" in the sense of color lightness is not the same word in
  Japanese as other usages. See #105113.
- "Double" as a data type vs. a value.

Also extract "Custom Color Presets" in the tracking UI.
Run clang-format as well.

Pull Request #105187
2023-02-27 15:21:00 +01:00
Damien Picard c7611d61e8 I18n: add disambiguation contexts
After rBdb87e2a638f9, two contexts were missing:

- VirtualReality, to be used in an add-on
- Constraint, used in the constraints UI

The latter was actually used without being added, which caused errors.
It was reverted in rB31a640027982.
2023-02-20 12:45:00 +01:00
Damien Picard db87e2a638 I18n: extract and disambiguate a few messages
Extract:
- EEVEE: Compiling Shaders (the same message exists in EEVEE Next, but
  it uses string concatenation and I don't know yet how to deal with
  those--see T92758)

Disambiguate:
- Pan (audio, camera)
- Box (TextSequence)
- Mix (noun in constraints, GP materials)
- Volume (object type, file system)
- Floor (math integer part, 3D viewport horizontal plane)
  - Impossible to disambiguate the constraint name because
    bConstraintTypeInfo doesn't have a context field.
- Show Overlay (in the sequence editor, use the same message as other
  editors to avoid a confusion with the Frame Overlay feature, also
  called "Show Overlay")

Additionally, fix a few issues reported by Joan Pujolar (@jpujolar)
in T101830.

Reviewed By: mont29

Differential Revision: https://developer.blender.org/D17114
2023-01-30 09:38:57 +01:00
Campbell Barton 9f6a045e23 Cleanup: replace BLI_join_dirfile with BLI_path_join
These functions are almost identical, the main difference being
BLI_join_dirfile didn't trim existing slashes when joining paths
however this isn't an important difference that warrants a separate
function.
2022-10-17 11:38:54 +11:00
Harley Acheson 4e7983e073 UI: Improved Font Thumbnails
Thumbnails of fonts that better show design, shapes, contents, intent,
and intended language. Previews almost every known language - living
and dead - and symbol, specialty fonts, etc.

See D12032 for more details and samples.

Differential Revision: https://developer.blender.org/D12032

Reviewed by Campbell Barton
2022-09-24 10:57:34 -07:00
Brecht Van Lommel 0ffd288fab Build: fix gtest build flags affecting actual library
Switch to target_ functions to avoid this.
2022-09-18 11:26:34 +02:00
Campbell Barton 95f05a6a4b Cleanup: spelling in comments 2022-09-16 18:14:33 +10:00
Harley Acheson 3e7d977886 IME Cleanup: Removal of BLT_lang_is_ime_supported
Removal of BLT_lang_is_ime_supported which is always returns true and
is no longer needed.

See D11800 for more details.

Differential Revision: https://developer.blender.org/D11800

Reviewed by Campbell Barton
2022-06-07 10:03:26 -07:00
Bastien Montagne 1e848281f9 18n: Add new `EDITOR_VIEW3D` translation context. 2022-02-28 14:37:07 +01:00