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 have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Blender - Unity viewport invisiblity

Discussion in 'Asset Importing & Exporting' started by mastertesty, Aug 25, 2015.

  1. mastertesty

    mastertesty

    Joined:
    Aug 12, 2015
    Posts:
    11
    Hella!

    In blender, when we dont want some object stay visible in viewport, we click in eye in outliner and press i to exclude that object from animation. But, when i import this blend file animate to unity, all stay visible. Some solution for that?
     
    marcospgp likes this.
  2. theANMATOR2b

    theANMATOR2b

    Joined:
    Jul 12, 2014
    Posts:
    7,790
    You can export them separately from blender into Unity. They will still be visible but you can uncheck the mesh renderer.
    You can also just uncheck the mesh renderer if you export them together - if they are separate mesh objects.

    But to control the visibility you will need to code it.
     
  3. mastertesty

    mastertesty

    Joined:
    Aug 12, 2015
    Posts:
    11
    Really theANMATOR2b? Its so sad! xD

    I already think that possibility, but i dont wanna believe xD. Twice more work for something so simple...

    i test today vertex group with mask modifier and not work too... i so sad, would be much more ez just pass the model to unity like in blender...

    Ty for help. If anyone have better and more efficient idea, please post it.
     
  4. mastertesty

    mastertesty

    Joined:
    Aug 12, 2015
    Posts:
    11
    So, 2 days trying, i reach a satisfatory solution:

    In this page, you find the unity capable for blender possibilities:

    http://docs.unity3d.com/Manual/HOWTO-ImportObjectBlender.html

    Unhappy, vertex groups, some modifiers, and outliner setups are not avaiable. However, scaling, how everbody knows, is avaiable. So, insert one keyframe before to turn invisible, to reduce time of transition to 0, and one keyframe after scale 0 for all dimensions. Undo to turn visible again.

    This just transform the extra code work in extra blender work. But it is best for do the changes in animation, not in code, letting all organized.

    I yet looking for best alternatives...
     
  5. febucci

    febucci

    Joined:
    Sep 3, 2015
    Posts:
    19
    Try go in blender, edit mode, A (select everything (verts, edges or faces) in your mesh), then ctrl + N (calculate normals).
    Then go in unity and see. It worked for me.
     
  6. mastertesty

    mastertesty

    Joined:
    Aug 12, 2015
    Posts:
    11
    Nomalize points work for scaling and position object troubles. Not my case... unhappy...

    Ty for trying, its a real unity limitation, i already understood it...
     
  7. MattGen

    MattGen

    Joined:
    May 12, 2015
    Posts:
    63
    Switching on/off the mesh renderer is a better solution than scaling it.
    If I'm getting it right, you want that "invisible" mesh to be there, and to become visible when you need it ?
    I don't understand why you think it is "so much additionnal work" : a few lines of code and it's ok !
     
    theANMATOR2b likes this.
  8. mastertesty

    mastertesty

    Joined:
    Aug 12, 2015
    Posts:
    11
    Hello, thanks for reply.

    Was more aditional work cause have many animation trasitions. But its ok, i solve my work combining animator + blender. In other words, animator in unity record some functions in real time. xD. Its very ez an clean.

    Thanks for help anyway.
     
  9. s3509260

    s3509260

    Joined:
    Oct 4, 2021
    Posts:
    2
    How would I do that with a few lines of code? Should I add an event in the animator and write a script that toggles the mesh renderer??
     
  10. marcospgp

    marcospgp

    Joined:
    Jun 11, 2018
    Posts:
    162
    If you want to hide objects in a .blend file from Unity: with the file open in Blender, simply place the objects you want to hide in a separate collection and disable that collection by unticking its checkbox.

    The objects will then no longer be visible in Unity!
     
  11. fleity

    fleity

    Joined:
    Oct 13, 2015
    Posts:
    289
    Because I ran into this roadblock as well today:

    The case that I see in the OP is controlling mesh visibility from an animation clip made in blender. If you have an extensive animation workflow this is a much needed feature. lets say switching of head meshes (random number: 5) for facial expressions for example is your explicit use case.
    Unity has understood this is a wanted feature and it works when exporting from maya, fbx files from there animate the Renderer.enabled property of a mesh renderer. So far I could not reproduce this from any blender file export.
    Neither viewport nor render visibility are imported as an animated property into the anim clip in unity.
    Any ideas on how to get this working?

    (this is blender not saving certain animated properties in their fbx exporter, not technically a unity issue)
     
    Last edited: Jun 15, 2022