daz3d / DazToUnreal

Daz to Unreal Bridge
Apache License 2.0
155 stars 46 forks source link

Leviathan Suit causing errors on import to unreal #26

Open mostlyhuman opened 1 year ago

mostlyhuman commented 1 year ago

Leviathan Suit for Genesis 8 Male(s) | Daz 3D

I have this added to a genesis 8.1 male character and upon import into unreal it errors out with: "Failed to find any bone hierarchy. Try disabling the "Import As Skeletal" option to import as a rigid mesh."

I noticed in Daz Studio the Leviathan suit ends up as a child of the main figure but then the suit has its own joint hierarchy childed under itself. Not sure if this is a problem or if there is a way to merge the two joint hierarchies together or if the issue is something else altogether.

danielbui78 commented 1 year ago

Sorry, I'm not getting any issues other than that the gun and helmet need to be exported as static meshes. The bone hierarchy under each asset of the suit is fine -- these are merged into the main figure by the Unreal side of the bridge plugin.

I am using Daz Studio 4.21 with Unreal Bridge v2022.2 revision 18.24 (2022.2.18.24). No morphs set, subd level 1 for the G8.1 male and 0 for all others. All other options are unchecked in DS side of bridge. On Unreal, I am using UE 5.0.3 with Unreal Bridge v2022.2.18.23. Fix bone rotations was tested successfully in checked and unchecked states. Combine Materials was checked. Other options were unchecked.

If you are still having problems, please post your settings in DS and Unreal, and attach the DTU file that was generated inside the intermediate folder.

mostlyhuman commented 1 year ago

Thank you, Daniel. I am using Windows, is there a studio plugin version 2022.2.18.24? I can only see that version for mac. I have version 2022.2.18.23

mostlyhuman commented 1 year ago

tap tap Is this thing on? :)

danielbui78 commented 1 year ago

Very sorry - I must not have hit the comment button. Yes, 2022.2.18.24 and 2022.2.18.23 are equivalent in all source and binary code. version 24 was just to fix a bug on the Mac installer.

If you are still having problems, please post the DTU file:

  1. Try to Send a figure with the Leviathan Armor. Make sure you select the root node in the scene graph.
  2. Verify that it is working or not in Unreal.
  3. Back in Daz Studio, click File -> Send to Daz To Unreal
  4. In the Advanced Settings section, click "Open Intermediate Folder"
  5. Find the DTU file and drag and drop it onto the little section at the bottom of the Github comment box that's labelled Attach files by dragging & dropping, selecting or pasting them.
mostlyhuman commented 1 year ago

No worries, so updating the plugin it no longer gives the original error, however only the suit imports, it doesnt import the GM8.1 mesh along with it. DTU attached as zip file. Thank you again for your help!

image Leviathan2.zip

danielbui78 commented 1 year ago

Load the attached dsa script inside the Daz Studio ScriptIDE pane and click Execute. Then copy and paste the "DEBUG: ..." line and everything after it in the script output window.

daz_to_unreal_debug_test.dsa.zip

mostlyhuman commented 1 year ago

Here ya go.

DEBUG: O:/OneDrive - mostlyhuman/Documents/DazToUnreal/test_output/test_output.fbx, file size=5592864, MD5=0084516c56fac87f167f5f377b10309d Export Warning: Fbx File size does not match expected result. O:/OneDrive - mostlyhuman/Documents/DazToUnreal/test_output/test_output Result: Script executed in 82 secs 343 msecs.

danielbui78 commented 1 year ago

Sorry, please run that script again, but with your Unreal Project with DazToUnreal plugin enabled. It should import G8.1M with the blue leviathan suit. If anything is missing or wrong, please post a screenshot like before and the DTU file.

mostlyhuman commented 1 year ago

test_output_DTU.zip Got an error in Daz Studio: "Error occurred while exporting file. See the log file for details."

Log File: 2023-02-18 02:12:07.732 [INFO] :: Exporting File... 2023-02-18 02:12:50.129 [INFO] :: Error occurred while exporting file. See the log file for details. 2023-02-18 02:12:50.129 [INFO] :: Error exporting file: C Exception: Memory Access Violation - Attempted to read memory at address 0x52a6d980 2023-02-18 02:12:50.129 [INFO] :: File exported in: 0.42 sec (42398.6 ms) 2023-02-18 02:12:50.132 [INFO] :: Failed to export: O:\OneDrive - mostlyhuman\Documents\DazToUnreal\test_output\test_output.fbx 2023-02-18 02:12:50.133 [INFO] :: Unhandled exception during operation 2023-02-18 02:12:50.762 [DEBUG] :: DEBUG: O:/OneDrive - mostlyhuman/Documents/DazToUnreal/test_output/test_output.fbx, file size=5592864, MD5=0084516c56fac87f167f5f377b10309d 2023-02-18 02:12:50.762 [DEBUG] :: Export Warning: Fbx File size does not match expected result. 2023-02-18 02:12:50.762 [DEBUG] :: O:/OneDrive - mostlyhuman/Documents/DazToUnreal/test_output/test_output 2023-02-18 02:12:50.762 [DEBUG] :: Result: 2023-02-18 02:12:50.763 [DEBUG] :: Script executed in 113 secs 439 msecs.

