UI: Custom Tooltips with Optional Images #105905

Merged
Harley Acheson merged 6 commits from Harley/blender:CustomTooltips into main 2023-09-15 21:06:38 +02:00
12 changed files with 37 additions and 99832 deletions
Showing only changes of commit cb19215710 - Show all commits

View File

@ -29,8 +29,8 @@
15:Russian (Русский):ru_RU
18:Ukrainian (Українська):uk_UA
41:Vietnamese (Tiếng Việt):vi_VN
13:Simplified Chinese (简体中文):zh_CN
14:Traditional Chinese (繁體中文):zh_TW
13:Simplified Chinese (简体中文):zh_HANS
14:Traditional Chinese (繁體中文):zh_HANT
#
0:Starting:
45:Abkhaz (Аԥсуа бызшәа):ab
@ -39,7 +39,6 @@
# Skipped (see IMPORT_LANGUAGES_SKIP in settings.py). #22:Bulgarian (Български):bg_BG
# Skipped (see IMPORT_LANGUAGES_SKIP in settings.py). #23:Greek (Ελληνικά):el_GR
35:Esperanto (Esperanto):eo
# Skipped (see IMPORT_LANGUAGES_SKIP in settings.py). #36:Spanish from Spain (Español de España):es_ES
# Skipped (see IMPORT_LANGUAGES_SKIP in settings.py). #34:Estonian (Eesti keel):et_EE
42:Basque (Euskara):eu_EU
26:Persian (ﯽﺳﺭﺎﻓ):fa_IR
@ -61,5 +60,5 @@
7:Swedish (Svenska):sv_SE
46:Thai (ภาษาไทย):th_TH
30:Turkish (Türkçe):tr_TR
# Skipped (see IMPORT_LANGUAGES_SKIP in settings.py). #38:Uzbek (Oʻzbek):uz_UZ
# Skipped (see IMPORT_LANGUAGES_SKIP in settings.py). #39:Uzbek Cyrillic (Ўзбек):uz_UZ@cyrillic
# Skipped (see IMPORT_LANGUAGES_SKIP in settings.py). #38:Uzbek (Oʻzbek):uz_UZ@latin
# Skipped (see IMPORT_LANGUAGES_SKIP in settings.py). #39:Uzbek Cyrillic (Ўзбек):uz_UZ@cyrillic

File diff suppressed because it is too large Load Diff

View File

@ -853,7 +853,7 @@ def dump_src_messages(msgs, reports, settings):
elif l[0] != '#':
forced.add(l.rstrip('\n'))
for root, dirs, files in os.walk(settings.POTFILES_SOURCE_DIR):
if "/.svn" in root:
if "/.git" in root:
continue
for fname in files:
if os.path.splitext(fname)[1] not in settings.PYGETTEXT_ALLOWED_EXTS:

View File

