Search Unity

Question How can I import existing Blender prefab's materials into Shader Graph

Discussion in 'Editor & General Support' started by dmitryponv, Aug 18, 2022.

  1. dmitryponv

    dmitryponv

    Joined:
    Mar 9, 2021
    Posts:
    19
    I have a blender model with several materials and textures with a standard shader

    I want to change the shader to do something like a see-through wall
    Code (CSharp):
    1. https://www.youtube.com/watch?v=S5gdvibmsV0
    Or just simply change the transparency of the model,

    If I try replacing any materials in the model, I lose the texture on my model.

    I dont want to go through the process and re-add the materials and textures to the model from scratch since there is a few of them

    How can I import/create a shader graph with existing materials in the blender model and modify this shader graph?

    Thanks
     
  2. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    5,063
    If you want a custom shader you have to extract the materials from the model and put the shader on it. The default shaders aren't shader graph ones
     
  3. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    38,752
    There's no facility for that. Blender integration in Unity simply consists of a python script that Unity tells Blender to run, and that script exports your blend file as an FBX, which Unity imports.

    All the material and shader graph stuff is outside of that domain. Here's some more random Blender integration notes:

    Unity imports Blender3D objects as FBX via a little Python script:

    https://forum.unity.com/threads/from-blender-to-unity-problem.1073381/#post-6925811

    The Python script that Unity uses (substitute your Unity version number or search) to import:

    ./Hub/Editor/2020.2.1f1/Unity.app/Contents/Tools/Unity-BlenderToFBX.py


    More on fixing it:

    https://forum.unity.com/threads/all-my-mesh-folder-content-is-gone.1102144/#post-7094962

    Blender3D objects used as trees / detail in Unity3D terrain (See the second half of this response)

    https://forum.unity.com/threads/ter...trees-made-with-blender.1112119/#post-7155631

    https://forum.unity.com/threads/all...nging-parent-in-blender.1159283/#post-7442123

    Probuilder and Probuilderize and Blender:

    https://forum.unity.com/threads/probuilder-vs-blender.462719/#post-8060462

    Some more potentially-useful info:

    https://forum.unity.com/threads/orientation-problem.1265834/#post-8037734