Page MenuHome

Enable Asset Browser by default for poses, rest stays experimental
ClosedPublic

Authored by Julian Eisel (Severin) on Aug 3 2021, 9:32 PM.

Details

Summary

Idea for 3.0 is to disable all functionality that isn't well polished and focus on few parts first. Starting with poses.

  • Adds a new experimental option "Extended Asset Browser", replacing "Asset Browser".
  • Unlike the previous option, this isn't enabled by default anymore. This didn't work well in practice and caused plenty of confusion.
  • "Mark as Asset" and "Clear Asset" are hidden if the option is disabled.
  • Same for the category selection in the Asset Browser.
  • Always show display the "Only Assets" option in the File Browser while browing inside .blend files. That way you can hide data-blocks that are not pose assets.
  • The Asset Library setup UI in the Preferences is always visible now, it's needed for pose library access.

Addresses T90181, T90180 and T90300.

Diff Detail

Repository
rB Blender
Branch
temp-asset-browser-extended-experimental (branched from master)
Build Status
Buildable 16356
Build 16356: arc lint + arc unit

Event Timeline

Julian Eisel (Severin) requested review of this revision.Aug 3 2021, 9:32 PM
Julian Eisel (Severin) created this revision.
release/scripts/startup/bl_ui/space_userpref.py
2256

That's the button to get to the project page. It's the Asset Browser one, so "Project Overview" is actually misleading (because there is Asset Browser Project Overview as well). So maybe call this "Project Page"?

source/blender/editors/space_file/space_file.c
1

Grrr...

589–595

Makes sure the Asset Browser refreshes properly as the preference option changes. Maybe I should mention the option explicitly so we don't forget to take it out.

Jeroen Bakker (jbakker) added inline comments.
release/scripts/startup/bl_ui/space_userpref.py
2256

I would go for "Project Page". Or the name of the project, but that is also a bit confusing... (Asset Browser)

source/blender/editors/space_file/space_file.c
589–595

Yes make explicit. Now it is unclear why all properties need a refresh of the file browser.

Julian Eisel (Severin) edited the summary of this revision. (Show Details)Aug 4 2021, 10:44 AM
Julian Eisel (Severin) marked 2 inline comments as done.
  • Small tweaks as discussed
source/blender/editors/space_file/space_file.c
589–595

Even better, the message bus allows directly subscribing to a specific property. Doing that now, so it's mentioned in code even.

This revision is now accepted and ready to land.Aug 9 2021, 9:38 AM
Sybren A. Stüvel (sybren) requested changes to this revision.Aug 10 2021, 12:42 PM

Always show display the "Only Assets" option in the File Browser while browing inside .blend files. That way you can hide data-blocks that are not pose assets.

I don't quite understand this sentence. Wouldn't it show all assets? Or is there an extra filter based on the "experimental" setting to either show all assets (ON) or limit to only pose assets (OFF)?

It seems that the ASSET_OT_mark operator is now too restrictive. As the only way to actually mark assets, it's also used by the pose library:

Python: Traceback (most recent call last):
  File "build_linux/bin/3.0/scripts/addons/pose_library/operators.py", line 210, in execute
    asset = pose_creation.create_pose_asset_from_context(
  File "build_linux/bin/3.0/scripts/addons/pose_library/pose_creation.py", line 334, in create_pose_asset_from_context
    return create_pose_asset(context, params)
  File "build_linux/bin/3.0/scripts/addons/pose_library/pose_creation.py", line 316, in create_pose_asset
    functions.asset_mark(context, pose_action)
  File "build_linux/bin/3.0/scripts/addons/pose_library/functions.py", line 39, in asset_mark
    return cast(Set[str], bpy.ops.asset.mark(asset_mark_ctx))
  File "build_linux/bin/3.0/scripts/modules/bpy/ops.py", line 130, in __call__
    ret = _op_call(self.idname_py(), C_dict, kw, C_exec, C_undo)
RuntimeError: Operator bpy.ops.asset.mark.poll() failed, context is incorrect

This is from the "Copy As Asset" button, but I'm guessing that other ways to create a pose asset are broken now too.

This revision now requires changes to proceed.Aug 10 2021, 12:42 PM

PS: I've just committed rBAbb587e5bf80e: Pose Library: transparently handle removal of experimental flag to make the pose library compatible with current master and this patch.

Always show display the "Only Assets" option in the File Browser while browing inside .blend files. That way you can hide data-blocks that are not pose assets.

I don't quite understand this sentence. Wouldn't it show all assets? Or is there an extra filter based on the "experimental" setting to either show all assets (ON) or limit to only pose assets (OFF)?

For linking/appending the File Browser got a "Only Assets" option, filtering out every data-block that is not an asset. Previously this wasn't shown when the Asset Browser experimental option was disabled.
Since in release builds users will only be able to create pose assets, effectively it's a filtering toggle to hide everything that isn't a pose asset for non-beta users -- at least at the current state.
I don't have a strong opinion if the option should be an experimental feature or not.

It seems that the ASSET_OT_mark operator is now too restrictive. As the only way to actually mark assets, it's also used by the pose library:
[...]
This is from the "Copy As Asset" button, but I'm guessing that other ways to create a pose asset are broken now too.

There are bpy.types.ID.asset_mark()/.asset_clear() methods now, they should still work. I think the add-on should be updated to use these.

Always show display the "Only Assets" option in the File Browser while browing inside .blend files. That way you can hide data-blocks that are not pose assets.

I don't quite understand this sentence. Wouldn't it show all assets? Or is there an extra filter based on the "experimental" setting to either show all assets (ON) or limit to only pose assets (OFF)?

For linking/appending the File Browser got a "Only Assets" option, filtering out every data-block that is not an asset. [...] I don't have a strong opinion if the option should be an experimental feature or not.

Ah ok, so it doesn't just show pose assets, but all assets (but normally you can only create pose assets, so those are likely to be the only ones).
Fine by me to have such an option in there. Pose Actions are not meant to be linked/appended, though, so I think this option should be experimental. It should become non-experimental the moment any "linkable/appendable" asset turns non-experimental.

There are bpy.types.ID.asset_mark()/.asset_clear() methods now, they should still work. I think the add-on should be updated to use these.

Perfect! I'll do that.

Update: done in rBA6cd3a7357134: Pose Library: use functions instead of operators to mark/clear asset.

This revision is now accepted and ready to land.Aug 11 2021, 11:24 AM
  • Hide "Only Assets" File Browser option behind the experimental flag

Fine by me to have such an option in there. Pose Actions are not meant to be linked/appended, though, so I think this option should be experimental. It should become non-experimental the moment any "linkable/appendable" asset turns non-experimental.

Agreed, did that now.