@ -46,8 +46,8 @@ LANGUAGES = (
(10, "Catalan (Català)", "ca_AD"),
(11, "Czech (Čeština)", "cs_CZ"),
(12, "Portuguese (Português)", "pt_PT"),
(13, "Simplified Chinese (简体中文)", "zh_CN"),
(14, "Traditional Chinese (繁體中文)", "zh_TW"),
(13, "Simplified Chinese (简体中文)", "zh_HANS"),
(14, "Traditional Chinese (繁體中文)", "zh_HANT"),
(15, "Russian (Русский)", "ru_RU"),
(16, "Croatian (Hrvatski)", "hr_HR"),
(17, "Serbian (Српски)", "sr_RS"),
@ -72,9 +72,9 @@ LANGUAGES = (
(33, "Hebrew (תירִבְעִ)", "he_IL"),
(34, "Estonian (Eesti keel)", "et_EE"),
(35, "Esperanto (Esperanto)", "eo"),
(36, "Spanish from Spain (Español de España)", "es_ES"),
# 36 is free, used to be 'Spanish from Spain' (`es_ES`).
(37, "Amharic (አማርኛ)", "am_ET"),
(38, "Uzbek (Oʻzbek)", "uz_UZ"),
(38, "Uzbek (Oʻzbek)", "uz_UZ@latin"),
(39, "Uzbek Cyrillic (Ўзбек)", "uz_UZ@cyrillic"),
(40, "Hindi (हिन्दी)", "hi_IN"),
(41, "Vietnamese (Tiếng Việt)", "vi_VN"),
@ -95,12 +95,12 @@ DEFAULT_CONTEXT = "*"
# Name of language file used by Blender to generate translations' menu.
LANGUAGES_FILE = "languages"
# The min level of completeness for a po file to be imported from /branches into /trunk, as a percentage.
# The min level of completeness for a po file to be imported from the working repository to the Blender one, as a percentage.
IMPORT_MIN_LEVEL = 0.0
# Languages in /branches we do not want to import in /trunk currently...
# Languages in the working repository that should not be imported in the Blender one currently...
IMPORT_LANGUAGES_SKIP = {
'am_ET', 'bg_BG', 'el_GR', 'et_EE', 'ne_NP', 'ro_RO', 'uz_UZ', 'uz_UZ@cyrillic', 'kk_KZ', 'es_ES',
'am_ET', 'bg_BG', 'el_GR', 'et_EE', 'ne_NP', 'ro_RO', 'uz_UZ@latin', 'uz_UZ@cyrillic', 'kk_KZ',
}
# Languages that need RTL pre-processing.
@ -529,25 +529,15 @@ SOURCE_DIR = os.path.abspath(os.path.join("blender"))
# The bf-translation repository (you'll have to override this in your user_settings.py).
I18N_DIR = os.path.abspath(os.path.join("i18n"))
# The /branches path (relative to I18N_DIR).
REL_BRANCHES_DIR = os.path.join("branches")
# The /trunk path (relative to I18N_DIR).
REL_TRUNK_DIR = os.path.join("trunk")
# The /trunk/po path (relative to I18N_DIR).
REL_TRUNK_PO_DIR = os.path.join(REL_TRUNK_DIR, "po")
# The /trunk/mo path (relative to I18N_DIR).
REL_TRUNK_MO_DIR = os.path.join(REL_TRUNK_DIR, "locale")
# The 'work' path to PO files (relative to I18N_DIR).
REL_WORK_DIR = os.path.join("")
# The path to the *git* translation repository (relative to SOURCE_DIR).
REL_GIT_I18N_DIR = os.path.join("locale")
# The path to the Blender translation directory (relative to SOURCE_DIR).
REL_BLENDER_I18N_DIR = os.path.join("locale")
# The /po path of the *git* translation repository (relative to REL_GIT_I18N_DIR).
REL_GIT_I18N_PO_DIR = os.path.join("po")
# The /po path of the Blender translation directory (relative to REL_BLENDER_I18N_DIR).
REL_BLENDER_I18N_PO_DIR = os.path.join("po")
# The Blender source path to check for i18n macros (relative to SOURCE_DIR).
@ -563,13 +553,8 @@ REL_TEMPLATES_DIR = os.path.join("scripts", "startup", "bl_app_templates_system"
ASSET_CATALOG_FILE = "blender_assets.cats.txt"
# The template messages file (relative to I18N_DIR).
REL_FILE_NAME_POT = os.path.join(REL_BRANCHES_DIR, DOMAIN + ".pot")
REL_FILE_NAME_POT = os.path.join(REL_WORK_DIR, DOMAIN + ".pot")
# Mo root data-path.
REL_MO_PATH_ROOT = os.path.join(REL_TRUNK_DIR, "locale")
# Mo path generator for a given language.
REL_MO_PATH_TEMPLATE = os.path.join(REL_MO_PATH_ROOT, "{}", "LC_MESSAGES")
# Mo path generator for a given language (relative to any "locale" dir).
MO_PATH_ROOT_RELATIVE = os.path.join("locale")
@ -716,18 +701,13 @@ class I18nSettings:
else:
fname.write(self.to_json())
BRANCHES_DIR = property(*(_gen_get_set_path("I18N_DIR", "REL_BRANCHES_DIR")))
TRUNK_DIR = property(*(_gen_get_set_path("I18N_DIR", "REL_TRUNK_DIR")))
TRUNK_PO_DIR = property(*(_gen_get_set_path("I18N_DIR", "REL_TRUNK_PO_DIR")))
TRUNK_MO_DIR = property(*(_gen_get_set_path("I18N_DIR", "REL_TRUNK_MO_DIR")))
GIT_I18N_ROOT = property(*(_gen_get_set_path("SOURCE_DIR", "REL_GIT_I18N_DIR")))
GIT_I18N_PO_DIR = property(*(_gen_get_set_path("GIT_I18N_ROOT", "REL_GIT_I18N_PO_DIR")))
WORK_DIR = property(*(_gen_get_set_path("I18N_DIR", "REL_WORK_DIR")))
BLENDER_I18N_ROOT = property(*(_gen_get_set_path("SOURCE_DIR", "REL_BLENDER_I18N_DIR")))
BLENDER_I18N_PO_DIR = property(*(_gen_get_set_path("BLENDER_I18N_ROOT", "REL_BLENDER_I18N_PO_DIR")))
POTFILES_SOURCE_DIR = property(*(_gen_get_set_path("SOURCE_DIR", "REL_POTFILES_SOURCE_DIR")))
PRESETS_DIR = property(*(_gen_get_set_path("SOURCE_DIR", "REL_PRESETS_DIR")))
TEMPLATES_DIR = property(*(_gen_get_set_path("SOURCE_DIR", "REL_TEMPLATES_DIR")))
FILE_NAME_POT = property(*(_gen_get_set_path("I18N_DIR", "REL_FILE_NAME_POT")))
MO_PATH_ROOT = property(*(_gen_get_set_path("I18N_DIR", "REL_MO_PATH_ROOT")))
MO_PATH_TEMPLATE = property(*(_gen_get_set_path("I18N_DIR", "REL_MO_PATH_TEMPLATE")))
def _get_py_sys_paths(self):
return self.INTERN_PY_SYS_PATHS

View File

@ -55,7 +55,7 @@ def get_best_similar(data):
return key, tmp
_locale_explode_re = re.compile(r"^([a-z]{2,})(?:_([A-Z]{2,}))?(?:@([a-z]{2,}))?$")
_locale_explode_re = re.compile(r"^([a-z]{2,})(?:_([A-Za-z]{2,}))?(?:@([a-z]{2,}))?$")
def locale_explode(locale):

View File

@ -60,19 +60,19 @@ def language_menu(args, settings):
stats = {"DEFAULT": 1.0, "en_US": 1.0}
po_to_uid = {
os.path.basename(po_path_branch): uid
for can_use, uid, _num_id, _name, _isocode, po_path_branch
in utils_i18n.list_po_dir(settings.BRANCHES_DIR, settings)
os.path.basename(po_path_work): uid
for can_use, uid, _num_id, _name, _isocode, po_path_work
in utils_i18n.list_po_dir(settings.WORK_DIR, settings)
if can_use
}
for po_dir in os.listdir(settings.BRANCHES_DIR):
po_dir = os.path.join(settings.BRANCHES_DIR, po_dir)
for po_dir in os.listdir(settings.WORK_DIR):
po_dir = os.path.join(settings.WORK_DIR, po_dir)
if not os.path.isdir(po_dir):
continue
for po_path in os.listdir(po_dir):
uid = po_to_uid.get(po_path, None)
# print("Checking %s, found uid %s" % (po_path, uid))
po_path = os.path.join(settings.TRUNK_PO_DIR, po_path)
po_path = os.path.join(po_dir, po_path)
if uid is not None:
po = utils_i18n.I18nMessages(uid=uid, kind='PO', src=po_path, settings=settings)
stats[uid] = po.nbr_trans_msgs / po.nbr_msgs if po.nbr_msgs > 0 else 0

View File

@ -728,13 +728,13 @@ static blender::bke::GeometrySet curve_calc_modifiers_post(Depsgraph *depsgraph,
continue;
}
blender::bke::ScopedModifierTimer modifier_timer{*md};
if (md->type == eModifierType_Nodes) {
mti->modify_geometry_set(md, &mectx_apply, &geometry_set);
continue;
}
blender::bke::ScopedModifierTimer modifier_timer{*md};
if (!geometry_set.has_mesh()) {
geometry_set.replace_mesh(BKE_mesh_new_nomain(0, 0, 0, 0));
}

View File

@ -23,7 +23,7 @@ void BLT_lang_free(void);
/* Set the current locale. */
void BLT_lang_set(const char *);
/* Get the current locale ([partial] ISO code, e.g. es_ES). */
/* Get the current locale ([partial] ISO code, e.g. `pt_BR`). */
const char *BLT_lang_get(void);
/* Get locale's elements (if relevant pointer is not NULL and element actually exists, e.g.

View File

@ -1888,7 +1888,7 @@ static void edittranslation_find_po_file(const char *root,
return;
}
/* Now try without the second ISO code part (`_ES` in `es_ES`). */
/* Now try without the second ISO code part (`_BR` in `pt_BR`). */
{
const char *tc = nullptr;
size_t szt = 0;

View File

@ -62,6 +62,10 @@ static Mesh *create_ico_sphere_mesh(const int subdivisions,
const float radius,
const AttributeIDRef &uv_map_id)
{
if (subdivisions >= 3) {
lazy_threading::send_hint();
}
const float4x4 transform = float4x4::identity();
const bool create_uv_map = bool(uv_map_id);