Experimental DazUERig Converter script

UpL8RenderingUpL8Rendering Posts: 129
edited February 2021 in Unreal Discussion

I had seen several request for a script that would change the Daz Skeleton to make it compatible with the Unreal Engine Manneguin Rig and animations

So I wanted to see if it would be possible.  A few users and I over on the Daz to Unreal discord server have been testing it out and so far it looks like it might work.

I now have the script on Github for you to try.

The documentation is in the ReadMe.md file but I will post it below as well

Again. This is experimental. It does work with the Daz to Unreal Plugin but is not officially supported.

https://github.com/GNVR-Dev/DazUERig

 

Post edited by Chohole on
«1

Comments

  • UpL8RenderingUpL8Rendering Posts: 129
    edited February 2021

    Setting up the DazToUnreal plugin:

    I recomend setting up the Plugin as a Project plugin instead of an engine plugin.

    This way if the skeleton get messed up it only effects this project not all the projects that use DaztoUnreal

    First make sure the project closed before adding the plugin.

    In your project's game folder create a new folder and name it Plugins

    Find the DazToUnreal Plugin folder

    The default path is C:\Program Files\Epic Games\UE_4.25\Engine\Plugins\Marketplace

    Copy and Paste the entire folder into your projec'ts Plugins folder

    Add an Unreal Engine animation pack and find the skeleton rig that is used for those animations

    In your Project Settings under Plugins - Daz To Unreal Engine Settings change the Genisis 3 and Genesis 8 Skeletons to the same skeleton as the animations

    Running the script:

    Either download the DazUERig script or clone a copy to your computer.

    In Daz Studio enable the ScriptIDE tab by going to Windows - Panes(Tabs) - and click ScriptIDE

    In the ScriptIDE tab click File - Open Script and browse to the DazUERig.dsa file and open

    Once your character is setup and selected click Execute

    This will rename, relabel, remove, and reparent all the necassary bones to make the Daz Skeleton compatible with the UE mannequin rig.

    Make sure your character is selected and SendToUnreal

    You may want to set up a new Intermediate Folder so that you don't overwrite existing exported characters.

    Once imported open an UE animation and change the Preview Mesh to your character

    This will happen:

    In the Asset Details tab - Additive Settings change the Additive Anim Type to Mesh Space

    Things should be looking better now.

    In the Skeleton Tree Tab - Options Check Show Retargetting Options

    You may need to adjust for animation to work correctly.

    ToDo - Add suggested settings

     

    Post edited by Chohole on
  • UpL8RenderingUpL8Rendering Posts: 129
    edited September 2020

    Editing Script For Your Own Needs:

    At the bottom of the script (after line 250) is where the Main Program starts

    The script uses the bone NAME not the bone LABEL and they are case sensitive

    To find the bone name click on it in the scene tree view. In the Node tab you will see the bone Name and its Label

     

    Post edited by Chohole on
  • UpL8RenderingUpL8Rendering Posts: 129
    edited September 2020

    Known issues:

    By changing the skeleton and bone names the Post Process animation that drives the corrective morphs no longer works.

    Post edited by UpL8Rendering on
  • jeronimocollaresjeronimocollares Posts: 131
    edited September 2020

    Known issues:

    By changing the skeleton and bone names the Post Process animation that drives the corrective morphs no longer works.

    Hi :) first of all, ty so much for your work. Secound, if need some help, people to experiment things, call me :) (i dont speak english so well, but...). Just few questions, if possible to answer:

     

    1 need retarget all bones? 2. "Process animation that drives the corrective morphs no longer works" its the single morph what we, eventualy, export to UE? 

     

    Apreciate, sorry my english

    Post edited by jeronimocollares on
  • UpL8RenderingUpL8Rendering Posts: 129
    edited September 2020

    Known issues:

    By changing the skeleton and bone names the Post Process animation that drives the corrective morphs no longer works.

    Hi :) first of all, ty so much for your work. Secound, if need some help, people to experiment things, call me :) (i dont speak english so well, but...). Just few questions, if possible to answer:

     

    1 need retarget all bones? 2. "Process animation that drives the corrective morphs no longer works" its the single morph what we, eventualy, export to UE? 

     

    Apreciate, sorry my english

    You're welcome and thank you, I will keep you in mind for testing future experiments.

    Answer to 1:

    Because the character comes in with the same bone names and order as the Unreal Engine Mannequin there is no need to manually retarget and create new animations.

    In the translation retargeting options there is a way to tell Unreal whether to strictly use the animation data or to use the information of the skeletal mesh. Im not 100% sure if that is the best explanation or how they should be set.

    If anyone has a better description or some insight on that part I would love to get a better idea how to set that up.

    Answer to 2: Sorry that was an over simplification.

    The Post Process animation is an Animation Blueprint that basically keeps track of about 50 different bone rotations and applies a corrective morph to the skeletal mesh as each joint bends.

    There is one of these set up in the plugin for Genesis 8 and Genesis 3 skeletons. There isn't one set up for the UE mannequin rig that we are using for our Daz character.

    It is possible to make one by copying the Event Graph from the Plugin's Post Process Animation Blueprint and pasting it into one for the UE skeleton. You would then need to change the names of the bones(sockets) that are being watched to drive the corrective morphs.

    One of the script testers came up with that solution and I believe got it working OK.

    Post edited by UpL8Rendering on
  • This is amazing, tanks a lot for your time. I have been trying to get that damm retarget to work properly but no succes xD. I have to try this but i already started to work with mixamo characters :(. I dont know what to do :V. But thanks a lot for doing this plugin.

  • This looks cool but when I try it UE4.25 crashes when it trys to import the character :/

  • Ahk, had set the plugin to ALS skeleton... now set on mannequin, character imports but setting additive anim type to mesh space doesn't do anything

  • This is amazing, tanks a lot for your time. I have been trying to get that damm retarget to work properly but no succes xD. I have to try this but i already started to work with mixamo characters :(. I dont know what to do :V. But thanks a lot for doing this plugin.

    Give it a quick go. If it works great. If it doesn't, let me know. Maybe I can get it working better for your next project with Daz characters.

    Ahk, had set the plugin to ALS skeleton... now set on mannequin, character imports but setting additive anim type to mesh space doesn't do anything

    Does the character stay balled up like the "this will happen" picture above? Do the animations still play correctly on the UE mannequin?

  • simon_966884d796simon_966884d796 Posts: 6
    edited September 2020

    Heya UpL8Rendering,

    Yah, she stay balled up even if I go into the skeleton and do the mesh thing.

    I compared her skeleton to the mannequins and (obviously) the problem is that the bones don't have the same orientation.

    I tried using the joint editor in Daz to correct this but there doesn't seem to be a way to rotate the bones on their local axis :(

    I had a look at your script but couldn't find an up to date API reference that would tell me about the commands available in dzBone.

    You wouldn't happen to know how to fix the bone orientation as well as the naming would you?

    Post edited by simon_966884d796 on
  • When I was trying to figure out reparenting bones this was the document I was pointed to.

    http://docs.daz3d.com/doku.php/public/software/dazstudio/4/referenceguide/scripting/api_reference/object_index/node_dz

    It looks like there are a few different methods that refer to orientation, rotation or position. I think one of those just might do it. That would be slick if that could work!

     

     

  • Hate to say it dude, but I think your reconfigured skeletons break the G8 skeleton in the plugin in UE4.

    Had to do the whole get a new copy of it thing to get normal skeleton import going again.

  • UpL8RenderingUpL8Rendering Posts: 129
    edited February 2021

    Hate to say it dude, but I think your reconfigured skeletons break the G8 skeleton in the plugin in UE4.

    Had to do the whole get a new copy of it thing to get normal skeleton import going again.

    Sorry you had to fix that. I'm glad you got it working again.

    The only time I have seen that happen is when I forgot to change the skeleton the plugin uses when importing.

    If it's set to use Genesis 8 or Genesis 3 then it will overwrite the plugin skeleton and has to be fixed.

    If it's set to use the UE mannequin skeleton when importing that shouldn't happen.

    It might be safer if I add instructions to copy the plugin into the project's plugin folder. That way if the skeleton gets messed up it only affects that project.

    Edit: I made the changes to the instructions. they now have you copy the Plugin folder to your project's main folder.

    Post edited by UpL8Rendering on
  • Yah, it's all good... easy enough to fix :)

    I had a good bash at trying to get those bone angles right but couldn't figure it out.  

    I noticed when if I imported the converted character and the mannequin into Blender that all the characters bones were just pointing up.

  • The plugin proposal is good, but you should better study Unreal bone hierarchy system, you don't need to delete any bones from the Daz Skeleton because inside Unreal there is an algorithm that interprets different types of bones like Spine_01, Spine_02, 03, 04 , 05 ....
    Watch this video to get inspired by your plugin

  • The plugin proposal is good, but you should better study Unreal bone hierarchy system, you don't need to delete any bones from the Daz Skeleton because inside Unreal there is an algorithm that interprets different types of bones like Spine_01, Spine_02, 03, 04 , 05 ....
    Watch this video to get inspired by your plugin

    Thank you. That is inspiring! That is what I hope might be possible straight out of Daz To Unreal by using a script to get the bone names and order sorted before transferring.

    I will look into not having to remove bones more. I know you don't have to do that if you are planning on retargetting all your animations from the UE marketplace to your Daz skeleton but I was pretty sure if you wanted to have characters share the same skeleton and animations the bone hierarchies had to be the same without skipping bones or having new ones in between. Leaf bones or leaf bone chains are OK of course.

    Without remove bones that the Daz characters have that the UE mannequin doesn't (like the carpal bones between the hand and finger bones) i get a "bone hierarchy has changed" warnings.

     

  • Yah, it's all good... easy enough to fix :)

    I had a good bash at trying to get those bone angles right but couldn't figure it out.  

    I noticed when if I imported the converted character and the mannequin into Blender that all the characters bones were just pointing up.

    Thanks for giving it a go. Did you find a method that would let you make those changes in Daz Studio?

    After thinking about it there may have been other issues at play.  Bone rotations aren't getting transferred correctly out of Daz Studio. Arm bones, for instance, don't rotate the same way in UE as they do in Daz Studio.

    Even if the script correctly changed the rotations to match the mannequin that information might be getting lost when transferring, exporting, or importing.

  • Hi again!

    Once i switch the option on the animations to MeshSpace, my characters blueprints even with the original skeletal mesh, they just disappear :V. 

  • i give up lol. i got it working like a 9.5 / 10 without this plugin but when i tried to put other character clothed, i got some wierd stuff again XD i dont know what to do haaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.

    Here is a link of my wonderfull art XD

    https://ibb.co/NZgccjX

  • Hey there. I've been having some trouble with this. changing to mesh space on the anims in Unreal is not an option for me. So I have been trying to understand the issue more clearly and here is what i've found. First I exported both the standard Unreal SK mannequin and the newly imported Daz character (using the script) out to FBX. Then I tested to make sure that when I re-imported the SK_mannequin (it's actually a mannequin from a plugin, but is mapped to the standard sk_manneequin skelteon) from Maya, that it still worked. This tells me that I can successfully export the mannequin, make changes, re-import and it still works (with an extra step and changing the import rotation settings). So then I compared the sk_mannequin and the Daz character in Maya, and at first glance they appear to be nearly identical, save for daz having extra face bones and missing the V-shaped IK bone arrangement...

  • UpL8Rendering thanks a lot for this. you are awesome

  • GutoCrafts said:

    UpL8Rendering thanks a lot for this. you are awesome

    Your welcome. I'm glad to find more users giving it a try.

  • UpL8RenderingUpL8Rendering Posts: 129
    edited February 2021

    valetteman said:

    Hi again!

    Once i switch the option on the animations to MeshSpace, my characters blueprints even with the original skeletal mesh, they just disappear :V. 

    I have had a couple users find this issue. I figured out why it's happening but have no solution yet. It looks like the same issue as here:
    https://answers.unrealengine.com/questions/910180/view.html
    Only... I'm not sure how to make the first animation "not additive" in the animation blueprints.

    Post edited by UpL8Rendering on
  • UpL8RenderingUpL8Rendering Posts: 129
    edited February 2021

    kremath said:

    Hey there. I've been having some trouble with this. changing to mesh space on the anims in Unreal is not an option for me. So I have been trying to understand the issue more clearly and here is what i've found. First I exported both the standard Unreal SK mannequin and the newly imported Daz character (using the script) out to FBX. Then I tested to make sure that when I re-imported the SK_mannequin (it's actually a mannequin from a plugin, but is mapped to the standard sk_manneequin skelteon) from Maya, that it still worked. This tells me that I can successfully export the mannequin, make changes, re-import and it still works (with an extra step and changing the import rotation settings). So then I compared the sk_mannequin and the Daz character in Maya, and at first glance they appear to be nearly identical, save for daz having extra face bones and missing the V-shaped IK bone arrangement...

    Hi kremath,

    Thanks for reaching out on Github, and for moving the conversation here for more visibility.

    I took a look at the bone rotation issue you grabbed screen shots of.  You are right. When Daz characters get imported into Unreal Engine the bone rotations are world aligned. This happens whether you use regular FBX or DazToUnreal.

    There is a feature in the DazToUnreal plugin that will fix the bone rotations on import.

    If you go into the Project Settings, scroll down to Plugins and select the Daz to Unreal Settings you can check Fix Bone Rotations on Import

    Now when importing the bones will be aligned correctly.

    The last I heard I think this breaks some animations coming in from Daz but if the plan is to use UE animations it should work fine for testing.

    Post edited by Chohole on
  • I have been wondering if UE Control Rig might be helpful in solving some of the issues like wiggly foot positions and hand IK.

    I found this video showing how Control Rig can control leg IK to help with foot placement

    https://youtu.be/Zwc9uuOYfFg?t=224
    (Link is cued to the start of the leg IK part)

    Later in the same video he talks about Runtime Retargeting that compensates for different character scales.

    https://youtu.be/Zwc9uuOYfFg?t=514
    (Link is cued to the start of the Runtime Ratargeting)

    Both might be helpful. I'm doing some more experimenting.

  • Hi kremath,

    Thanks for reaching out on Github, and for moving the conversation here for more visibility.

    I took a look at the bone rotation issue you grabbed screen shots of.  You are right. When Daz characters get imported into Unreal Engine the bone rotations are world aligned. This happens whether you use regular FBX or DazToUnreal.

    There is a feature in the DazToUnreal plugin that will fix the bone rotations on import.

    If you go into the Project Settings, scroll down to Plugins and select the Daz to Unreal Settings you can check Fix Bone Rotations on Import

    Now when importing the bones will be aligned correctly.

    The last I heard I think this breaks some animations coming in from Daz but if the plan is to use UE animations it should work fine for testing.

    Thanks for the suggestion, but it has not solved the issue. Using the script still requires all animations to be set to mesh space, which destroys the animation blueprint. Further inspection reveals the same behavior in Maya:
    When the correct SK_mannequin skeleton is pasted over top the Landon8 Daz model, this is the result:
     

  • I've tried to use the Daz forum as you suggested, but between it capping my post and claiming i'm over by x number of lines (when it is incorrectly interpreting pasted images as lines of text based on the size of the image), and also the frustrating fact that it will not let me post outright, leaving me no way to see if my message may be viewed correclty and logically, I'm not sure what to do at this point, but continue posting here. The Daz forum seems to be missing some very basic forum functionality and in desperate need of an upgrade. To make a long story short, I tried the suggested checkbox and watched the videos. This has not solved the issue. The bind pose is still incorrect, and setting animations to mesh space causes exponentially more problems than it solves. Our team really likes your characters and we've spent a fair amount of money already. However this is holding up production, and we really need to get this to work without having to re-paint skin weights on every Daz character, which seems like that shouldn't be a requirement. Is there a way we can do a video call or collaborate more directly and try to work through these issues?

  • UpL8RenderingUpL8Rendering Posts: 129
    edited February 2021

    kremath said:

    I've tried to use the Daz forum as you suggested, but between it capping my post and claiming i'm over by x number of lines (when it is incorrectly interpreting pasted images as lines of text based on the size of the image), and also the frustrating fact that it will not let me post outright, leaving me no way to see if my message may be viewed correclty and logically, I'm not sure what to do at this point, but continue posting here. The Daz forum seems to be missing some very basic forum functionality and in desperate need of an upgrade. To make a long story short, I tried the suggested checkbox and watched the videos. This has not solved the issue. The bind pose is still incorrect, and setting animations to mesh space causes exponentially more problems than it solves. Our team really likes your characters and we've spent a fair amount of money already. However this is holding up production, and we really need to get this to work without having to re-paint skin weights on every Daz character, which seems like that shouldn't be a requirement. Is there a way we can do a video call or collaborate more directly and try to work through these issues?

    You may just want to manually retarget the animations and not bother using this script DazUERIG conversion script if it is holding up production.

    The creator of the DazToUnreal plugin posted how to do this on his Youtube channel.

    https://youtu.be/HYs43h3DNdo

    I don't work for Daz. I am just a Daz and UE user who put the DazUERig script on Github in case anyone found it useful in their workflow.  It isn't a perfect solution as you have found.

    I'm sorry if I led you astray with the two video links. They weren't meant to solve your exact problem. Just me thinking "out loud" how I might possibly solve a couple different issues I noticed.

    I agree that the Daz fourms can be a little wonky. One issue may be more that you are a new user and post probably have to be cleared before they go up.

    You can't paste an image inline, but you can add it as an attachment, or post it on a site like imgur and add to the post as an image.

    My goal for continuing the conversation on the forums was to hopefully find others who might be able to help solve these issues. 

    Unreal Engine and Daz is still just a hobby of mine for now and this DazUERig script is a small part of that.

    Post edited by UpL8Rendering on
  • dtoxodtoxo Posts: 6

    So could someone explain to me what is the benefit of using this, instead of just retargeting required animations/poses from UE4_Mannequin to G8 inside the UE?

Sign In or Register to comment.