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

.blend file: prevent lights and camera from being part of prefab

Discussion in 'Asset Importing & Exporting' started by lambch0p, Feb 11, 2022.

  1. lambch0p

    lambch0p

    Joined:
    Oct 22, 2014
    Posts:
    62
    Hi,
    I've created my character model/rig in Blender and can import the .blend file into Unity directly and everything is OK. However, I now want to use Blender to render still images of different skins that will be used as Thumbnails in my IAP store.

    I've created cameras and lights (C&L) in Blender to that I can render different skins from the same position but the lights and camera now show up in Unity.

    I've tried disabling the C&L in Blender but they still get imported. Is there a way to have them exist in the .blend file but prevent them from coming into Unity?

    I'd rather not have to maintain two different blender files; one for the model and one for rendering the skin thumbnails.

    Thanks
    M
     
  2. koirat

    koirat

    Joined:
    Jul 7, 2012
    Posts:
    2,008
    In blender you only select the objects you want to export. Than in FBX you enable Selected Only checkbox.
     
  3. lambch0p

    lambch0p

    Joined:
    Oct 22, 2014
    Posts:
    62
    Thanks. I am not exporting from Blender. Unity is able to recognise .blend files now so they can be imported directly without needing to convert them to .fbx files. This means that edits I make in Blender appear straight away in Unity.

    A workaround is to create a prefab from the .blend model. This can then be edited and the lights/cameras removed.
     
  4. bastien_humeau

    bastien_humeau

    Unity Technologies

    Joined:
    Jun 14, 2017
    Posts:
    176
    Hey @lambch0p,

    The ModelImporter in Unity has options to enable/disable Lights and Camera import on the Model panel of the Inspector when you select an imported model.
    If you deactivate the Lights and Camera options, then the Lights and Cameras components will not be added to the Prefab, see https://docs.unity3d.com/2021.2/Documentation/Manual/FBXImporter-Model.html for further reference on the available options.
     
  5. lambch0p

    lambch0p

    Joined:
    Oct 22, 2014
    Posts:
    62
    Thank you!