Search Unity

  1. Unity 2019.2 is now released.
    Dismiss Notice

ProBuilder ProBuilder lightweight render pipeline material error

Discussion in 'World Building' started by FlockingBehavior, Jun 9, 2019.

  1. FlockingBehavior

    FlockingBehavior

    Joined:
    Jul 24, 2013
    Posts:
    8
    I am trying to create a polyshape at runtime while using the lightweight render pipeline. This throws an error in probuilder when it tries to get the default material. I don't have access to the logs right now, but I can reliably reproduce it and it goes away when I disable the lightweight render pipeline.

    I am using Unity 2019.1.5f1 and ProBuilder 4.0.5.
     
  2. gabrielw_unity

    gabrielw_unity

    Unity Technologies

    Joined:
    Feb 19, 2018
    Posts:
    653
    Hi, sorry for the wait - I'll give this a try but meanwhile could you (if not already) log a bug for this? (via Help > Report a Bug). Thanks!
     
  3. FlockingBehavior

    FlockingBehavior

    Joined:
    Jul 24, 2013
    Posts:
    8
    I cannot reproduce it in the Unity Editor, only in builds (Android, Oculus Quest).
    It's hard to pull the full logs from the device, but here's the relevant log lines:

    NullReferenceException: Object reference not set to an instance of an Object
    UnityEngine.ProBuilder.BuiltinMaterials.Init () (at)
    UnityEngine.ProBuilder.BuiltinMaterials.get_defaultMaterial ()
    UnityEngine.ProBuilder.MeshOperations.AppendElements.CreateShapeFromPolygon ()
     
  4. unity_BA_K1gYb6WCNpg

    unity_BA_K1gYb6WCNpg

    Joined:
    Nov 6, 2018
    Posts:
    1
    I am also seeing this when building a Polyshap, it happens in WebGL, it seems to only happen once and there isn't anything visually wrong afterwards
     
    FlockingBehavior likes this.
  5. Florian_Amthor

    Florian_Amthor

    Joined:
    Nov 27, 2015
    Posts:
    1
    If anyone still sees this error i found a workaround.

    When you call mesh.CreateShapeFromPolygon(...) surround it with a try catch block.

    It's dirty but it's working for the moment until that matter gets clarified.

    There is also the problem - and maybe the source - that the materials from ProBuilder package(v4.1.0 and older 4.x.x versions) won't be converted properly to be usable with the HDRP.

    Materials are found in Packages/com.unity.probuilder(ProBuilder)/Content/Resources/Materials

    upload_2019-11-1_18-30-44.png upload_2019-11-1_18-30-56.png
     
    FlockingBehavior likes this.