diff options
author | Stefan Werner <stefan.werner@tangent-animation.com> | 2021-08-02 10:28:54 +0300 |
---|---|---|
committer | Stefan Werner <stefan.werner@tangent-animation.com> | 2021-08-02 10:28:54 +0300 |
commit | 34e8d79c3edbc58fd242cec0c1f2bed4e43855af (patch) | |
tree | 36c70e63515af2bd8ea840102493028faec37971 /release/scripts/startup/bl_ui | |
parent | 465fb31ed275618ec71e4925ab94bd4a9b077a12 (diff) | |
parent | 48722e8971133dbe14ecc6825a2451637df77eab (diff) |
Merge branch 'master' into cycles_texture_cache
Diffstat (limited to 'release/scripts/startup/bl_ui')
10 files changed, 105 insertions, 39 deletions
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 b51d7157c06..3f7c0735eec 100644 --- a/release/scripts/startup/bl_ui/properties_collection.py +++ b/release/scripts/startup/bl_ui/properties_collection.py @@ -86,12 +86,15 @@ class COLLECTION_PT_lineart_collection(CollectionButtonsPanel, Panel): row = layout.row() row.prop(collection, "lineart_usage") - layout.prop(collection, "lineart_use_intersection_mask") + layout.prop(collection, "lineart_use_intersection_mask", text="Collection Mask") - row = layout.row(align=True, heading="Masks") - row.active = collection.lineart_use_intersection_mask + col = layout.column(align=True) + col.active = collection.lineart_use_intersection_mask + row = col.row(align=True, heading="Masks") for i in range(8): - row.prop(collection, "lineart_intersection_mask", index=i, text=str(i), toggle=True) + row.prop(collection, "lineart_intersection_mask", index=i, text=" ", toggle=True) + if i == 3: + row = col.row(align=True) classes = ( diff --git a/release/scripts/startup/bl_ui/properties_data_mesh.py b/release/scripts/startup/bl_ui/properties_data_mesh.py index 7f4328bb25a..d9ad094ac4f 100644 --- a/release/scripts/startup/bl_ui/properties_data_mesh.py +++ b/release/scripts/startup/bl_ui/properties_data_mesh.py @@ -646,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_material.py b/release/scripts/startup/bl_ui/properties_material.py index b217e33de12..1c7f3639f0a 100644 --- a/release/scripts/startup/bl_ui/properties_material.py +++ b/release/scripts/startup/bl_ui/properties_material.py @@ -291,18 +291,18 @@ class MATERIAL_PT_lineart(MaterialButtonsPanel, Panel): mat = context.material lineart = mat.lineart - layout.prop(lineart, "use_material_mask") + layout.prop(lineart, "use_material_mask", text="Material Mask") - row = layout.row(align=True, heading="Masks") - row.active = lineart.use_material_mask + col = layout.column(align=True) + col.active = lineart.use_material_mask + row = col.row(align=True, heading="Masks") for i in range(8): - row.prop(lineart, "use_material_mask_bits", text=str(i), index=i, toggle=True) + row.prop(lineart, "use_material_mask_bits", text=" ", index=i, toggle=True) + if i == 3: + row = col.row(align=True) row = layout.row(align=True, heading="Custom Occlusion") - row.prop(lineart, "use_mat_occlusion", text="") - sub = row.row(align=False) - sub.active = lineart.use_mat_occlusion - sub.prop(lineart, "mat_occlusion", slider=True, text="Levels") + row.prop(lineart, "mat_occlusion", text="Levels") classes = ( diff --git a/release/scripts/startup/bl_ui/properties_physics_fluid.py b/release/scripts/startup/bl_ui/properties_physics_fluid.py index d168d9ab6dd..6408d4096fe 100644 --- a/release/scripts/startup/bl_ui/properties_physics_fluid.py +++ b/release/scripts/startup/bl_ui/properties_physics_fluid.py @@ -734,11 +734,9 @@ class PHYSICS_PT_noise(PhysicButtonsPanel, Panel): col = flow.column() col.prop(domain, "noise_scale", text="Upres Factor") - # TODO (sebbas): Mantaflow only supports wavelet noise. Maybe get rid of noise type field. - col.prop(domain, "noise_type", text="Noise Method") + col.prop(domain, "noise_strength", text="Strength") col = flow.column() - col.prop(domain, "noise_strength", text="Strength") col.prop(domain, "noise_pos_scale", text="Scale") col.prop(domain, "noise_time_anim", text="Time") 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_outliner.py b/release/scripts/startup/bl_ui/space_outliner.py index ba91b6e8d50..0a4f419362d 100644 --- a/release/scripts/startup/bl_ui/space_outliner.py +++ b/release/scripts/startup/bl_ui/space_outliner.py @@ -105,6 +105,10 @@ class OUTLINER_MT_context_menu(Menu): @staticmethod def draw_common_operators(layout): + layout.menu_contents("OUTLINER_MT_asset") + + layout.separator() + layout.menu("OUTLINER_MT_context_menu_view") layout.separator() @@ -306,6 +310,22 @@ class OUTLINER_MT_object(Menu): OUTLINER_MT_context_menu.draw_common_operators(layout) +class OUTLINER_MT_asset(Menu): + bl_label = "Assets" + + @classmethod + def poll(cls, context): + return context.preferences.experimental.use_asset_browser + + def draw(self, context): + layout = self.layout + + space = context.space_data + + layout.operator("asset.mark") + layout.operator("asset.clear") + + class OUTLINER_PT_filter(Panel): bl_space_type = 'OUTLINER' bl_region_type = 'HEADER' @@ -451,6 +471,7 @@ classes = ( OUTLINER_MT_collection_visibility, OUTLINER_MT_collection_view_layer, OUTLINER_MT_object, + OUTLINER_MT_asset, OUTLINER_MT_context_menu, OUTLINER_MT_context_menu_view, OUTLINER_PT_filter, diff --git a/release/scripts/startup/bl_ui/space_sequencer.py b/release/scripts/startup/bl_ui/space_sequencer.py index 55714e0b0a5..30467521c3d 100644 --- a/release/scripts/startup/bl_ui/space_sequencer.py +++ b/release/scripts/startup/bl_ui/space_sequencer.py @@ -263,6 +263,7 @@ class SEQUENCER_PT_sequencer_overlay(Panel): layout.prop(st, "show_strip_offset", text="Offsets") layout.prop(st, "show_fcurves", text="F-Curves") + layout.prop(st, "show_grid", text="Grid") layout.separator() @@ -1156,14 +1157,19 @@ class SEQUENCER_PT_effect(SequencerButtonsPanel, Panel): flow.prop(strip, "use_only_boost") elif strip_type == 'SPEED': - layout.prop(strip, "use_default_fade", text="Stretch to Input Strip Length") - if not strip.use_default_fade: - layout.prop(strip, "use_as_speed") - if strip.use_as_speed: - layout.prop(strip, "speed_factor") - else: - layout.prop(strip, "speed_factor", text="Frame Number") - layout.prop(strip, "use_scale_to_length") + col = layout.column(align=True) + col.prop(strip, "speed_control", text="Speed Control") + if strip.speed_control == "MULTIPLY": + col.prop(strip, "speed_factor", text=" ") + elif strip.speed_control == "LENGTH": + col.prop(strip, "speed_length", text=" ") + elif strip.speed_control == "FRAME_NUMBER": + col.prop(strip, "speed_frame_number", text=" ") + + row = layout.row(align=True) + row.enabled = strip.speed_control != "STRETCH" + row = layout.row(align=True, heading="Interpolation") + row.prop(strip, "use_frame_interpolate", text="") elif strip_type == 'TRANSFORM': col = layout.column() @@ -1233,11 +1239,7 @@ class SEQUENCER_PT_effect(SequencerButtonsPanel, Panel): layout.prop(strip, "wrap_width", text="Wrap Width") col = layout.column(align=True) - if strip_type == 'SPEED': - col.prop(strip, "multiply_speed") - col.prop(strip, "use_frame_interpolate") - - elif strip_type in {'CROSS', 'GAMMA_CROSS', 'WIPE', 'ALPHA_OVER', 'ALPHA_UNDER', 'OVER_DROP'}: + if strip_type in {'CROSS', 'GAMMA_CROSS', 'WIPE', 'ALPHA_OVER', 'ALPHA_UNDER', 'OVER_DROP'}: col.prop(strip, "use_default_fade", text="Default Fade") if not strip.use_default_fade: col.prop(strip, "effect_fader", text="Effect Fader") @@ -2293,8 +2295,8 @@ class SEQUENCER_PT_snapping(Panel): col.prop(sequencer_tool_settings, "snap_ignore_muted", text="Muted Strips") col.prop(sequencer_tool_settings, "snap_ignore_sound", text="Sound Strips") - col = layout.column() - col.prop(sequencer_tool_settings, "use_snap_current_frame_to_strips") + col = layout.column(heading="Current Frame", align=True) + col.prop(sequencer_tool_settings, "use_snap_current_frame_to_strips", text="Snap to Strips") classes = ( diff --git a/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py b/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py index c55f637f8b2..46a6944d2ea 100644 --- a/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py +++ b/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py @@ -191,6 +191,11 @@ class _defs_annotate: row.prop(tool_settings.gpencil_sculpt, "lockaxis") elif tool_settings.gpencil_stroke_placement_view3d in {'SURFACE', 'STROKE'}: row.prop(tool_settings, "use_gpencil_stroke_endpoints") + elif space_type in {'IMAGE_EDITOR', 'NODE_EDITOR', 'SEQUENCE_EDITOR', 'CLIP_EDITOR'}: + layout.separator() + + row = layout.row(align=True) + row.prop(tool_settings, "annotation_stroke_placement_view2d", text="Placement") if tool.idname == "builtin.annotate_line": layout.separator() diff --git a/release/scripts/startup/bl_ui/space_userpref.py b/release/scripts/startup/bl_ui/space_userpref.py index 7e6fde1ebaf..91bd5f04b9d 100644 --- a/release/scripts/startup/bl_ui/space_userpref.py +++ b/release/scripts/startup/bl_ui/space_userpref.py @@ -619,7 +619,7 @@ class USERPREF_PT_system_os_settings(SystemPanel, CenterAlignMixIn, Panel): split = layout.split(factor=0.4) split.alignment = 'RIGHT' split.label(text="") - split.operator("file.associate_blend", text="Make Default") + split.operator("preferences.associate_blend", text="Make Default") class USERPREF_PT_system_memory(SystemPanel, CenterAlignMixIn, Panel): |