Merge remote-tracking branch 'origin/blender-v3.0-release'

This commit is contained in:
Julian Eisel 2021-11-03 18:07:36 +01:00
commit e10caf6fe3
9 changed files with 79 additions and 11 deletions

View File

@ -252,27 +252,50 @@ def dump_rna_messages(msgs, reports, settings, verbose=False):
# Function definitions
def walk_properties(cls):
# This handles properties whose name is the same as their identifier.
# Usually, it means that those are internal properties not exposed in the UI, however there are some cases
# where the UI label is actually defined and same as the identifier (color spaces e.g., `RGB` etc.).
# So we only exclude those properties in case they belong to an operator for now.
def prop_name_validate(cls, prop_name, prop_identifier):
if prop_name != prop_identifier:
return True
# Heuristic: A lot of operator's HIDDEN properties have no UI label/description.
# While this is not ideal (for API doc purposes, description should always be provided),
# for now skip those properties.
# NOTE: keep in sync with C code in ui_searchbox_region_draw_cb__operator().
if issubclass(cls, bpy.types.OperatorProperties) and "_OT_" in cls.__name__:
return False
# Heuristic: If UI label is not capitalized, it is likely a private (undocumented) property,
# that can be skipped.
if prop_name and not prop_name[0].isupper():
return False
return True
bl_rna = cls.bl_rna
# Get our parents' properties, to not export them multiple times.
bl_rna_base = bl_rna.base
bl_rna_base_props = set()
if bl_rna_base:
bl_rna_base_props = set(bl_rna_base.properties.values())
else:
bl_rna_base_props = set()
bl_rna_base_props |= set(bl_rna_base.properties.values())
for cls_base in cls.__bases__:
bl_rna_base = getattr(cls_base, "bl_rna", None)
if not bl_rna_base:
continue
bl_rna_base_props |= set(bl_rna_base.properties.values())
props = sorted(bl_rna.properties, key=lambda p: p.identifier)
for prop in props:
# Only write this property if our parent hasn't got it.
if prop in bl_rna_base_props:
continue
if prop.identifier == "rna_type":
if prop.identifier in {"rna_type", "bl_icon", "icon"}:
continue
reports["rna_props"].append((cls, prop))
msgsrc = "bpy.types.{}.{}".format(bl_rna.identifier, prop.identifier)
msgctxt = prop.translation_context or default_context
if prop.name and (prop.name != prop.identifier or msgctxt != default_context):
if prop.name and prop_name_validate(cls, prop.name, prop.identifier):
process_msg(msgs, msgctxt, prop.name, msgsrc, reports, check_ctxt_rna, settings)
if prop.description:
process_msg(msgs, default_context, prop.description, msgsrc, reports, check_ctxt_rna_tip, settings)
@ -282,7 +305,7 @@ def dump_rna_messages(msgs, reports, settings, verbose=False):
for item in prop.enum_items:
msgsrc = "bpy.types.{}.{}:'{}'".format(bl_rna.identifier, prop.identifier, item.identifier)
done_items.add(item.identifier)
if item.name and item.name != item.identifier:
if item.name and prop_name_validate(cls, item.name, item.identifier):
process_msg(msgs, msgctxt, item.name, msgsrc, reports, check_ctxt_rna, settings)
if item.description:
process_msg(msgs, default_context, item.description, msgsrc, reports, check_ctxt_rna_tip,
@ -292,7 +315,7 @@ def dump_rna_messages(msgs, reports, settings, verbose=False):
continue
msgsrc = "bpy.types.{}.{}:'{}'".format(bl_rna.identifier, prop.identifier, item.identifier)
done_items.add(item.identifier)
if item.name and item.name != item.identifier:
if item.name and prop_name_validate(cls, item.name, item.identifier):
process_msg(msgs, msgctxt, item.name, msgsrc, reports, check_ctxt_rna, settings)
if item.description:
process_msg(msgs, default_context, item.description, msgsrc, reports, check_ctxt_rna_tip,

View File

@ -689,11 +689,13 @@ class SpellChecker:
"ctrl",
"cw", "ccw",
"dev",
"dls",
"djv",
"dpi",
"dvar",
"dx",
"eo",
"ewa",
"fh",
"fk",
"fov",
@ -733,6 +735,7 @@ class SpellChecker:
"rhs",
"rv",
"sdl",
"sdls",
"sl",
"smpte",
"ssao",
@ -767,6 +770,7 @@ class SpellChecker:
"svbvh",
# Files types/formats
"aac",
"avi",
"attrac",
"autocad",
@ -789,6 +793,7 @@ class SpellChecker:
"ico",
"jpg", "jpeg", "jpegs",
"json",
"lzw",
"matroska",
"mdd",
"mkv",
@ -798,6 +803,7 @@ class SpellChecker:
"openjpeg",
"osl",
"oso",
"pcm",
"piz",
"png", "pngs",
"po",

View File

@ -43,22 +43,30 @@ class WM_OT_previews_batch_generate(Operator):
files: CollectionProperty(
type=OperatorFileListElement,
options={'HIDDEN', 'SKIP_SAVE'},
name="",
description="Collection of file paths with common `directory` root",
)
directory: StringProperty(
maxlen=1024,
subtype='FILE_PATH',
options={'HIDDEN', 'SKIP_SAVE'},
name="",
description="Root path of all files listed in `files` collection",
)
# Show only images/videos, and directories!
filter_blender: BoolProperty(
default=True,
options={'HIDDEN', 'SKIP_SAVE'},
name="",
description="Show Blender files in the File Browser",
)
filter_folder: BoolProperty(
default=True,
options={'HIDDEN', 'SKIP_SAVE'},
name="",
description="Show folders in the File Browser",
)
# -----------

View File

@ -2607,6 +2607,17 @@ void nodeInternalRelink(bNodeTree *ntree, bNode *node)
bNodeLink *fromlink = link->fromsock->link->fromsock->link;
/* skip the node */
if (fromlink) {
if (link->tosock->flag & SOCK_MULTI_INPUT) {
/* remove the link that would be the same as the relinked one */
LISTBASE_FOREACH_MUTABLE (bNodeLink *, link_to_compare, &ntree->links) {
if (link_to_compare->fromsock == fromlink->fromsock &&
link_to_compare->tosock == link->tosock) {
adjust_multi_input_indices_after_removed_link(
ntree, link_to_compare->tosock, link_to_compare->multi_input_socket_index);
nodeRemLink(ntree, link_to_compare);
}
}
}
link->fromnode = fromlink->fromnode;
link->fromsock = fromlink->fromsock;

View File

@ -12773,6 +12773,8 @@ static void rna_def_nodetree(BlenderRNA *brna)
prop = RNA_def_property(srna, "view_center", PROP_FLOAT, PROP_XYZ);
RNA_def_property_array(prop, 2);
RNA_def_property_float_sdna(prop, NULL, "view_center");
RNA_def_property_ui_text(
prop, "", "The current location (offset) of the view for this Node Tree");
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
/* AnimData */

View File

@ -985,10 +985,12 @@ static void rna_def_pointcache_common(StructRNA *srna)
prop = RNA_def_property(srna, "is_baked", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", PTCACHE_BAKED);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "", "The cache is baked");
prop = RNA_def_property(srna, "is_baking", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", PTCACHE_BAKING);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "", "The cache is being baked");
prop = RNA_def_property(srna, "use_disk_cache", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", PTCACHE_DISK_CACHE);
@ -999,11 +1001,13 @@ static void rna_def_pointcache_common(StructRNA *srna)
prop = RNA_def_property(srna, "is_outdated", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", PTCACHE_OUTDATED);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Cache is outdated", "");
RNA_def_property_ui_text(prop, "Cache Is Outdated", "");
prop = RNA_def_property(srna, "is_frame_skip", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", PTCACHE_FRAMES_SKIPPED);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(
prop, "", "Some frames were skipped while baking/saving that cache");
prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "name");

View File

@ -1451,6 +1451,11 @@ static void rna_def_panel(BlenderRNA *brna)
RNA_def_property_string_sdna(prop, NULL, "type->translation_context");
RNA_def_property_string_default(prop, BLT_I18NCONTEXT_DEFAULT_BPYRNA);
RNA_def_property_flag(prop, PROP_REGISTER_OPTIONAL);
RNA_def_property_ui_text(prop,
"",
"Specific translation context, only define when the label needs to be "
"disambiguated from others using the exact same label");
RNA_define_verify_sdna(true);
prop = RNA_def_property(srna, "bl_description", PROP_STRING, PROP_NONE);
@ -1460,14 +1465,21 @@ static void rna_def_panel(BlenderRNA *brna)
// RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_flag(prop, PROP_REGISTER_OPTIONAL);
RNA_def_property_clear_flag(prop, PROP_NEVER_NULL); /* check for NULL */
RNA_def_property_ui_text(prop, "", "The panel tooltip");
prop = RNA_def_property(srna, "bl_category", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "type->category");
RNA_def_property_flag(prop, PROP_REGISTER_OPTIONAL);
RNA_def_property_ui_text(
prop,
"",
"The category (tab) in which the panel will be displayed, when applicable");
prop = RNA_def_property(srna, "bl_owner_id", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "type->owner_id");
RNA_def_property_flag(prop, PROP_REGISTER_OPTIONAL);
RNA_def_property_ui_text(
prop, "", "The ID owning the data displayed in the panel, if any");
prop = RNA_def_property(srna, "bl_space_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "type->space_type");

View File

@ -266,7 +266,7 @@ void DOutputSocket::foreach_target_socket(ForeachTargetSocketFn target_fn,
}
/* The internal link only forwards the first incoming link. */
if (linked_socket->is_multi_input_socket()) {
if (linked_socket->directly_linked_links()[0] == link) {
if (linked_socket->directly_linked_links()[0] != link) {
continue;
}
}

View File

@ -212,8 +212,10 @@ static uiBlock *wm_block_create_splash(bContext *C, ARegion *region, void *UNUSE
UI_but_func_set(but, wm_block_close, block, NULL);
wm_block_splash_add_label(
block, BKE_blender_version_string(), splash_width, splash_height - 13.0 * U.dpi_fac);
wm_block_splash_add_label(block,
BKE_blender_version_string(),
splash_width - 8.0 * U.dpi_fac,
splash_height - 13.0 * U.dpi_fac);
const int layout_margin_x = U.dpi_fac * 26;
uiLayout *layout = UI_block_layout(block,