Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We are updating our Terms of Service for all Unity subscription plans, effective October 13, 2022, to create a more streamlined, user-friendly set of terms. Please review them here: unity.com/legal/terms-of-service.
    Dismiss Notice
  3. Have a look at our Games Focus blog post series which will show what Unity is doing for all game developers – now, next year, and in the future.
    Dismiss Notice

Added SkinnedMesh not saved properly

Discussion in 'Animation' started by charanim3dofficial, Dec 19, 2021.

  1. charanim3dofficial

    charanim3dofficial

    Joined:
    Apr 28, 2019
    Posts:
    7
    Hello fellow unity users, I am working on an asset that adds a SkinnedMesh to an existing GameObject in the Editor. In the editor, I am able to add the skinnedmesh, and it works perfectly. I am able to modify move the bones.

    The issue is when I close and reopen Unity Editor, the SkinnedMeshRenderer breaks, and I get the error
    The assigned mesh is missing either bone weights with bind pode, or blend shapes. This might cause the mesh no to render in the Player. If your mesh does not have either bone weights with bind pose, or blend shapes, use a mesh renderer instead of SkinnedMeshRenderer.


    - I tried to create separate prefab dragging the gameObject from the hierarchy to Project, it did not work.
    - suggestion https://answers.unity.com/questions/673834/updating-prefab-with-skinned-fbx.html
    - I tried to create a new prefab, then edit the prefab did not work.
    - guide: https://docs.unity3d.com/Manual/EditingInPrefabMode.html

    Any help will be deeply appreciated, thanks.

    Code
    Mesh meshCopy = meshFilter.sharedMesh;
    meshCopy.boneWeights = boneWeights;
    meshCopy.bindposes = bindPoses;

    meshFilter.gameObject.GetComponent<SkinnedMeshRenderer>().sharedMesh = meshCopy;
    meshFilter.gameObject.GetComponent<SkinnedMeshRenderer>().bones = context.bones;
    meshFilter.gameObject.GetComponent<SkinnedMeshRenderer>().rootBone = context.amature;
     
  2. wechat_os_Qy0y56RVQkvKpad5AMJzhmLk8

    wechat_os_Qy0y56RVQkvKpad5AMJzhmLk8

    Joined:
    Aug 28, 2020
    Posts:
    6
    Have you solved your problem yet? I have also encountered this problem
     
unityunity