diff options
Diffstat (limited to 'release/scripts')
m--------- | release/scripts/addons | 0 | ||||
-rw-r--r-- | release/scripts/modules/rna_info.py | 20 | ||||
-rw-r--r-- | release/scripts/presets/keyconfig/keymap_data/blender_default.py | 12 | ||||
-rw-r--r-- | release/scripts/startup/bl_operators/wm.py | 60 | ||||
-rw-r--r-- | release/scripts/startup/bl_ui/properties_data_volume.py | 3 | ||||
-rw-r--r-- | release/scripts/startup/bl_ui/properties_grease_pencil_common.py | 2 | ||||
-rw-r--r-- | release/scripts/startup/bl_ui/space_filebrowser.py | 5 | ||||
-rw-r--r-- | release/scripts/startup/bl_ui/space_view3d.py | 2 | ||||
-rw-r--r-- | release/scripts/templates_py/gizmo_operator.py | 5 |
9 files changed, 93 insertions, 16 deletions
diff --git a/release/scripts/addons b/release/scripts/addons -Subproject 7025cd28ede25eb44208722f842e35b10325c6c +Subproject d936e4c01fa263a71a7d0665628ae621283b15e diff --git a/release/scripts/modules/rna_info.py b/release/scripts/modules/rna_info.py index 687f3c95d0b..04120508df5 100644 --- a/release/scripts/modules/rna_info.py +++ b/release/scripts/modules/rna_info.py @@ -61,7 +61,8 @@ def range_str(val): def float_as_string(f): val_str = "%g" % f - if '.' not in val_str and '-' not in val_str: # value could be 1e-05 + # Ensure a `.0` suffix for whole numbers, excluding scientific notation such as `1e-05` or `1e+5`. + if '.' not in val_str and 'e' not in val_str: val_str += '.0' return val_str @@ -584,6 +585,16 @@ def BuildRNAInfo(): structs = [] def _bpy_types_iterator(): + # Don't report when these types are ignored. + suppress_warning = { + "bpy_func", + "bpy_prop", + "bpy_prop_array", + "bpy_prop_collection", + "bpy_struct", + "bpy_struct_meta_idprop", + } + names_unique = set() rna_type_list = [] for rna_type_name in dir(bpy.types): @@ -593,8 +604,13 @@ def BuildRNAInfo(): if rna_struct is not None: rna_type_list.append(rna_type) yield (rna_type_name, rna_struct) + elif rna_type_name.startswith("_"): + # Ignore "__dir__", "__getattr__" .. etc. + pass + elif rna_type_name in suppress_warning: + pass else: - print("Ignoring", rna_type_name) + print("rna_info.BuildRNAInfo(..): ignoring type", repr(rna_type_name)) # Now, there are some sub-classes in add-ons we also want to include. # Cycles for e.g. these are referenced from the Scene, but not part of diff --git a/release/scripts/presets/keyconfig/keymap_data/blender_default.py b/release/scripts/presets/keyconfig/keymap_data/blender_default.py index 9c94029fa16..a4bac916946 100644 --- a/release/scripts/presets/keyconfig/keymap_data/blender_default.py +++ b/release/scripts/presets/keyconfig/keymap_data/blender_default.py @@ -2031,13 +2031,9 @@ def km_node_editor(params): items.extend(_template_node_select(type='LEFTMOUSE', value='PRESS', select_passthrough=True)) else: items.extend(_template_node_select( - type='RIGHTMOUSE', value=params.select_mouse_value, select_passthrough=False)) - items.extend([ - ("node.select", {"type": 'LEFTMOUSE', "value": 'PRESS'}, - {"properties": [("deselect_all", False)]}), - ("node.select", {"type": 'LEFTMOUSE', "value": 'PRESS', "shift": True}, - {"properties": [("toggle", True)]}), - ]) + type='RIGHTMOUSE', value=params.select_mouse_value, select_passthrough=True)) + items.extend(_template_node_select( + type='LEFTMOUSE', value='PRESS', select_passthrough=True)) items.extend([ ("node.select_box", {"type": params.select_mouse, "value": 'CLICK_DRAG'}, @@ -4795,7 +4791,7 @@ def _template_view3d_gpencil_select(*, type, value, legacy, use_select_mouse=Tru def _template_node_select(*, type, value, select_passthrough): items = [ ("node.select", {"type": type, "value": value}, - {"properties": [("deselect_all", True), ("select_passthrough", True)]}), + {"properties": [("deselect_all", True), ("select_passthrough", select_passthrough)]}), ("node.select", {"type": type, "value": value, "ctrl": True}, None), ("node.select", {"type": type, "value": value, "alt": True}, None), ("node.select", {"type": type, "value": value, "ctrl": True, "alt": True}, None), diff --git a/release/scripts/startup/bl_operators/wm.py b/release/scripts/startup/bl_operators/wm.py index 0f063da40fb..37d7ef19a28 100644 --- a/release/scripts/startup/bl_operators/wm.py +++ b/release/scripts/startup/bl_operators/wm.py @@ -21,10 +21,68 @@ from bpy.props import ( ) from bpy.app.translations import pgettext_iface as iface_ + +def _rna_path_prop_search_for_context_impl(context, edit_text, unique_attrs): + # Use the same logic as auto-completing in the Python console to expand the data-path. + from bl_console_utils.autocomplete import intellisense + context_prefix = "context." + line = context_prefix + edit_text + cursor = len(line) + namespace = {"context": context} + comp_prefix, _, comp_options = intellisense.expand(line=line, cursor=len(line), namespace=namespace, private=False) + prefix = comp_prefix[len(context_prefix):] # Strip "context." + for attr in comp_options.split("\n"): + if attr.endswith(( + # Exclude function calls because they are generally not part of data-paths. + "(", ")", + # RNA properties for introspection, not useful to expand. + ".bl_rna", ".rna_type", + )): + continue + attr_full = prefix + attr.lstrip() + if attr_full in unique_attrs: + continue + unique_attrs.add(attr_full) + yield attr_full + + +def rna_path_prop_search_for_context(self, context, edit_text): + # NOTE(@campbellbarton): Limiting data-path expansion is rather arbitrary. + # It's possible for e.g. that someone would want to set a shortcut in the preferences or + # in other region types than those currently expanded. Unless there is a reasonable likelihood + # users might expand these space-type/region-type combinations - exclude them from this search. + # After all, this list is mainly intended as a hint, users are not prevented from constructing + # the data-paths themselves. + unique_attrs = set() + + for window in context.window_manager.windows: + for area in window.screen.areas: + # Users are very unlikely to be setting shortcuts in the preferences, skip this. + if area.type == 'PREFERENCES': + continue + space = area.spaces.active + # Ignore the same region type multiple times in an area. + # Prevents the 3D-viewport quad-view from attempting to expand 3 extra times for e.g. + region_type_unique = set() + for region in area.regions: + if region.type not in {'WINDOW', 'PREVIEW'}: + continue + if region.type in region_type_unique: + continue + region_type_unique.add(region.type) + with context.temp_override(window=window, area=area, region=region): + yield from _rna_path_prop_search_for_context_impl(context, edit_text, unique_attrs) + + if not unique_attrs: + # Users *might* only have a preferences area shown, in that case just expand the current context. + yield from _rna_path_prop_search_for_context_impl(context, edit_text, unique_attrs) + + rna_path_prop = StringProperty( name="Context Attributes", - description="RNA context string", + description="Context data-path (expanded using visible windows in the current .blend file)", maxlen=1024, + search=rna_path_prop_search_for_context, ) rna_reverse_prop = BoolProperty( diff --git a/release/scripts/startup/bl_ui/properties_data_volume.py b/release/scripts/startup/bl_ui/properties_data_volume.py index 678972a677c..98855d4b516 100644 --- a/release/scripts/startup/bl_ui/properties_data_volume.py +++ b/release/scripts/startup/bl_ui/properties_data_volume.py @@ -115,6 +115,9 @@ class DATA_PT_volume_render(DataButtonsPanel, Panel): col = layout.column(align=True) col.prop(render, "clipping") + col = layout.column() + col.prop(render, "precision") + col = layout.column(align=False) col.prop(volume, "velocity_grid") diff --git a/release/scripts/startup/bl_ui/properties_grease_pencil_common.py b/release/scripts/startup/bl_ui/properties_grease_pencil_common.py index 6b55683ee89..f186fca0849 100644 --- a/release/scripts/startup/bl_ui/properties_grease_pencil_common.py +++ b/release/scripts/startup/bl_ui/properties_grease_pencil_common.py @@ -245,7 +245,7 @@ class GPENCIL_MT_move_to_layer(Menu): icon = 'GREASEPENCIL' else: icon = 'NONE' - layout.operator("gpencil.move_to_layer", text=gpl.info, icon=icon).layer = i + layout.operator("gpencil.move_to_layer", text=gpl.info, icon=icon, translate=False).layer = i i -= 1 layout.separator() diff --git a/release/scripts/startup/bl_ui/space_filebrowser.py b/release/scripts/startup/bl_ui/space_filebrowser.py index 31552111276..92cfa7e8219 100644 --- a/release/scripts/startup/bl_ui/space_filebrowser.py +++ b/release/scripts/startup/bl_ui/space_filebrowser.py @@ -696,11 +696,12 @@ class ASSETBROWSEROLD_PT_metadata(asset_utils.AssetBrowserPanel, Panel): prefs = context.preferences show_asset_debug_info = prefs.view.show_developer_ui and prefs.experimental.show_asset_debug_info + is_local_asset = bool(asset_file_handle.local_id) layout.use_property_split = True layout.use_property_decorate = False # No animation. - if asset_file_handle.local_id: + if is_local_asset: # If the active file is an ID, use its name directly so renaming is possible from right here. layout.prop(asset_file_handle.local_id, "name") @@ -720,7 +721,7 @@ class ASSETBROWSEROLD_PT_metadata(asset_utils.AssetBrowserPanel, Panel): col.prop(asset_file_handle.asset_data, "catalog_simple_name", text="Simple Name") row = layout.row(align=True) - row.prop(wm, "asset_path_dummy", text="Source") + row.prop(wm, "asset_path_dummy", text="Source", icon='CURRENT_FILE' if is_local_asset else 'NONE') row.operator("asset.open_containing_blend_file", text="", icon='TOOL_SETTINGS') layout.prop(asset_file_handle.asset_data, "description") diff --git a/release/scripts/startup/bl_ui/space_view3d.py b/release/scripts/startup/bl_ui/space_view3d.py index bcc5976fb59..1af70895be9 100644 --- a/release/scripts/startup/bl_ui/space_view3d.py +++ b/release/scripts/startup/bl_ui/space_view3d.py @@ -2295,6 +2295,8 @@ class VIEW3D_MT_object_relations(Menu): layout = self.layout layout.operator("object.make_override_library", text="Make Library Override...") + layout.operator("object.make_override_library", + text="Make Library Override - Fully Editable...").do_fully_editable = True layout.operator("object.make_dupli_face") diff --git a/release/scripts/templates_py/gizmo_operator.py b/release/scripts/templates_py/gizmo_operator.py index 450f67ba3a4..75595b0c5ea 100644 --- a/release/scripts/templates_py/gizmo_operator.py +++ b/release/scripts/templates_py/gizmo_operator.py @@ -84,7 +84,7 @@ class SelectSideOfPlaneGizmoGroup(GizmoGroup): bl_label = "Side of Plane Gizmo" bl_space_type = 'VIEW_3D' bl_region_type = 'WINDOW' - bl_options = {'3D'} + bl_options = {'3D', 'EXCLUDE_MODAL'} # Helper functions @staticmethod @@ -199,7 +199,8 @@ class SelectSideOfPlaneGizmoGroup(GizmoGroup): matrix.col[0].xyz = no_x matrix.col[1].xyz = no_y matrix.col[2].xyz = no_z - matrix.col[3].xyz = co + # The location callback handles the location. + # `matrix.col[3].xyz = co`. # Dial no_z = self.rotate_axis |