"import pose library" doesn't import the preview icons anymore

Issue #2000 resolved
Alessandro Padovani created an issue

1.7.4.2075, blender 3.6 4.1

Tried both blender 3 and 4, the previews are not imported in the asset browser. I remember they imported fine from the daz library in 1.7.3, see #1892. Please note that the poses are imported fine and everything works, they just miss the preview icon.

Let us know if this is a bug or you had to remove the feature for some reason.

note. The “import preview“ option is missing in blender 3.6, that was available in 1.7.3.

steps:

  1. import G8 and save the blender file
  2. import pose library, any will do, I did the base poses included with the G8 package
  3. open the asset browser, set to current file, check the preview icons

Comments (20)

  1. Prenses Karolin

    I would like to ask a personal question that is a bit related to the subject.

    I prepared special expressions for myself and saved them to my character as Custom Morph. I get the expression by setting the value of the expression I want from the panel to 1.

    My question is this;
    Can I build a library in Blender where I can see what these expressions are (how they react), just like the pose library, but without moving the bones, just by turning the morphs on and off?

    What I want to do is to have multiple emoticon images and select the one I want and transfer it to the character.

    Can I do something like this in blender? Honestly, I don't know much about blender, you have a lot of experience. I know how to save a pose in a library, but it's about the bone of the character. What about morph?

  2. Alessandro Padovani reporter

    The pose library doesn’t support shapekeys, only bones. This is a limitation in blender, not a addon bug. That doesn’t mean you can’t have face expressions in the pose library, but there has to be a facial rig. For example you can save G81 FACS via the daz facial rig in the G81 package. You can also save G8 expressions since they are bone based, but without the HD corrective shapes. You can not save G1 G2 expressions since those use shapes instead of bones.

  3. Prenses Karolin

    So for G9, do all emoticons work with the bones in the face, or does it depend on the person creating the emoticon?

  4. Alessandro Padovani reporter

    G9 uses FACS same as G81, but she doesn’t have a face control rig, the G81 rig doesn’t work on G9 in daz studio. So you can’t import daz G9 expressions in a blender pose library. But, differently from daz studio, in diffeomorphic you can use the G81 face rig on G9, then pose the face rig and save expressions in a pose library. These won’t be daz expressions but those you do yourself in blender.

    Personally I don’t advise to use G9 in blender though because she’s a really heavy figure. G8 is much faster.

  5. GeneralProtectionFault

    This is mostly a rehash of this issue I brought up a while ago, isn’t it?

    https://bitbucket.org/Diffeomorphic/import_daz/issues/1892/import-pose-library-blender-asset-browser

    Thomas had said that he felt the Blender API was lacking. I think I’m hallucinating but I thought he had said somewhere, something about changing into pose mode or something, but I haven’t tested this since then (got distracted by bvh 😋 ).

    The commit (on a fork for the purpose) I referenced in there will “work” only if the user has an Asset Browser open. Blender’s API and its documentation are generally pretty bad, but I can’t point to a bunch of competing software that allows you to modify it at all and is free for everyone LOL.

    That said, it’s terrible to need to hack windows open to truly add a pose library, but when I tested that solution, the previews were fine. The problem is importing the library in the first place if there is no Asset Browser.

    All that said, I’m not sure why that issue was moved to resolved. I would have thought it be left open until that’s figured out, or moved to won’t fix.

  6. Alessandro Padovani reporter

    Thank you, the difference is that 1.7.4 doesn’t work in blender 3 too, while 1.7.3 did. @Thomas let us know.

    p.s. Just tested in blender 3 and 4, having the asset browser already open in current file, before importing, doesn’t fix it.

    p.p.s. #1892 is marked as resolved because Thomas fixed some code to avoid the crash in blender 4, but yes eventually “wontfix“ would be better.

  7. GeneralProtectionFault

    I’m not sure if the preview images are actually “not working.” I might remember wrong, but I think Thomas took out the checkbox that said “Use Preview Images” or something because of the issues.

    I took a look at my old commit there and with a little tweak (use bpy.context instead of importing because context is passed as an argument, I think), it worked in 4.1 better than it did last time I tried.

    Let me clarify that I’m speaking about the Import Pose Library button, and just selecting a couple. If there is an asset browser open, it works, previews and all.

    There are two annoyances. The asset browser has to exist, and you can’t import with “All” selected, it has to be Current File. I did this in code before but it either didn’t work or borked from a race condition. Trying in 4.1, it all worked, it would automatically put it to Current File, add the catalog (didn’t test trying to pass the name, there didn’t appear to be any way to in 3.x), and adds the poses with previews.

    I did find one caveat--if I tried to do this again, with one of the poses applied, I got an exception:

    RuntimeError: Operator bpy.ops.asset.catalog_new.poll() Asset catalogs cannot be edited in this asset library

    …So I think if it were to be implemented, it needs to have the pose cleared automatically before everything. That makes sense anyway. If that were done, I THINK the only crappy thing is that you still need to have the Asset Browser window. I mean that kinda makes sense too, if you’re importing a library of a bunch of poses, it’s a little weird to have it happen silently without some sort of feedback.

    I’ll put the file I’m using here, I merged changes first so it should be current. Totally up to you guys, but my vote would be add clearing the pose first to the code I have (I see sort of how it’s in there but it’s almost 3 AM LOL), pass the name of the Catalog if Blender’s Awful Programming Interface will allow it, and then gray out the Import Pose Library button with a mouse-hover message that obnoxiously indicates that the user needs an Asset Browser to see the glorious pose library to be imported 😁 .

  8. Alessandro Padovani reporter

    @GPF that’s great thank you, your animation.py fix works fine here in blender 4.1, while it crashes in blender 3.6. Also, I’d change the error message into “To import previews please open the asset browser and set it to current file.“, when “import previews“ is checked.

    @Thomas let us know.

  9. GeneralProtectionFault

    Sure, if Thomas is ok w/ that I can play with it more tomorrow. I know he had some understandable reservations about the clunkiness of the approach needed 😅 . To clarify, though, I think the switch from All => Current File is working, at least for me in 4.1 if the pose is cleared. By the 2 annoyances, I mean there are 2 janky things you shouldn’t really have to do programmatically to add the library 😋 --and I think the Current File part is solved. Probably possible to hijack one of the user’s windows to asset browser and flip it back, but at that point, I agree w/ Thomas, pretty nasty “solution” LOL. Anyhoo, gonna get some sleep.

  10. Thomas Larsson repo owner

    I found a different way to import the preview image, so the “Import preview” option is back. I still don’t know why the generated image is blank.

    Edit: Now I see that the new way is essentially the same as the one proposed by GPF.

  11. Alessandro Padovani reporter

    Commit e0ff231.

    That’s wonderful works fine here, tested both in blender 3.6 and 4.1, both with the asset browser open or not. A couple minor bugs.

    bug. affect morphs. The asset browser in blender can’t store shapekeys or drivers, only bones, so the “affect morphs” option doesn’t make sense because the pose in the asset browser will not affect morphs. Of course we can affect morphs when we load the pose from the daz library, but that’s for “import pose”, not for “import pose library”. Unless I misunderstand what “affect morphs“ is for.

    bug. new pose library. The new catalog is not created, we need to create a new catalog with the name chosen by the user. Or remove the option then the user will create the new catalog himself if needed.

  12. Thomas Larsson repo owner

    Both options have been removed in the last commit (new poselib is still present with the old pose library). Tested with 2.83 and 4.1.

  13. Alessandro Padovani reporter

    Commit 7919ba2 works fine, if there’s nothing to add we can close as resolved.

    note. storing daz morphs in the asset browser. As noted above the asset browser doesn’t support morphs, but this doesn’t mean we can’t use morphs. If we want to store in the blender asset browser a daz pose using morphs, then we have first to bake the pose in daz studio. This is limited to bones though, if the daz morph also uses shapes other than bones then the shapes are lost in blender. Anyway, for example, G8 body morphs and expressions work fine with bones so they can be stored in the asset browser.

    steps:

    1. in daz studio load G8
    2. load a pose using body morphs and/or expressions
    3. bake the pose with “edit > figure > bake to transforms”, this way the morphs are baked to bones
    4. save as pose preset
    5. in blender load the baked daz pose, we can save that in the asset browser

  14. GeneralProtectionFault

    So just for posterity: https://blender.stackexchange.com/questions/249316/python-set-asset-library-tags-and-catalogs

    Interestingly, the catalogs appear to be stored in a text file alongside the blend file(s).

    So, maybe not worth the hassle, but if the catalog were added and the API did not have direct access to it, it seems like the name could be updated in that text file.

    I still see some sketchy behavior where the API doesn’t always seem to react the same way, like sometimes setting it to Current File in code works and other times not. Also Blender will throw an error even in the UI if you try to add a catalog and the blend file has not been saved yet.

    It seems like it’s “possible” to actually change the active area to the asset browser in code, do the work, and set it back, and the user be none the wiser, but first attempt did at that crashed Blender 😋 .

    No need to keep this open on my account, the API is definitely screwy on this stuff, but I think the info is worth noting here in case it’s returned to at some point.

  15. Log in to comment