Skip to content

Wrong size of baking texture was created #117

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

Open
bbccyy opened this issue Aug 9, 2022 · 0 comments
Open

Wrong size of baking texture was created #117

bbccyy opened this issue Aug 9, 2022 · 0 comments

Comments

@bbccyy
Copy link

bbccyy commented Aug 9, 2022

The problem code locates right at method "PrepareBoneTexture" in script file "AnimationGenerator.cs". According to the code, one can not generate any texture with the size equal to variant "textureWidth" which describes the size of last texture (which is miss-estimated as well).

for (int i = 0; i != count; ++i)
{   //如果有多张纹理,既count > 1,理论上最后一张纹理的size使用textureWidth标记的值(一般会小于1024)
    //the problem code lies below,correct code in condition statements should be: count > 1 && i < count -1 ? ...
    int width = count > 1 && i < count ? stardardTextureSize[stardardTextureSize.Length - 1] : textureWidth;
    bakedBoneTexture[i] = new Texture2D(width, width, format, false);
    bakedBoneTexture[i].filterMode = FilterMode.Point;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant