60 Commits

Author SHA1 Message Date
Campbell Barton
c434782e3a File headers: SPDX License migration
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
2022-02-11 09:14:36 +11:00
luzpaz
dea26253a0 cleanup: fix typos in comments and docs
Followup to https://developer.blender.org/D10288

Reviewed By: Blendify

Differential Revision: https://developer.blender.org/D10346
2021-11-16 18:45:10 -05:00
Bastien Montagne
2ecaa971f0 I18n: Fix several issues with UI messages extraction script.
* Fix systematic skipping of labels when they are the same as
  the identifier (Some cases are valid, like `RGB` or `HSV` e.g.).
* Add instead heuristics checks to skip non-UI properties (non-capitalized,
  or same name as identifier and Operator properties, mainly).
* Skip `bl_icon` and `icon` properties.
* Properly search for properties in all parent classes (some cases with
  e.g. `Panel` would break due to intermediary utils classes, leading to
  those internal UI properties not being skipped as expected).

Related to T43295.
2021-11-03 16:13:46 +01:00
Campbell Barton
e288e392a8 Cleanup: line length in Python scripts 2021-10-24 21:04:04 +11:00
Bastien Montagne
23d9953c80 I18n tools: Fix issue when extracting messages on release builds.
This was also affecting prototype of buildbot-driven UI messages
extraction...
2021-10-04 12:17:50 +02:00
Campbell Barton
37793b90be Cleanup: unused imports 2021-03-06 19:26:18 +11:00
Bastien Montagne
32073993a8 i18n messages extraction script: fix handling of C unicode-escapes.
rB1f5647c07d15 introduced for the first time a unicode escape in strings
to be translated, directly extracted from C-code itself.

This revealed that this case was not properly handled by current code,
for now we work around using `raw_unicode_escape` encoding/decoding of
python.
2021-02-22 18:32:49 +01:00
Bastien Montagne
623ddc4aa6 Fix i18n messages extraction tool after update to support py 3.10.
The new defferred approach broke existing way to access items from
struct definition...

See T85872.
2021-02-22 12:20:25 +01:00
Bastien Montagne
626a9aae6d Fix part of T84004: Some 2.92 alpha UI strings can't be translated.
Adding 'new' (?) `heading` parameter of some UILayout functions...
2020-12-21 11:50:38 +01:00
Campbell Barton
41d2d6da0c Cleanup: pep8 (indentation, spacing, long lines) 2020-10-02 11:59:16 +10:00
Bastien Montagne
9d674708ea Fix T80589: Translations in python scripts are missing.
Python 3.8 changed handling of constant values in its AST tool.
This code should work on both officialy supported 3.7, and newer 3.8,
for now.
2020-09-13 19:50:08 +02:00
Bastien Montagne
9607e54985 Fix T74959: Need to be explicit about UTF8 encoding in py.
Because some OSs are still using old 8bits specific encodings... Angry
eye @windows...
2020-03-20 20:52:52 +01:00
Bastien Montagne
d119e163d0 Fix many typos and other issues in UI messages. 2020-02-17 13:01:07 +01:00
Campbell Barton
5a541cfcec Cleanup: resolve static analyzer warnings in bl_i18n_utils
Reported in T73504
2020-01-30 11:48:26 +11:00
Bastien Montagne
22d157d469 I18n: dirty workaround for PITA ghost classes remaining after unregister.
Spent again a whole day trying to understand what happens here, with no
luck. For some reasons, OperatorProperties children of unregistered
operator classes remain accessible, with their `bl_rna` member, although
that one is 100% invalid (freed memory, crashes with ASAN builds).

Funny thing is, I cannot reproduce that situation when disabling the
add-on from the py console of a Blender-with-UI.

Note: issue revealed by X3D add-on, which is still enabled in factory
settings, while not being officially supported any more, this has to be
fixed in a separate commit.
2019-09-09 17:42:44 +02:00
Bastien Montagne
4cbcbacc6a I18n messages extraction: do not report multi-lines messages anymore.
Those are now supported for tooltips.
2019-08-01 12:52:52 +02:00
Bastien Montagne
4b37abd61f Cleanup a bit i18n message extraction code. 2019-08-01 12:52:52 +02:00
Bastien Montagne
a4869df4c9 I18n messages extraction: add 'generic' handling of Tools. 2019-03-31 18:49:11 +02:00
Campbell Barton
bbe98b18fb Cleanup: use preferences prefix for Python operators 2019-03-02 00:23:42 +11:00
Bastien Montagne
59b530ca18 Fix and workaround for i18n messages extraction code. 2018-12-23 22:03:43 +01:00
Campbell Barton
916446e83f Cleanup: move keymap hierarchy into own file 2018-11-20 11:38:13 +11:00
Campbell Barton
1c3411ac89 Keymap: expose tool keymaps in the preferences
Currently some modes share tool keymaps, we might want to disable
this since it's confusing editing one thing in multiple places.

However this should be resolved in the tool definitions.
2018-10-03 15:55:57 +10:00
Campbell Barton
09aa446100 Merge branch 'master' into blender2.8 2018-09-13 20:15:18 +10:00
Campbell Barton
ff432a410a PyAPI: use brief description for operator repr
Only include description in docstring.

