Hope to Add prefix for user custom morph ID.

Issue #84 resolved
engetudouiti created an issue

Hi I plan to exort all morph value, as json like daz shape (or pose) preset file, then import when we need.

Before I did not find good way, to get only about daz propertys which used for current armature (obj)

by use pre-fix of each morphs.

But now I learn how to use getattr, with use prefix which Thomas already add for each morphs,

“DzU” “DzE”and “DzV” so I almost sure , we can get each Dz morph values of current rig. (object)

and export those as json, as tuple or dictionary. (Json formatted) Then may import when we hope to change quick. (like daz shape preset)

One thing I still not find way is, custom morph which user improted. there is no special prefix. then could

you add “DzC” for custom morphs ID, as same as other morphs? I suppose it may not break anything.

labell is not need to add prefix (as same as other porps)

Comments (6)

  1. engetudouiti reporter

    What I plan is, if I get all plug in morphs,
    for prop in actor.keys():
    if prop[:2] == "Dz":
    print((prop + ","), actor[prop])

    (then they will be generated in console like this)

    #~ DzUBrowInnerUp-Down, 0.0
    #~ DzUBrowInnerUp-DownL, 0.0
    #~ DzUBrowInnerUp-DownR, 0.0
    #~ DzUBrowOuterUp-Down, 0.0
    #~ DzUBrowOuterUp-DownL, 0.0
    #~ DzUBrowOuterUp-DownR, 0.0
    ….….
    #~ DzVM, 0.0
    #~ DzVOW, 0.0
    #~ DzVS, 0.0
    #~ DzVSH, 0.0
    #~ DzVT, 0.0
    #~ DzVTH, 0.0
    #~ DzVUW, 0.0
    #~ DzVW, 0.0

    So If custom morph use Prefilx DzC, we can generate Custom morphs value too.

    after all, I may export as [id, value] as preset json, then plan to import and apply them, with select Actor rig. at current there is no way to check each custom morphs was generated (and used) by this add on.

  2. engetudouiti reporter

    So I could find “prefix” property,

    in” morphing.py” Line 691

    class DAZ_OT_ImportCustomMorphs():

    then set it as “Dz_”

    it worked for my purpose, (access all rig props value for morphs , which include “Dz” as prefix)

    of course it means, I change shape key name, and prop key. but it changed labell of each custom morph controller too.

    (I remember someone requested it before, then you remove prefix from labell)

    I understand, about custom prop, you need to make class to draw separately, (which change category etc)

    but I could not find which function may change only about labell (just remove prefix) of the rig[“prop”]

    Eg Expresssion controller, I see labell without prefix, DzE. (but shape key name were added “DzE” and data rprop name too)

    eg when I import “angry”, shape key, and prop keys change, but labell keep as “angry” user not see prefix, from UI.

    I hope to do samething for custom morph , so please teach me where I need to edit .

  3. engetudouiti reporter

    OK I could find where I need to edit. to set labell in daz.py

    class AZ_PT_CustomMorphs(bpy.types.Panel):

    draw ()

    row.prop(rig, '["%s"]' % morph.prop, text=morph.name[3:])

    now it seems worked for me.. (Finally I could add custom props to save and load morph value presets,,)

    Then do not you like adding prefix for custom morphs, as same as other morphs, “DzU, DzE, DzV, DzC,, ?

    I just hope you add “Dz*” (the third letter is what you prefer for custom morphs, At current I set as “Dz_” of course you decide it as you like,,I follow it)

    (at current I set it as “Dz_” for custom morphs)

    Though I do not know if you need not , but I suppose it may useful when you up-date something about custom morphs, to easy access.

    (check mark option is really powerful but, I still do not know clear how use it for each rig[key], only about props which check mark true. from by bpy, I now consider, to use the checkmark to save and load preset,,(only save and load about the prop (ON)

  4. Thomas Larsson repo owner

    In the last commit custom morphs have the prefix DzM. Hope this will work for you.

  5. engetudouiti reporter

    Amazing!! thanks, it should work.

    (I really hope Thomas add on will offer preset library, (for material, morphs )

    maybe next year?? I hope to use activate check to enhance for simple morph preset system,

    but I believe you can use it more smart.

    we can not expect, blender 2.83 offer blender library.

    so I hope if we can add preset system, for DAZ importer (edit in blender then save each preset, load them when we need) ^^b

  6. Log in to comment