Open Uqbc9 opened 2 years ago
We summon @IllusionMods @ManlyMarco
How do we get this Export-Material fixer to work in 2022 with HS2 BR8 models, to setup the FBX file in Blender 3.0, 3+? Was this mod made it only work in ancient versions of Blender? Help us please in these dark days.
I am downloading the latest torrent (BR11) and I will update the scripts to work with it. It will take a while though (probably won't happen for at least two weeks).
@veryfancypants Thank you for returning, and for saying you'll update.
I thought it was working correctly, but I may have messed it up somehow. I found the BR8 torrent, going to download it and try it first. Any specific models you'd like me to test?
Thank you. Can you clarify which setting counts as a model in HS2 (you mean a setting that changes the body weights correct)? Please test what I am using:
RE Body: Uncensor Female BP4 Meaty 1
FYI, I just noticed that if I set my model to use the custom pussy (not use Default), (and then export), that merely changing the pussy adds extra bones (vagina) and toe bones. So maybe that is one reason why your Blender body meshes/rig didn't match (if your rig didn't have the extra vagina and toe bones)? Hope it helps.
By 'model' I mean one of the included characters, but I'll try to build one as you describe.
In the mean time, I've pushed an updated blend file, it's work in progress but see if it works for you any better. I've decided that asking users to edit the Python script is too problematic, so there are UI controls instead. (For now, ignore the "presets" controls, they aren't fully hooked up.)
Updated procedure: Export textures+fbx with MeshExporter and make a unity dump. Supposing that the export is in c:\temp\HS2\export\BR-Chan, it should be arranged like so: c:\temp\HS2\export\BR-Chan\ . BR-Chan.fbx . unity_dump.txt (can be named anything you want, as long as it's a .txt) . Textures\ .. cf_m_skin_body_00_MainTex.png .. ... (lots more png's)
Put "c:\temp\HS2\export\BR-Chan" in "Char directory:" Hit "Import model"
One thing I've noticed is that getting the correct Unity dump may be difficult, because there are many different "cf_J_Root" nodes in the scene, and only one of them is "correct". If you dump the wrong one, the armature won't work correctly. As an alternative, you can dump the "CommonSpace" node instead, there should be only one of those. You can tell that you have the correct dump if, after import, shoulder/elbow/wrist bones start inside the body.
Wow beautiful! I have never seen a working Blender file except in the Cira 2021 video. Thank you so much for continuing your work on this.
What is your Gumroad so I can donate? :)
FYI everyone: Troubleshooting:
{My notes/questions to you are in these brackets.} {To make problems easier to recreate for you, I Exported the vanilla Hayashi model so we have the same settings (but also my character worked/errored in the same ways below:}
Pending Issues:
After “Import model” the Head texture does not complete, it is gray.
Body main texture did not seem to load at all, it is a generic skin color without the details of the skin texture, e.g. no freckles, spots.
Body texture has nail texture, but no Nipple texture/color (generic skin color).
Eyes: I don't know how to setup the texture layers in Blender, but the Iris color is being blocked by another eye mesh, that isn't set to transparent or alpha/Mask is wrong.
Eyebrows: the alpha is not showing correct to “Mask” and only display the lash pixels. Instead it shows the full eyebrow mesh as a color.
Clothes: the alpha is not showing correct to “Mask” and only display the correct parts.
The accessories are not positioned to the correct bones. They are on the floor (0, 0, 0). A. {If you import the FBX character in Blender using Better FBX plugin, then this mod puts the accessories on the correct bones. But Better FBX loads bone orientation differently than your file. Thus I am unsure which mod to use first.}
Questions:
I found cf_J_ArmElboura_dam_L (not weighted), which is the controller bone for cf_J_ArmElboura_s_L (weighted). Why does HS2 use 2 bones to do the job when one bone could be moved (with the weights)?
I see you have the joint corrections working for the elbow/arm bend (extra Weight paints). I see the Copy Rotation. Did your script/the dump file set those up? It was my understanding that FBX files cannot save Bone Contraints (the Grey's export), and must be baked into animations as FBX files (if we want to export anims out of Blender)?
Do you want me to start specific Issue threads for specific issues? Thank you so much :)
Thanks for giving reply updates :) How can I donate to you?
Does it matter which Blender version we use for your file? I'm in 3.0. Here are files (dump, text, Fbx, + Character cards) for 2 characters:
Thanks for doing those constraints, it is a lot. Is there a way to verify if they are correct (HS2)? I want to edit anims and have wrist twisting. Then put back into HS2.
Do you know the hierarchy bone list for HS2 rig, or know someone who does? The names are cryptic.
As long as you're not getting warnings about incompatible versions, Blender version shouldn't matter. I'm using 3.3.1.
The first dump works correctly here. The script has a few difficulties with the second dump, one major problem is that it pulls in hat textures into the head material in several places. I'm going to try to figure out why it happens.
Here's what I get after manually fixing the textures and tweaking a few material settings:
I've added some logic to place accessories in the right places (work in progress), and it adds the veins as subsurface material. The Hanmen skin shader probably has some additional tricks but I'd need to look into it to get the full effect.
I'll push the updated blend file later, after I've worked out why it loads wrong textures.
What do you mean by twist bones? You have one pose bone per joint. E.g. in the left arm, you have cf_J_Shoulder_L (breastbone to clavicle), cf_J_ArmUp00_L (clavicle to upper arm), cf_J_ArmLow01_L (elbow), and cf_J_Hand_L (wrist), each can be rotated around all three axes (which is kind of cheating, since you don't have three degrees of freedom in your real joints, but I didn't get the "correct" constraints fully worked out, and sometimes you can't get the pose you want without cheating.) There's a couple of s bones in each joint with weight paints. And there are dam bones that do joint corrections. E.g., when you twist cf_J_ArmUp00_L along its length, joint corrections rotate cf_J_ArmUp01_s_L and cf_J_ArmUp02_s_L in the opposite direction, so that you get a smooth increase in twist from shoulder to elbow.
You can see the architecture in Blender, just expand the armature in the outliner window.
As long as you're not getting warnings about incompatible versions, Blender version shouldn't matter. I'm using 3.3.1.
Wow, thank you for confirming the version you use, and that statement is incorrect. I installed Blender 3.3.2 LTS (Long Term Support version, which was the closest I could find to 3.3.1). https://www.blender.org/download/lts/3-3/
And so many things were fixed:
Things that aren't fixed for me:
one major problem is that it pulls in hat textures into the head material in several places. I'm going to try to figure out why it happens.
Thanks for your work on this :) How about a https://ko-fi.com/about that I can donate to you, if you don't have Gumroad?
Can you please help with an issue in the meantime? Thank you.
Because I cant use Better FBX to Export. It exports the Armature as HS2 proportions, and the Meshes as my Character proportions (don't match).
So I need a way to apply/finalize my Armature proportions in your Blender file (so I can Export or continue using your file).
Example when I go to Edit mode, the Body mesh shifts.
And if I click these 2 cage icons, it fixes it in Edit mode. But not for Export, or if I change the Armature to a Rig tool, the Meshes get stuck in your HS2 proportions.
And "Apply" the Armature modifier isn't working. In one file, if I "Apply" the Armature modifier (it disappears), and then I remake the Armature modifier, the mesh deforms shorter and distorted.
And in the BR chan2 file, if I click Apply, it says "Modifier cannot be applied to a mesh with shape keys." So I am stuck, I cannot Export your product as FBX or continue animation work in your Blend file :(
I got Hanmen's next gen textures and managed to enable subsurface scattering effects similar to what his "next gen body/face" shaders do. It's not quite the same but it produces some interesting effects. Cycles without SSS (some manual tweaking, HairTool hair and eyebrows): Cycles with SSS:
"How do I apply/finalize my Armature proportions to the Meshes that your script sets up"
If I understand the question correctly, unchecking "Refactor armature" will do the job.
- Eye/hair colors are not in the dump. The dump is strictly geometry. That's one of the difficulties with doing a proper export - settings like hair colors, skin gloss levels, bump levels (athletic/skinny/etc), need to be set up manually. If you make a preset file, you can put colors for each char in there, otherwise it starts with defaults. There are also hidden settings associated with each item of clothing, which the script can't set up automatically (you can see them in Material Editor), so, even if the script correctly identifies the object as clothing, to get it to look exactly like in the game, it needs to be tweaked by hand.
Sorry for posting to an old-ish thread, but couldn't you parse the character card png for all of this info? From what I understand, all customization data is appended after the IEND block. I don't know how practical or possible it is to shift through png bytes in Blender, but it would be a pretty concise way of accessing it all without needing to dump multiple components from Unity.
CttCJim has a nifty little standalone character editor which may have some ideas on how to do it/what to look for. It's written in C#, though.
Someone purged the videos or is gatekeeping information! I shall enlighten you with the video I found. https://vimeo.com/780198400
But even so, the code in this video does not match the current 2021 upload. So when I run the script, it displays an error, and not all textures get setup; or in different models, the body is deformed.
Look at the code change on October 16, 2021: https://github.com/veryfancypants/hs2_blender_export/commit/d44833949a5875e23c2f10dfdff5149cdf809d99#diff-de792ac8f74de70d362f452d6c8d082c2cb344961fed11c3f6020f50b35708a8
Line 34 in the old code (red) says:
dump='c:[\\temp\\dump.txt](file:////dump.txt)'
But in the new code (green), it is line 36 and says:dumpfilename='c:\\temp\\dump.txt'
So “dump” was changed to “dumpfilename.” We can use this as a version identifier. But if we download the “current” version with the Blender files, open it, go to line 34/36, we see that it says “dump” not “dumpfile.” This proves that the newer Blender file has not been updated with the newer code change. But it also does not work with the old code (of meshexporter.py). Something in the Blender file mismatches, and I get errors.
For even so, if I manually copy the new code of meshexporter.py into the Blender Script tab, I get an error when running it. What is this chaos?
The video (older version) also does not show how to use the UI. But a new video has not been shown.
We summon @veryfancypants @veryfancy @Lzzdyyy @youtoo123 to assist us in these dark times. You can upload a new video on www.vimeo.com which allows nudity (if that was the reason Youtube took down the prior video).
Help us get this script to work for HS2 BR8. I get mismatch errors and: