6 votes Vote

Enabling Override Exposed on a Function inside a biome breaks generation

Unity 2020.1.6f1/MM 2.0.8
I have a setup where I have main graph having a Biome Set, two biomes there and inside these biomes, I have some functions. Everything works until I check Override Exposed in any of those functions. This issue only happens when I have the Function inside a Biome. If I use the biome graph directly, everything works fine.
Happens 100% of times in playmode and only sometimes in edit mode

I'm sending you an email with 3 simple graphs to reproduce this.

This is the stack trace I got:
Thread failed: UnityEngine.UnityException: CreateScriptableObjectInstanceFromType can only be called from the main thread.
Constructors and field initializers will be executed from the loading thread when loading a scene.
Don't use this function in the constructor or field initializers, instead move initialization code to the Awake or Start function.
at (wrapper managed-to-native) UnityEngine.ScriptableObject.CreateScriptableObjectInstanceFromType(System.Type,bool)
at UnityEngine.ScriptableObject.CreateInstance (System.Type type) [0x00001] in :0
at UnityEngine.ScriptableObject.CreateInstance[T] () [0x00001] in :0
at MapMagic.Nodes.Graph.Create (MapMagic.Nodes.Graph src, System.Boolean inThread) [0x0001a] in C:\Dev\Unity\project\Assets\3rdParty\MapMagic\Nodes\Graph.cs:43
at MapMagic.Nodes.Biomes.Function200.GetSubGraph (MapMagic.Products.TileData parentData) [0x0002d] in C:\Dev\Unity\project\Assets\3rdParty\MapMagic\Generators\Biomes\Runtime\Function.cs:129
at MapMagic.Nodes.Biomes.Function200.Generate (MapMagic.Products.TileData data, MapMagic.Products.StopToken stop) [0x00023] in C:\Dev\Unity\project\Assets\3rdParty\MapMagic\Generators\Biomes\Runtime\Function.cs:185
at MapMagic.Nodes.Graph.GenerateRecursive (MapMagic.Nodes.Generator gen, MapMagic.Products.TileData data, MapMagic.Products.StopToken stop) [0x00149] in C:\Dev\Unity\project\Assets\3rdParty\MapMagic\Nodes\Graph.cs:778
at MapMagic.Nodes.Graph.GenerateRecursive (MapMagic.Nodes.Generator gen, MapMagic.Products.TileData data, MapMagic.Products.StopToken stop) [0x00035] in C:\Dev\Unity\project\Assets\3rdParty\MapMagic\Nodes\Graph.cs:750
at MapMagic.Nodes.Graph.Generate (MapMagic.Products.TileData data, MapMagic.Products.StopToken stop) [0x00039] in C:\Dev\Unity\project\Assets\3rdParty\MapMagic\Nodes\Graph.cs:732
at MapMagic.Nodes.Graph.Generate (MapMagic.Products.TileData data, MapMagic.Products.Stop

Refeas, 27.09.2020, 13:32
Idea status: completed

Comments

Wraith, 29.09.2020, 13:25
Reproduced, planned for 2.1.0
Wraith, 05.12.2020, 11:55
Fixed for 2.1.0
Refeas, 05.12.2020, 12:31
That's great news! Would it be possible for me to send you our graphs to test if everything works before you release since you made a lot of changes to the workflow based on your Gitlab?
Wraith, 05.12.2020, 14:14
There is pretty big change in exposing values - it's re-made from scratch, and now you can use expressions in exposed values like formulas, vector channel selections, etc. However you will need to re-expose all the values once again.

I've tried exposing values inside biome, and it seems to be working as it should.

Leave a comment