Skip to main content
Participant
Jul 5, 2021 8:09 PM UTC
Question

Unity crashes after changing SubstanceGraph textures resolution from a script.

Unity Version: 2020.3.11f1

Plugin Version:2.6.0

 

substanceGraph.SetTexturesResolution(new Vector2Int(512, 512));

substanceGraph.QueueForRender();
substanceGraph.RenderSync();

 

throws:

 

NullReferenceException: Object reference not set to an instance of an object
at Substance.Game.NativeCallbacks.csGameTextureCallback (System.String assetPath, System.IntPtr preComputeCallback, System.UInt32 outputHash, System.Int32 pSubstanceFormat, System.Int32 channelsOrder, System.Int32 width, System.Int32 height, System.Int32 mipCount, System.IntPtr sPixels) [0x001a1] in <8088e596cdc64f389f7f79f32b7b19f0>:0
at (wrapper managed-to-native) System.Object.wrapper_native_00007FFF4CC95360()
at Substance.Platform.NativeFunctions.cppProcessQueuedOutputs () [0x00039] in C:\..\Assets\Allegorithmic\Plugins\Substance.Platform\NativeFunctions.cs:864
at Substance.Game.NativeCallbacks+Renderer.ProcessJobs () [0x00012] in <8088e596cdc64f389f7f79f32b7b19f0>:0
at Substance.Editor.SubstanceMain.Update () [0x00119] in <c02c644420904d8cb7f0dbe27269d0c2>:0
at (wrapper delegate-invoke) <Module>.invoke_void()
at UnityEditor.EditorApplication.Internal_CallUpdateFunctions () [0x00076] in <0b8db76a688c4d18a15dd7dfe092a035>:0

This topic is closed to new replies. Start a new post to keep the conversation going.

3 replies

Participant
Sep 24, 2021 8:00 PM UTC

We're having the same issue and callstack on Unity 2021.1.4f1 with Substance 2.6.0.

This did not happen on Substance 2.5.3 (haven't tested 2.5.4 yet), so we have to stay on that version until this is fixed.

The crash does not happen in 2.6.0 if we take out the SetTexturesResolution call.

Translate
Participant
Oct 10, 2021 3:24 AM UTC

Hey guys i am having a similar problem on unity 2020.3.17f1 every time i try and use sbsar files but i am dragging and dropping though, is there other precautions i should be taking?

Translate
Inspiring
Jul 21, 2021 7:22 PM UTC

@Woof15A8 Apologies, it looks like we missed your post! I don't have an answer at this moment but will follow up with you as soon as the team reviews it.

Translate