Filetexture not loading when Opening Gamma but doing it when F8-F5 recompilation

Hello,
it will be difficult to show it with a simple sample patch.
In my App, my brushes module is giving me hard time:

  • when i open gamma and load my project the path are correctly done, but the texture are not loaded in preview in i m Gui, nor in my drawing application
  • if i recompile F8-F5, everything works.
  • if i recompile several time also

If i use my standalone Help patch, on open of Gamma the texture are correctly shown on first compilation.
I m a bit connfused on how to fix this problem. If anybody has an advice on how to fix I will gladdly hear it !



image

Sounds like I have the same issue. When loading the filetextures stay on either IsLoading true and output is NULL or sometimes IsLoading is false, but the output is still NULL. Pressing F9 to reload fixes it.

This is with the patch running. No errors. The output is NULL on both. After F9 they are loaded.

Maybe some regression in the Filetexture node?

1 Like

I was just contemplating how to maybe catch this error and somehow reload the FileTexture node when it outputs NULL. I was thinking with the Try region, but when the output is NULL it didn’t actually throw an error:

(in this instance I just input an invalid path).

That proposed IsAssigned region might be nice, but it would also need some way to Reset the Region on Failure like the Try. Or maybe some combination of the 2.

I will also try with ManageProcess and see if I can reset the node (maybe with a limit so it doesn’t do it constantly) if the FileTexture outputs NULL, even though it shouldn’t.

if it shouldnt isnt it a bug rather than a special technique to apply ?

Could this be because somewhere you are not checking whether your texture is NULL or not? It’s not clear from the screenshots exactly what’s going on, and I’m not sure exactly how the image is being loaded.

But I would like to point out that FileTexture (we are talking about the Stride version, right?) creates an asset with texture path data. This is roughly an asynchronous process, it is not loaded immediately. Until it is loaded, the output is unfortunately NULL.

upd: I took a closer look at the screenshots and it hit me. I think I know what’s going on. The thing is that loading a texture does not load an image, it creates an asset in the Stride backend. So an entity with the path to the image file is created. Then a function that manages the state of this asset is called on update. And when the file is loaded, this function reports completion and that the file has been loaded. Without calling this function, you will not get the image. And after reloading, everything works immediately because the asset is cached on the backend and the Stride’s cache is not released when the patch is restarted.

You can probably make custom filetexture node and provide asset instead of texture.

Screenshot

thank you @yar . when i will have found to fix my broken stride i will rush on it !