diff options
Diffstat (limited to 'release')
101 files changed, 408 insertions, 239 deletions
diff --git a/release/scripts/freestyle/modules/freestyle/shaders.py b/release/scripts/freestyle/modules/freestyle/shaders.py index 28b8aa9b23e..95e1c873657 100644 --- a/release/scripts/freestyle/modules/freestyle/shaders.py +++ b/release/scripts/freestyle/modules/freestyle/shaders.py @@ -1153,11 +1153,9 @@ class RoundCapShader(StrokeShader): return # calculate the number of additional vertices to form caps thickness_beg = sum(stroke[0].attribute.thickness) - caplen_beg = thickness_beg / 2.0 nverts_beg = max(5, int(thickness_beg)) thickness_end = sum(stroke[-1].attribute.thickness) - caplen_end = (thickness_end) / 2.0 nverts_end = max(5, int(thickness_end)) # adjust the total number of stroke vertices @@ -1169,7 +1167,7 @@ class RoundCapShader(StrokeShader): # reshape the cap at the beginning of the stroke q, attr = buffer[1] p, attr = buffer[0] - direction = (p - q).normalized() * caplen_beg + direction = (p - q).normalized() * thickness_beg n = 1.0 / nverts_beg R, L = attr.thickness for t, svert in zip(range(nverts_beg, 0, -1), stroke): @@ -1180,7 +1178,7 @@ class RoundCapShader(StrokeShader): # reshape the cap at the end of the stroke q, attr = buffer[-2] p, attr = buffer[-1] - direction = (p - q).normalized() * caplen_beg + direction = (p - q).normalized() * thickness_end n = 1.0 / nverts_end R, L = attr.thickness for t, svert in zip(range(nverts_end, 0, -1), reversed(stroke)): diff --git a/release/scripts/modules/bl_i18n_utils/utils.py b/release/scripts/modules/bl_i18n_utils/utils.py index f63b6990cdd..fda93682dc5 100644 --- a/release/scripts/modules/bl_i18n_utils/utils.py +++ b/release/scripts/modules/bl_i18n_utils/utils.py @@ -781,7 +781,6 @@ class I18nMessages: print("Could not import bpy, find_best_messages_matches must be run from whithin Blender.") return - # Build helper mappings. # Note it's user responsibility to know when to invalidate (and hence force rebuild) this cache! if self._reverse_cache is None: diff --git a/release/scripts/modules/bl_i18n_utils/utils_cli.py b/release/scripts/modules/bl_i18n_utils/utils_cli.py index d3750d5e9a4..e18491fa042 100644 --- a/release/scripts/modules/bl_i18n_utils/utils_cli.py +++ b/release/scripts/modules/bl_i18n_utils/utils_cli.py @@ -140,6 +140,7 @@ def main(): args.func(args=args, settings=settings) + if __name__ == "__main__": print("\n\n *** Running {} *** \n".format(__file__)) main() diff --git a/release/scripts/modules/bl_keymap_utils/keymap_from_toolbar.py b/release/scripts/modules/bl_keymap_utils/keymap_from_toolbar.py index aff1108568b..26f38cf09fc 100644 --- a/release/scripts/modules/bl_keymap_utils/keymap_from_toolbar.py +++ b/release/scripts/modules/bl_keymap_utils/keymap_from_toolbar.py @@ -449,6 +449,5 @@ def generate(context, space_type, *, use_fallback_keys=True, use_reset=True): ) kmi.properties.skip_depressed = True - wm.keyconfigs.update() return keymap diff --git a/release/scripts/modules/bl_previews_utils/bl_previews_render.py b/release/scripts/modules/bl_previews_utils/bl_previews_render.py index 51ea53c0eba..17577a9a9f2 100644 --- a/release/scripts/modules/bl_previews_utils/bl_previews_render.py +++ b/release/scripts/modules/bl_previews_utils/bl_previews_render.py @@ -37,6 +37,7 @@ OBJECT_TYPES_RENDER = {'MESH', 'CURVE', 'SURFACE', 'META', 'FONT'} def ids_nolib(bids): return (bid for bid in bids if not bid.library) + def ids_nolib_with_preview(bids): return (bid for bid in bids if (not bid.library and bid.preview)) diff --git a/release/scripts/modules/bl_rna_utils/data_path.py b/release/scripts/modules/bl_rna_utils/data_path.py index 42942b7a295..439dfcae12a 100644 --- a/release/scripts/modules/bl_rna_utils/data_path.py +++ b/release/scripts/modules/bl_rna_utils/data_path.py @@ -23,6 +23,7 @@ __all__ = ( "decompose_data_path", ) + class _TokenizeDataPath: """ Class to split up tokens of a data-path. diff --git a/release/scripts/modules/bpy/utils/__init__.py b/release/scripts/modules/bpy/utils/__init__.py index e6c7bca3e3c..58b20d9e3c8 100644 --- a/release/scripts/modules/bpy/utils/__init__.py +++ b/release/scripts/modules/bpy/utils/__init__.py @@ -155,6 +155,7 @@ def _test_import(module_name, loaded_modules): # This supports the case of loading a new preferences file which may reset scripts path. _sys_path_ensure_paths = set() + def _sys_path_ensure_prepend(path): if path not in _sys.path: _sys.path.insert(0, path) diff --git a/release/scripts/modules/bpy_extras/asset_utils.py b/release/scripts/modules/bpy_extras/asset_utils.py index 1656c21a137..2cd5dddefbc 100644 --- a/release/scripts/modules/bpy_extras/asset_utils.py +++ b/release/scripts/modules/bpy_extras/asset_utils.py @@ -31,6 +31,7 @@ __all__ = ( "SpaceAssetInfo", ) + class SpaceAssetInfo: @classmethod def is_asset_browser(cls, space_data: bpy.types.Space): @@ -46,6 +47,7 @@ class SpaceAssetInfo: active_file = context.active_file return active_file.asset_data if active_file else None + class AssetBrowserPanel: bl_space_type = 'FILE_BROWSER' @@ -53,6 +55,18 @@ class AssetBrowserPanel: def poll(cls, context): return SpaceAssetInfo.is_asset_browser_poll(context) + +class AssetBrowserSpecificCategoryPanel(AssetBrowserPanel): + asset_categories = set() # Set of strings like 'ANIMATIONS', see `asset_category_items` in rna_space.c + + @classmethod + def poll(cls, context): + return ( + SpaceAssetInfo.is_asset_browser_poll(context) + and context.space_data.params.asset_category in cls.asset_categories + ) + + class AssetMetaDataPanel: bl_space_type = 'FILE_BROWSER' bl_region_type = 'TOOL_PROPS' diff --git a/release/scripts/modules/bpy_extras/node_shader_utils.py b/release/scripts/modules/bpy_extras/node_shader_utils.py index 54124fd4ca6..e37c1a17152 100644 --- a/release/scripts/modules/bpy_extras/node_shader_utils.py +++ b/release/scripts/modules/bpy_extras/node_shader_utils.py @@ -681,7 +681,10 @@ class ShaderImageTextureWrapper(): tree = self.owner_shader.material.node_tree node_image = tree.nodes.new(type='ShaderNodeTexImage') - self.owner_shader._grid_to_location(-1, 0 + self.grid_row_diff, dst_node=node_image, ref_node=self.node_dst) + self.owner_shader._grid_to_location( + -1, 0 + self.grid_row_diff, + dst_node=node_image, ref_node=self.node_dst, + ) tree.links.new(node_image.outputs["Alpha" if self.use_alpha else "Color"], self.socket_dst) if self.use_alpha: @@ -778,7 +781,7 @@ class ShaderImageTextureWrapper(): socket_dst = self.node_image.inputs["Vector"] # If not already existing, we need to create texcoords -> mapping link (from UV). socket_src = (socket_dst.links[0].from_socket if socket_dst.is_linked - else self.owner_shader.node_texcoords.outputs['UV']) + else self.owner_shader.node_texcoords.outputs['UV']) tree = self.owner_shader.material.node_tree node_mapping = tree.nodes.new(type='ShaderNodeMapping') diff --git a/release/scripts/modules/console/complete_calltip.py b/release/scripts/modules/console/complete_calltip.py index 706af67905b..60daa1d2045 100644 --- a/release/scripts/modules/console/complete_calltip.py +++ b/release/scripts/modules/console/complete_calltip.py @@ -41,7 +41,7 @@ RE_DEF_COMPLETE = re.compile( # allow empty string '''|)''' # allow opening bracket(s) - '''(?:\(|\s)*)$''') + r'''(?:\(|\s)*)$''') def reduce_newlines(text): diff --git a/release/scripts/presets/camera/1_inch.py b/release/scripts/presets/camera/1_inch.py index 72b039fb978..97e87b8c5a7 100644 --- a/release/scripts/presets/camera/1_inch.py +++ b/release/scripts/presets/camera/1_inch.py @@ -1,4 +1,4 @@ import bpy bpy.context.camera.sensor_width = 13.2 bpy.context.camera.sensor_height = 8.80 -bpy.context.camera.sensor_fit = 'HORIZONTAL'
\ No newline at end of file +bpy.context.camera.sensor_fit = 'HORIZONTAL' diff --git a/release/scripts/presets/camera/1_slash_1.8_inch.py b/release/scripts/presets/camera/1_slash_1.8_inch.py index 38e09182de6..8b0dc3cea1d 100644 --- a/release/scripts/presets/camera/1_slash_1.8_inch.py +++ b/release/scripts/presets/camera/1_slash_1.8_inch.py @@ -1,4 +1,4 @@ import bpy bpy.context.camera.sensor_width = 7.18 bpy.context.camera.sensor_height = 5.32 -bpy.context.camera.sensor_fit = 'HORIZONTAL'
\ No newline at end of file +bpy.context.camera.sensor_fit = 'HORIZONTAL' diff --git a/release/scripts/presets/camera/1_slash_2.3_inch.py b/release/scripts/presets/camera/1_slash_2.3_inch.py index 4d55738f4ed..bd6808da082 100644 --- a/release/scripts/presets/camera/1_slash_2.3_inch.py +++ b/release/scripts/presets/camera/1_slash_2.3_inch.py @@ -1,4 +1,4 @@ import bpy bpy.context.camera.sensor_width = 6.17 bpy.context.camera.sensor_height = 4.55 -bpy.context.camera.sensor_fit = 'HORIZONTAL'
\ No newline at end of file +bpy.context.camera.sensor_fit = 'HORIZONTAL' diff --git a/release/scripts/presets/camera/1_slash_2.5_inch.py b/release/scripts/presets/camera/1_slash_2.5_inch.py index cbdb6f3cbe0..90f60e7d7f0 100644 --- a/release/scripts/presets/camera/1_slash_2.5_inch.py +++ b/release/scripts/presets/camera/1_slash_2.5_inch.py @@ -1,4 +1,4 @@ import bpy bpy.context.camera.sensor_width = 5.76 bpy.context.camera.sensor_height = 4.29 -bpy.context.camera.sensor_fit = 'HORIZONTAL'
\ No newline at end of file +bpy.context.camera.sensor_fit = 'HORIZONTAL' diff --git a/release/scripts/presets/camera/1_slash_2.7_inch.py b/release/scripts/presets/camera/1_slash_2.7_inch.py index 5ccfa4ab555..4a9591803d0 100644 --- a/release/scripts/presets/camera/1_slash_2.7_inch.py +++ b/release/scripts/presets/camera/1_slash_2.7_inch.py @@ -1,4 +1,4 @@ import bpy bpy.context.camera.sensor_width = 5.37 bpy.context.camera.sensor_height = 4.04 -bpy.context.camera.sensor_fit = 'HORIZONTAL'
\ No newline at end of file +bpy.context.camera.sensor_fit = 'HORIZONTAL' diff --git a/release/scripts/presets/camera/1_slash_3.2_inch.py b/release/scripts/presets/camera/1_slash_3.2_inch.py index 1963f7ec048..5f31b9ec49c 100644 --- a/release/scripts/presets/camera/1_slash_3.2_inch.py +++ b/release/scripts/presets/camera/1_slash_3.2_inch.py @@ -1,4 +1,4 @@ import bpy bpy.context.camera.sensor_width = 4.54 bpy.context.camera.sensor_height = 3.42 -bpy.context.camera.sensor_fit = 'HORIZONTAL'
\ No newline at end of file +bpy.context.camera.sensor_fit = 'HORIZONTAL' diff --git a/release/scripts/presets/camera/2_slash_3_inch.py b/release/scripts/presets/camera/2_slash_3_inch.py index 25b46016800..eb463a31af7 100644 --- a/release/scripts/presets/camera/2_slash_3_inch.py +++ b/release/scripts/presets/camera/2_slash_3_inch.py @@ -1,4 +1,4 @@ import bpy bpy.context.camera.sensor_width = 8.8 bpy.context.camera.sensor_height = 6.6 -bpy.context.camera.sensor_fit = 'HORIZONTAL'
\ No newline at end of file +bpy.context.camera.sensor_fit = 'HORIZONTAL' diff --git a/release/scripts/presets/camera/APS-C.py b/release/scripts/presets/camera/APS-C.py index 84e40825248..4031e8bae71 100644 --- a/release/scripts/presets/camera/APS-C.py +++ b/release/scripts/presets/camera/APS-C.py @@ -1,4 +1,4 @@ import bpy bpy.context.camera.sensor_width = 23.6 bpy.context.camera.sensor_height = 15.6 -bpy.context.camera.sensor_fit = 'HORIZONTAL'
\ No newline at end of file +bpy.context.camera.sensor_fit = 'HORIZONTAL' diff --git a/release/scripts/presets/camera/APS-C_(Canon).py b/release/scripts/presets/camera/APS-C_(Canon).py index 55f20ce0eac..484929a54e7 100644 --- a/release/scripts/presets/camera/APS-C_(Canon).py +++ b/release/scripts/presets/camera/APS-C_(Canon).py @@ -1,4 +1,4 @@ import bpy bpy.context.camera.sensor_width = 22.30 bpy.context.camera.sensor_height = 14.90 -bpy.context.camera.sensor_fit = 'HORIZONTAL'
\ No newline at end of file +bpy.context.camera.sensor_fit = 'HORIZONTAL' diff --git a/release/scripts/presets/camera/APS-H_(Canon).py b/release/scripts/presets/camera/APS-H_(Canon).py index d63f733280b..d3b61d1aa46 100644 --- a/release/scripts/presets/camera/APS-H_(Canon).py +++ b/release/scripts/presets/camera/APS-H_(Canon).py @@ -1,4 +1,4 @@ import bpy bpy.context.camera.sensor_width = 27.90 bpy.context.camera.sensor_height = 18.60 -bpy.context.camera.sensor_fit = 'HORIZONTAL'
\ No newline at end of file +bpy.context.camera.sensor_fit = 'HORIZONTAL' diff --git a/release/scripts/presets/camera/Analog_16mm.py b/release/scripts/presets/camera/Analog_16mm.py index aa98eaf2408..a290839c8e0 100644 --- a/release/scripts/presets/camera/Analog_16mm.py +++ b/release/scripts/presets/camera/Analog_16mm.py @@ -1,4 +1,4 @@ import bpy bpy.context.camera.sensor_width = 10.26 bpy.context.camera.sensor_height = 7.49 -bpy.context.camera.sensor_fit = 'HORIZONTAL'
\ No newline at end of file +bpy.context.camera.sensor_fit = 'HORIZONTAL' diff --git a/release/scripts/presets/camera/Analog_35mm.py b/release/scripts/presets/camera/Analog_35mm.py index a0dee1f0166..fe3338dd292 100644 --- a/release/scripts/presets/camera/Analog_35mm.py +++ b/release/scripts/presets/camera/Analog_35mm.py @@ -1,4 +1,4 @@ import bpy bpy.context.camera.sensor_width = 22 bpy.context.camera.sensor_height = 16 -bpy.context.camera.sensor_fit = 'HORIZONTAL'
\ No newline at end of file +bpy.context.camera.sensor_fit = 'HORIZONTAL' diff --git a/release/scripts/presets/camera/Analog_65mm.py b/release/scripts/presets/camera/Analog_65mm.py index 8de91ac0ee3..d6eb9c32283 100644 --- a/release/scripts/presets/camera/Analog_65mm.py +++ b/release/scripts/presets/camera/Analog_65mm.py @@ -1,4 +1,4 @@ import bpy bpy.context.camera.sensor_width = 52.45 bpy.context.camera.sensor_height = 23.01 -bpy.context.camera.sensor_fit = 'HORIZONTAL'
\ No newline at end of file +bpy.context.camera.sensor_fit = 'HORIZONTAL' diff --git a/release/scripts/presets/camera/Analog_IMAX.py b/release/scripts/presets/camera/Analog_IMAX.py index 5a445f3de8c..b71b910dee0 100644 --- a/release/scripts/presets/camera/Analog_IMAX.py +++ b/release/scripts/presets/camera/Analog_IMAX.py @@ -1,4 +1,4 @@ import bpy bpy.context.camera.sensor_width = 71.41 bpy.context.camera.sensor_height = 52.63 -bpy.context.camera.sensor_fit = 'HORIZONTAL'
\ No newline at end of file +bpy.context.camera.sensor_fit = 'HORIZONTAL' diff --git a/release/scripts/presets/camera/Analog_Super_16.py b/release/scripts/presets/camera/Analog_Super_16.py index a340a31dc25..f76238c69d3 100644 --- a/release/scripts/presets/camera/Analog_Super_16.py +++ b/release/scripts/presets/camera/Analog_Super_16.py @@ -1,4 +1,4 @@ import bpy bpy.context.camera.sensor_width = 12.35 bpy.context.camera.sensor_height = 7.42 -bpy.context.camera.sensor_fit = 'HORIZONTAL'
\ No newline at end of file +bpy.context.camera.sensor_fit = 'HORIZONTAL' diff --git a/release/scripts/presets/camera/Analog_Super_35.py b/release/scripts/presets/camera/Analog_Super_35.py index 3c8f1837253..b22ff545c68 100644 --- a/release/scripts/presets/camera/Analog_Super_35.py +++ b/release/scripts/presets/camera/Analog_Super_35.py @@ -1,4 +1,4 @@ import bpy bpy.context.camera.sensor_width = 24.89 bpy.context.camera.sensor_height = 18.66 -bpy.context.camera.sensor_fit = 'HORIZONTAL'
\ No newline at end of file +bpy.context.camera.sensor_fit = 'HORIZONTAL' diff --git a/release/scripts/presets/camera/Arri_Alexa_65.py b/release/scripts/presets/camera/Arri_Alexa_65.py index b1467709949..24d03e022ae 100644 --- a/release/scripts/presets/camera/Arri_Alexa_65.py +++ b/release/scripts/presets/camera/Arri_Alexa_65.py @@ -1,4 +1,4 @@ import bpy bpy.context.camera.sensor_width = 54.12 bpy.context.camera.sensor_height = 25.58 -bpy.context.camera.sensor_fit = 'HORIZONTAL'
\ No newline at end of file +bpy.context.camera.sensor_fit = 'HORIZONTAL' diff --git a/release/scripts/presets/camera/Arri_Alexa_LF.py b/release/scripts/presets/camera/Arri_Alexa_LF.py index 1cde94fce8d..430fdc996a6 100644 --- a/release/scripts/presets/camera/Arri_Alexa_LF.py +++ b/release/scripts/presets/camera/Arri_Alexa_LF.py @@ -1,4 +1,4 @@ import bpy bpy.context.camera.sensor_width = 36.70 bpy.context.camera.sensor_height = 25.54 -bpy.context.camera.sensor_fit = 'HORIZONTAL'
\ No newline at end of file +bpy.context.camera.sensor_fit = 'HORIZONTAL' diff --git a/release/scripts/presets/camera/Arri_Alexa_Mini_&_SXT.py b/release/scripts/presets/camera/Arri_Alexa_Mini_&_SXT.py index 0f61d35a0f9..90998bc0da0 100644 --- a/release/scripts/presets/camera/Arri_Alexa_Mini_&_SXT.py +++ b/release/scripts/presets/camera/Arri_Alexa_Mini_&_SXT.py @@ -1,4 +1,4 @@ import bpy bpy.context.camera.sensor_width = 29.90 bpy.context.camera.sensor_height = 15.77 -bpy.context.camera.sensor_fit = 'HORIZONTAL'
\ No newline at end of file +bpy.context.camera.sensor_fit = 'HORIZONTAL' diff --git a/release/scripts/presets/camera/Blackmagic_Pocket_&_Studio.py b/release/scripts/presets/camera/Blackmagic_Pocket_&_Studio.py index 260bfbaf94f..bb2b172919e 100644 --- a/release/scripts/presets/camera/Blackmagic_Pocket_&_Studio.py +++ b/release/scripts/presets/camera/Blackmagic_Pocket_&_Studio.py @@ -1,4 +1,4 @@ import bpy bpy.context.camera.sensor_width = 12.48 bpy.context.camera.sensor_height = 7.02 -bpy.context.camera.sensor_fit = 'HORIZONTAL'
\ No newline at end of file +bpy.context.camera.sensor_fit = 'HORIZONTAL' diff --git a/release/scripts/presets/camera/Blackmagic_Pocket_4K.py b/release/scripts/presets/camera/Blackmagic_Pocket_4K.py index dc057397828..4b735283c8b 100644 --- a/release/scripts/presets/camera/Blackmagic_Pocket_4K.py +++ b/release/scripts/presets/camera/Blackmagic_Pocket_4K.py @@ -1,4 +1,4 @@ import bpy bpy.context.camera.sensor_width = 18.96 bpy.context.camera.sensor_height = 10.00 -bpy.context.camera.sensor_fit = 'HORIZONTAL'
\ No newline at end of file +bpy.context.camera.sensor_fit = 'HORIZONTAL' diff --git a/release/scripts/presets/camera/Blackmagic_Pocket_6k.py b/release/scripts/presets/camera/Blackmagic_Pocket_6k.py index a483f3d5f98..1a882f05786 100644 --- a/release/scripts/presets/camera/Blackmagic_Pocket_6k.py +++ b/release/scripts/presets/camera/Blackmagic_Pocket_6k.py @@ -1,4 +1,4 @@ import bpy bpy.context.camera.sensor_width = 23.10 bpy.context.camera.sensor_height = 12.99 -bpy.context.camera.sensor_fit = 'HORIZONTAL'
\ No newline at end of file +bpy.context.camera.sensor_fit = 'HORIZONTAL' diff --git a/release/scripts/presets/camera/Blackmagic_URSA_4.6K.py b/release/scripts/presets/camera/Blackmagic_URSA_4.6K.py index c71e42d72d3..767d16984d8 100644 --- a/release/scripts/presets/camera/Blackmagic_URSA_4.6K.py +++ b/release/scripts/presets/camera/Blackmagic_URSA_4.6K.py @@ -1,4 +1,4 @@ import bpy bpy.context.camera.sensor_width = 25.34 bpy.context.camera.sensor_height = 14.25 -bpy.context.camera.sensor_fit = 'HORIZONTAL'
\ No newline at end of file +bpy.context.camera.sensor_fit = 'HORIZONTAL' diff --git a/release/scripts/presets/camera/Foveon_(Sigma).py b/release/scripts/presets/camera/Foveon_(Sigma).py index e6a1a0ed344..6b35f29acaf 100644 --- a/release/scripts/presets/camera/Foveon_(Sigma).py +++ b/release/scripts/presets/camera/Foveon_(Sigma).py @@ -1,4 +1,4 @@ import bpy bpy.context.camera.sensor_width = 20.70 bpy.context.camera.sensor_height = 13.80 -bpy.context.camera.sensor_fit = 'HORIZONTAL'
\ No newline at end of file +bpy.context.camera.sensor_fit = 'HORIZONTAL' diff --git a/release/scripts/presets/camera/Fullframe.py b/release/scripts/presets/camera/Fullframe.py index 95fb4afc10b..c8017331b28 100644 --- a/release/scripts/presets/camera/Fullframe.py +++ b/release/scripts/presets/camera/Fullframe.py @@ -1,4 +1,4 @@ import bpy bpy.context.camera.sensor_width = 36 bpy.context.camera.sensor_height = 24 -bpy.context.camera.sensor_fit = 'HORIZONTAL'
\ No newline at end of file +bpy.context.camera.sensor_fit = 'HORIZONTAL' diff --git a/release/scripts/presets/camera/MFT.py b/release/scripts/presets/camera/MFT.py index bc0dd49baa8..7441f1aea76 100644 --- a/release/scripts/presets/camera/MFT.py +++ b/release/scripts/presets/camera/MFT.py @@ -1,4 +1,4 @@ import bpy bpy.context.camera.sensor_width = 17.3 bpy.context.camera.sensor_height = 13.0 -bpy.context.camera.sensor_fit = 'HORIZONTAL'
\ No newline at end of file +bpy.context.camera.sensor_fit = 'HORIZONTAL' diff --git a/release/scripts/presets/camera/Medium-format_(Hasselblad).py b/release/scripts/presets/camera/Medium-format_(Hasselblad).py index e9b16024b79..d03a4f22db7 100644 --- a/release/scripts/presets/camera/Medium-format_(Hasselblad).py +++ b/release/scripts/presets/camera/Medium-format_(Hasselblad).py @@ -1,4 +1,4 @@ import bpy bpy.context.camera.sensor_width = 44 bpy.context.camera.sensor_height = 33 -bpy.context.camera.sensor_fit = 'HORIZONTAL'
\ No newline at end of file +bpy.context.camera.sensor_fit = 'HORIZONTAL' diff --git a/release/scripts/presets/camera/RED_Dragon_5K.py b/release/scripts/presets/camera/RED_Dragon_5K.py index fa95a98f8c4..e8b990d4d00 100644 --- a/release/scripts/presets/camera/RED_Dragon_5K.py +++ b/release/scripts/presets/camera/RED_Dragon_5K.py @@ -1,4 +1,4 @@ import bpy bpy.context.camera.sensor_width = 25.60 bpy.context.camera.sensor_height = 13.5 -bpy.context.camera.sensor_fit = 'HORIZONTAL'
\ No newline at end of file +bpy.context.camera.sensor_fit = 'HORIZONTAL' diff --git a/release/scripts/presets/camera/RED_Dragon_6K.py b/release/scripts/presets/camera/RED_Dragon_6K.py index 80f7ad1bbb8..982e2ab8e00 100644 --- a/release/scripts/presets/camera/RED_Dragon_6K.py +++ b/release/scripts/presets/camera/RED_Dragon_6K.py @@ -1,4 +1,4 @@ import bpy bpy.context.camera.sensor_width = 30.70 bpy.context.camera.sensor_height = 15.80 -bpy.context.camera.sensor_fit = 'HORIZONTAL'
\ No newline at end of file +bpy.context.camera.sensor_fit = 'HORIZONTAL' diff --git a/release/scripts/presets/camera/RED_Helium_8K.py b/release/scripts/presets/camera/RED_Helium_8K.py index 0f61d35a0f9..90998bc0da0 100644 --- a/release/scripts/presets/camera/RED_Helium_8K.py +++ b/release/scripts/presets/camera/RED_Helium_8K.py @@ -1,4 +1,4 @@ import bpy bpy.context.camera.sensor_width = 29.90 bpy.context.camera.sensor_height = 15.77 -bpy.context.camera.sensor_fit = 'HORIZONTAL'
\ No newline at end of file +bpy.context.camera.sensor_fit = 'HORIZONTAL' diff --git a/release/scripts/presets/camera/RED_Monstro_8K.py b/release/scripts/presets/camera/RED_Monstro_8K.py index 86c382624ab..1c8bc11dfaa 100644 --- a/release/scripts/presets/camera/RED_Monstro_8K.py +++ b/release/scripts/presets/camera/RED_Monstro_8K.py @@ -1,4 +1,4 @@ import bpy bpy.context.camera.sensor_width = 40.96 bpy.context.camera.sensor_height = 21.60 -bpy.context.camera.sensor_fit = 'HORIZONTAL'
\ No newline at end of file +bpy.context.camera.sensor_fit = 'HORIZONTAL' diff --git a/release/scripts/presets/keyconfig/Blender.py b/release/scripts/presets/keyconfig/Blender.py index 222ee43432f..eb66c961472 100644 --- a/release/scripts/presets/keyconfig/Blender.py +++ b/release/scripts/presets/keyconfig/Blender.py @@ -103,8 +103,8 @@ class Prefs(bpy.types.KeyConfigPreferences): v3d_tilde_action: EnumProperty( name="Tilde Action", items=( - ('OBJECT_SWITCH', "Object Switch", - "Switch the active object under the cursor (when not in object mode)", + ('VIEW', "Navigate", + "View operations (useful for keyboards without a numpad)", 0), ('GIZMO', "Gizmos", "Control transform gizmos", @@ -113,7 +113,7 @@ class Prefs(bpy.types.KeyConfigPreferences): description=( "Action when 'Tilde' is pressed" ), - default='OBJECT_SWITCH', + default='VIEW', update=update_fn, ) diff --git a/release/scripts/presets/keyconfig/keymap_data/blender_default.py b/release/scripts/presets/keyconfig/keymap_data/blender_default.py index 7f1039a975b..3527e993173 100644 --- a/release/scripts/presets/keyconfig/keymap_data/blender_default.py +++ b/release/scripts/presets/keyconfig/keymap_data/blender_default.py @@ -730,6 +730,8 @@ def km_user_interface(_params): ("anim.keyingset_button_add", {"type": 'K', "value": 'PRESS'}, None), ("anim.keyingset_button_remove", {"type": 'K', "value": 'PRESS', "alt": True}, None), ("ui.reset_default_button", {"type": 'BACK_SPACE', "value": 'PRESS'}, {"properties": [("all", True)]}), + # UI lists (polls check if there's a UI list under the cursor). + ("ui.list_start_filter", {"type": 'F', "value": 'PRESS', "ctrl": True}, None), ]) return keymap @@ -1084,7 +1086,13 @@ def km_view3d(params): {"properties": [("use_all_regions", True), ("center", False)]}), ("view3d.view_all", {"type": 'C', "value": 'PRESS', "shift": True}, {"properties": [("center", True)]}), - op_menu_pie("VIEW3D_MT_view_pie", {"type": 'D', "value": 'CLICK_DRAG'}), + op_menu_pie( + "VIEW3D_MT_view_pie" if params.v3d_tilde_action == 'VIEW' else "VIEW3D_MT_transform_gizmo_pie", + {"type": 'ACCENT_GRAVE', "value": params.pie_value}, + ), + *(() if not params.use_pie_click_drag else + (("view3d.navigate", {"type": 'ACCENT_GRAVE', "value": 'CLICK'}, None),)), + ("view3d.navigate", {"type": 'ACCENT_GRAVE', "value": 'PRESS', "shift": True}, None), ("view3d.navigate", {"type": 'ACCENT_GRAVE', "value": 'PRESS', "shift": True}, None), # Numpad views. ("view3d.view_camera", {"type": 'NUMPAD_0', "value": 'PRESS'}, None), @@ -1328,32 +1336,6 @@ def km_view3d(params): op_tool_cycle("builtin.select_box", {"type": 'W', "value": 'PRESS'}), ]) - # Tilda key. - if params.use_pie_click_drag: - items.extend([ - ("object.transfer_mode", - {"type": 'ACCENT_GRAVE', "value": 'CLICK' if params.use_pie_click_drag else 'PRESS'}, - None), - op_menu_pie( - "VIEW3D_MT_transform_gizmo_pie", - {"type": 'ACCENT_GRAVE', "value": 'CLICK_DRAG'}, - ) - ]) - else: - if params.v3d_tilde_action == 'OBJECT_SWITCH': - items.append( - ("object.transfer_mode", - {"type": 'ACCENT_GRAVE', "value": 'PRESS'}, - {"properties": [("use_eyedropper", False)]}) - ) - else: - items.append( - op_menu_pie( - "VIEW3D_MT_transform_gizmo_pie", - {"type": 'ACCENT_GRAVE', "value": 'PRESS'}, - ) - ) - return keymap @@ -2679,7 +2661,8 @@ def km_sequencer(params): {"properties": [("side", 'LEFT')]}), ("sequencer.select_side_of_frame", {"type": 'RIGHT_BRACKET', "value": 'PRESS'}, {"properties": [("side", 'RIGHT')]}), - + ("wm.context_toggle", {"type": 'TAB', "value": 'PRESS', "shift": True}, + {"properties": [("data_path", 'tool_settings.use_snap_sequencer')]}), *_template_items_context_menu("SEQUENCER_MT_context_menu", params.context_menu_event), ]) @@ -4113,7 +4096,7 @@ def km_pose(params): ("pose.bone_layers", {"type": 'M', "value": 'PRESS'}, None), ("transform.bbone_resize", {"type": 'S', "value": 'PRESS', "ctrl": True, "alt": True}, None), ("anim.keyframe_insert_menu", {"type": 'I', "value": 'PRESS'}, None), - ("anim.keyframe_delete", {"type": 'I', "value": 'PRESS', "alt": True}, None), + ("anim.keyframe_delete_v3d", {"type": 'I', "value": 'PRESS', "alt": True}, None), ("anim.keying_set_active_set", {"type": 'I', "value": 'PRESS', "shift": True, "ctrl": True, "alt": True}, None), ("poselib.browse_interactive", {"type": 'L', "value": 'PRESS', "alt": True}, None), ("poselib.pose_add", {"type": 'L', "value": 'PRESS', "shift": True}, None), @@ -4185,7 +4168,7 @@ def km_object_mode(params): ("wm.context_toggle", {"type": 'PERIOD', "value": 'PRESS', "ctrl": True}, {"properties": [("data_path", 'tool_settings.use_transform_data_origin')]}), ("anim.keyframe_insert_menu", {"type": 'I', "value": 'PRESS'}, None), - ("anim.keyframe_delete", {"type": 'I', "value": 'PRESS', "alt": True}, None), + ("anim.keyframe_delete_v3d", {"type": 'I', "value": 'PRESS', "alt": True}, None), ("anim.keying_set_active_set", {"type": 'I', "value": 'PRESS', "shift": True, "ctrl": True, "alt": True}, None), ("collection.create", {"type": 'G', "value": 'PRESS', "ctrl": True}, None), ("collection.objects_remove", {"type": 'G', "value": 'PRESS', "ctrl": True, "alt": True}, None), @@ -5071,6 +5054,11 @@ def km_object_non_modal(params): ("object.origin_set", {"type": 'C', "value": 'PRESS', "shift": True, "ctrl": True, "alt": True}, None), ]) else: + items.extend([ + # NOTE: this shortcut (while not temporary) is not ideal, see: T89757. + ("object.transfer_mode", {"type": 'Q', "value": 'PRESS', "alt": True}, None), + ]) + if params.use_pie_click_drag: items.extend([ ("object.mode_set", {"type": 'TAB', "value": 'CLICK'}, @@ -5551,6 +5539,7 @@ def km_view3d_walk_modal(_params): ("DECELERATE", {"type": 'NUMPAD_MINUS', "value": 'PRESS', "any": True, "repeat": True}, None), ("ACCELERATE", {"type": 'WHEELUPMOUSE', "value": 'PRESS', "any": True}, None), ("DECELERATE", {"type": 'WHEELDOWNMOUSE', "value": 'PRESS', "any": True}, None), + ("AXIS_LOCK_Z", {"type": 'Z', "value": 'PRESS'}, None), ]) return keymap diff --git a/release/scripts/presets/keyconfig/keymap_data/industry_compatible_data.py b/release/scripts/presets/keyconfig/keymap_data/industry_compatible_data.py index b0144672745..714126903d8 100644 --- a/release/scripts/presets/keyconfig/keymap_data/industry_compatible_data.py +++ b/release/scripts/presets/keyconfig/keymap_data/industry_compatible_data.py @@ -3015,7 +3015,7 @@ def km_pose(params): ("anim.keyframe_insert_by_name", {"type": 'R', "value": 'PRESS', "shift": True}, {"properties": [("type", 'Scaling')]}), - ("anim.keyframe_delete", {"type": 'S', "value": 'PRESS', "alt": True}, None), + ("anim.keyframe_delete_v3d", {"type": 'S', "value": 'PRESS', "alt": True}, None), ("anim.keying_set_active_set", {"type": 'S', "value": 'PRESS', "shift": True, "ctrl": True, "alt": True}, None), *_template_items_context_menu("VIEW3D_MT_pose_context_menu", {"type": 'RIGHTMOUSE', "value": 'PRESS'}), # Tools @@ -3086,7 +3086,7 @@ def km_object_mode(params): {"properties": [("type", 'Rotation')]}), ("anim.keyframe_insert_by_name", {"type": 'R', "value": 'PRESS', "shift": True}, {"properties": [("type", 'Scaling')]}), - ("anim.keyframe_delete", {"type": 'S', "value": 'PRESS', "alt": True}, None), + ("anim.keyframe_delete_v3d", {"type": 'S', "value": 'PRESS', "alt": True}, None), ("anim.keying_set_active_set", {"type": 'S', "value": 'PRESS', "shift": True, "ctrl": True, "alt": True}, None), *_template_items_context_menu("VIEW3D_MT_object_context_menu", {"type": 'RIGHTMOUSE', "value": 'PRESS'}), ("object.move_to_collection", {"type": 'G', "value": 'PRESS', "ctrl": True}, None), diff --git a/release/scripts/presets/tracking_camera/1_inch.py b/release/scripts/presets/tracking_camera/1_inch.py index 72b039fb978..97e87b8c5a7 100644 --- a/release/scripts/presets/tracking_camera/1_inch.py +++ b/release/scripts/presets/tracking_camera/1_inch.py @@ -1,4 +1,4 @@ import bpy bpy.context.camera.sensor_width = 13.2 bpy.context.camera.sensor_height = 8.80 -bpy.context.camera.sensor_fit = 'HORIZONTAL'
\ No newline at end of file +bpy.context.camera.sensor_fit = 'HORIZONTAL' diff --git a/release/scripts/presets/tracking_camera/1_slash_1.8_inch.py b/release/scripts/presets/tracking_camera/1_slash_1.8_inch.py index 38e09182de6..8b0dc3cea1d 100644 --- a/release/scripts/presets/tracking_camera/1_slash_1.8_inch.py +++ b/release/scripts/presets/tracking_camera/1_slash_1.8_inch.py @@ -1,4 +1,4 @@ import bpy bpy.context.camera.sensor_width = 7.18 bpy.context.camera.sensor_height = 5.32 -bpy.context.camera.sensor_fit = 'HORIZONTAL'
\ No newline at end of file +bpy.context.camera.sensor_fit = 'HORIZONTAL' diff --git a/release/scripts/presets/tracking_camera/1_slash_2.3_inch.py b/release/scripts/presets/tracking_camera/1_slash_2.3_inch.py index 4d55738f4ed..bd6808da082 100644 --- a/release/scripts/presets/tracking_camera/1_slash_2.3_inch.py +++ b/release/scripts/presets/tracking_camera/1_slash_2.3_inch.py @@ -1,4 +1,4 @@ import bpy bpy.context.camera.sensor_width = 6.17 bpy.context.camera.sensor_height = 4.55 -bpy.context.camera.sensor_fit = 'HORIZONTAL'
\ No newline at end of file +bpy.context.camera.sensor_fit = 'HORIZONTAL' diff --git a/release/scripts/presets/tracking_camera/1_slash_2.5_inch.py b/release/scripts/presets/tracking_camera/1_slash_2.5_inch.py index cbdb6f3cbe0..90f60e7d7f0 100644 --- a/release/scripts/presets/tracking_camera/1_slash_2.5_inch.py +++ b/release/scripts/presets/tracking_camera/1_slash_2.5_inch.py @@ -1,4 +1,4 @@ import bpy bpy.context.camera.sensor_width = 5.76 bpy.context.camera.sensor_height = 4.29 -bpy.context.camera.sensor_fit = 'HORIZONTAL'
\ No newline at end of file +bpy.context.camera.sensor_fit = 'HORIZONTAL' diff --git a/release/scripts/presets/tracking_camera/1_slash_2.7_inch.py b/release/scripts/presets/tracking_camera/1_slash_2.7_inch.py index 5ccfa4ab555..4a9591803d0 100644 --- a/release/scripts/presets/tracking_camera/1_slash_2.7_inch.py +++ b/release/scripts/presets/tracking_camera/1_slash_2.7_inch.py @@ -1,4 +1,4 @@ import bpy bpy.context.camera.sensor_width = 5.37 bpy.context.camera.sensor_height = 4.04 -bpy.context.camera.sensor_fit = 'HORIZONTAL'
\ No newline at end of file +bpy.context.camera.sensor_fit = 'HORIZONTAL' diff --git a/release/scripts/presets/tracking_camera/1_slash_3.2_inch.py b/release/scripts/presets/tracking_camera/1_slash_3.2_inch.py index 1963f7ec048..5f31b9ec49c 100644 --- a/release/scripts/presets/tracking_camera/1_slash_3.2_inch.py +++ b/release/scripts/presets/tracking_camera/1_slash_3.2_inch.py @@ -1,4 +1,4 @@ import bpy bpy.context.camera.sensor_width = 4.54 bpy.context.camera.sensor_height = 3.42 -bpy.context.camera.sensor_fit = 'HORIZONTAL'
\ No newline at end of file +bpy.context.camera.sensor_fit = 'HORIZONTAL' diff --git a/release/scripts/presets/tracking_camera/2_slash_3_inch.py b/release/scripts/presets/tracking_camera/2_slash_3_inch.py index 25b46016800..eb463a31af7 100644 --- a/release/scripts/presets/tracking_camera/2_slash_3_inch.py +++ b/release/scripts/presets/tracking_camera/2_slash_3_inch.py @@ -1,4 +1,4 @@ import bpy bpy.context.camera.sensor_width = 8.8 bpy.context.camera.sensor_height = 6.6 -bpy.context.camera.sensor_fit = 'HORIZONTAL'
\ No newline at end of file +bpy.context.camera.sensor_fit = 'HORIZONTAL' diff --git a/release/scripts/presets/tracking_camera/APS-C.py b/release/scripts/presets/tracking_camera/APS-C.py index 84e40825248..4031e8bae71 100644 --- a/release/scripts/presets/tracking_camera/APS-C.py +++ b/release/scripts/presets/tracking_camera/APS-C.py @@ -1,4 +1,4 @@ import bpy bpy.context.camera.sensor_width = 23.6 bpy.context.camera.sensor_height = 15.6 -bpy.context.camera.sensor_fit = 'HORIZONTAL'
\ No newline at end of file +bpy.context.camera.sensor_fit = 'HORIZONTAL' diff --git a/release/scripts/presets/tracking_camera/APS-C_(Canon).py b/release/scripts/presets/tracking_camera/APS-C_(Canon).py index 55f20ce0eac..484929a54e7 100644 --- a/release/scripts/presets/tracking_camera/APS-C_(Canon).py +++ b/release/scripts/presets/tracking_camera/APS-C_(Canon).py @@ -1,4 +1,4 @@ import bpy bpy.context.camera.sensor_width = 22.30 bpy.context.camera.sensor_height = 14.90 -bpy.context.camera.sensor_fit = 'HORIZONTAL'
\ No newline at end of file +bpy.context.camera.sensor_fit = 'HORIZONTAL' diff --git a/release/scripts/presets/tracking_camera/APS-H_(Canon).py b/release/scripts/presets/tracking_camera/APS-H_(Canon).py index d63f733280b..d3b61d1aa46 100644 --- a/release/scripts/presets/tracking_camera/APS-H_(Canon).py +++ b/release/scripts/presets/tracking_camera/APS-H_(Canon).py @@ -1,4 +1,4 @@ import bpy bpy.context.camera.sensor_width = 27.90 bpy.context.camera.sensor_height = 18.60 -bpy.context.camera.sensor_fit = 'HORIZONTAL'
\ No newline at end of file +bpy.context.camera.sensor_fit = 'HORIZONTAL' diff --git a/release/scripts/presets/tracking_camera/Analog_16mm.py b/release/scripts/presets/tracking_camera/Analog_16mm.py index aa98eaf2408..a290839c8e0 100644 --- a/release/scripts/presets/tracking_camera/Analog_16mm.py +++ b/release/scripts/presets/tracking_camera/Analog_16mm.py @@ -1,4 +1,4 @@ import bpy bpy.context.camera.sensor_width = 10.26 bpy.context.camera.sensor_height = 7.49 -bpy.context.camera.sensor_fit = 'HORIZONTAL'
\ No newline at end of file +bpy.context.camera.sensor_fit = 'HORIZONTAL' diff --git a/release/scripts/presets/tracking_camera/Analog_35mm.py b/release/scripts/presets/tracking_camera/Analog_35mm.py index a0dee1f0166..fe3338dd292 100644 --- a/release/scripts/presets/tracking_camera/Analog_35mm.py +++ b/release/scripts/presets/tracking_camera/Analog_35mm.py @@ -1,4 +1,4 @@ import bpy bpy.context.camera.sensor_width = 22 bpy.context.camera.sensor_height = 16 -bpy.context.camera.sensor_fit = 'HORIZONTAL'
\ No newline at end of file +bpy.context.camera.sensor_fit = 'HORIZONTAL' diff --git a/release/scripts/presets/tracking_camera/Analog_65mm.py b/release/scripts/presets/tracking_camera/Analog_65mm.py index 8de91ac0ee3..d6eb9c32283 100644 --- a/release/scripts/presets/tracking_camera/Analog_65mm.py +++ b/release/scripts/presets/tracking_camera/Analog_65mm.py @@ -1,4 +1,4 @@ import bpy bpy.context.camera.sensor_width = 52.45 bpy.context.camera.sensor_height = 23.01 -bpy.context.camera.sensor_fit = 'HORIZONTAL'
\ No newline at end of file +bpy.context.camera.sensor_fit = 'HORIZONTAL' diff --git a/release/scripts/presets/tracking_camera/Analog_IMAX.py b/release/scripts/presets/tracking_camera/Analog_IMAX.py index 5a445f3de8c..b71b910dee0 100644 --- a/release/scripts/presets/tracking_camera/Analog_IMAX.py +++ b/release/scripts/presets/tracking_camera/Analog_IMAX.py @@ -1,4 +1,4 @@ import bpy bpy.context.camera.sensor_width = 71.41 bpy.context.camera.sensor_height = 52.63 -bpy.context.camera.sensor_fit = 'HORIZONTAL'
\ No newline at end of file +bpy.context.camera.sensor_fit = 'HORIZONTAL' diff --git a/release/scripts/presets/tracking_camera/Analog_Super_16.py b/release/scripts/presets/tracking_camera/Analog_Super_16.py index a340a31dc25..f76238c69d3 100644 --- a/release/scripts/presets/tracking_camera/Analog_Super_16.py +++ b/release/scripts/presets/tracking_camera/Analog_Super_16.py @@ -1,4 +1,4 @@ import bpy bpy.context.camera.sensor_width = 12.35 bpy.context.camera.sensor_height = 7.42 -bpy.context.camera.sensor_fit = 'HORIZONTAL'
\ No newline at end of file +bpy.context.camera.sensor_fit = 'HORIZONTAL' diff --git a/release/scripts/presets/tracking_camera/Analog_Super_35.py b/release/scripts/presets/tracking_camera/Analog_Super_35.py index 3c8f1837253..b22ff545c68 100644 --- a/release/scripts/presets/tracking_camera/Analog_Super_35.py +++ b/release/scripts/presets/tracking_camera/Analog_Super_35.py @@ -1,4 +1,4 @@ import bpy bpy.context.camera.sensor_width = 24.89 bpy.context.camera.sensor_height = 18.66 -bpy.context.camera.sensor_fit = 'HORIZONTAL'
\ No newline at end of file +bpy.context.camera.sensor_fit = 'HORIZONTAL' diff --git a/release/scripts/presets/tracking_camera/Arri_Alexa_65.py b/release/scripts/presets/tracking_camera/Arri_Alexa_65.py index b1467709949..24d03e022ae 100644 --- a/release/scripts/presets/tracking_camera/Arri_Alexa_65.py +++ b/release/scripts/presets/tracking_camera/Arri_Alexa_65.py @@ -1,4 +1,4 @@ import bpy bpy.context.camera.sensor_width = 54.12 bpy.context.camera.sensor_height = 25.58 -bpy.context.camera.sensor_fit = 'HORIZONTAL'
\ No newline at end of file +bpy.context.camera.sensor_fit = 'HORIZONTAL' diff --git a/release/scripts/presets/tracking_camera/Arri_Alexa_LF.py b/release/scripts/presets/tracking_camera/Arri_Alexa_LF.py index 1cde94fce8d..430fdc996a6 100644 --- a/release/scripts/presets/tracking_camera/Arri_Alexa_LF.py +++ b/release/scripts/presets/tracking_camera/Arri_Alexa_LF.py @@ -1,4 +1,4 @@ import bpy bpy.context.camera.sensor_width = 36.70 bpy.context.camera.sensor_height = 25.54 -bpy.context.camera.sensor_fit = 'HORIZONTAL'
\ No newline at end of file +bpy.context.camera.sensor_fit = 'HORIZONTAL' diff --git a/release/scripts/presets/tracking_camera/Arri_Alexa_Mini_&_SXT.py b/release/scripts/presets/tracking_camera/Arri_Alexa_Mini_&_SXT.py index 0f61d35a0f9..90998bc0da0 100644 --- a/release/scripts/presets/tracking_camera/Arri_Alexa_Mini_&_SXT.py +++ b/release/scripts/presets/tracking_camera/Arri_Alexa_Mini_&_SXT.py @@ -1,4 +1,4 @@ import bpy bpy.context.camera.sensor_width = 29.90 bpy.context.camera.sensor_height = 15.77 -bpy.context.camera.sensor_fit = 'HORIZONTAL'
\ No newline at end of file +bpy.context.camera.sensor_fit = 'HORIZONTAL' diff --git a/release/scripts/presets/tracking_camera/Blackmagic_Pocket_&_Studio.py b/release/scripts/presets/tracking_camera/Blackmagic_Pocket_&_Studio.py index 260bfbaf94f..bb2b172919e 100644 --- a/release/scripts/presets/tracking_camera/Blackmagic_Pocket_&_Studio.py +++ b/release/scripts/presets/tracking_camera/Blackmagic_Pocket_&_Studio.py @@ -1,4 +1,4 @@ import bpy bpy.context.camera.sensor_width = 12.48 bpy.context.camera.sensor_height = 7.02 -bpy.context.camera.sensor_fit = 'HORIZONTAL'
\ No newline at end of file +bpy.context.camera.sensor_fit = 'HORIZONTAL' diff --git a/release/scripts/presets/tracking_camera/Blackmagic_Pocket_4K.py b/release/scripts/presets/tracking_camera/Blackmagic_Pocket_4K.py index dc057397828..4b735283c8b 100644 --- a/release/scripts/presets/tracking_camera/Blackmagic_Pocket_4K.py +++ b/release/scripts/presets/tracking_camera/Blackmagic_Pocket_4K.py @@ -1,4 +1,4 @@ import bpy bpy.context.camera.sensor_width = 18.96 bpy.context.camera.sensor_height = 10.00 -bpy.context.camera.sensor_fit = 'HORIZONTAL'
\ No newline at end of file +bpy.context.camera.sensor_fit = 'HORIZONTAL' diff --git a/release/scripts/presets/tracking_camera/Blackmagic_Pocket_6k.py b/release/scripts/presets/tracking_camera/Blackmagic_Pocket_6k.py index a483f3d5f98..1a882f05786 100644 --- a/release/scripts/presets/tracking_camera/Blackmagic_Pocket_6k.py +++ b/release/scripts/presets/tracking_camera/Blackmagic_Pocket_6k.py @@ -1,4 +1,4 @@ import bpy bpy.context.camera.sensor_width = 23.10 bpy.context.camera.sensor_height = 12.99 -bpy.context.camera.sensor_fit = 'HORIZONTAL'
\ No newline at end of file +bpy.context.camera.sensor_fit = 'HORIZONTAL' diff --git a/release/scripts/presets/tracking_camera/Blackmagic_URSA_4.6K.py b/release/scripts/presets/tracking_camera/Blackmagic_URSA_4.6K.py index c71e42d72d3..767d16984d8 100644 --- a/release/scripts/presets/tracking_camera/Blackmagic_URSA_4.6K.py +++ b/release/scripts/presets/tracking_camera/Blackmagic_URSA_4.6K.py @@ -1,4 +1,4 @@ import bpy bpy.context.camera.sensor_width = 25.34 bpy.context.camera.sensor_height = 14.25 -bpy.context.camera.sensor_fit = 'HORIZONTAL'
\ No newline at end of file +bpy.context.camera.sensor_fit = 'HORIZONTAL' diff --git a/release/scripts/presets/tracking_camera/Foveon_(Sigma).py b/release/scripts/presets/tracking_camera/Foveon_(Sigma).py index e6a1a0ed344..6b35f29acaf 100644 --- a/release/scripts/presets/tracking_camera/Foveon_(Sigma).py +++ b/release/scripts/presets/tracking_camera/Foveon_(Sigma).py @@ -1,4 +1,4 @@ import bpy bpy.context.camera.sensor_width = 20.70 bpy.context.camera.sensor_height = 13.80 -bpy.context.camera.sensor_fit = 'HORIZONTAL'
\ No newline at end of file +bpy.context.camera.sensor_fit = 'HORIZONTAL' diff --git a/release/scripts/presets/tracking_camera/Fullframe.py b/release/scripts/presets/tracking_camera/Fullframe.py index 95fb4afc10b..c8017331b28 100644 --- a/release/scripts/presets/tracking_camera/Fullframe.py +++ b/release/scripts/presets/tracking_camera/Fullframe.py @@ -1,4 +1,4 @@ import bpy bpy.context.camera.sensor_width = 36 bpy.context.camera.sensor_height = 24 -bpy.context.camera.sensor_fit = 'HORIZONTAL'
\ No newline at end of file +bpy.context.camera.sensor_fit = 'HORIZONTAL' diff --git a/release/scripts/presets/tracking_camera/MFT.py b/release/scripts/presets/tracking_camera/MFT.py index bc0dd49baa8..7441f1aea76 100644 --- a/release/scripts/presets/tracking_camera/MFT.py +++ b/release/scripts/presets/tracking_camera/MFT.py @@ -1,4 +1,4 @@ import bpy bpy.context.camera.sensor_width = 17.3 bpy.context.camera.sensor_height = 13.0 -bpy.context.camera.sensor_fit = 'HORIZONTAL'
\ No newline at end of file +bpy.context.camera.sensor_fit = 'HORIZONTAL' diff --git a/release/scripts/presets/tracking_camera/Medium-format_(Hasselblad).py b/release/scripts/presets/tracking_camera/Medium-format_(Hasselblad).py index e9b16024b79..d03a4f22db7 100644 --- a/release/scripts/presets/tracking_camera/Medium-format_(Hasselblad).py +++ b/release/scripts/presets/tracking_camera/Medium-format_(Hasselblad).py @@ -1,4 +1,4 @@ import bpy bpy.context.camera.sensor_width = 44 bpy.context.camera.sensor_height = 33 -bpy.context.camera.sensor_fit = 'HORIZONTAL'
\ No newline at end of file +bpy.context.camera.sensor_fit = 'HORIZONTAL' diff --git a/release/scripts/presets/tracking_camera/RED_Dragon_5K.py b/release/scripts/presets/tracking_camera/RED_Dragon_5K.py index fa95a98f8c4..e8b990d4d00 100644 --- a/release/scripts/presets/tracking_camera/RED_Dragon_5K.py +++ b/release/scripts/presets/tracking_camera/RED_Dragon_5K.py @@ -1,4 +1,4 @@ import bpy bpy.context.camera.sensor_width = 25.60 bpy.context.camera.sensor_height = 13.5 -bpy.context.camera.sensor_fit = 'HORIZONTAL'
\ No newline at end of file +bpy.context.camera.sensor_fit = 'HORIZONTAL' diff --git a/release/scripts/presets/tracking_camera/RED_Dragon_6K.py b/release/scripts/presets/tracking_camera/RED_Dragon_6K.py index 80f7ad1bbb8..982e2ab8e00 100644 --- a/release/scripts/presets/tracking_camera/RED_Dragon_6K.py +++ b/release/scripts/presets/tracking_camera/RED_Dragon_6K.py @@ -1,4 +1,4 @@ import bpy bpy.context.camera.sensor_width = 30.70 bpy.context.camera.sensor_height = 15.80 -bpy.context.camera.sensor_fit = 'HORIZONTAL'
\ No newline at end of file +bpy.context.camera.sensor_fit = 'HORIZONTAL' diff --git a/release/scripts/presets/tracking_camera/RED_Helium_8K.py b/release/scripts/presets/tracking_camera/RED_Helium_8K.py index 0f61d35a0f9..90998bc0da0 100644 --- a/release/scripts/presets/tracking_camera/RED_Helium_8K.py +++ b/release/scripts/presets/tracking_camera/RED_Helium_8K.py @@ -1,4 +1,4 @@ import bpy bpy.context.camera.sensor_width = 29.90 bpy.context.camera.sensor_height = 15.77 -bpy.context.camera.sensor_fit = 'HORIZONTAL'
\ No newline at end of file +bpy.context.camera.sensor_fit = 'HORIZONTAL' diff --git a/release/scripts/presets/tracking_camera/RED_Monstro_8K.py b/release/scripts/presets/tracking_camera/RED_Monstro_8K.py index 86c382624ab..1c8bc11dfaa 100644 --- a/release/scripts/presets/tracking_camera/RED_Monstro_8K.py +++ b/release/scripts/presets/tracking_camera/RED_Monstro_8K.py @@ -1,4 +1,4 @@ import bpy bpy.context.camera.sensor_width = 40.96 bpy.context.camera.sensor_height = 21.60 -bpy.context.camera.sensor_fit = 'HORIZONTAL'
\ No newline at end of file +bpy.context.camera.sensor_fit = 'HORIZONTAL' diff --git a/release/scripts/startup/bl_operators/assets.py b/release/scripts/startup/bl_operators/assets.py index 48f07a03773..d2655784afd 100644 --- a/release/scripts/startup/bl_operators/assets.py +++ b/release/scripts/startup/bl_operators/assets.py @@ -18,7 +18,9 @@ # <pep8 compliant> from __future__ import annotations +from pathlib import Path +import bpy from bpy.types import Operator from bpy_extras.asset_utils import ( @@ -72,7 +74,88 @@ class ASSET_OT_tag_remove(Operator): return {'FINISHED'} +class ASSET_OT_open_containing_blend_file(Operator): + """Open the blend file that contains the active asset""" + + bl_idname = "asset.open_containing_blend_file" + bl_label = "Open Blend File" + bl_options = {'REGISTER'} + + _process = None # Optional[subprocess.Popen] + + @classmethod + def poll(cls, context): + asset_file_handle = getattr(context, 'asset_file_handle', None) + asset_library = getattr(context, 'asset_library', None) + + if not asset_library: + cls.poll_message_set("No asset library selected") + return False + if not asset_file_handle: + cls.poll_message_set("No asset selected") + return False + if asset_file_handle.local_id: + cls.poll_message_set("Selected asset is contained in the current file") + return False + return True + + def execute(self, context): + asset_file_handle = context.asset_file_handle + asset_library = context.asset_library + + if asset_file_handle.local_id: + self.report({'WARNING'}, "This asset is stored in the current blend file") + return {'CANCELLED'} + + asset_lib_path = bpy.types.AssetHandle.get_full_library_path(asset_file_handle, asset_library) + self.open_in_new_blender(asset_lib_path) + + wm = context.window_manager + self._timer = wm.event_timer_add(0.1, window=context.window) + wm.modal_handler_add(self) + + return {'RUNNING_MODAL'} + + def modal(self, context, event): + if event.type != 'TIMER': + return {'PASS_THROUGH'} + + if self._process is None: + self.report({'ERROR'}, "Unable to find any running process") + self.cancel(context) + return {'CANCELLED'} + + returncode = self._process.poll() + if returncode is None: + # Process is still running. + return {'RUNNING_MODAL'} + + if returncode: + self.report({'WARNING'}, "Blender subprocess exited with error code %d" % returncode) + + # TODO(Sybren): Replace this with a generic "reload assets" operator + # that can run outside of the Asset Browser context. + if bpy.ops.file.refresh.poll(): + bpy.ops.file.refresh() + if bpy.ops.asset.list_refresh.poll(): + bpy.ops.asset.list_refresh() + + self.cancel(context) + return {'FINISHED'} + + def cancel(self, context): + wm = context.window_manager + wm.event_timer_remove(self._timer) + + def open_in_new_blender(self, filepath): + import subprocess + + cli_args = [bpy.app.binary_path, str(filepath)] + self._process = subprocess.Popen(cli_args) + + classes = ( ASSET_OT_tag_add, ASSET_OT_tag_remove, + ASSET_OT_open_containing_blend_file, ) diff --git a/release/scripts/startup/bl_operators/node.py b/release/scripts/startup/bl_operators/node.py index 3cefaf6929b..2959232fa51 100644 --- a/release/scripts/startup/bl_operators/node.py +++ b/release/scripts/startup/bl_operators/node.py @@ -306,67 +306,6 @@ class NODE_OT_tree_path_parent(Operator): return {'FINISHED'} -class NODE_OT_active_preview_toggle(Operator): - '''Toggle active preview state of node''' - bl_idname = "node.active_preview_toggle" - bl_label = "Toggle Active Preview" - bl_options = {'REGISTER', 'UNDO'} - - @classmethod - def poll(cls, context): - space = context.space_data - if space is None: - return False - if space.type != 'NODE_EDITOR': - return False - if space.edit_tree is None: - return False - if space.edit_tree.nodes.active is None: - return False - return True - - def execute(self, context): - node_editor = context.space_data - ntree = node_editor.edit_tree - active_node = ntree.nodes.active - - if active_node.active_preview: - self._disable_preview(context, active_node) - else: - self._enable_preview(context, node_editor, ntree, active_node) - - return {'FINISHED'} - - @classmethod - def _enable_preview(cls, context, node_editor, ntree, active_node): - spreadsheets = cls._find_unpinned_spreadsheets(context) - - for spreadsheet in spreadsheets: - spreadsheet.set_geometry_node_context(node_editor, active_node) - - for node in ntree.nodes: - node.active_preview = False - active_node.active_preview = True - - @classmethod - def _disable_preview(cls, context, active_node): - spreadsheets = cls._find_unpinned_spreadsheets(context) - for spreadsheet in spreadsheets: - spreadsheet.context_path.clear() - - active_node.active_preview = False - - @staticmethod - def _find_unpinned_spreadsheets(context): - spreadsheets = [] - for window in context.window_manager.windows: - for area in window.screen.areas: - space = area.spaces.active - if space.type == 'SPREADSHEET' and not space.is_pinned: - spreadsheets.append(space) - return spreadsheets - - classes = ( NodeSetting, @@ -375,5 +314,4 @@ classes = ( NODE_OT_add_search, NODE_OT_collapse_hide_unused_toggle, NODE_OT_tree_path_parent, - NODE_OT_active_preview_toggle, ) diff --git a/release/scripts/startup/bl_operators/sequencer.py b/release/scripts/startup/bl_operators/sequencer.py index 48a02a4c5c6..8f678896e61 100644 --- a/release/scripts/startup/bl_operators/sequencer.py +++ b/release/scripts/startup/bl_operators/sequencer.py @@ -108,14 +108,13 @@ class SequencerSplitMulticam(Operator): if s.multicam_source == camera or camera >= s.channel: return {'FINISHED'} - if not s.select: - s.select = True - cfra = context.scene.frame_current - bpy.ops.sequencer.split(frame=cfra, type='SOFT', side='RIGHT') - for s in context.scene.sequence_editor.sequences_all: - if s.select and s.type == 'MULTICAM' and s.frame_final_start <= cfra and cfra < s.frame_final_end: - context.scene.sequence_editor.active_strip = s + right_strip = s.split(frame=cfra, split_method='SOFT') + + if right_strip: + s.select = False + right_strip.select = True + context.scene.sequence_editor.active_strip = right_strip context.scene.sequence_editor.active_strip.multicam_source = camera return {'FINISHED'} diff --git a/release/scripts/startup/bl_operators/spreadsheet.py b/release/scripts/startup/bl_operators/spreadsheet.py index 5cc83d4eddd..b5098d63dac 100644 --- a/release/scripts/startup/bl_operators/spreadsheet.py +++ b/release/scripts/startup/bl_operators/spreadsheet.py @@ -20,6 +20,7 @@ from __future__ import annotations from bpy.types import Operator + class SPREADSHEET_OT_toggle_pin(Operator): '''Turn on or off pinning''' bl_idname = "spreadsheet.toggle_pin" @@ -47,18 +48,7 @@ class SPREADSHEET_OT_toggle_pin(Operator): def unpin(self, context): space = context.space_data space.is_pinned = False - - space.context_path.clear() - - # Try to find a node with an active preview in any open editor. - if space.object_eval_state == 'EVALUATED': - node_editors = self.find_geometry_node_editors(context) - for node_editor in node_editors: - ntree = node_editor.edit_tree - for node in ntree.nodes: - if node.active_preview: - space.set_geometry_node_context(node_editor, node) - return + space.context_path.guess() def find_geometry_node_editors(self, context): editors = [] diff --git a/release/scripts/startup/bl_operators/wm.py b/release/scripts/startup/bl_operators/wm.py index 2cc7b828c11..6a3830ad1e4 100644 --- a/release/scripts/startup/bl_operators/wm.py +++ b/release/scripts/startup/bl_operators/wm.py @@ -135,7 +135,7 @@ def context_path_decompose(data_path): if base_path: assert(base_path.startswith(".")) - base_path= base_path[1:] + base_path = base_path[1:] if prop_attr: assert(prop_attr.startswith(".")) prop_attr = prop_attr[1:] diff --git a/release/scripts/startup/bl_ui/__init__.py b/release/scripts/startup/bl_ui/__init__.py index ef705f8fe37..25484e905c3 100644 --- a/release/scripts/startup/bl_ui/__init__.py +++ b/release/scripts/startup/bl_ui/__init__.py @@ -117,13 +117,15 @@ def register(): for cls in mod.classes: register_class(cls) - # space_userprefs.py from bpy.props import ( EnumProperty, StringProperty, ) - from bpy.types import WindowManager + from bpy.types import ( + WindowManager, + ) + # space_userprefs.py def addon_filter_items(_self, _context): import addon_utils @@ -234,3 +236,21 @@ class UI_UL_list(bpy.types.UIList): bpy.utils.register_class(UI_UL_list) + + +class UI_MT_list_item_context_menu(bpy.types.Menu): + """ + UI List item context menu definition. Scripts can append/prepend this to + add own operators to the context menu. They must check context though, so + their items only draw in a valid context and for the correct UI list. + """ + + bl_label = "List Item" + bl_idname = "UI_MT_list_item_context_menu" + + def draw(self, context): + # Dummy function. This type is just for scripts to append their own + # context menu items. + pass + +bpy.utils.register_class(UI_MT_list_item_context_menu) diff --git a/release/scripts/startup/bl_ui/properties_collection.py b/release/scripts/startup/bl_ui/properties_collection.py index 27de80bb88d..b51d7157c06 100644 --- a/release/scripts/startup/bl_ui/properties_collection.py +++ b/release/scripts/startup/bl_ui/properties_collection.py @@ -35,7 +35,7 @@ def lineart_make_line_type_entry(col, line_type, text_disp, expand, search_from) if line_type.use and expand: col.prop_search(line_type, "layer", search_from, "layers", icon='GREASEPENCIL') - col.prop_search(line_type, "material", search_from, + col.prop_search(line_type, "material", search_from, "materials", icon='SHADING_TEXTURE') @@ -90,7 +90,7 @@ class COLLECTION_PT_lineart_collection(CollectionButtonsPanel, Panel): row = layout.row(align=True, heading="Masks") row.active = collection.lineart_use_intersection_mask - for i in range(0,8): + for i in range(8): row.prop(collection, "lineart_intersection_mask", index=i, text=str(i), toggle=True) diff --git a/release/scripts/startup/bl_ui/properties_constraint.py b/release/scripts/startup/bl_ui/properties_constraint.py index a88def34767..2a0cf56534c 100644 --- a/release/scripts/startup/bl_ui/properties_constraint.py +++ b/release/scripts/startup/bl_ui/properties_constraint.py @@ -505,6 +505,7 @@ class ConstraintButtonsPanel: self.target_template(layout, con) + layout.prop(con, "remove_target_shear") layout.prop(con, "mix_mode", text="Mix") self.space_template(layout, con) diff --git a/release/scripts/startup/bl_ui/properties_data_gpencil.py b/release/scripts/startup/bl_ui/properties_data_gpencil.py index e71ea2f31a4..b273eee4e19 100644 --- a/release/scripts/startup/bl_ui/properties_data_gpencil.py +++ b/release/scripts/startup/bl_ui/properties_data_gpencil.py @@ -93,8 +93,8 @@ class GPENCIL_MT_layer_context_menu(Menu): gpd = ob.data gpl = gpd.layers.active - layout.operator("gpencil.layer_duplicate", text="Duplicate", icon='DUPLICATE').mode='ALL' - layout.operator("gpencil.layer_duplicate", text="Duplicate Empty Keyframes").mode='EMPTY' + layout.operator("gpencil.layer_duplicate", text="Duplicate", icon='DUPLICATE').mode = 'ALL' + layout.operator("gpencil.layer_duplicate", text="Duplicate Empty Keyframes").mode = 'EMPTY' layout.separator() @@ -113,8 +113,8 @@ class GPENCIL_MT_layer_context_menu(Menu): layout.operator("gpencil.layer_merge", icon='SORT_ASC', text="Merge Down") layout.separator() - layout.operator("gpencil.layer_duplicate_object", text="Copy Layer to Selected").only_active=True - layout.operator("gpencil.layer_duplicate_object", text="Copy All Layers to Selected").only_active=False + layout.operator("gpencil.layer_duplicate_object", text="Copy Layer to Selected").only_active = True + layout.operator("gpencil.layer_duplicate_object", text="Copy All Layers to Selected").only_active = False class DATA_PT_gpencil_layers(DataButtonsPanel, Panel): diff --git a/release/scripts/startup/bl_ui/properties_data_mesh.py b/release/scripts/startup/bl_ui/properties_data_mesh.py index fb8aedd1f49..d9ad094ac4f 100644 --- a/release/scripts/startup/bl_ui/properties_data_mesh.py +++ b/release/scripts/startup/bl_ui/properties_data_mesh.py @@ -41,7 +41,6 @@ class MESH_MT_vertex_group_context_menu(Menu): ).sort_type = 'BONE_HIERARCHY' layout.separator() layout.operator("object.vertex_group_copy", icon='DUPLICATE') - layout.operator("object.vertex_group_copy_to_linked") layout.operator("object.vertex_group_copy_to_selected") layout.separator() layout.operator("object.vertex_group_mirror", icon='ARROW_LEFTRIGHT').use_topology = False @@ -647,7 +646,7 @@ class DATA_PT_mesh_attributes(MeshButtonsPanel, Panel): if len(colliding_names) == 0: return - layout.label(text="Name Collisions: {}".format(", ".join(colliding_names)), icon='INFO') + layout.label(text="Name collisions: {}".format(", ".join(colliding_names)), icon='ERROR') classes = ( 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 0da0716e850..de743033036 100644 --- a/release/scripts/startup/bl_ui/properties_grease_pencil_common.py +++ b/release/scripts/startup/bl_ui/properties_grease_pencil_common.py @@ -847,6 +847,7 @@ class GreasePencilLayerRelationsPanel: col.enabled = bool(gpl.viewlayer_render) col.prop(gpl, "use_viewlayer_masks") + class GreasePencilLayerDisplayPanel: def draw(self, context): diff --git a/release/scripts/startup/bl_ui/space_clip.py b/release/scripts/startup/bl_ui/space_clip.py index 96920af1c7e..afbc3abf302 100644 --- a/release/scripts/startup/bl_ui/space_clip.py +++ b/release/scripts/startup/bl_ui/space_clip.py @@ -72,8 +72,9 @@ class CLIP_PT_marker_display(Panel): col.prop(view, "show_marker_pattern", text="Pattern") col.prop(view, "show_marker_search", text="Search") - col.active = view.show_track_path col.prop(view, "show_track_path", text="Path") + col = col.column() + col.active = view.show_track_path col.prop(view, "path_length", text="Length") col = row.column() @@ -113,7 +114,6 @@ class CLIP_PT_clip_display(Panel): row = layout.row() col = row.column() col.prop(sc.clip_user, "use_render_undistorted", text="Render Undistorted") - col.prop(sc, "lock_selection", text="Lock to Selection") col = row.column() col.prop(sc, "show_stable", text="Show Stable") col.prop(sc, "show_grid", text="Grid") @@ -190,7 +190,7 @@ class CLIP_HT_header(Header): row.prop(sc, "pivot_point", text="", icon_only=True) row = layout.row(align=True) icon = 'LOCKED' if sc.lock_selection else 'UNLOCKED' - row.prop(sc, "lock_selection", icon=icon, text="") + row.operator("clip.lock_selection_toggle", icon=icon, text="", depress=sc.lock_selection) row.popover(panel='CLIP_PT_display') elif sc.view == 'GRAPH': @@ -250,7 +250,7 @@ class CLIP_HT_header(Header): row.popover(panel='CLIP_PT_mask_display') row = layout.row(align=True) icon = 'LOCKED' if sc.lock_selection else 'UNLOCKED' - row.prop(sc, "lock_selection", icon=icon, text="") + row.operator("clip.lock_selection_toggle", icon=icon, text="", depress=sc.lock_selection) row.popover(panel='CLIP_PT_display') def draw(self, context): @@ -1477,9 +1477,13 @@ class CLIP_MT_track(Menu): layout.separator() - layout.operator("clip.solve_camera", - text="Solve Camera Motion" if tracking_object.is_camera - else "Solve Object Motion") + layout.operator( + "clip.solve_camera", + text=( + "Solve Camera Motion" if tracking_object.is_camera else + "Solve Object Motion" + ), + ) layout.separator() diff --git a/release/scripts/startup/bl_ui/space_dopesheet.py b/release/scripts/startup/bl_ui/space_dopesheet.py index ffb7b9e5c20..84d1c36c53d 100644 --- a/release/scripts/startup/bl_ui/space_dopesheet.py +++ b/release/scripts/startup/bl_ui/space_dopesheet.py @@ -609,9 +609,9 @@ class DOPESHEET_MT_context_menu(Menu): layout.operator_menu_enum("action.keyframe_type", "type", text="Keyframe Type") if st.mode != 'GPENCIL': - layout.operator_menu_enum("action.handle_type", "type", text="Handle Type") - layout.operator_menu_enum("action.interpolation_type", "type", text="Interpolation Mode") - layout.operator_menu_enum("action.easing_type", "type", text="Easing Mode") + layout.operator_menu_enum("action.handle_type", "type", text="Handle Type") + layout.operator_menu_enum("action.interpolation_type", "type", text="Interpolation Mode") + layout.operator_menu_enum("action.easing_type", "type", text="Easing Mode") layout.separator() @@ -625,8 +625,8 @@ class DOPESHEET_MT_context_menu(Menu): layout.operator("action.delete") if st.mode == 'GPENCIL': - layout.operator("gpencil.interpolate_reverse") - layout.operator("gpencil.frame_clean_duplicate", text="Delete Duplicate Frames") + layout.operator("gpencil.interpolate_reverse") + layout.operator("gpencil.frame_clean_duplicate", text="Delete Duplicate Frames") layout.separator() diff --git a/release/scripts/startup/bl_ui/space_filebrowser.py b/release/scripts/startup/bl_ui/space_filebrowser.py index 1ad88744b16..8ca93d2406c 100644 --- a/release/scripts/startup/bl_ui/space_filebrowser.py +++ b/release/scripts/startup/bl_ui/space_filebrowser.py @@ -552,6 +552,10 @@ class FILEBROWSER_MT_context_menu(Menu): sub.operator_context = 'EXEC_DEFAULT' sub.operator("file.delete", text="Delete") + active_asset = asset_utils.SpaceAssetInfo.get_active_asset(context) + if active_asset: + layout.operator("asset.open_containing_blend_file") + layout.separator() sub = layout.row() @@ -592,15 +596,28 @@ class ASSETBROWSER_PT_metadata(asset_utils.AssetBrowserPanel, Panel): def draw(self, context): layout = self.layout - active_file = context.active_file - active_asset = asset_utils.SpaceAssetInfo.get_active_asset(context) + asset_file_handle = context.asset_file_handle - if not active_file or not active_asset: + if asset_file_handle is None: layout.label(text="No asset selected", icon='INFO') return - # If the active file is an ID, use its name directly so renaming is possible from right here. - layout.prop(context.id if context.id is not None else active_file, "name", text="") + asset_library = context.asset_library + asset_lib_path = bpy.types.AssetHandle.get_full_library_path(asset_file_handle, asset_library) + + if asset_file_handle.local_id: + # 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", text="") + row = layout.row() + row.label(text="Source: Current File") + else: + layout.prop(asset_file_handle, "name", text="") + col = layout.column(align=True) # Just to reduce margin. + col.label(text="Source:") + row = col.row() + row.label(text=asset_lib_path) + + row.operator("asset.open_containing_blend_file", text="", icon='TOOL_SETTINGS') class ASSETBROWSER_PT_metadata_preview(asset_utils.AssetMetaDataPanel, Panel): diff --git a/release/scripts/startup/bl_ui/space_image.py b/release/scripts/startup/bl_ui/space_image.py index 3fafa328289..0fceb864ac2 100644 --- a/release/scripts/startup/bl_ui/space_image.py +++ b/release/scripts/startup/bl_ui/space_image.py @@ -257,8 +257,9 @@ class IMAGE_MT_image_flip(Menu): def draw(self, _context): layout = self.layout - layout.operator("image.flip", text="Horizontally").use_flip_horizontal = True - layout.operator("image.flip", text="Vertically").use_flip_vertical = True + layout.operator("image.flip", text="Horizontally").use_flip_x = True + layout.operator("image.flip", text="Vertically").use_flip_y = True + class IMAGE_MT_image_invert(Menu): bl_label = "Invert" diff --git a/release/scripts/startup/bl_ui/space_node.py b/release/scripts/startup/bl_ui/space_node.py index 1208ca0a64a..fba86676ad4 100644 --- a/release/scripts/startup/bl_ui/space_node.py +++ b/release/scripts/startup/bl_ui/space_node.py @@ -694,6 +694,97 @@ class NODE_UL_interface_sockets(bpy.types.UIList): layout.template_node_socket(color=color) +class NodeTreeInterfacePanel: + def draw_socket_list(self, context, in_out, sockets_propname, active_socket_propname): + layout = self.layout + + snode = context.space_data + tree = snode.edit_tree + sockets = getattr(tree, sockets_propname) + active_socket_index = getattr(tree, active_socket_propname) + active_socket = sockets[active_socket_index] if active_socket_index >= 0 else None + + split = layout.row() + + split.template_list("NODE_UL_interface_sockets", in_out, tree, sockets_propname, tree, active_socket_propname) + + ops_col = split.column() + + add_remove_col = ops_col.column(align=True) + props = add_remove_col.operator("node.tree_socket_add", icon='ADD', text="") + props.in_out = in_out + props = add_remove_col.operator("node.tree_socket_remove", icon='REMOVE', text="") + props.in_out = in_out + + ops_col.separator() + + up_down_col = ops_col.column(align=True) + props = up_down_col.operator("node.tree_socket_move", icon='TRIA_UP', text="") + props.in_out = in_out + props.direction = 'UP' + props = up_down_col.operator("node.tree_socket_move", icon='TRIA_DOWN', text="") + props.in_out = in_out + props.direction = 'DOWN' + + if active_socket is not None: + # Mimicking property split. + layout.use_property_split = False + layout.use_property_decorate = False + layout_row = layout.row(align=True) + layout_split = layout_row.split(factor=0.4, align=True) + + label_column = layout_split.column(align=True) + label_column.alignment = 'RIGHT' + # Menu to change the socket type. + label_column.label(text="Type") + + property_row = layout_split.row(align=True) + props = property_row.operator_menu_enum( + "node.tree_socket_change_type", + "socket_type", + text=active_socket.bl_label if active_socket.bl_label else active_socket.bl_idname + ) + props.in_out = in_out + + layout.use_property_split = True + layout.use_property_decorate = False + + layout.prop(active_socket, "name") + # Display descriptions only for Geometry Nodes, since it's only used in the modifier panel. + if tree.type == 'GEOMETRY': + layout.prop(active_socket, "description") + active_socket.draw(context, layout) + + +class NODE_PT_node_tree_interface_inputs(NodeTreeInterfacePanel, Panel): + bl_space_type = 'NODE_EDITOR' + bl_region_type = 'UI' + bl_category = "Group" + bl_label = "Inputs" + + @classmethod + def poll(cls, context): + snode = context.space_data + return snode.edit_tree is not None + + def draw(self, context): + self.draw_socket_list(context, "IN", "inputs", "active_input") + +class NODE_PT_node_tree_interface_outputs(NodeTreeInterfacePanel, Panel): + bl_space_type = 'NODE_EDITOR' + bl_region_type = 'UI' + bl_category = "Group" + bl_label = "Outputs" + + @classmethod + def poll(cls, context): + snode = context.space_data + return snode.edit_tree is not None + + def draw(self, context): + self.draw_socket_list(context, "OUT", "outputs", "active_output") + + # Grease Pencil properties class NODE_PT_annotation(AnnotationDataPanel, Panel): bl_space_type = 'NODE_EDITOR' @@ -752,6 +843,8 @@ classes = ( NODE_PT_quality, NODE_PT_annotation, NODE_UL_interface_sockets, + NODE_PT_node_tree_interface_inputs, + NODE_PT_node_tree_interface_outputs, node_panel(EEVEE_MATERIAL_PT_settings), node_panel(MATERIAL_PT_viewport), diff --git a/release/scripts/startup/bl_ui/space_outliner.py b/release/scripts/startup/bl_ui/space_outliner.py index 7a694108e14..ba91b6e8d50 100644 --- a/release/scripts/startup/bl_ui/space_outliner.py +++ b/release/scripts/startup/bl_ui/space_outliner.py @@ -442,7 +442,6 @@ class OUTLINER_PT_filter(Panel): row.prop(space, "use_filter_lib_override_system", text="System Overrides") - classes = ( OUTLINER_HT_header, OUTLINER_MT_editor_menus, diff --git a/release/scripts/startup/bl_ui/space_sequencer.py b/release/scripts/startup/bl_ui/space_sequencer.py index ab05461f185..55714e0b0a5 100644 --- a/release/scripts/startup/bl_ui/space_sequencer.py +++ b/release/scripts/startup/bl_ui/space_sequencer.py @@ -400,7 +400,7 @@ class SEQUENCER_MT_view(Menu): layout.menu("SEQUENCER_MT_proxy") layout.operator_context = 'INVOKE_DEFAULT' - + layout.separator() layout.operator_context = 'INVOKE_REGION_WIN' layout.operator("sequencer.refresh_all", icon='FILE_REFRESH', text="Refresh All") @@ -467,6 +467,7 @@ class SEQUENCER_MT_select_handle(Menu): layout.operator("sequencer.select_handles", text="Left Neighbor").side = 'LEFT_NEIGHBOR' layout.operator("sequencer.select_handles", text="Right Neighbor").side = 'RIGHT_NEIGHBOR' + class SEQUENCER_MT_select_channel(Menu): bl_label = "Select Channel" @@ -1415,7 +1416,7 @@ class SEQUENCER_PT_source(SequencerButtonsPanel, Panel): split.label(text="%dx%d" % size, translate=False) else: split.label(text="None") - #FPS + # FPS if elem.orig_fps: split = col.split(factor=0.5, align=False) split.alignment = 'RIGHT' @@ -1424,7 +1425,6 @@ class SEQUENCER_PT_source(SequencerButtonsPanel, Panel): split.label(text="%.2f" % elem.orig_fps, translate=False) - class SEQUENCER_PT_scene(SequencerButtonsPanel, Panel): bl_label = "Scene" bl_category = "Strip" @@ -1857,7 +1857,7 @@ class SEQUENCER_PT_cache_settings(SequencerButtonsPanel, Panel): @classmethod def poll(cls, context): show_developer_ui = context.preferences.view.show_developer_ui - return cls.has_sequencer(context) and context.scene.sequence_editor and show_developer_ui + return cls.has_sequencer(context) and context.scene.sequence_editor and show_developer_ui def draw(self, context): layout = self.layout @@ -2286,14 +2286,15 @@ class SEQUENCER_PT_snapping(Panel): layout.use_property_decorate = False col = layout.column(heading="Snap to", align=True) - col.prop(sequencer_tool_settings, "snap_seq_element", expand=True) + col.prop(sequencer_tool_settings, "snap_to_current_frame") + col.prop(sequencer_tool_settings, "snap_to_hold_offset") col = layout.column(heading="Ignore", align=True) col.prop(sequencer_tool_settings, "snap_ignore_muted", text="Muted Strips") - col.prop(sequencer_tool_settings, "snap_ignore_sound",text="Sound Strips") + col.prop(sequencer_tool_settings, "snap_ignore_sound", text="Sound Strips") col = layout.column() - col.prop(sequencer_tool_settings, "snap_distance", slider=True, text="Distance") + col.prop(sequencer_tool_settings, "use_snap_current_frame_to_strips") classes = ( diff --git a/release/scripts/startup/bl_ui/space_spreadsheet.py b/release/scripts/startup/bl_ui/space_spreadsheet.py index 178be9ef0b7..afdbfea5091 100644 --- a/release/scripts/startup/bl_ui/space_spreadsheet.py +++ b/release/scripts/startup/bl_ui/space_spreadsheet.py @@ -54,8 +54,11 @@ class SPREADSHEET_HT_header(bpy.types.Header): pin_icon = 'PINNED' if space.is_pinned else 'UNPINNED' layout.operator("spreadsheet.toggle_pin", text="", icon=pin_icon, emboss=False) + if space.object_eval_state == 'VIEWER_NODE' and len(context_path) < 3: + layout.label(text="No active viewer node.", icon='INFO') + layout.separator_spacer() - + row = layout.row(align=True) sub = row.row(align=True) sub.active = self.selection_filter_available(space) @@ -112,6 +115,7 @@ class SPREADSHEET_HT_header(bpy.types.Header): return False return True + classes = ( SPREADSHEET_HT_header, ) diff --git a/release/scripts/startup/bl_ui/space_userpref.py b/release/scripts/startup/bl_ui/space_userpref.py index f9359a8b4a0..7e6fde1ebaf 100644 --- a/release/scripts/startup/bl_ui/space_userpref.py +++ b/release/scripts/startup/bl_ui/space_userpref.py @@ -1391,7 +1391,6 @@ class USERPREF_PT_file_paths_asset_libraries(FilePathsPanel, Panel): row.separator() row.label(text="Path") - for i, library in enumerate(paths.asset_libraries): name_col.prop(library, "name", text="") row = path_col.row() diff --git a/release/scripts/startup/bl_ui/space_view3d.py b/release/scripts/startup/bl_ui/space_view3d.py index 80cede9ee5a..df41445ee6f 100644 --- a/release/scripts/startup/bl_ui/space_view3d.py +++ b/release/scripts/startup/bl_ui/space_view3d.py @@ -2765,23 +2765,27 @@ class VIEW3D_MT_make_single_user(Menu): props = layout.operator("object.make_single_user", text="Object") props.object = True - props.obdata = props.material = props.animation = False + props.obdata = props.material = props.animation = props.obdata_animation = False props = layout.operator("object.make_single_user", text="Object & Data") props.object = props.obdata = True - props.material = props.animation = False + props.material = props.animation = props.obdata_animation = False props = layout.operator("object.make_single_user", text="Object & Data & Materials") props.object = props.obdata = props.material = True - props.animation = False + props.animation = props.obdata_animation = False props = layout.operator("object.make_single_user", text="Materials") props.material = True - props.object = props.obdata = props.animation = False + props.object = props.obdata = props.animation = props.obdata_animation = False props = layout.operator("object.make_single_user", text="Object Animation") props.animation = True - props.object = props.obdata = props.material = False + props.object = props.obdata = props.material = props.obdata_animation = False + + props = layout.operator("object.make_single_user", text="Object Data Animation") + props.obdata_animation = props.obdata = True + props.object = props.material = props.animation = False class VIEW3D_MT_object_convert(Menu): @@ -3129,7 +3133,6 @@ class VIEW3D_MT_mask(Menu): layout.menu("VIEW3D_MT_random_mask", text="Random Mask") - class VIEW3D_MT_face_sets(Menu): bl_label = "Face Sets" @@ -3259,6 +3262,7 @@ class VIEW3D_MT_random_mask(Menu): op = layout.operator("sculpt.mask_init", text='Per Loose Part') op.mode = 'RANDOM_PER_LOOSE_PART' + class VIEW3D_MT_particle(Menu): bl_label = "Particle" diff --git a/release/scripts/startup/bl_ui/space_view3d_toolbar.py b/release/scripts/startup/bl_ui/space_view3d_toolbar.py index bc385faf378..46fed79332d 100644 --- a/release/scripts/startup/bl_ui/space_view3d_toolbar.py +++ b/release/scripts/startup/bl_ui/space_view3d_toolbar.py @@ -1731,7 +1731,7 @@ class VIEW3D_PT_tools_grease_pencil_brush_paint_falloff(GreasePencilBrushFalloff from bl_ui.space_toolsystem_common import ToolSelectPanelHelper tool = ToolSelectPanelHelper.tool_active_from_context(context) - if tool and tool.idname != 'builtin_brush.Tint': + if tool and tool.idname != 'builtin_brush.Tint': return False gptool = brush.gpencil_tool @@ -2057,7 +2057,7 @@ class VIEW3D_PT_tools_grease_pencil_brush_mixcolor(View3DPanel, Panel): from bl_ui.space_toolsystem_common import ToolSelectPanelHelper tool = ToolSelectPanelHelper.tool_active_from_context(context) - if tool and tool.idname in('builtin.cutter', 'builtin.eyedropper', 'builtin.interpolate'): + if tool and tool.idname in {'builtin.cutter', 'builtin.eyedropper', 'builtin.interpolate'}: return False if brush.gpencil_tool == 'TINT': @@ -2118,7 +2118,7 @@ class VIEW3D_PT_tools_grease_pencil_brush_mix_palette(View3DPanel, Panel): from bl_ui.space_toolsystem_common import ToolSelectPanelHelper tool = ToolSelectPanelHelper.tool_active_from_context(context) - if tool and tool.idname in('builtin.cutter', 'builtin.eyedropper', 'builtin.interpolate'): + if tool and tool.idname in {'builtin.cutter', 'builtin.eyedropper', 'builtin.interpolate'}: return False if brush.gpencil_tool == 'TINT': diff --git a/release/scripts/startup/keyingsets_builtins.py b/release/scripts/startup/keyingsets_builtins.py index 2fc2d966ea9..ceffeaaff6c 100644 --- a/release/scripts/startup/keyingsets_builtins.py +++ b/release/scripts/startup/keyingsets_builtins.py @@ -383,6 +383,7 @@ class BUILTIN_KSI_Available(KeyingSetInfo): ############################### + class WholeCharacterMixin: # these prefixes should be avoided, as they are not really bones # that animators should be touching (or need to touch) diff --git a/release/scripts/startup/nodeitems_builtins.py b/release/scripts/startup/nodeitems_builtins.py index 8ae5d95f639..15c54fe18f9 100644 --- a/release/scripts/startup/nodeitems_builtins.py +++ b/release/scripts/startup/nodeitems_builtins.py @@ -508,14 +508,17 @@ geometry_node_categories = [ NodeItem("GeometryNodeCurveResample"), NodeItem("GeometryNodeMeshToCurve"), NodeItem("GeometryNodeCurveToPoints"), + NodeItem("GeometryNodeCurveEndpoints"), NodeItem("GeometryNodeCurveLength"), NodeItem("GeometryNodeCurveReverse"), ]), GeometryNodeCategory("GEO_PRIMITIVES_CURVE", "Curve Primitives", items=[ + NodeItem("GeometryNodeCurvePrimitiveLine"), NodeItem("GeometryNodeCurvePrimitiveCircle"), NodeItem("GeometryNodeCurveStar"), NodeItem("GeometryNodeCurveSpiral"), NodeItem("GeometryNodeCurveQuadraticBezier"), + NodeItem("GeometryNodeCurvePrimitiveQuadrilateral"), NodeItem("GeometryNodeCurvePrimitiveBezierSegment"), ]), GeometryNodeCategory("GEO_GEOMETRY", "Geometry", items=[ @@ -547,7 +550,7 @@ geometry_node_categories = [ NodeItem("GeometryNodeTriangulate"), NodeItem("GeometryNodeEdgeSplit"), NodeItem("GeometryNodeSubdivisionSurface"), - NodeItem("GeometryNodeSubdivide"), + NodeItem("GeometryNodeMeshSubdivide"), ]), GeometryNodeCategory("GEO_PRIMITIVES_MESH", "Mesh Primitives", items=[ NodeItem("GeometryNodeMeshCircle"), @@ -559,6 +562,7 @@ geometry_node_categories = [ NodeItem("GeometryNodeMeshLine"), NodeItem("GeometryNodeMeshUVSphere"), ]), + GeometryNodeCategory("GEO_POINT", "Point", items=[ NodeItem("GeometryNodePointDistribute"), NodeItem("GeometryNodePointInstance"), @@ -574,6 +578,7 @@ geometry_node_categories = [ NodeItem("ShaderNodeMath"), NodeItem("FunctionNodeBooleanMath"), NodeItem("FunctionNodeFloatCompare"), + NodeItem("FunctionNodeFloatToInt"), NodeItem("GeometryNodeSwitch"), ]), GeometryNodeCategory("GEO_VECTOR", "Vector", items=[ @@ -583,6 +588,9 @@ geometry_node_categories = [ NodeItem("ShaderNodeVectorMath"), NodeItem("ShaderNodeVectorRotate"), ]), + GeometryNodeCategory("GEO_OUTPUT", "Output", items=[ + NodeItem("GeometryNodeViewer"), + ]), GeometryNodeCategory("GEO_VOLUME", "Volume", items=[ NodeItem("GeometryNodePointsToVolume"), NodeItem("GeometryNodeVolumeToMesh"), diff --git a/release/scripts/templates_py/image_processing.py b/release/scripts/templates_py/image_processing.py index 2392faf440c..ab14436ad8e 100644 --- a/release/scripts/templates_py/image_processing.py +++ b/release/scripts/templates_py/image_processing.py @@ -20,9 +20,9 @@ input_image.pixels.foreach_get(pixel_data.ravel()) # Do whatever image processing you want using numpy here: # Example 1: Inverse red green and blue channels. -pixel_data[:,:,:3] = 1.0 - pixel_data[:,:,:3] +pixel_data[:, :, :3] = 1.0 - pixel_data[:, :, :3] # Example 2: Change gamma on the red channel. -pixel_data[:,:,0] = np.power(pixel_data[:,:,0], 1.5) +pixel_data[:, :, 0] = np.power(pixel_data[:, :, 0], 1.5) # Create output image. if output_image_name in bpy.data.images: diff --git a/release/scripts/templates_py/operator_mesh_add.py b/release/scripts/templates_py/operator_mesh_add.py index aa5b9ebf880..3fc7636459b 100644 --- a/release/scripts/templates_py/operator_mesh_add.py +++ b/release/scripts/templates_py/operator_mesh_add.py @@ -6,6 +6,7 @@ from bpy.props import ( FloatProperty, ) + def add_box(width, height, depth): """ This function takes inputs and returns vertex and face arrays. |