GPencil: New support for Asset Manager #104413

Closed
Antonio Vazquez wants to merge 10 commits from antoniov/blender:temp-asset-lite into main

When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.
1 changed files with 4 additions and 15 deletions
Showing only changes of commit 4fb56b9dd9 - Show all commits

View File

@ -976,7 +976,6 @@ class VIEW3D_MT_editor_menus(Menu):
layout.menu("VIEW3D_MT_edit_gpencil")
layout.menu("VIEW3D_MT_edit_gpencil_stroke")
layout.menu("VIEW3D_MT_edit_gpencil_point")
layout.menu("VIEW3D_MT_edit_gpencil_asset")
elif obj and obj.mode == 'WEIGHT_GPENCIL':
layout.menu("VIEW3D_MT_weight_gpencil")
if obj and obj.mode == 'VERTEX_GPENCIL':
@ -5161,6 +5160,8 @@ class VIEW3D_MT_edit_gpencil(Menu):
# Remove
layout.menu("VIEW3D_MT_edit_gpencil_delete")
# Assets
layout.menu("VIEW3D_MT_edit_gpencil_asset", text="Create Asset...")
antoniov marked this conversation as resolved
Review

The ellipsis "..." are not needed because there is no extra popup or window after. Rename to "Create Asset" and also move it above "Duplicate" menu adding separators.

The ellipsis *"..."* are not needed because there is no extra popup or window after. Rename to *"Create Asset"* and also move it above "Duplicate" menu adding separators.
class VIEW3D_MT_edit_gpencil_stroke(Menu):
@ -5230,23 +5231,11 @@ class VIEW3D_MT_edit_gpencil_point(Menu):
class VIEW3D_MT_edit_gpencil_asset(Menu):
Review

I think you can use layout.operator_enum() here.

I think you can use `layout.operator_enum()` here.
bl_label = "Asset"
bl_label = "Create Asset"
def draw(self, _context):
layout = self.layout
layout.operator("gpencil.asset_create", text="Active Layer").source = 'LAYER'
layout.operator("gpencil.asset_create", text="All Layers").source = 'LAYERS_ALL'
layout.operator("gpencil.asset_create", text="All Layers Separated").source = 'LAYERS_SPLIT'
layout.separator()
layout.operator("gpencil.asset_create", text="Active Keyframe (Active Layer)").source = 'KEYFRAME'
layout.operator("gpencil.asset_create", text="Active Keyframe (All Layers)").source = 'KEYFRAME_ALL'
layout.operator("gpencil.asset_create", text="Selected Keyframes").source = 'KEYFRAME_SELECTED'
layout.separator()
layout.operator("gpencil.asset_create", text="Selected Strokes").source = 'SELECTED'
layout.operator("gpencil.asset_create", text="Selected Points").source = 'POINT'
layout.operator_enum("gpencil.asset_create", "source")
class VIEW3D_MT_weight_gpencil(Menu):