Page MenuHome

GPencil: Asset Manager support
AbandonedPublic

Authored by Antonio Vazquez (antoniov) on Nov 11 2021, 6:19 PM.
Tokens
"Love" token, awarded by flav."Love" token, awarded by WinglessFly."Love" token, awarded by HEYPictures."Love" token, awarded by Draise."Burninate" token, awarded by frogstomp."Love" token, awarded by jsm."Love" token, awarded by Dantti."Love" token, awarded by ShenCiao."Love" token, awarded by brilliant_ape."Pterodactyl" token, awarded by Gavriel5578.

Details

Summary

This operator creates an asset base on one of the next option:

  • Active Layer.
  • All Layers.
  • All Layers Separated
  • Active Frame (Active Layer).
  • Active Frame (All Layers).
  • Selected Frames.
  • Selected Strokes.

The menu uses Create Assetinstead of Mark Asset because the asset is created as new datablock and not reuse existing data.

Also new asset preview for Grease Pencil has been added.

For testing, be sure to enable Experimental Featureand Developers Extra

Note: Still pending how manage layers order and how use temp datablocks.

Diff Detail

Repository
rB Blender
Branch
asset-greasepencil
Build Status
Buildable 18602
Build 18602: arc lint + arc unit

Event Timeline

Antonio Vazquez (antoniov) requested review of this revision.Nov 11 2021, 6:19 PM
Antonio Vazquez (antoniov) created this revision.
Antonio Vazquez (antoniov) edited the summary of this revision. (Show Details)
  • Check Autokey Button
  • Merge branch 'master' into asset-greasepencil
  • Merge branch 'master' into asset-greasepencil
  • Fix C++ conversion of render_preview
  • Cleanup C++ nullptr and compiler warning
  • Remove experimental flag check
  • Add missing menu options

@Antonio Vazquez (antoniov) so far I found that drag drop stroke to grease pencil object in edit mode leads to crash when receiving object contains more than one layer.

Steps to reproduce:

  • add default monkey
  • drag stroke from asset browser to viewport

@Aleš Jelovčan (frogstomp) you mean an asset with several layers or an asset with one layer in an object with several layers? Could you provide me a simple blend file to test the crash?

@Antonio Vazquez (antoniov)

here is test file.

1.) save file to your assets files folder
2.) drag one of thr red characters to viewport and go to edit mode
3.) drag in any of your strokes

  • Merge branch 'master' into asset-greasepencil
  • Safe checking of pointers of material
  • Fix crash importing due wrong active frame pointer

Loving this tool, tested with some hand poses, some feedback:
First, a question:
Is there a way to edit stokes is asset browser? I created hand pack and forgot to tick "origin to geometry". Would be very useful to be able to change this afterwards.

Second thing, I thought of the box that appears right after dropping the strokes in object as redundant but I see it is great for multiframes.

Two usability suggestions:

  • allow negative scaling so the object can be flipped.
  • preserve scale ratio from previous drop.

See image, this would simply scale matching

Is there a way to edit stokes is asset browser? I created hand pack and forgot to tick "origin to geometry". Would be very useful to be able to change this afterwards.

Really the assets are datablocks (no objects), so you need an object to edit the strokes... I did not tested but as idea, you could open the asset file, create an empty GP object and then assign the asset datablock. Now you can edit the asset and update it.

preserve scale ratio from previous drop.

About this we have a problem. The import of assets is something more general in Blender and the idea is to avoid as much as possible the settings to define how is imported, so we cannot put a parameter to define if flip or not and the same for scale. Actually, if you want to flip you can import in edit mode and after that, just use scale -1 (the imported strokes are selected automatically ready to edit).
IMHO is not logic to duplicate the transform operations that can be already be done with the existing Edit transform features.

@Antonio Vazquez (antoniov) thanks for response. Yes I use regular edit for this. In any case having some scale asset slider would be great for consistency.
Of course alternatively we can also scale receiving object beforehand and then stop dropping in strokes.

Further findings: I deleted the assets and added them again, this time with "origin to geometry". Now dropping strokes in receiving objects is accurate.
I suspect that this will be desired outcome in majority of situations, so let's think of having this defaul ON.

In asset browser I'd expect that you'd be able to clear multiple assets at once, but only the first one selected is deleted. Just a small usability remark for consistency.

I have also noticed that scale thickness option is ignored when you scale with this new box

Material (slots) duplication issue

@Aleš Jelovčan (frogstomp) you are using Append instead of Append Reuse this is why the materials are duplicated.

Further findings, yet to pin down exact case:

  • sometimes wrong asset appears on drag to viewport, I can't reproduce every time, maybe caused by using multiple libraries.

One more usability concern regarding the new selection box:

  • if dropped in edit mode, new strokes will get selected, but not when dropped in object mode

Thanks, default on and selected strokes in all modes help a lot.

Some further visual aid is needed in timeline, especially when working with multistroke. See video please.

Would be very useful if:

  • affected layers were auto-selected when drag is confirmed
  • affected frames are selected.

The user still needs to keep in mind to:

  • turn ON autokeying
  • turn on multiframe mode

So we have lots of iffy situation. Would be good to display info message at the bottom if user has those options toggled off.

  • Merge branch 'master' into asset-greasepencil
  • GPencil: Fix compiler errors after merge
  • Merge branch 'master' into asset-greasepencil
  • Merge branch 'master' into asset-greasepencil
  • Fix possible use of NULL pointer
  • Cleanup code
  • Create custom Tooltip for GPencil

@Julian Eisel (Severin) Could you help me to find the memory leak?

After drag and drop an asset...always get the memory leak (a pair for each asset):

Error: Not freed memory blocks: 2, total unfreed memory 0.062561 MB
Data from GD len: 64 000001BCDD0FA7C8
Data from GD len: 65536 000001BCDCE51788

I have tested and the problem is just dragging an asset. Maybe the problem is in these lines:

/* TODO(@antoniov): Change to use a temp copy using BLO_library_temp_load_id (). */
  WM_dropbox_add(lb,
                 "GPENCIL_OT_asset_import",
                 view3d_gpencil_drop_poll,
                 view3d_id_drop_copy_with_type,
                 WM_drag_free_imported_drag_ID,
                 view3d_gpencil_data_drop_tooltip);

I added this TODO because you told me that this would need to be changed.

  • Merge branch 'master' into asset-greasepencil
  • Merge branch 'master' into asset-greasepencil

@Julian Eisel (Severin), @Matias Mendiola (mendio), @Daniel Martinez Lara (pepeland), now that we are in 3.3 bcon1, I'd like to very politely ask the whole collective if we could pay a little attention to this one.

From artist perspective it brings a whole new workflow to the table, I am constantly rebuilding with this patch on top.

I think @Antonio Vazquez (antoniov) did a really great job putting this together, I find the design consistent with other areas.
The patch has also been around for 2 releases now without review. This of course produces another side effect, which is when some other feature makes it into master, this gets knocked out and has to be reconfigured.

I know and respect that you are also burdened with other tasks that are prioritized, that goes without saying, and all the respect for this.

But really, this patch is outstanding in what it brings to the table, in my eyes it is the most important feature of grease pencil in a long time.

It is already stable and usable enough and I think it would really benefit GP community to have this in master soon and continue adding and improving features later.

  • Merge branch 'master' into asset-greasepencil
Antonio Vazquez (antoniov) planned changes to this revision.Jun 22 2022, 4:19 PM

We have created a new Lite version in D15271

As the version that uses Edit for transform (D15271) is more simple, easy to use and better, we can close this patch.