Also avoid using op_get_rna.
2018-09-13 19:59:15 +10:00
Bastien Montagne
a43ebc63fa Merge branch 'master' into blender2.8
Conflicts:
	source/blender/blenkernel/intern/collision.c
2018-09-03 17:44:36 +02:00
Brecht Van Lommel
4da2acae3a Spelling fixes in comments and descriptions, patch by luzpaz.
Differential Revision: https://developer.blender.org/D3668
2018-09-03 16:55:01 +02:00
Campbell Barton
80a31d30a4 Merge branch 'master' into blender2.8 2018-07-07 08:53:00 +02:00
Campbell Barton
4b373ed086 Cleanup: pep8 2018-07-07 08:48:35 +02:00
Brecht Van Lommel
74fd17e9d7 UI/Python: rename Lamps to Lights, to follow more standard terminology.
Internally it's still mostly named lamps, though some modules like Cycles
were already calling them lights.
2018-07-06 20:06:09 +02:00
Bastien Montagne
a22af1a84b Fix i18n messages extraction script, and a few more UI messages... 2017-10-04 12:39:06 +02:00
Bastien Montagne
1a1bcad43a Fix T49158: Untranslatable elements in UI.
We cannot skip 'collections clesse' when generating i18n messages from RNA, some of them
are visible and UI...
2016-08-26 15:46:56 +02:00
Bastien Montagne
fe8b197269 Fix T49150: make new 'operator categories' in search menu i18n-aware. 2016-08-23 21:48:16 +02:00
Bastien Montagne
337b718695 Fix T47371 - add access to 'static' enum items.
Some dynamic enums, which do not need a valid context pointer, have their 'itemf'
callback always called. This is annoying for introspection tools (like the ones generating
translations, or API documentation), because it means they never have access to all possible
options (enum items).

So now, there is also an `enum_items_static` accessor to get only statically-defined
enum items.

Note: only i18n tools take advantage of this currently, others are still to be updated.

Reviewers: campbellbarton, sergey

Differential Revision: https://developer.blender.org/D1782
2016-02-09 12:51:07 +01:00
Bastien Montagne
46a7b46c30 Fix broken i18n messages extracting script with new py code.
Some py devs are way too smart for our own good... :P
2016-01-14 17:00:16 +01:00
Bastien Montagne
2eb0c990f1 i18n extraction tools: keep even better order of entries in PO files.
Important to avoid too much changes, especially on the git repo (we are still getting
way too much changes there currently...).
2015-09-28 20:32:09 +02:00
Bastien Montagne
451a077511 I18n extract: better handling of commandline args. 2015-06-03 17:15:00 +02:00
Bastien Montagne
7b743defd4 Fix wrong 'check context' handling in addon i18n messages generator.
Reported (with patch) by yedpodtrzitko (yed podtrzitko), thanks a bunch!

Differential Revision: https://developer.blender.org/D1327
2015-05-29 11:08:26 +02:00
Bastien Montagne
e092a58fb5 I18n message extractor script: py code: do not consider strings inside 'Compare' AST nodes.
Otherwise, we'd get 'MOVIE' from `text="Build Proxy / Timecode" if clip.source == 'MOVIE' else "Build Proxy")`...
2015-05-25 21:17:49 +02:00
Campbell Barton
616eb6818f cleanup 2015-02-13 16:17:00 +11:00
Campbell Barton
7095f47665 cleanup: pep8
also remove empty class parenthesis
2015-01-29 15:35:06 +11:00
Campbell Barton
2c3a503731 UI: Rename Addons -> Add-ons
D812 by @thefallenweeble

internally variable names & paths remain the same, this is for labels & tips only.
2014-11-14 12:19:14 +01:00
Campbell Barton
0e0e528ea4 Cleanup: pep8 2014-09-17 18:36:17 +10:00
Bastien Montagne
52f2c8aec5 Add support for new "bl_category" member (new panels "tabs" system). 2014-01-23 22:30:18 +01:00
Bastien Montagne
a5c7b9202b i18n module cleanup: remove hack used during svn -> git transition phase! 2013-11-25 22:00:14 +01:00
Bastien Montagne
84daa57188 Update i18n tools for new build_hash... 2013-11-04 18:26:56 +00:00
Bastien Montagne
a567dd20c0 More "relpath" try/except protection... 2013-08-18 15:17:33 +00:00
Bastien Montagne
0e4b092c2d More fixes for addon i18n messages management. 2013-04-12 12:19:50 +00:00
Bastien Montagne
6382f6bedd Various edits preparing addons' translations tools (not everything yet functionnal/tested, though).
Also workaround a nasty bug, where unregistered py classes remain listed in relevant __subclasses__() calls, which would lead to crash with python addons i18n tools (main translation was not affected, as messages extracting tools are executed in a brand new "factory startup" Blender ;) ).
2013-04-09 08:56:35 +00:00
Campbell Barton
8e3d590b76 code cleanup: python/pep8 and double-promotion warnings. 2013-03-28 19:33:14 +00:00
Bastien Montagne
c54fba6a11 I18n: fix/enhance how predefined contexts are handled in py code. Now they should be specified by an attribute with the same name as the one in bpy.app.translations.contexts named tuple (i18n_contexts.default, .id_windowmanager, etc.).
This way, i18n message extracting code is now able to get the right context!
2013-03-28 15:03:47 +00:00