Alembic Exporter

123457

Comments

  • TheMysteryIsThePointTheMysteryIsThePoint Posts: 2,946
    edited August 2020
    marble said:

    @marble

    You are correct... you need to import with Diffeo first, which will create the materials.

    Then, import the Alembic model, having used the Diffeo material slot naming method to export. Those material slot names in the screenshot you provided are the object#surface method, and so don't match anything that Diffeo would have created.

    Let me know how it goes.

    Edit: Also, avoid multiple imports in the same scene without having cleared out the materials from any previous imports. This will invoke Blender's numbering scheme, and then the material slot names will no longer match. You can clear the materials by deleting the object that use them, and then purging orphan data.

    Right. So I still don't get what the Object#Surface option is for. If I understand you correctly, your Alembic exporter needs the Diffeo add-on to be able to transfer materials. If so, when you use it for Marvelous Designer, for example, do it export without materials?

    @marble

    First things first... did it work for you? I have only tested it with my own scene files; other scene files may have special cases that I haven't encountered.

    In most instances, Object#Surface is more human readable that Material-1 :) Haven't you ever looks at a material slot, and wondered what the heck it was? In addition, after you've imported the Alembic objects, one of the scripts created in the scripts directory will rename all the materials to this Object#Surface format. So now, if you have to export again, you can select the Object#Surface method which avoids parsing the .duf file (I have some that take 3 minutes), and have the materials still match for subsequent imports. The idea, and something that I'm still working on to make as easy as possible, is to convert materials only once and store them in another .blend file, a compendium of all one's converted materials ready to be automatically appended/linked.

     

    Post edited by TheMysteryIsThePoint on
  • marblemarble Posts: 7,500
    edited August 2020

    @marble

    You are correct... you need to import with Diffeo first, which will create the materials.

    Then, import the Alembic model, having used the Diffeo material slot naming method to export. Those material slot names in the screenshot you provided are the object#surface method, and so don't match anything that Diffeo would have created.

    Let me know how it goes.

    Edit: Also, avoid multiple imports in the same scene without having cleared out the materials from any previous imports. This will invoke Blender's numbering scheme, and then the material slot names will no longer match. You can clear the materials by deleting the object that use them, and then purging orphan data.

    So this is how I did it this time (and yes, now I have a figure with materials):

    1. In DAZ Studio, load G8F and set her mesh resolution to SubD level 2.

    2. Save the DS Scene to a specified folder.

    3. Use the Diffeo export menu to export the .dbz file to the same specified folder.

    4. Bring up your Alembic Exporter and  ...

    5. Set the Default Directory to the above specified folder.

    6. In the Scaling Tab, set to Current SubD Level.

    7. In the Materials tab, check "Write Textures" and "Diffeomorphic".

    8. Export.

    Now in Blender ...

    1. Use the Diffeo DAZ Importer to import the Diffeo exported G8F from step 3 (above).

    2. File > Import > Alembic = blender_houdini.abc

    Now I have two G8F figures in my Blender Viewport, one overlaying the other. I assume I can delete the diffeo figure but what about those orphans if I do? Do I purge them too? How do I save the materials so that I don't have to do this every time I want to import the same figure (in different poses, clothers, etc.)?

    Post edited by marble on
  • marblemarble Posts: 7,500
    edited August 2020

    Here's my G8F rendered in Blender using Eevee. I note that the edges suggest that SubD is not working?

    G8F_Eevee.png
    983 x 771 - 818K
    Post edited by marble on
  • marblemarble Posts: 7,500

    Here's the wire frame comparison ...

     

    DAZ_Studio_Wire.jpg
    731 x 718 - 209K
    Blender_Wire.jpg
    701 x 710 - 67K
  • Please upgrade immediately. I found a bug where using a base filename with a trailing slash will cause Daz Studio to freeze. It is present in all versions. Sorry, I am not a Windows programmer and I don't know how to set up unit tests to catch these sort of things and am not in the mood to learn how.

    Please Upgrade to version 1.11.1.0

    Happens to the best of 'em :)

  • marble said:

    Here's the wire frame comparison ...

    @marble

    You are absolutely right. It seems that when the SubDivision Level and the Render SubD Level (minimum) are different, Daz Studio reports back the unsubdivided mesh., or rather, the code is doing something to provoke this. I'll investigate, but you can work around it by setting both to 2.

    Thanks for finding and reporting this bug.

  • marble said:
    Now I have two G8F figures in my Blender Viewport, one overlaying the other. I assume I can delete the diffeo figure but what about those orphans if I do? Do I purge them too? How do I save the materials so that I don't have to do this every time I want to import the same figure (in different poses, clothers, etc.)?

    @marble

    Yes, you can delete the collection with the Diffeo model in it. This won't create any material orphans because the Alembic model will be using its materials, but it will create mesh orphans that can be purged.

    To do this automatically in the future, and before I have the other scripts done, you can run the rename_materials.py script by making a window into a text editor and opening the script. This will rename all the materials to the Object#Surface convention. If you want to close the .blend file and reopen it later, you'll need to add a fake user to all the materials or they'll be gone when you reload it (come to think of it, I'll update the script to do this for you). Now, you can select the Object#Surface naming convention when you export, and you won't need to import with Diffeo anymore.

  • @marble

    This version will produce a renaming script that also creates a fake user for the converted materials so you won't lose them if you close the .blend file with nothing referencing the materials.

    Version 1.12.0.0

     

  • marblemarble Posts: 7,500

    @marble

    This version will produce a renaming script that also creates a fake user for the converted materials so you won't lose them if you close the .blend file with nothing referencing the materials.

    Version 1.12.0.0

     

    Great customer service!  :)

  • marblemarble Posts: 7,500
    edited August 2020

    @marble

    This version will produce a renaming script that also creates a fake user for the converted materials so you won't lose them if you close the .blend file with nothing referencing the materials.

    Version 1.12.0.0

     

    Now, you can select the Object#Surface naming convention when you export, and you won't need to import with Diffeo anymore.

     

    So I downloaded 1.12 and tried it with the Object#Surface option checked along with Write Texture Maps. However, I'm back to the white figure in my viewport again. Am I misunderstanding - when you say I can use Object#Surface do you mean only after I have been through the Diffeo import first? 

    Additionally, the low-poly edges are still visible but something strange has happened. It now looks like I have two versions (low-poly and HD) exported at the same time. I hope you can see that from this wireframe from Blender.

     

    Blender_wire.jpg
    481 x 537 - 82K
    Post edited by marble on
  • PadonePadone Posts: 3,688
    edited August 2020

    @TheMysteryIsThePoint

    tested with daz studio 4.11.0.383, blender 2.83.4, diffeo commit 92ce960 (latest today), alembic 1.12.0.0

    Sorry for the out of date studio version but I don't feel like installing 4.12 until they fix the animation bugs. I used 4.12.0.86 before but it seems it got corrupted in my backup and can't get it back from the daz support yet. I guess this shouldn't affect the alembic exporter if it just reads geometry from the viewport.

    issue 1 subd. As already reported by @marble the subdivision level is ignored unless the viewport subd is the same as the render subd. If we set viewport = render then it works fine.

    issue 2 diffeo materials. I exported a simple G8F animation. As for the diffeo material option there are some frames where the textures are scrambled. While other frames work fine. Now this is odd since the materials should be the same for all the frames. That is, daz studio doesn't support animated materials so I guess the alembic exporter doesn't save different materials for every frame.

    Then the animation itself is imported fine. I just have to set the blender fps the same as daz but this is expected. Test scene included.

     

    edit. I can't confirm the low-poly + hd issue reported by @marble. As for subd it seems to work fine here if I set viewport = render. I don't know may be he makes some confusion with the diffeo mesh.

    alembic.jpg
    530 x 355 - 40K
    duf
    duf
    g8f.duf
    191K
    Post edited by Padone on
  • marblemarble Posts: 7,500
    edited August 2020

    Here's a couple of other views that might show what I mean better ...

    Blender_wire.jpg
    695 x 683 - 203K
    Blender_solid.jpg
    1231 x 722 - 72K
    Post edited by marble on
  • JClaveJClave Posts: 64
    edited August 2020

    @JClave Ha ha maybe it's me that needs to better understand your requirements. You made it sound like you foresaw an iteritive process of perfecting the materials. This led me to assume that a one-click export method that wasn't concerned with the other details that would always output to the same files would be most convenient.

    If I'm totally wrong, and you just need the material slot naming convention, I can just remove the tab.

    You are indeed correct in that:

    1. certain users will want to iteratively change material parameters / poses and repeatedly export the Daz scene to Blender
    2. it would make sense to make the exported filename and the path always the same for each export. (and if a pre-existing file exists, overwrite it)

    In addition, to best accommodate this use case where a user wants to use 'Blender as a render engine',

    I believe that the followings should be minimised in the Daz Alembic Exporter:

    • button clicks required, ideally to one.
    • manual configurations required, ideally non visible because they are all automated and always works without needing manual intervention

    To best achieve this, I was thinking of the following:

    • A button under File menu:
      • image
      • This will save the current .duf file and export using the following settings
        • Current SubD level
        • Object#Surface material naming
        • Exported filepath is preset everytime:
          • e.g. {current duf directory}/{current duf file name i.e. "v8_test" for "v8_test.duf"}/{current duf file name i.e. "v8_test" for "v8_test.duf"}.abc
        • Everything else is using default setting in the current exporter dialog
        • If the current scene is not saved as a .duf file, file dialog will pop up asking to save the current scene as a .duf file.
      • Set a default key binding for this button.
        • e.g. Ctrl+E+A
    • When the export is triggered:
      • a config file is generated in the same directory as the .abc file.
        • this config file contains the path to the .duf file.
          • this info is used by Z-Cycles when importing an alembic file to find the .duf file path.

    Would like to know whether you are interested in satisfying this use case and what you think about this proposal if you are interested.

    Otherwise, I was looking at implementing this myself once you open source your exporter.

     

     

    alembic export button.png
    519 x 486 - 69K
    Post edited by JClave on
  • marble said:

    Here's a couple of other views that might show what I mean better ...

    @marble All of those pics look like the Diffeo model superimposed on the Alembic one.

  • marblemarble Posts: 7,500
    marble said:

    Here's a couple of other views that might show what I mean better ...

    @marble All of those pics look like the Diffeo model superimposed on the Alembic one.

    But that time I did not export the diffeo model. I'll try it again now just to confirm that.

    BTW, I'm in New Zealand so it is 8:45 AM here. We have just started a temporary lockdown again so I'll have a bit more time to play today.

  • marble said:
    So I downloaded 1.12 and tried it with the Object#Surface option checked along with Write Texture Maps. However, I'm back to the white figure in my viewport again. Am I misunderstanding - when you say I can use Object#Surface do you mean only after I have been through the Diffeo import first?

    @marble

    You only need to select Write Texture Maps if you want the raw maps that Daz is using, to create your own node setup. You probably don't need these.

    But the material slots only refer to anything if there is a material with the same name, either because you imported them via Diffeo, or if you ran the rename script, packed them into the blend file, saved the blend file, and re-imported Alembic with the Object#Surface method. Otherwise, those slot names, whether you renamed them or not, refer to materials that do not exist. You either have to have imported them, or saved/reloaded them.

  • marblemarble Posts: 7,500

    Just had a thought - my character has geografts with shells - would that create the second mesh?

  • marblemarble Posts: 7,500
    edited August 2020
    marble said:
    So I downloaded 1.12 and tried it with the Object#Surface option checked along with Write Texture Maps. However, I'm back to the white figure in my viewport again. Am I misunderstanding - when you say I can use Object#Surface do you mean only after I have been through the Diffeo import first?

    @marble

    You only need to select Write Texture Maps if you want the raw maps that Daz is using, to create your own node setup. You probably don't need these.

    But the material slots only refer to anything if there is a material with the same name, either because you imported them via Diffeo, or if you ran the rename script, packed them into the blend file, saved the blend file, and re-imported Alembic with the Object#Surface method. Otherwise, those slot names, whether you renamed them or not, refer to materials that do not exist. You either have to have imported them, or saved/reloaded them.

    OK - I thought that might be the problem. So I need to import the character using the DAZ Importer first, then save those textures somewhere (I don't yet know how to do this), then start over and import the character again using your Alembic exporter? Do I have the gist of it?

    Post edited by marble on
  • TheMysteryIsThePointTheMysteryIsThePoint Posts: 2,946
    edited August 2020
    Padone said:
    issue 2 diffeo materials. I exported a simple G8F animation. As for the diffeo material option there are some frames where the textures are scrambled. While other frames work fine. Now this is odd since the materials should be the same for all the frames. That is, daz studio doesn't support animated materials so I guess the alembic exporter doesn't save different materials for every frame.

    @Padone

    Thank you for the test scene. I'll investigate this as well. I too am a little confused because the materials are of course the same for every frame.

    Post edited by TheMysteryIsThePoint on
  • JClave said:

    @JClave Ha ha maybe it's me that needs to better understand your requirements. You made it sound like you foresaw an iteritive process of perfecting the materials. This led me to assume that a one-click export method that wasn't concerned with the other details that would always output to the same files would be most convenient.

    If I'm totally wrong, and you just need the material slot naming convention, I can just remove the tab.

    You are indeed correct in that:

    1. certain users will want to iteratively change material parameters / poses and repeatedly export the Daz scene to Blender
    2. it would make sense to make the exported filename and the path always the same for each export. (and if a pre-existing file exists, overwrite it)

    In addition, to best accommodate this use case where a user wants to use 'Blender as a render engine',

    I believe that the followings should be minimised in the Daz Alembic Exporter:

    • button clicks required, ideally to one.
    • manual configurations required, ideally non visible because they are all automated and always works without needing manual intervention

    To best achieve this, I was thinking of the following:

    • A button under File menu:
      • image
      • This will save the current .duf file and export using the following settings
        • Current SubD level
        • Object#Surface material naming
        • Exported filepath is preset everytime:
          • e.g. {current duf directory}/{current duf file name i.e. "v8_test" for "v8_test.duf"}/{current duf file name i.e. "v8_test" for "v8_test.duf"}.abc
        • Everything else is using default setting in the current exporter dialog
        • If the current scene is not saved as a .duf file, file dialog will pop up asking to save the current scene as a .duf file.
      • Set a default key binding for this button.
        • e.g. Ctrl+E+A
    • When the export is triggered:
      • a config file is generated in the same directory as the .abc file.
        • this config file contains the path to the .duf file.
          • this info is used by Z-Cycles when importing an alembic file to find the .duf file path.

    Would like to know whether you are interested in satisfying this use case and what you think about this proposal if you are interested.

    Otherwise, I was looking at implementing this myself once you open source your exporter.

     

     

    @JClave

    I may have to leave that one to you, with me as a resource. I think @Padone's bug is going to be an interesting one. I just need to get to a stable version before I can deal with more hands in the code, I'm sure you understand. It should not be long.

  • marblemarble Posts: 7,500

    OK - I seem to be getting an idea of what is happening with the duplicate mesh problem. When I have a character with a geograft (in this case the Meipe GP graft) I end up with two full figures in Blender. If I separate them and click on one I can see the character is selected in the Outliner. If I click on the other, I see the geograft shell is selected.

    I still have not figured out why sometimes I get a SubD model plus a Base resolution model and another time I get 2xSubd models.

    Here's a screenshot to illustrate ...

     

    Blender Duplicate.jpg
    2560 x 1390 - 945K
  • marblemarble Posts: 7,500
    edited August 2020

    I think that Diffeo has an option to merge the grafts to get around that problem.

    Post edited by marble on
  • marble said:

    I think that Diffeo has an option to merge the grafts to get around that problem.

    @marble

    You can click on the material surfaces in Blender to find out what surfaces to ignore in the Alembic export.

  • marblemarble Posts: 7,500
    marble said:

    I think that Diffeo has an option to merge the grafts to get around that problem.

    @marble

    You can click on the material surfaces in Blender to find out what surfaces to ignore in the Alembic export.

    Well, I've just spent an hour trying different combinations of ignoring, hiding, Subd levels, etc., etc., and I'm still getting multiple meshes with geografts and that's before I attempt to figure out how to get materials into Blender. I think I'm just going to have to give up on Blender for now - it has me totally confused, whether I try Alembic or Diffeomorphic. 

  • PadonePadone Posts: 3,688
    edited August 2020

    @marble As I understand it @TheMysteryIsThePoint didn't deal with shells and grafts yet, so some issues are expected there. The low-poly cage you see is probably the shell. Then diffeo doesn't import the shell geometry and implements it as an extra material layer. This is an optimization for animation but may cause issues with alembic, I mean if not handled correctly.

     

    p.s. As for the alembic workflow it's just import the diffeo scene then import the alembic animation then delete the diffeo scene. You don't need to export textures unless you have special needs, the daz textures will be used.

    Post edited by Padone on
  • marblemarble Posts: 7,500
    Padone said:

    @marble As I understand it @TheMysteryIsThePoint didn't deal with shells and grafts yet, so some issues are expected there. The low-poly cage you see is probably the shell. Then diffeo doesn't import the shell geometry and implements it as an extra material layer. This is an optimization for animation but may cause issues with alembic, I mean if not handled correctly.

     

    p.s. As for the alembic workflow it's just import the diffeo scene then import the alembic animation then delete the diffeo scene. You don't need to export textures unless you have special needs, the daz textures will be used.

    Thanks for the explanation. My confusion arises from the fact that I don't really get the whole shell vs material vs mesh thing so I'm at a loss to understand why I see multiple figures superimposed on each other when they come into Blender. Right now I'm having another stab at understanding the various intricacies of Diffeomorphic. There are options there that I don't get either - such as when to select BSDF or Principled and what difference it may make. Plus I have problems posing the figure because of the lag in moving a bone that I don't have in DAZ Studio. Oh, just so many things I need to get a handle on.

  • PadonePadone Posts: 3,688
    edited August 2020

    @marble For an easy workflow just use the diffeo default values if you don't know what they mean. But I'd advice you to get at least the basics of the blender nodes. As for the viewport lag you can use the simplify panel in blender, that's similar to the scene optimizer addon in daz studio as for features.

    simplify.jpg
    305 x 279 - 19K
    Post edited by Padone on
  • marblemarble Posts: 7,500
    Padone said:

    @marble For an easy workflow just use the diffeo default values if you don't know what they mean. But I'd advice you to get at least the basics of the blender nodes. As for the viewport lag you can use the simplify panel in blender, that's similar to the scene optimizer addon in daz studio as for features.

    Doh, now that you show me that I realise I've been told that before. Old age can be annoying.

    As for the node system - I keep plugging away at YouTube videos and I get the whole concept but it will take practice. I'm more comfortable with the Pricipled node because it looks more like the IRay surfaces tab in DAZ Studio and I can fiddle with sliders. I'm also understanding how things like bump and Normal map nodes link in but don't mention math nodes or I'll run away shaking my head. ;)

  • PadonePadone Posts: 3,688
    edited August 2020

    @marble Well then the bsdf option means the plugin will use bsdf nodes and the principled option means the plugin will use the principled node. Same for sss that will use the sss node vs volumetric that will use the volume nodes. Then automaterial will override the user choice when necessary to get the iray properties.

    Right now Thomas is working on a new nodes setup to join cycles and eevee (that I don't like too much). So be sure to get the latest version with bug fixes.

    https://bitbucket.org/Diffeomorphic/import_daz/issues/154/material-issues

    import.jpg
    241 x 403 - 26K
    Post edited by Padone on
  • marblemarble Posts: 7,500

    Is there a way to get the HD version over yet or are we back to baking normals?

Sign In or Register to comment.