Moo-Ack-Productions / MCprep

Blender python addon to increase workflow for creating minecraft renders and animations
https://theduckcow.com/MCprep
GNU General Public License v3.0
269 stars 26 forks source link

Blender asset browser support #414

Open TheDuckCow opened 1 year ago

TheDuckCow commented 1 year ago

At a high level, it would be great to support the Blender Asset browser. This is unfortunately tricky for a number of reasons, but I'll start with what the high level goals could be:

Requirements:

Why it's difficult:

We have dynamically created assets. We want people to be able to use MCprep equally with different assets from different places, and to be able to use material generation with material settings. This means we cannot simply pre-generate the textures and expect it will work for everyone as they like (though that could be a stepping stone). Additionally, if we save assets with tagging for the asset browser, it means those assets won't be available for pre blender 3.0 users, creating a compatibility rift.

That points to auto generating blend files containing the assets on the fly. This, too, is non trivial. Though thankfully I [TheDuckCow] have had recent efforts in a separate project to perform this. The API for the asset browser is rather limited, and creates some complicated to use situations.

Possible approaches:

Open for comments, suggestions, and user desired for this integration.

StandingPadAnimations commented 1 year ago

Based on what I'm reading (correct me if I'm wrong, it's pretty late here), the goal is to keep the "dynamicness" (for the lack of a better term) with the asset browser, but I feel like that might be the wrong approach.

No offense, but "background instance" raised some red flags for me

zNightlord commented 1 year ago

We could also take the approach of: have a single asset library created for everything, but then when the user imports (drags and drops) MCprep post-processes and regenerates the thing imported as necessary.

This is the first thing I would think of dragging a block out depend on scene resourcepack and change it. With that problem previously is there is no proper way to know an asset dragged out of "main" asset browser and put in the scene through API.

I looked through the builtin Pose library addon noticed they can specify whatever custom operator to execute with template_asset_view Also there is a question about it on Blender devtalk on asset browser custom drag operator

StandingPadAnimations commented 1 year ago

Here's my idea for the asset browser: we mark all of the rigs (by using a seperate file for 3.0), and then make it easy for the user to A. open the master blend file (the same way we do for sync materials) and B. make it easy to mark a new rig as an asset.

Sure it may not be automatic, but it's a good starting point, and doesn't have a lot of headaches (compared to if we make it dynamic), not to mention it makes rig spawning more "interactive" and less "place a 3D cursor and append a rig".

On 0402, Trung Phạm wrote:

 We could also take the approach of: have a single asset library
 created for everything, but then when the user imports (drags and
 drops) MCprep post-processes and regenerates the thing imported as
 necessary.

This is the first thing I would think of dragging a block out depend on scene resourcepack and change it. With that problem previously is there is no proper way to know an asset dragged out of "main" asset browser and put in the scene through API.

I looked through the builtin Pose library addon noticed they can specify whatever custom operator to execute with template_asset_view Also there is a question about it on Blender devtalk on asset browser [1]custom drag operator

-- Reply to this email directly, [2]view it on GitHub, or [3]unsubscribe. You are receiving this because you commented. Message ID: @.***>

References

  1. https://devtalk.blender.org/t/implementing-custom-drag-operator-with-template-asset-view/21716/5
  2. https://github.com/TheDuckCow/MCprep/issues/414#issuecomment-1493627466
  3. https://github.com/notifications/unsubscribe-auth/AR4UXCWWCHAVR4OS47TQMBTW7JFEFANCNFSM6AAAAAAWQTGYIQ
zNightlord commented 1 year ago

Yeah marking I think it should be manually too since it fairly simple to mark one in the outliner.

I'm not really sure about storing every rigs inside one "master" blend file. I tried to store many rigs inside one thought it would be convenient but later on it causing unknown lag spike although they all hide away and beside if you right click on asset browser thumbnail it should have an operator to open it in new blender instance to edit and save.

About that there is one issue in Discord I mentioned, about pre 3.2 (3.0, 3.1) mark collection wasn't exist in those so need to use instance collection for marking.

StandingPadAnimations commented 1 year ago

I'm not really sure about storing every rigs inside one "master" blend file. I tried to store many rigs inside one thought it would be convenient but later on it causing unknown lag spike although they all hide away and beside if you right click on asset browser thumbnail it should have an operator to open it in new blender instance to edit and save.

Fair point, and a master blend file would be pretty massive as well.

About that there is one issue in Discord I mentioned, about pre 3.2 (3.0, 3.1) mark collection wasn't exist in those so need to use instance collection for marking.

Instance collections might cause some confusion when people go and try to edit the rigs themselves, maybe we can mark the armatures instead?

On 0403, Trung Phạm wrote:

Yeah marking I think it should be manually too since it fairly simple to mark one in the outliner.

I'm not really sure about storing every rigs inside one "master" blend file. I tried to store many rigs inside one thought it would be convenient but later on it causing unknown lag spike although they all hide away and beside if you right click on asset browser thumbnail it should have an operator to open it in new blender instance to edit and save.

About that there is one issue in Discord I mentioned, about pre 3.2 (3.0, 3.1) mark collection wasn't exist in those so need to use instance collection for marking.

-- Reply to this email directly, [1]view it on GitHub, or [2]unsubscribe. You are receiving this because you commented. Message ID: @.***>

References

  1. https://github.com/TheDuckCow/MCprep/issues/414#issuecomment-1494307535
  2. https://github.com/notifications/unsubscribe-auth/AR4UXCRJVOOPVIISR7SOE23W7LEP7ANCNFSM6AAAAAAWQTGYIQ
zNightlord commented 1 year ago

Instance collections might cause some confusion when people go and try to edit the rigs themselves, maybe we can mark the armatures instead?

I know that is quite finicky with "realize" linked override, it is the only way to import a group of objects in pre 3.2. Asset browser don't import the whole children hierachy, but for the datablock is "referenced" like bone shapes it will import other objects along with it.

https://user-images.githubusercontent.com/61040487/229693455-2eb04ee9-3127-4242-b8bc-0d05e73f2a37.mp4

*Mark collection in 3.2+ add in a collection instance