New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Center/Radius algorithm #69
Comments
Nothing for @niftools/blender-plugin-reviewer |
Did Does this mean that every Skyrim NIF ever saved by NifSkope has an incorrect Center/Radius if the data is I saw the basis of this ticket in the forums, and it had to do with an object showing up in the wrong position in the inventory, no? Can someone test running Mesh > Update Center/Radius on some Skyrim NIFs and see if some, all, or none of them shift their position in game? Not specifically in the inventory, but out in the world. I will also try to test this thoroughly when I can. Also, the Center/Radius appears to have no bearing on the position in NifSkope, and I am guessing if these values actually matter somehow, that these should be taken into account.. My guess is that the objects will not move out in the world because they use the actual origins of the meshes, and that for whatever reason they use the center/radius when positioning the object on screen for display in the inventory. Should FO3/NV also be taken into account here? I assume they either act like Oblivion or act like Skyrim for the algorithm choice, but nowhere is Fallout covered in the conditions for that function. Side note: I need to audit |
I have tested some files in Skyrim and Fallout3.
Fallout3:
So, for Skyrim is best solution to set consistency flags to It would be good to find if exists any Fallout3 or Skyrim vanilla nif with consistency flags set to
|
All 3 values are used in all of the mentioned games depending on item types. currently the plugin has a custom to store imported setting for this and defaults to static if setting in not found on export. |
This is something that needs to be added as general documentation |
NifSkope has two algorithms for computing the
Center
andRadius
values ofNiTriShapeData
/NiTriStripsData
blocks. One algorithm computes the center of the data's bounding box, and one uses another method (some kind of vertex average?).In NifSkope mesh.cpp#L618 the algorithm chosen depends on the NIF version or if
Consistency Flags
is set toCT_VOLATILE
. See: mesh.cpp#L634. (That condition was surely written before Skyrim.)I have checked several Skyrim NIFs and found that their
Center
andRadius
values are precisely like using the bounding box algorithm but instead have theirConsistency Flags
set toCT_STATIC
. So, in NifSkope when Mesh > Update Center/Radius function is used on Skyrim NIFs, it produces different Center/Radius values because it chooses the second method.I think that the condition should be changed such that in the case that
Consistency Flags
is set toCT_STATIC
, the first method (Bounding box) is used instead.The text was updated successfully, but these errors were encountered: