DarkStarSword / 3d-fixes

Stereoscopic 3D fixes using Helix mod & 3DMigoto
108 stars 128 forks source link

error when exporting 3dmigoto #30

Closed deadcelebrity closed 5 months ago

deadcelebrity commented 7 months ago

Game: Power Rangers: Battle for the Grid Engine: Unity 2019

I get the following error when using the 3dmigoto blender plugin:

Python: Traceback (most recent call last): File "C:\Users\jubil\AppData\Roaming\Blender Foundation\Blender\3.6\scripts\addons\blender_3dmigoto.py", line 2610, in execute export_3dmigoto(self, context, vb_path, ib_path, fmt_path, ini_path) File "C:\Users\jubil\AppData\Roaming\Blender Foundation\Blender\3.6\scripts\addons\blender_3dmigoto.py", line 1694, in export_3dmigoto vertex = blender_vertex_to_3dmigoto_vertex(mesh, obj, blender_lvertex, layout, texcoord_layers, None, translate_normal, translate_tangent) File "C:\Users\jubil\AppData\Roaming\Blender Foundation\Blender\3.6\scripts\addons\blender_3dmigoto.py", line 1440, in blender_vertex_to_3dmigoto_vertex vertex[elem.name] = list(mesh.vertex_colors[elem.name+'.RGB'].data[blender_loop_vertex.index].color)[:3] + \ KeyError: 'bpy_prop_collection[key]: key "COLOR.RGB" not found'

It is also worth noting that I'm unable to export the models in a T or A-pose, they instead export in their pose at the time of the frame capture.

DarkStarSword commented 7 months ago

The issue with Unity games dumping the already posed model is known and related to a pre-skinning pass that Unity performs. If you are lucky the game in question performs that pass on the GPU where there is still a chance for us to intercept it and inject a modified model, but if you are unlucky it might perform it on the CPU where 3DMigoto cannot intervene.

I recently explained how you can determine which case it is by examining the frame analysis log file in another ticket - refer to this comment for details: https://github.com/bo3b/3Dmigoto/issues/187#issuecomment-1913989451

If you do determine that the pre-skinning is taking place on the GPU then the vanilla version of my script still cannot work with these (I have some progress towards that goal, but it is nowhere near ready), but some of the game specific forks have been made to work with them - most notably GIMI for Genshin Impact: https://github.com/SilentNightSound/GI-Model-Importer/tree/main/Tools . I believe these forks do have some hard coded offsets so may need some tweaking to work with other games.

As for the COLOR.RGB not found message - can you please attach your frame analysis dump and I'll take a look and see what's wrong (preferably the full dump including log file, .txt and .buf files, but at least the log file and .txt files from the problematic draw call)

deadcelebrity commented 7 months ago

I figured out the COLOR.RGB, I needed to add a vertex color attribute. GIMI seems to have fixed my case, thank you for your help.