Add new import morph option for HD morph (generate VDM by dhdm file with Xin add on)

Issue #388 closed
engetudouiti created an issue

Xin offer really powerful tool to manage HD morph files in topic #357😃

It offer many option (import as real shape key, import as normal map (bake), import as Vector displacement map (not bake but generate vdm which convert morph vector as RGB) I do not know, which option Thomas will plan to add for daz importer. (Daz importer, already offer many option to import daz items with smart rig + really enhanced driver system + materials etc etc)

Anyway I could confirm, with test Xin offered add on , import HD morph as VDM already stable for me and it work well .Then I may request new DAZ importer option (import HD morph as VDM (hd.dhdm) + shape key (hd.dsf)) when import morphs.

About this case, we do not need to use daz importer “HD option”. we only need to import as base. (import as base resolution only) + sub-D modifier. then add new Vector displacement map Node for all material with auto-change setting when we use the option to import HD morph.

Xin HD importer, already show best setting value when generate VDM and correct VDM node scale value. as console output,

So if Thomas plan to use Xin HD exporter generate VDM as add on import HD morph option, I think it is not so difficult. Xin know how it work clear so I hope Thomas may test Xin HD exporter , and import some HD morph as VDM then set up- node. then hope talk how it can be included in daz importer.. (so it depend yours decision)

At current after generate VDM by Xin importer, we need to add VDM node for all material, which used for HD morph, then adjust render setting , adjust material setting for geometry from “bump” to “displacement, or bump and displacement”. etc,, so if it is included as Daz importer, import HD morph option,, it make user easy pray HD morph (as cycles vector displacement map, with adaptive sub-D)

1st step maybe (only about VDM),

add new option which import HD morph as vector displacement. (Like creature HD morph).

about this case,, imported mesh by Daz importer as base already include the HD.dsf delta. so add on only need to generate VDM of the HD.dhdm .which path described in HD.dsf file. ( should not import the hd.dsf as new shape key) then generate VDM nodes (add to current material node for cycles) with auto-set VDM node properties. (you can make new custom node as same as usuall displacement node, And all displacement node out put are vector from midpoint, so you can easy add it if there are already usuall displacement map is used for the map.

Anyway I really hope Thomas test Xin add on, and generate VDM for Full body HD, and may talk with Xin and plan what you can do with it,)

what I really like the way (use Xin HD add on generate VDM to get dhdm delta) with use Daz importer.

  1. it can keep base as same as before (non destructive)
  2. VDM (texture) can represent daz HD almost perfectly, without use multrresolution. (and it need not to bake so generate VDM fast (less than 10 second for all UV tile I felt)
  3. Daz importer already offer option to import HD.dsf as shape key, UI controller, with driver. then only need to add VDM node for blender.(and set driver when it need)
  4. VDM node can set driver, and the driver function should be same as dsf (when it need to be driven) . and I can easy imagine how mix when there are multi VDM, to represent daz mix HD morph (if it need)
  5. VDM may only effect peformance when we real render, (I may expect there will be switch which temporally hide VDM node as OFF, and change material setting as bump only, when we pose etc, so user only set them ON when we need to render or check it )

Comments (15)

  1. Alessandro Padovani

    To be fair we need to test HD geografts and jcms yet, since Xin doesn’t provide any driver for the maps so far. But I agree this is revolutionary and a nice alternative to multires. Or, as for HD face expressions, it could also be used together with multires.

  2. engetudouiti reporter

    About geograft, I do not think there will be issue, the VDM might cause problem.

    Because each HD morph file are data of each mesh. then when we import mesh , untill merge, the base are same as daz.

    Then we can get delta VDM for body mesh and gfaft item mesh.

    After all we may merge mesh, but material group remain,(only remove doubled mesh part, ) as same as other map. so if VDM cause issue, same issue should happen for all material when we merge. but add on already manage it.

    About jcms driver, It need to be offered by Thomas add on side. and I almost confrim , it can easy achieved by use VDM node property.

    I happend to offer usual displacement custom node ,wittch can input strength as same as daz way in another topic, then if Thomas may plan to add VDM node, at same time I may recommend to separate strength node (min to max) from node groups, the value will be multipled with the VDM scale, (I may offer VDM custom node groups, which user can easy work (only show input props which we need to change)

    so actually it means we get strength property (we see as shape key value for morphs) which can be driven or user can easy input directly (if not driven)

    And the driver setting funciton should be same as hd.dsf (shape key and controller, which driven by bone rotation etc,)

    When we import morphs, add on generate hd.dsf as same as other morph, and it may come with driver when they need.. so if we clear divide,, VDM nodes groups as DHDM shape keys (converted as shader) in each material,

    we only need to use the custom VDM node “strength” which represent the dhdm, as same as the dsf morph driver property value. (or shape key value) . (only thing we need to care,, so it need to set driver for all material strength which represent same DHDM (but separaed by UV tile)

    But even though we may need to generate 8 or 10 VDM which represent all dhdm file, for each mat,, set driver seems not matter. (I can not confirm pefromance though,

    And I do not think I need to compare with other option,, I simply easy import Full morph first. or only mouth HD (because the morph dsf are already generated, so I may only add one or 2 VDM then set driver as same as the dsf controller and shape key. so I just request it.

    But even though Thomas not try VDM but choose other options Xin offer, I do not complain at all… I just hope Thomas anyway test it, and as for me, generate vdm from dhdm is real matter.

    (and Xin now try to make it work with sculpt mesh in blender,, it is amazing for me.. so I do not need to buy zbrush only to generate VDM any more^^;)

  3. engetudouiti reporter

    And at current Xin HD improter need to use dhdm, but if his current try work (just bake from selected mesh, or obj), even though when we see issue, for merged mesh with the way,

    we may directly generate the morphed (HD) delta (not include dsf defomation), from high-reso (in daz studio) to meged base, I suppose (if Xin current plan will work, (scuplted mesh >> to base mesh) in blender.

    Recently I only use, Thomas importer, so do not clear remember, I could import daz grafted mesh as merged one, (which already remove duplicated mesh) by obj, but at least export as FBX with grafted item, the mesh seems merged already. (without duplicated mesh)

    so we may import base FBX, (in daz merge graft item arleady), and import high-reso with real HD morph as FBX, can generate dhdm VDM I suppose. once generate VDM we can use it without problem for daz importer merged mesh. (it not shape key,just texture, so it work, without UV corrupted for some reason)

    Then I may plan to test graft item, but I do not have HD item actually .. so it may need to test by other user,, (I hope the user clear understand how to use etc,, ) to test easy those many things, (driver work? or quarity? or merged mesh work?) I hope, Thomas anyway add VDM shader node group, when we import dhdm as morph, for necessary materials.

    even though there were general displacement map node, it easy added ,, then we can seriously set driver or test merged case I think. at current generate node for all material actually easy cause user side miss with compare UV tile I actually think so.

  4. Thomas Larsson repo owner

    Now I have tested Xin’s add-on and I understand why your are excited. However, it will take some time before my plugin can use it, because the code that loads morphs needs to be rewritten. It really only works for morphs that are either pure face rig poses or pure shapekeys, but not for mixed cases. This has not been an issue before, but the FACS morphs depend heavily on both kinds, as was reported in #389. What has been ignored is that the ordinary expressions also depend on shapekeys; when the ectrl file is imported, the corresponding ejcm shapekey should be loaded automatically. Loading the textures created by Xin’s addon only makes sense once this is fixed.

    However, rewriting the morph loader will take time, and I want to make a stable release 1.5.1 first, so people have something to fall back on.

  5. engetudouiti reporter

    What I planned,,,

    VDM strength = the dhdm dsf shape key value. so only problem is how you set driver for HD morph (dsf only) is not it?

    VDM dhdm may not include any driver.. so it just follow value of the same name.dsf.

    So I supposed (Just expected) you already set driver import XXXHDJCM.dsf as same as other JCM.dsf..

    then we only need to add driver for the VDM node strength (the function is,, simply use the shape key value of dsf. or controller value (if you generate HD.dsf controller)…

    (I am not clever enough if I miss something, so I should say wrong. )

  6. engetudouiti reporter

    And I see,, yes so I reported but stop about FACS morph any more ^^; main reason is I am not G8.1 user, then I undersatnd when add on can not generate driver as same as daz, but I can not find way to perfectly solve issue. (include daz way to save driver function, in controller (driver target ) file and sub-component (driven file) file.

    And I already said,, I may think, only way is actualy generate all custom prop with (row and final). but I know it drastically change current morph way, so I can not request it.

    And I may suppose, if you generate all controller prop (even though it is pure JCM), I think it may help to set driver. (as same as daz offer cotroller for JCM MCM too, though we have shape key in blender, but it maybetter to set driver for custom prop , then shape key driver value only driven by the name custom prop value (hidden controller)

    (if we clear catch, all ERC formula, then we just need to set driver function one by one, but it not work for new morph, or you have not checked, I know)

    But those things may better to talk as far future request. (then as real, I do not expect it work well for JCM or MCM , after all it cause heavy performance issue, and I do not know, blender can manage such many png files (though we can generate node and set driver, ) it seems same for me, I do not believe, we can import all JCM with driver as high resolution mesh. (so after all I do not seriously count it work for JCM and I may not plan to use it for JCM (VDM and high reso shape keys)

  7. engetudouiti reporter

    Xin if I miss-understand correct it anytime please.

    I feel, as quarity, use new option (directly generate vdm from high-reso sculpted mesh to non sculpt mesh (base) + subD modifier. seems work better, than import dhdm.

    Is not it?

    What I plan to test is,,

    1. set sub-D as user need, then import it as high-reso mesh (source mesh) by Thomas importer.
    2. set sub-D as same as 1, in daz studio, then set HD morph which I need to generate VDM then import the mesh as sculpted mesh by Thomas importer. (without multi-resolution option)
    3. in blender set source mesh as source mesh(1) set VDM target mesh as scuplted mesh(2) , it should have UV and keep same vertex order. then we can generate VDM.
    4. import base without HD morph, then set the VDM(generate by 3), for the base mesh. + sub-D modifier. (or use adaptive sub-D).

    The VDM may include hd.dsf morph but, I suppose the final quarity with sub-D , it may get more better result than import ad dhdm.

    about this case, we do not need to import HD.dsf as morph any-more. (so all HD morph (hd. dsf + hd.dhdm) may represent as VDM only.

    I feel, when I use the new option (not use dhdm), generate VDM take more time usually, but the quarity is really reliable. with small scale delta too. easy generate VDM, use dhdm convert is good. but to get VDM more precisely, the procedure (directly import as high-reso mesh >sculoted and non sculpted ,then generate VDM may offer more quarity I feel.

  8. Xin

    The subdivision performed by the dll matches perfectly the one performed by daz, and also the one performed by Blender’s subsurf with limit surface turned off (in terms of coordinates, they are different in terms of vertex order).

    So I don’t think there should be any difference between the two operators, as long as you use subsurf with limit surface off on the displaced mesh.

  9. engetudouiti reporter

    I see thanks Xin confrim it . Actually to generate with real 2 mesh, took more time to prepare. (I set sub-D 3 in DS, and it need to import twice,, with my cpu, untill import 2 meshes, I took 4 minutes more.

    Maybe the reason I felt quarity difference, I could compare real mesh in blender, with generate VDM by use 2 mesh.. as you said, dll may do same thing without import mesh. And yes, the sub-D setting limit OFF surface is important.

    And I usually use adaptive sub-D, then I found, it only work with limit surface ON sub-D. (when I set OFF, usually adaptive sub-D option disappear for me) your new option offer to select limit surface On and Off. so it seems show difference when I use adaptive sub-D. If you can add limit surface ON option for adaptive sub-D, really welcom, (generate VDM with dhdm file directly)

  10. Xin

    I will see if subdividing to limit surface in the dll can be done the same way as in Blender. It might be possible.

  11. engetudouiti reporter

    My current thinking , how drive VDM shape keys,,(if it really need)

    1, generate VDMs for each dhdm file.

    2. generate custom VDM nodes, connect with VDM, dhdm)

    one HD shape key will be represented by one VDM nodes for each UV tile.

    3. , VDM nodes outpout vector multiple with “Value” (represent shape key fin value) by use vector math node. (or can use color mix? I usually use vector math node)

    then driver expression will be added for the “value”

    (not try to drive RGB color, not drive the scale value in VDM node) so we can keep the best setting of scale and mid value. for each tangent VDM. without complex circulation, I suppose)

  12. engetudouiti reporter

    Then about driver expresison of those node, I suppose, actually should be simple.

    because when we generate dhdm VDM,, user will mport HD.dsf then generate controller with real shape key.

    so each VDM node value only need to be driven by HD.dsf property(fin) value. That means, user may controll VDM strength, by HD.dsf controller. (you may divide raw and fin as same as other shape key morphs I suppose)

    Only thing I may request Thomas, consider case, when HD.dsf is already baked as FBM or PBM. about this case,we do not import HD.dsf again.But I may hope VDM node (dhdm delta node shape key) value, will be controlled by UI controller easy…

    Acutally I plan to request , FBM, PBM case first… (so not plan to make complex driver as same as JCM or expression HD , at all ^^; but you seems plan to use VDM for JCM, MCM, first,, )

  13. engetudouiti reporter

    And your commit memo “how to comblie multipe maps”,

    I do not think blender offer, math node, which can input many vector and get sum as output vector, if I only use vector math node (add) , it may becom really huge. (though we can hide it as group).

    do you plan to make new custom vector math node, which can get sum of vectors from many input vector by python first?

    https://blender.stackexchange.com/questions/67487/cycles-materials-math-node-with-more-than-two-inputs/99003#99003

  14. Log in to comment