| Description | When an image changes on disk, an integration calls RaiseTextureChanged on the texture provider it gave Studio
through Studio::Options::GetTextureProvider, with the Uri the provider was asked for, as Noesis's Unreal plugin
does (FNoesisStudioTextureProvider::OnTextureChanged, with the Uri it recorded in GetTextureInfo). Studio keeps
showing the old image.
The provider's TextureChanged() delegate has no handler while Studio is
open, so nothing in Studio hears the raise: no GetTextureInfo follows, and the image isn't loaded again.
The same provider given to GUI::SetTextureProvider for an ordinary view has one handler, and the same raise is
followed by a GetTextureInfo call with the new size.
Steps to reproduce
- On Windows, with
NOESIS_SDK_DIR set, run powershell -ExecutionPolicy Bypass -File build.ps1 in minimal/.
It builds repro.cpp against Noesis.lib and NoesisEditor.lib and runs repro Repro.noesis studio 3 times
and repro Repro.noesis view once, on a fresh copy of project/ each time.
- The provider serves one image: 8 x 6, then 16 x 12 once it "changes". It logs each
GetTextureInfo with its Uri
and keeps the Uri object it last received.
studio: the provider is returned by GetTextureProvider, Studio opens Page.xaml (an Image with
Source="swatch.png"), 60 updates. Then the image changes, RaiseTextureChanged(last) with the very Uri
GetTextureInfo received, 60 updates.
view: the same provider set with GUI::SetTextureProvider, Page.xaml loaded with GUI::LoadXaml into a
view, the same steps.
- Each prints the handlers on
TextureChanged and the GetTextureInfo calls after the raise. Exit 1 if none
came; build.ps1 exits 1 if a studio run got none.
Expected and actual
Expected: after the raise, Studio asks GetTextureInfo again (and LoadTexture, with a device), and shows the new
image.
Actual:
GetTextureInfo('studio:///Repro;component/swatch.png', GetPath 'swatch.png') -> 8 x 6
GetTextureInfo('studio:///Repro;component/swatch.png', GetPath 'swatch.png') -> 8 x 6
2 GetTextureInfo call(s) before the change; handlers on TextureChanged: 0
RaiseTextureChanged('studio:///Repro;component/swatch.png'), the Uri GetTextureInfo last received
studio: 0 GetTextureInfo call(s) after the raise
The control:
GetTextureInfo('swatch.png', GetPath 'swatch.png') -> 8 x 6
GetTextureInfo('swatch.png', GetPath 'swatch.png') -> 8 x 6
2 GetTextureInfo call(s) before the change; handlers on TextureChanged: 1
RaiseTextureChanged('swatch.png'), the Uri GetTextureInfo last received
GetTextureInfo('swatch.png', GetPath 'swatch.png') -> 16 x 12
view: 1 GetTextureInfo call(s) after the raise
|
|---|