Animation-Instancing icon indicating copy to clipboard operation
Animation-Instancing copied to clipboard

Wrong size of baking texture was created

Open bbccyy opened this issue 2 years ago • 0 comments

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;
}

bbccyy avatar Aug 09 '22 04:08 bbccyy