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. Dismiss Notice

Reimporting characters and why we have to start all over again?

Discussion in 'Editor & General Support' started by skinwalker, Mar 27, 2018.

  1. skinwalker

    skinwalker

    Joined:
    Apr 10, 2015
    Posts:
    505
    Hello,

    I have multiple characters that when imported in Unity will be later edited (in Maya) and imported again with the new features. The problem is that I don't know a simple way of reimporting a model while keeping all of it's current state in each scene (all of the components attached and references). After each modification in Maya I have to delete the old character and start all over again from scratch, setting it up in every scene attaching every single component. Is it possible to simply replace the old character with the new one?

    I tried closing unity, deleting the old model and placing the new one with the same name, but when I open Unity, the model looks really broken.
     
  2. AlkisFortuneFish

    AlkisFortuneFish

    Joined:
    Apr 26, 2013
    Posts:
    959
    Hm? You should be able to directly replace the FBX file and do very little else to replace a model. We do on a daily basis. We don't even quit Unity for this, it just works.

    The only thing I can suggest is to ensure you have visible meta files so that any deletion will not lose the GUID of the asset.
     
  3. daxiongmao

    daxiongmao

    Joined:
    Feb 2, 2016
    Posts:
    395
    If you are making a prefab from the model in the scene, this basically disconnects it from the FBX file.

    I seem to find I can kind of think of the fbx file being like a prefab. When you assign the model in the scene to a prefab it is now connected there. So the mesh etc should update, but things like new nodes or renames don't seem to get updated anymore.

    I usually try to separate some of that where possible. And have a prefab then I can instantiate my mesh later at runtime from a reference. Or I will write tools to regenerate the config or post asset importer script to configure the fbx after import. Give it a model and hit a button and it will reconstruct the setup automatically.
     
  4. daxiongmao

    daxiongmao

    Joined:
    Feb 2, 2016
    Posts:
    395
    If you are changing bones or weightings this can also cause problems. Because locations are not updated in the prefab. It is possible through editor code to fix this. By adjusting bone locations and mappings etc. without having to rebuild it all.

    I would have to look up the script I created, but we had a problem where our artist would reskin or adjust a bone and the prefabs we had would be screwed up in some cases.
     
  5. AlkisFortuneFish

    AlkisFortuneFish

    Joined:
    Apr 26, 2013
    Posts:
    959
    Note that if you enable the optimised transform hierarchy on the model, updating prefabs will work fine as well, since the transform hierarchy won't change.
     
  6. skinwalker

    skinwalker

    Joined:
    Apr 10, 2015
    Posts:
    505
    Yes, I know that making it a prefab breaks the connection to the model prefab, so I dont bother making my characters into prefabs at all. The problem is for example I have a character with eyes in Unity, then I remove the eyes in Maya and replace the FBX, the result in the scene is really awful to look at.

    The only thing I can add to an existing FBX model in the scene is more blendshapes. Note that Im using SkinnedMeshRenderer.
     
  7. daxiongmao

    daxiongmao

    Joined:
    Feb 2, 2016
    Posts:
    395
    That doesn't sound right. If there is no prefab then it should update to the fbx contents.

    What do you mean it looks bad. Because there are holes in their head?
    Or because the skinning data is wrong and it looks like a blob of triangles?

    If you are using blend shapes did you update the blend shapes to remove the eyes? If your base mesh and the blendshapes verts do not match 1 to 1 then I think this will cause strange deformations.

    I am guessing though you can just drop the updated fbx back into the scene as a new object and eveything works ok? If so it's probably not s problem with the source. But maybe unity caching something.
     
  8. skinwalker

    skinwalker

    Joined:
    Apr 10, 2015
    Posts:
    505
    If I delete the eyes the materials are wrong and I have to manually reassign them. A few months ago I also tried editing the mesh and the results were really poor when I reimported it, so I had to manually add all of the components I previously had.
     
  9. skinwalker

    skinwalker

    Joined:
    Apr 10, 2015
    Posts:
    505
    I am still dealing with this problem, we added more bones and yes we are changing bones and weights, then the old mesh is completely broken, the new bones are missing from its hierarchy as well. Can you show that script or can someone suggest a workaround?

    I have lots of scripts on that game object, so if this wont work I will have to make a script to duplicate all of the scripts from the old one and transfer them to the new object.
     
  10. alienware377

    alienware377

    Joined:
    Jun 26, 2021
    Posts:
    2
  11. halley

    halley

    Joined:
    Aug 26, 2013
    Posts:
    1,862
    Don't just bump a five-year-old thread with no information at all. If you have an issue, make your own thread with specifics about your question.