Script Result: DEBUG: O:/OneDrive - mostlyhuman/Documents/DazToUnreal/test_output/test_output.fbx, file size=5592864, MD5=0084516c56fac87f167f5f377b10309d Export Warning: Fbx File size does not match expected result. O:/OneDrive - mostlyhuman/Documents/DazToUnreal/test_output/test_output Result: Script executed in 113 secs 439 msecs.

Unreal Result: Only the suit imported, I have attached a screenshot and DTU file in zip Screenshot_20230218_021327

danielbui78 commented 1 year ago

Try doing a manual FBX export using File->Export and type in any filename and change file type to FBX. When the FBX Options window pops up, deselect every single checkbox and click Accept. Then re-run the script to see if you still get the error message.

mostlyhuman commented 1 year ago

Just to clarify, do you want me to do a manual FBX export of a blank scene, or after first loading G8.1 Male with the Leviathan suit?

If it is the second one, after doing the manual FBX export, do you want me to keep those loaded and THEN run the script or clear the scene first? Thanks for the clarification.

danielbui78 commented 1 year ago

Any of the above is fine, it actually won't matter for setting the FBX Options and the script will clear the scene anyway.

mostlyhuman commented 1 year ago

No memory error this time, but does still have the MD5 hash mismatch, and of course it only imported the suit into unreal again.

DEBUG: O:/OneDrive - mostlyhuman/Documents/DazToUnreal/test_output/test_output.fbx, file size=5592864, MD5=6241a86e8fbb2511eeb6e32aa5cc83e5 Export Warning: Fbx File size does not match expected result. O:/OneDrive - mostlyhuman/Documents/DazToUnreal/test_output/test_output Result: Script executed in 77 secs 286 msecs.

mostlyhuman commented 1 year ago

Also not sure if it matters for this test but the fbx version was set to 2012

danielbui78 commented 1 year ago
  1. Unzip the zip file below and copy out the .py file to any folder
  2. Open Daz Studio and Unreal Project.
  3. Run the Script I posted above in Daz Studio
  4. After asset is imported into Unreal, select Tools -> Execute Python Script... in Unreal Editor
  5. Select the .py file and click open
  6. You should get an Unreal Asset Texture Editor opened with the G8.1M face texture.
  7. If not, then open the Output Log, right-click and select "Clear Log", rerun the .py file and post the output here.

If you successfully get a face texture in the Texture Editor window, but the imported skeletal mesh is still missing a face, take a screenshot of all the materials in the skeletal mesh asset edtior window, and post here. Then try creating a new Unreal Project and importing the G8.1M + Leviathan Suit into that project and see if it works. If it does, then there is something wrong with your existing project.

daz_to_unreal_debug_assets.py.zip

mostlyhuman commented 1 year ago

Thank you, Daniel. I ran the python script in Unreal and nothing visible happened, the log only shows a single line which is the script load

Output Log: Cmd: py "O:/Downloads/daz_to_unreal_debug_assets.py/daz_to_unreal_debug_assets.py"

danielbui78 commented 1 year ago

Open the "Output Log" tab, click the "Filters" drop down and make sure that "LogPython" is selected. If you do not at least see "DEBUG: DazToUnreal: Daz To Unreal Asset Asset Analaysis..." then your Unreal python installation may not be working.

mostlyhuman commented 1 year ago

LogPython was selected, I did a verification on the engine files through the Epic Launcher and after trying again got the same result. Is there anything else I might have to do other than the file verification to ensure the Unreal Python installation is working correctly?

danielbui78 commented 1 year ago
  1. Open the "Output Log" window.
  2. Click the "Cmd" drop down next to the "Enter Console Command" input line, and change the mode to "Python (REPL)"
  3. Type print("hello, world") into the input line and press ENTER.
  4. You should see the following output in the Output Log:
LogPython: print("hello world")
LogPython: hello world
mostlyhuman commented 1 year ago

That worked correctly.

Output Log: LogPython: print("hello, world") LogPython: hello, world

danielbui78 commented 1 year ago

If that works, try running the python script again to see if you can get any new output. If it still does not work, then please make a video of the entire process from launching Daz Studio and Unreal project, running the DSA debug script, waiting for the import to finish in Unreal and then running the Unreal python debug script and looking for Output Log output.

mostlyhuman commented 1 year ago

Here ya go:

https://user-images.githubusercontent.com/12530954/219880516-8cef6476-d437-4674-a672-685e67e85421.mp4

danielbui78 commented 1 year ago

Hi, thanks for the video. I was able to reproduce your issue using Daz Studio Public Beta 4.21.1.29 and Public Beta 4.21.1.41. It is working for me in the Release version, Daz Studio 4.21.0.5, please let me know if that works for you.

mostlyhuman commented 1 year ago

It does work! Is the bug in the bridge or something the studio devs need to work out? Either way, thank you for your time, I sincerely appreciate it!