Open AkaShrug opened 10 months ago
Generally not - frame analysis can only dump the buffers that are passed to the GPU, while the conversion to world space occurs in the vertex shader.
There are two ways this could conceivably work:
If you are able to find a suitable matrix, dump out the constant buffer it is in with frame analysis, then modify the blender addon to multiply the coordinates by that matrix (which might be in row-major or column-major order changing which way around the multiplication goes).
There are probably a few too many game specific aspects of this to realistically add this to the generic script, but maybe we could add an optional field for it in the importer that could work in some games.
Hi xodd! I figured I would post my response to the question here so the response would be visible.
For unity games that do posing in the GPU and have the Skinning/Draw split into different calls (e.g. all Mihoyo games), there are specific VS that draw the model to the screen and contains information on the world location of the model - I believe in Genshin, that data is stored in CB2[0]-CB2[5] and CB3[21] (one is relative to the world, while the other is relative to the current camera location, can't remember which is which at the moment) and there are ~5 or so VS that contain the information (the ones that draw the model).
Using that in conjunction with the pose data it is possible load the "true" position of the model in blender - I actually did something similar when getting the animations to work, since replacing the pose data alone isn't sufficient (since even with the new animations the model will still rotate/move as the character breaths/attacks). This could be extended to actually load custom animations into Blender from the frame analysis folders, though I only got the first portion of that (pose) working and never managed to implement the world location portion.
Generalizing this to other games would be tricky since they may have different methods of calculating where the model is located (they might not use the same formula, though I'm guessing the form would be fairly similar since it is just a matrix multiplication).
can addon import models in same positions as world space (im not sure thats what it is called ) i only know about pose cb import but not sure if thats what needed here or does 3DMigoto Framedump have such data ? i only checked few places but dont think i found anything my end goal is just being able to import framedump with all models positoned (location) in same way as in-game