Adding Dual Quaternion support to UnrealEngine4 (Images inside)

17891012

Comments

  • AlienRendersAlienRenders Posts: 790
    edited March 2023

    There's a Default Deformer Graph setting in project but it doesn't seem to do anything in 5.1. Haven't checked 5.2 yet. Also, I never added a project setting for the default skinning method. If I have time, I'll check to see if this works on 5.2 and add a default setting for the skinning method.

    As for recompute tangents and normals, I think I can use the node I wanted on 5.2 where it's part of the original deformer plugin. So I can add the DQS graph for that. I'll see if I can this done as well. If you really need to use this, you can uncheck the checkbox to enable deformer, do recompute normals and turn it back on. I know it's not the best solution, but it's at least a workaround for now.

    As for morphs not working, I'm not sure why that would be. If someone can send me a test project, I'd be happy to look at it. Not sure about the jitter issue either.

    Sorry for any inconvenience on these changes.

     

    Post edited by AlienRenders on
  • AlienRendersAlienRenders Posts: 790
    edited March 2023

    I took a look at the code in 5.3 today. The defaults in the project settings look like it's a completely new API that hasn't been hooked up yet. Nothing calls the method that uses those defaults. I've only seen two places that even ask for the interface.

    The more I look at this, the more I want to put the skinning type (LS or DQS) on the graph itself. So you just set the graph and it knows what kind of skinning shoud be used. I didn't do that originally because the task seemed daunting with 5.1 looking vastly different than 5.3. But I'm now thinking I should give it a shot.

    As for the default graphs, it looks like this will be implemented at some point by a UE developer, so I'm not going to add it. However, I will try to add it on my own branch. I will make 5.1 look more like 5.3 so that the normal recomputations can work and I'll make the default deformer work.

    edit: I updated my pull request so that the SkinningFormat flag is passed in the same manner as other rendering flags. I created a DQS recompute normals graph as well. But I have no idea how you would use it in a conventional workflow. You can't use the recompute normals graph as the main graph. So you'd have to swap it and swap it back. I think this is what they were trying to solve with the project settings but never completed it.

    As for using DQS by default, it's just a couple clicks per class. I really don't see this as an issue. I don't have time right now to update the 5.1 branch. But when I do, I'll try to hook up the default grahps in the project settings. I'm still not sure what to do about the default recompute normals graph project setting. You'd need a separate setting for each class. OR a separate setting for LS and DQS, but even then, you can't override this per class. The way it is now just makes no sense to me. There should probably be a deformer graph as well as a recompute normals graph property. Then you can set defaults per class (or in project settings for those that haven't been set) and you're done.

    Post edited by AlienRenders on
  • Could someone help me out? I need someone to confirm something for me. In UE, could someone duplicate the LS deformer graph for recomputing normals? It's in the plugin contents. You can enable it in your content folder if you click on Settings at the top left of the content window and enable engine and plugin content.

    Duplicate this.

    Engine/Plugins/Deformer Graph Content/Deformers/DG_LinearBlend_Skin_Morph_Cloth_RecomputeNormals

    Open the copy. Drag a new node onto the graph for the Skinned Mesh node. Do not copy the existing one. Drag it from the Palette window.

    Now mouse over the Index Buffer pin. Does the Data Domain say Triangle x 3? Now mouse over the same pin on the pre-existing Skinned Mesh node. Does it say Triangle without x3?

    Seems to me the recompute normals graph hasn't been updated. I can't connect these nodes together in the DQS graph I'm trying to create because the types are incompatible. But on 5.3, the graph is MUCH simpler. So may have to wait for 5.3 to get something more robust.

     

     

  • McKenzieMcKenzie Posts: 8
    edited April 2023

    AlienRenders said:

    Could someone help me out? I need someone to confirm something for me. In UE, could someone duplicate the LS deformer graph for recomputing normals? It's in the plugin contents. You can enable it in your content folder if you click on Settings at the top left of the content window and enable engine and plugin content.

    Duplicate this.

    Engine/Plugins/Deformer Graph Content/Deformers/DG_LinearBlend_Skin_Morph_Cloth_RecomputeNormals

    Open the copy. Drag a new node onto the graph for the Skinned Mesh node. Do not copy the existing one. Drag it from the Palette window.

    Now mouse over the Index Buffer pin. Does the Data Domain say Triangle x 3? Now mouse over the same pin on the pre-existing Skinned Mesh node. Does it say Triangle without x3?

    Seems to me the recompute normals graph hasn't been updated. I can't connect these nodes together in the DQS graph I'm trying to create because the types are incompatible. But on 5.3, the graph is MUCH simpler. So may have to wait for 5.3 to get something more robust.

     

     

    Yeah I tried it and it just said as you described... the one dragged  from the Palette window said "Triangle x 3 (Dimensional)"
    and the pre-existing one said only "Triangle (Dimensional)"

    sorry for the late reply...I'll help as much I can within my reach
     

    Post edited by McKenzie on
  • AlienRendersAlienRenders Posts: 790
    edited April 2023

    Thanks! I appreciate it. I'll try to report the bug.

    edit: I've submitted a bug report. It's an easy fix, so maybe they'll get to it. Thing is the graph is insanely complicated on 5.1. In 5.3, they greatly simlplified it. So I think I'm going to likely skip 5.2 and jump straight ot 5.3 when it comes out. If I have some free time, I'll even add proper project default setting so you people can set it once and have DQS everywhere if they want it. And I'll run some tests on morphs as well.

    If someone can provide me a test project for morphs, I could look at it much sooner.

    Post edited by AlienRenders on
  • faseceroofaseceroo Posts: 11
    edited April 2023

    Hi, I´m trying to build 5.1 mod from source and after about 3 hs I´m getting this at the end of the log
     

    AutomationException: Attempt to add file to temp storage manifest that does not exist (C:\Users\User\Downloads\Unreal\Engine\Intermediate\Build\Win64\UnrealGame\Inc\AITestSuite\UHT\AITestSuiteClasses.h)

    Post edited by faseceroo on
  • faseceroofaseceroo Posts: 11
    edited April 2023

    Nevermind, after following this procedure it went through ^^

     

    AlienRenders said:

    I updated 5.0-mod. To build with your compiler start a x64 native tools command prompt for the VS version you want to use. If you get an error about unrealbuildtool.dll not being built, type this:

    set Platform=

    Then run GenerateProjectFiles.bat again.

    And yes, there's nothing after the equal sign.

    I haven't built this one yet. I may only have time this weekend.

     

    Post edited by faseceroo on
  • AlienRendersAlienRenders Posts: 790

    Just a warning to not use 5.2-mod. It doesn't work. My 5.1 and 5.2 builds no longer work (unrelated to DQS). I wanted to skip 5.2, but I tihnk 5.3 has the same problems. So until those things are fixed in Unreal Engine, there will be no further DQS builds.I've posted on their forums and asked on their Discord channel and no one even knows what I'm talking about. A few mods said something in the forums, but no fix. I'm going back to UE 4 for my own projects and won't be touching UE5 until the quality improves.

     

  • AlienRenders said:

    Just a warning to not use 5.2-mod. It doesn't work. My 5.1 and 5.2 builds no longer work (unrelated to DQS). I wanted to skip 5.2, but I tihnk 5.3 has the same problems. So until those things are fixed in Unreal Engine, there will be no further DQS builds.I've posted on their forums and asked on their Discord channel and no one even knows what I'm talking about. A few mods said something in the forums, but no fix. I'm going back to UE 4 for my own projects and won't be touching UE5 until the quality improves.

     

    The amount of major problems with UE5 is most likely related with the new code being slapped ontop of UE4's code. It's a mess currently.

  • AlienRendersAlienRenders Posts: 790

    An Epic staff member on the UE forums was finally able to reproduce the bug(s) I was experincing. A friend confirmed it. It took a lot of work to narrow down how to cause it. Still don't know why it's happening. In UE5, they replaced the import modules for 3d meshes, textures and other things. I think they may have gotten some of the configuration wrong, but that's just a guess at this point. You couldn't use Class references in the main character's properties if you used top down, first person or third person templates when setting up your project. Only the empty project works as of now. If you tried to use class references, your textures would no longer be able to be reimported and your materials would suddenly have nodes disappear. Yeah, it was pretty bad.

    Anyhow, hopefully they'll fix it soon and we can move beyond this. I lost a LOT of time on this, so I'll be happy when it's fixed.

    Here's the thread in case anyone is interested.

    https://forums.unrealengine.com/t/ue5-2-how-to-fix-interchange-errors-cant-reimport-textures-nodes-disappearing/1164835/1

     

  • faseceroofaseceroo Posts: 11
    edited June 2023

    AlienRenders said:

    Just a warning to not use 5.2-mod. It doesn't work. My 5.1 and 5.2 builds no longer work (unrelated to DQS). I wanted to skip 5.2, but I tihnk 5.3 has the same problems. So until those things are fixed in Unreal Engine, there will be no further DQS builds.I've posted on their forums and asked on their Discord channel and no one even knows what I'm talking about. A few mods said something in the forums, but no fix. I'm going back to UE 4 for my own projects and won't be touching UE5 until the quality improves.

    Just in case, I compiled Unreal 5.1-mod from source again today. There was no way to get it working with Visual Studio 2019, so I had to upgrade to Visual Studio 2022 and install the .NET Desktop Development, Desktop Development with C++, and Game Development with C++ workloads. I also needed to download and replace the Engine/Build/Commit.gitdeps.xml file for version 5.1.0 (changelist 23058290) from Epic Games. After running setup.bat, I pressed "N" so that it did not replace some modified files. While compiling, I received two errors. I solved these errors by copying the lib folder and then a dll file from the OpenColorIO plugin. I simply copied these files from the official 5.1 Epic Games release to my own (they were missing for some reason).

    In any case, thank you very much for your work. The current solutions that exist to fix linear quaternion with Daz characters are very complex to use or require very expensive programs. Your work is a much-needed and appreciated improvement.

    Post edited by faseceroo on
  • Indeed it is.

     

  • Hi @AlienRenders I have disc space issues and i raelly want to use dual quaternion, is it possible to make it a plugin by now? or make it able to use ML deformer in unreal engine 5 straight from daz to unreal?

  • McKenzieMcKenzie Posts: 8
    edited June 2023

    With alienrenders out of eqation now we only have to rely on Deformer graph even though it is highly inefficient(according to alienrenders.... if he says so BELIEVE him guy's a genius , he carried all of us till here) then I stumbled upon this:
    https://www.bilibili.com/video/BV1Lx4y157LQ/?spm_id_from=333.880.my_history.page.click&vd_source=8de627b19f1f6987753e1f7076cedcfc
    yeah it was VERY ,VERY difficult to get a hold of them (long story) finally they shared it today and it works(I tested in official  5.2.1) haven't tried morph targets but it should work tho ,as of rn this is the only way of getting DQS to work without having custom builds I'm aware of.
    Here it is if anyone else wants to try...I take no credit this was entirely built by them and I haven't asked for permission if I can distribute it but they were giving it for free to anyone who contacted them so i guess sharing this here means no harm
    https://anonfiles.com/z1M0y5zbz7/CustomDeformer_zip

    Post edited by McKenzie on
  • faseceroofaseceroo Posts: 11
    edited July 2023

    McKenzie said:

    With alienrenders out of eqation now we only have to rely on Deformer graph even though it is highly inefficient(according to alienrenders.... if he says so BELIEVE him guy's a genius , he carried all of us till here) then I stumbled upon this:
    https://www.bilibili.com/video/BV1Lx4y157LQ/?spm_id_from=333.880.my_history.page.click&vd_source=8de627b19f1f6987753e1f7076cedcfc
    yeah it was VERY ,VERY difficult to get a hold of them (long story) finally they shared it today and it works(I tested in official  5.2.1) haven't tried morph targets but it should work tho ,as of rn this is the only way of getting DQS to work without having custom builds I'm aware of.
    Here it is if anyone else wants to try...I take no credit this was entirely built by them and I haven't asked for permission if I can distribute it but they were giving it for free to anyone who contacted them so i guess sharing this here means no harm
    https://anonfiles.com/z1M0y5zbz7/CustomDeformer_zip

    Hey @McKenzie, thanks for sharing it! I've been trying the plugin, but it doesn't work for me. I've tried it on a couple of projects (UE5.1) and on a new one just in case, but when I choose Dual Quaterion (DG_DualQuatSkin or DG_DualQuatSkin_Morph deformers) on the skeletal mesh or in the skeletal mesh actor, the character is placed in A pose and it stays completely rigid both in runtime and in the editor. I can neither move nor rotate it, for example when moving it in the control rig. It is completely static. Am I missing anything? I have tried both with and without morphs, and the result is the same.

    Post edited by faseceroo on
  • faseceroofaseceroo Posts: 11

    Okay, I have no idea what I did, but after messing around with the deformer graph editor, it started to work. I tested it with a few morphs and it seems to be working too. Wow!

  • MacislavMacislav Posts: 126

    Can you show a screen of your deformer graph / animation setup, because I don't know how to do the nodes.

    Plugin seems to be installed (put into plugin folder "Marketplace and active), character is set to use "DQ_DualQuatSkin_Morph", but what to do next?

  • MacislavMacislav Posts: 126

    Ok, somehow it works now. Don't even know what I did. Changed the preview mesh in the deformer and/or compiled it.........

  • noirjtnoirjt Posts: 0

    Anybody else's mesh absolutely explode after adding the DQ deformers? Morph or standard, same issue.

    Untitled.png
    729 x 1029 - 1M
  • McKenzieMcKenzie Posts: 8
    edited July 2023

    Sorry for the late reply I was testing all possible stuff out to see if it works for all conditions Here are some things that you need to take care of if you want to use this :

    1. If character is not following your bones(behaving like static mesh) then open the deformer graph and compile it once

    2.As far as I know you cannot use the graph in the skeletal mesh editor you have to make a blueprint ,add the skeletal mesh and assign the graph there.

    3.Alien renders also mentioned and this problem persists here too, your animation MUST HAVE UNIFORM BONE SCALE or it'll break the mesh when animated, it'll work perfectly fine if all your bones have uniform scale animations.

    Hope this answers the problem some of you are having

    Post edited by McKenzie on
  • McKenzie said:

    With alienrenders out of eqation now we only have to rely on Deformer graph even though it is highly inefficient(according to alienrenders.... if he says so BELIEVE him guy's a genius , he carried all of us till here) then I stumbled upon this:
    https://www.bilibili.com/video/BV1Lx4y157LQ/?spm_id_from=333.880.my_history.page.click&vd_source=8de627b19f1f6987753e1f7076cedcfc
    yeah it was VERY ,VERY difficult to get a hold of them (long story) finally they shared it today and it works(I tested in official  5.2.1) haven't tried morph targets but it should work tho ,as of rn this is the only way of getting DQS to work without having custom builds I'm aware of.
    Here it is if anyone else wants to try...I take no credit this was entirely built by them and I haven't asked for permission if I can distribute it but they were giving it for free to anyone who contacted them so i guess sharing this here means no harm
    https://anonfiles.com/z1M0y5zbz7/CustomDeformer_zip

    How do the DQS deformer graphs from this creator compare to the DQS graphs provided in AlienRender's most recent builds? If I recall there were some problems with deformer graphs not being a suitable replacement for the DQS "always on" branches provided by Alien. One problem I encountered with the deformer graphs is that it seems to put the character in T pose for one frame whenever an animation loops. Also I had some issues with mesh flickering when a deformer graph was applied, especially with clothing. Until these issues are sorted out with the deformer graphs I will continue to use the "always on" DQS branch for 5.1, unless there is a new DQS graph that addresses those problems.

  • emaneman Posts: 23

    If someone is interested I made a dual quaternion skinning deformer some times ago and I decided to share.
    Performance are good, at least on my PC, but I was wondering how is compared to AlienRender's one. I never tried it.

    https://github.com/pedroscialfa/DualQuaternionDeformer

  • Hello, everyone. Been using the DQS build a while and loving it. Thank you @AlienRenders for keeping this going. Bummbed to hear about all the problems churning up with UE at the moment.

    I currently have 5.1-mod working for me (pre 5.1.1 hotfix) but really need that hotfix. However, I am having trouble trying to get my branch updated with upstream/5.1. It does not seem to exist?

    Anyway. Was wondering if someone has a fork of what I am looking for already made.

    Looking for 5.1-mod with the 5.1.1 hotfix and without AlienRenders work to hook into the deformer system.

    Thanks in advance :)

     

  • funkinfamily said:

    Looking for 5.1-mod with the 5.1.1 hotfix and without AlienRenders work to hook into the deformer system.

    I figured it out. I was using Git poorly. Fetched upstream/5.1 and rebased onto my branch. All working now :)

  • MacislavMacislav Posts: 126
    edited September 2023

    I can confirm that the deformer graphs (I`ve tried both DQ versions with morphs) do work well with UE 5.2 standard version. No flickering and no t-pose issues (animations, posing) even with clothes on.

    If framerate is bad, just change from lumen to screen space (not as good as lumen) as lumen is the culprit for performance issues with older gpus. Btw don't forget to convert your open world into world partition and convert all bsp meshes into static ones.

    Post edited by Macislav on
  • Tried all links I could find but all dead. Has anyone made a fork on github that is willing to share?

  • Is there any working dual quaternion skinning plugin i can use?

  • UE 5.3 was realease recently. I'll likely try to get DQS working again in that version. I'm using 5.2 on my own projects though.

    For those asking if a DQS plugin exists. It cannot exist until the UE devs approve my pull request. And that doesn't resolve the project settings defaults. So the answer is no. Now, you can go from LS to DQS to LS right now, but that won't actually do what you think.

    Also, the DQS example deformers and the Dual Quaternion classes in Unreal Engine are buggy. They do not work properly. The fix is also in my pull request.

    I just checked my pull request. There are now some conflicts. They are trivial to fix so I'll try to do that soon.

    I have very little time even though I work in UE every day. I'm working on my own game (and doesn't require DQS).

     

    Going forward, need to decide on which road to take. I'm not going to maitain two different versions. 

    Option 1: Have a very small update in the codebase and use a plugin. If the devs eventually merge my pull request, then all you'll need is a plugin.

    Option 2: Go back to the "always on" custom build.

     

    I was led to believe that getting morphs, cloth, etc. to work was easier with Option 1, but a lot of people said it didn't work properly. Also, Option 1 needs a proper design on how default options in the project settings work. They do not work like defaults. It's been too long so I don't remember all the details. I'd have to go back. I think defaults are if you don't select anything in your classes. People also complained that they have to set it on every character. How many characters do you realistically have? It's literally one click for ALL instances of that character. Unless you're setting it on the instance. And I think a lot of people don't actually undertsand how UE works between classes and instances. If you open a character from the Content Drawer, any options you set there will set it for ALL instances. If you change a setting by clicking on a character in the viewport or in the Outliner, you will only set it for that one instance. You can get to the global class by editing the blueprint as well (found in the Type column of the Outliner. This is the same as opening it from the Content Drawer). This is UE 101, but I think a lot of people don't understand this design.

    Going with Option 2 is not something I'm really interested in. The changes are quite intrusive to the shaders. They don't work with morphs or cloth. But a lot of people like the simplicity of using it. You just compile and go.

     

    Right now, I'm leaning toward Option 1. Get something working with just DQS. Then get morphs and cloth to work. The deformers will be available. It would be a lot of help if people could provide sample projects to test this.

    Then I think it would be best to create completely new options in the project settings. The problem here is that different deformers are used when recalculating normals. I'm not convinced the math is correct here either on the existing sample DQS deformers. Scratch that, I know with 100% certainty they are not correct. For most uses, you won't see the difference. But for those that want correct normals, it will need to be fixed and it's in a different deformer than you use in-game.

    So here's the problem with defaults in the project settings. They were made assuming LS was the only game in town. If you want DQS and LS, then we need multiple sets of defaults. And another default if you don't specify either DQS or LS for those people that want the "always on" option. Maybe there's a simpler way to handle this that I haven't though of. Oh, and there's defaults in the previews that are different than the defaults for the actual actors.

    Sorry for the long post. I have not abandoned DQS. I'm just busy and was waiting for 5.3 to be released. 5.1, 5.2 and 5.3 all have different versions of the deformer classes/graphs (and are incompatible with each other).

     

  • I forgot they still haven't fixed the disappearing nodes issue if you use any assets from the main character. I mentioned above that an empty project works, but I've since discovered that it too has the same bugs. It's just harder to reproduce.

    If I have time, I may start work on DQS again. But I hate that you can't use the main character. I literally have a separate dummy class where all the funcitonality of the main character is stored because of this stupid bug. Hopefully, I can avoid the bug when implementing DQS.

     

  • For those asking if a DQS plugin exists. It cannot exist until the UE devs approve my pull request. And that doesn't resolve the project settings defaults. So the answer is no.

    Have you tried to contact them in the forums in the animation section? I keep getting plenty of errors when i build and now that setup.bat gives 403 forbidden error.  its impossible to build it from source. even after fixing that i get errors. My gpu is weak enough for generating ML Deformer data so I desperately want to use a dual quaternion option.

Sign In or Register to comment.