Search Unity

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. hadtofall

    hadtofall

    Joined:
    Aug 28, 2020
    Posts:
    7
    Have you solved your problem yet? I have also encountered this problem
     
  3. carmofin

    carmofin

    Joined:
    May 13, 2017
    Posts:
    116
    Anyone has an idea? This has been driving me crazy...
     
  4. carmofin

    carmofin

    Joined:
    May 13, 2017
    Posts:
    116
    Ok, to be a bit more precise:

    I'm using an enemy model that I found fitting my purpose, a bubble enemy.
    But the bubble enemy has ears, which I don't need. So, I adjusted the model in Blender and reshaped the ears into a flat surface.
    However, of course the ears are still in all the animation FBX models.
    And I assume this is where the problem comes from.
    In the editor everything looks absolutely fine.
    But as soon as I create a build, the models do not show up in the game.
    Any ideas how I could fix this?
     
  5. carmofin

    carmofin

    Joined:
    May 13, 2017
    Posts:
    116
    I have now gotten closer to understanding the issue.
    The provided FBX file contains no armature bones,or rather they must get lost by importing to blender.
    When I export it back to fbx, the file comes out with this warning. Works completely fine in the editor though.
    I'm quite bummed out about this.
    All I want is to move a few vertices of the model...
     
  6. Marteen0

    Marteen0

    Joined:
    Apr 11, 2024
    Posts:
    1
    U may make your model Read/Write first