Import correctivenes after merge geografts errors out

Issue #45 closed
Noname created an issue

Hello,

After merge geografts morphs → import correctives no longer works.

Step to reproduce:

  • import mesh with json
  • select G3|G8 character
  • import correctives works
  • select geograft and mesh
  • merge geografts
  • select main mesh morphs → import correctives errors out

Error:

Can not add morphs to this mesh.

I don’t know if this is really a bug as probably main mesh at this point is already modified.

Reason why I think it’s bug is that when I do import correctives before merge geografts I can still use those correctives morphs.

Best regards.

Comments (7)

  1. Zack Johnson

    Hi, I may be misunderstanding but are you trying to use Import Correctives after merging geografts?

    I think the preferred process is:

    • Import correctives to body mesh (before merging geografts)
    • Select the geograft mesh(es), then select the body mesh last
    • Use “transfer correctives”

    This transfers the corrective morphs from the body mesh to all geografts. Afterwards, you can merge the geografts. Once you merge the geografts, I don’t think the importer is able to import any more morphs. I believe you have to import morphs to each mesh in isolation.

    This might be a good place to bring up another issue, though - I have noticed the corrective morph shapekeys are no longer driven. I believe they used to be driven by the rig at some point, but now the shapekey values aren’t purple, meaning they aren’t being driven by anything, which kind of makes them useless. Here is a screenshot showing the corrective morph shapekeys vs. the Face Units shapekeys (which are driven):

  2. Noname reporter

    Indeed.

    When I do have separate meshes I can import morphs to them, and this apply to every morph not only correctives ones (if I understand this correctly).

    I think root of issue is that those morphs reference by vertex id ? If that’s the case then I think it could be possible to i.e. create vertex id map and store it as custom attribute so later on, after import and blend save, we could still import morphs.

    Right now it’s a little bit tedious workflow, saying that I must say that this plug-in is AMAZING !!!

    Great job !!!

  3. Thomas Larsson repo owner

    Zack, thank you for pointing out that the drivers were missing. Should work now.

    Noname, shapekey morphs rely on vertex numbers, so if those change it is not possible to load new morphs. If you delete vertices shapekeys will still work for the remaining vertices, but not for new vertices if you add some. This is just how shapekeys work in Blender.

    One could store associations between new and original vertices as a property list, but there are some problems with that. It will make the mesh considerably heavier, so you would want to empty the list once you decide you don’t need it. Also, it will not work anyway if you edit the mesh by hand, and not through buttons that know about the associations.

  4. Ben ny

    Can’t vertex groups or face maps (as they aren’t used much) be used to keep track of what was what?! (not sure if either of those qualify or if they raise unsolvable problems with vertex order)

    Say each mesh gets a facemap with all faces assigned on import, when merging two objects the merged mesh would have both face maps which could be selected on import of morphs. That way the morph could get remapped to the correct vertices

    Currently its a little bit frustrating to have redo all the work just to get a new morph on a character.

  5. Thomas Larsson repo owner

    Vertex groups are floats between 0.0 and 1.0, so they are not suitable. Face maps I don’t know since I haven’t heard of them before. But keeping track of the mapping is not really the problem, it can be done with a custom collection property of ints. The big problem is what happens if you switch to edit mode and change the mesh by hand. Then the mapping will not be updated, and the next time you load a morph it will be off.

    However, there is a trick that you can use to load morphs after the mesh has changed. I just recalled that I wrote about it some time ago:

    http://diffeomorphic.blogspot.com/2019/02/loading-morphs-after-anatomy-has-been.html

  6. Noname reporter

    As stated in other issue (resoled now) there is a way to store additional data that is not saved with blend file. Setting data to blender window as property seams to be the key and root of trick.

    So after re-opening blender data is gone, but for initial import this would be suitable.

    Also using mesh property probably (???) would work. Basically base mesh for G3 has:

    Genesis 3: 17418 vertices, 17000 polygons, 17 material groups, 173 bones

    Genesis 8 has around 16k verts (yes less then G3F).

    So adding verts ids map would double that and it could be added as additional mesh property so after morph import is done etc. that data could be purged (either by script button or user - in thsi case script would have to check if there is that map still present).

    Just throwing some ideas.

    Also what about better warning widgets ? For example when importing multiple morphs script will silently fail and not load all of them, would it be possible to add “summary” popup with information if any error occure ?

  7. Thomas Larsson repo owner

    The big problem with keeping a map of vertex numbers is that it will go out of sync if the user manually change vertices. This will lead to strange behavior and bug reports sooner or later.

  8. Log in to comment