Skip to content

Wrong size of baking texture was created #117

Open
@bbccyy

Description

@bbccyy

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @bbccyy

        Issue actions

          Wrong size of baking texture was created · Issue #117 · Unity-Technologies/Animation-Instancing