Age | Commit message (Collapse) | Author |
|
draw_item *is* optional (it then uses default C function), even though there is not much sense to register a class without it, except for our default UI_UL_list!
|
|
class now has a dummy draw_item callback. Panel draw_header is now optional (most panel classes don't define it).
|
|
suggestions!
This commit adds:
* A new bpy.app.translations module giving some info about locales/translation stuff (current active locale, all locales currently known by blender, all translation contexts currently defined, etc.).
* The ability for addons to feature translations, using the (un)register functions of above module.
* Also cleans up "translate py string when storing into RNA prop" by removing "PROP_TRANSLATE" string's subtype, and adding a PROP_STRING_PY_TRANSLATE flag instead (this way it is no more exposed to python...).
Addon translations work with py dictionaries: each addon features a dict {lang: {(context, message): translation, ...}, ...}, which is registered when the addon is enabled (and unregistered when disabled).
Then, when a key (context, message) is not found in regular mo catalog, a cache dict for current locale is built from all registered addon translations, and key is searched in it.
Note: currently addons writers have to do all the work by hand, will add something (probably extend "edit translation" addon) to automate messages extraction from addons soon(ish)! To get a look to expected behavior from addons, have a look at render_copy_settings/__init__.py and render_copy_settings/translations.py (rather stupid example currently, but...). Once we have a complete process, I'll also update relevant wiki pages.
|
|
registering/unregistering.
|
|
could leave the interface pointing to freed memory.
|
|
over 2000 string lookups on startup and gives overall ~10% speedup for starting blender on my system.
|
|
This sub-type is actually *only* needed for the "text" property of UI rna api (maybe we should rename it to "PROP_PY_TRANSLATE", as it is anyway only 'active' during conversion from py string to RNA string property...). In fact, I think it should only be used in RNA func properties anyway, as it stores the translated string into the property, it should only be used with "one time" RNA stuff...
|
|
|
|
from all the limitations this implied (mostly, the "only one list per panel" one).
It introduces a new (py-extendable and registrable) RNA type, UIList (roughly similar to Panel one), which currently contains only "standard" list's scroll pos and size (but may be expended to include e.g. some filtering data, etc.). This now makes lists completely independent from Panels!
This UIList has a draw_item callback which allows to customize items' drawing from python, that all addons can now use. Incidentally, this also greatly simplifies the C code of this widget, as we do not code any "special case" here anymore!
To make all this work, other changes were also necessary:
* Now all buttons (uiBut struct) have a 'custom_data' void pointer, used currently to store the uiList struct associated with a given uiLayoutListBox.
* DynamicPaintSurface now exposes a new bool, use_color_preview (readonly), saying whether that surface has some 3D view preview data or not.
* UILayout class has now four new (static) functions, to get the actual icon of any RNA object (important e.g. with materials or textures), and to get an enum item's UI name, description and icon.
* UILayout's label() func now takes an optional 'icon_value' integer parameter, which if not zero will override the 'icon' one (mandatory to use "custom" icons as generated for material/texture/... previews).
Note: not sure whether we should add that one to all UILayout's prop funcs?
Note: will update addons using template list asap.
|
|
|
|
BKE_report()<->BKE_reportf() fixes.
|
|
|
|
normalise->normalize).
|
|
|
|
* Remove RNA, Operator and UI for Texture and Sequence plugins.
Since 2.5x no effort has been done to bring that back, so there is simply no reason in keeping that code and the UI for that ;-)
* Low Level code still exists and is unchanged.
|
|
Operator descriptions can be NULL pointers,
fix this by making use of PROP_NEVER_NULL flag, when its not set, generated string funcs will test for NULL.
|
|
Note about long lines: I did not touch to two pieces of code (because I don’t see any way to keep a nicely formated, compact code, with shorter lines):
* The node types definitions into rna_nodetree_types.h
* The vgroup name functions into rna_particle.c
|
|
also remove large, duplicate comments from sunsky.h
|
|
Addresses:
* C++ comments.
* Spaces after if/for/while/switch statements.
* Spaces around assignment operators.
|
|
That was intended change to clear PROP_TRANSLATE flag from bl_label property of
operators, panels and menus (see rev40570)
If this flag leads to another issues it should be fixed in another way.
This fixes #30210: International Font Problem
|
|
|
|
|
|
tooltip, since menus are used as buttons too.
|
|
http://markmail.org/message/fp7ozcywxum3ar7n
|
|
lookup returns the same pointer every time. some of these functions - panel/operator poll for eg, are called many times per redraw so while not a bottleneck its unnecessary.
|
|
|
|
(grrr... That update created tons of new things... back to ~40% done...)
|
|
This flag lead to storing translated label for templates and
instant language switching became impossible.
This labels are display-time translated.
|
|
translating too
|
|
Plus a few splits of very long lines…
|
|
|
|
generic, to be used by render engine later.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
long. (related to bug ), found while looking into bug [#25776].
|
|
tab regardless of the order they were registered.
* This is a quick and simple workaround until we can define proper ordering for the panels.
|
|
- move GS() define into DNA_ID.h
- add BLI_utildefines as an automatic include with makesrna generated files.
|
|
MAKE_ID, FILE_MAXDIR, moved the generic defines to BLI_utildefines.h.
no functional changes.
|
|
|
|
|
|
in all cases except for the render engine.
this allows python to NULL its internal context while scripts are not running.
|
|
incorrect formatting is used the compiler will warn of this.
found & fixed 2x incorrect formatting args.
|
|
bl_options which has 2 flags: 'DEFAULT_CLOSED' and 'HIDE_HEADER'.
this matches operators which also uses bl_options like this
|
|
mix-in's to define properties.
An example of how this is useful - an importer mixin could define the filepath properties and a generic invoke function which can run the subclasses exec for each selected file.
- Panels and Menus now skip the property check when registering.
- renamed _idproperties_ to _idprops_ in function names, function names were getting very long.
|
|
|
|
Added some docs mainly in bpy.types.UILayout.html, descriptions by Florian Meyer (testscreenings), thanks.
|