Announcement

Collapse
No announcement yet.

Morph baking tool

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

    [WIP] Morph baking tool


    Morph Tools Plugin - WIP

    Current Feature List Overview:
    1. Morph Baking in Editor
      • Via a custom asset and morph editor
    2. Morph Baking at Runtime
    3. Combine multiple morphs into a single morph (Editor Only)
    4. Copy morphs from one mesh to another. (Editor Only)
    5. Export morph target presets and set them at run-time with handy blueprint functions.

    Feature 1: Morph Baking in Editor







    What do i mean by bake? I mean permanently apply the deformation of the morph target the the mesh data, and optionally remove the morph target entirely.


    Why would I want to do this?






    The characters in my game have a lot of "set and forget" morph targets, e.g nose size, body size, or other things that don't change over time. Since morph targets can cause performance drops if you have a ton (which i did), I made this system to lighten the load. My test character (exported from daz) has roughly 2000 morph targets and consumed tons of memory. With this system i can set the morph targets once on load and then immediately bake them and remove them from the mesh entirely. Cutting down the mesh size by hundreds of MB. This is an extreme scenario.


    In Editor Morph Baking Overview



    Once the plugin is installed, you can create a new "Morph tools Asset" by right clicking anywhere in the content browser, or by right clicking any skeletal mesh.


    creating a new asset








    Once created you can pick a default skeletal mesh to start working on, and then you can open up the asset and you will be presented with the Morph Tools Editor.

    The Main View


    Once opened, there are 4 Panels in the Editor. You will generally want to un-dock these and make them full screen in order for them to display properly.
    1. Copy Panel (see morph copying section)
    2. Meshes Panel
    3. Bake Panel
    4. Morphs Panel
    Morphs Panel



    The Morphs Panel

    The morphs panel is where you set the values of the morphs before you bake them. You can see the effect in the morph tools viewport window.

    Bake Terms:

    bake: Bake the deform of the morph into the mesh at the current weight
    remove: Remove the morph from the mesh after baking
    blacklist: do absolutely nothing to this morph.

    Once you have everything set the way you like it, you can either save the asset to finish settings the morphs later, or click the "Bake Morphs" button the in the bottom of the Baking Panel (see bake panel section). The baking process does not effect the original mesh, it creates a new version in the output directory you specify.

    You can also export the current morph settings as a preset and import them into another Morph Tools Asset so you have a base to start from rather than starting fresh each time.

    Feature 2: Morph Baking at Runtime



    Most important for me was runtime Morph baking. My test character meshes have over 2000 possible morphs, and i needed the ability to customize characters at runtime via a character generator.

    For runtime baking, simply set the morphs you want on your character via Set Morph Target, then call this blueprint node. It can also be called via c++.

    The example project shows a simple scenario where you can see how I set it up.




    The Bake Morphs function takes in a SkeletalMeshComponent with morphs applied to it, and uses the bake settings array passed to it to determine which morphs to bake and remove, and which morphs to ignore. If bake settings is empty it will bake and remove ALL morphs.

    For an more complete example of how to bake them at runtime, see the example project.

    Feature 3 & 4: Morph Copying and Morph Combining

    Morph copying and combining is handled from the "Copy Morphs" Panel:

    Copying:
    Morph copying from one mesh to another is accomplished by creating a proximity map that maps the vertices on the "target" mesh, to the closest vertices on the "source" mesh. A proximity map asset is created when you click the copy morphs button, and can be reused instead of creating a new one if you need to run the same operation again. The proximity map is generated using a k-d tree, and the closest vertices are found using the k-nearest-neighbors algorithm.
    https://en.wikipedia.org/wiki/K-near...bors_algorithm

    The target mesh is whatever mesh you currently have selected in the morphs panel. You pick the source mesh using the first button under "setup".

    Morph copying and combining is currently editor only.

    For a deeper explanation of all the controls on the copy panel, see the video.

    Example Project




    The example project contains a very basic example of how you might want to set up your morph presets and characters. Its very simplified and you will likely want to come up with some more sophisticated for your game. I will go over the sample project in the video.
    Attached Files
    creating a new asset The Main View The Morphs Panel
    Last edited by kostenickj; 05-18-2019, 10:55 AM.
    Morph Tools Plugin

    #2
    I would pick this up

    Comment


      #3
      It is interesting and it would be even more if that could work somehow in runtime and just not in the editor.
      Nilson Lima
      Technical Director @ Rigel Studios Ltda - twitter: @RigelStudios
      Join us at Discord: https://discord.gg/uFFSEXY

      UE4 Marketplace: Cloudscape Seasons
      supporting: Community FREE Ocean plugin

      Comment


        #4
        When is this going to be released on the marketplace? And what about the price ?

        Comment


          #5
          This sounds like a really nice plugin to increase performance (especially if you can bake morphs at runtime). Any updates on this?
          [WIP] Procedural City Generator
          [MARKETPLACE] Animal Behavior Kit | Space Shooter Template | Procedural Foliage Tool | Procedural Park
          [FREE] Modular Road Tool | Action Platformer Template | Radar BP | Free Birds
          Join our Discord

          Comment


            #6
            You should make this . I 'll need it to enable morphs in morph target preview because, there is some bug or something.

            Comment


              #7
              Originally posted by CoquiGames View Post
              This sounds like a really nice plugin to increase performance (especially if you can bake morphs at runtime). Any updates on this?
              Yes, i can bake morphs at runtime and in editor and it works great! Once I get everything cleaned up I will go ahead and release it as a plugin on the marketplace. I just need to make it into a proper plugin first.
              Morph Tools Plugin

              Comment


                #8
                a plugin like that would be really usefull, i'm interested

                Comment


                  #9
                  Is this still going to be released ?

                  Comment


                    #10
                    Still watching this as well.

                    Comment


                      #11
                      Originally posted by kostenickj View Post

                      Yes, i can bake morphs at runtime and in editor and it works great! Once I get everything cleaned up I will go ahead and release it as a plugin on the marketplace. I just need to make it into a proper plugin first.
                      I hope you are going to release it soon.

                      Comment


                        #12
                        I've been hoping for a tool like this for a while. Please keep me in the loop.

                        Comment


                          #13
                          Hi,
                          sorry if this is not a right place for this question, but i haven't been able to find any solution for it elsewhere.
                          i am trying to simulate cnc ( machining) process like this link: "https://www.youtube.com/watch?v=SpkdzxrRxKQ"
                          I have followed some tutorials on snow deformation and procedural mesh, but I haven't been able to create something similar to the link above (material removal).
                          i would appreciate if anyone could help me with that
                          Shayan

                          Comment


                            #14
                            Hi all,

                            recently picked this back up and finished converting it to a plugin for 4.22. It took so long because it was deeply integrated into the source code for my project, and not a separate module. I managed to fix most of the bugs (I think) and also add a new feature: Morph copying.

                            You can copy morphs from one mesh to another based on vertex proximity (editor only)! This is mainly how i manage morphs on clothing in my game, and it works well for clothing that has similar topology to the underlying mesh. If the clothing is too different, you will need to make custom morphs.

                            Current core Feature List:
                            - Morph bake in editor
                            - Morph bake in runtime
                            - Morph copying in editor

                            I will make a video demoing all the features, as well as better documentation in the near future.

                            I'm planning on releasing this soon, but first i'm looking for 1 or 2 testers to help me find bugs and make sure everything works correctly. As a tester you will get the plugin for free on release.
                            Message me if you are interested and ill package the plugin and send it to you (without source, but full source once i release the plugin officially). Im only looking for 1 or 2 testers so its first come first serve. If you only have 1 post I am probably not going to accept.

                            Thanks.
                            Morph Tools Plugin

                            Comment


                              #15
                              Keep up the hard work Kostenickj!

                              Comment

                              Working...
                              X