Author Topic: 2018.x asset isProcessing property  (Read 1883 times)

I'm upgrading my asset to use the new plugin in Unity 2018.1 and I can't find a replacement in the API for ProceduralMaterial.isProcessing - does anyone know how to check the new Substance.Game.SubstanceGraph if it's currently rebuilding any textures?

Quick glance through the API doesn't reveal anything useful. There may be something you can do to hook into callbacks used for substances, but those are buried in the C++ end of the plugin (and they don't actually seem to have callbacks for specific substances). Looks like the current approach is just to call QueueForRender() on the graph and let things take their course, which is not exactly ideal.

Thanks for replying. I did see something in the cpp about a callback but the API documentation is more of a meta shell rather than describing anything and providing examples which is what I usually rely on.

Unfortunately I really can't just QueueForRender() and then wait because my planet texture build process is relying on sequentially building textures using the same SubstanceGraph and then copying textures before building the next one.

I see this in the documentation:
Code: [Select]
cppSetCallbacks()
static void Substance.Game.NativeFunctions.cppSetCallbacks ( System.IntPtr log,
System.IntPtr texture,
System.IntPtr graphInitialized
)

...but I'm not sure how to use it. Any suggestion would be appreciated. I guess this should enable me to get a callback when a graph is initialized (does that mean finished building?) and what do I do with a System.IntPtr? =)

Still no success on this for me. @Allegorithmic - how do we find out if a SubstanceGraph is processing?

Still no success on this for me. @Allegorithmic - how do we find out if a SubstanceGraph is processing?

Hi Stefan,

We don't currently have a function for this in the API. The API is till being worked on but we are looking at adding this functionality in a future update where you can use a function to check to see if a substance graph is queued/processing.

Cheers,
Wes
Head of Substance Demo Art Team
the3dninja@adobe.com
Twitter: The3DNinja

Still no success on this for me. @Allegorithmic - how do we find out if a SubstanceGraph is processing?

Hi Stefan,

We don't currently have a function for this in the API. The API is till being worked on but we are looking at adding this functionality in a future update where you can use a function to check to see if a substance graph is queued/processing.

Cheers,
Wes

Ok, thanks for response and for confirming. Hope to see it added - I use it for progressively updating textures in my procedural planets so it waits for processing to finish before moving on to the next resolution. I also use it for callbacks so people using my procedural planets can be sure that a planet has been generated in case they want to hide it or use cut scenes while it is being generated.