View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0001951 | NoesisGUI | Unreal | public | 2021-03-26 15:29 | 2022-03-02 12:31 |
Reporter | Tadinu | Assigned To | hcpizzi | ||
Priority | normal | Severity | major | Reproducibility | always |
Status | resolved | Resolution | fixed | ||
Product Version | 3.0.11 | ||||
Target Version | 3.1.3 | Fixed in Version | 3.1.3 | ||
Summary | 0001951: XAML assets not recognized as placed in Plugin's Content | ||||
Description | In various places of NoesisGUI plugin sources, `/Game/` prefix is hardcoded, meaning the asset is presumed to reside under the Content folder of Project, however it does not work for ones in Plugin's Contents, notably these ones: https://github.com/Noesis/UE4Plugin/blob/master/Source/NoesisEditor/Private/NoesisXamlFactory.cpp#L341 https://github.com/Noesis/UE4Plugin/blob/master/Source/NoesisRuntime/Private/NoesisResourceProvider.cpp#L34 https://github.com/Noesis/UE4Plugin/blob/master/Source/NoesisRuntime/Private/NoesisResourceProvider.cpp#L63 https://github.com/Noesis/UE4Plugin/blob/master/Source/NoesisRuntime/Private/NoesisResourceProvider.cpp#L79 (1) I would recommend the argument being passed into `LoadXAML()` function be just the xaml asset name, and by using AssetRegistry, a `FAssetData` could be fetched based on that name as the key. Then that `FAssetData` could be converted to `UObject*`, in our case as `UNoesisXaml*` as noted here: https://docs.unrealengine.com/en-US/ProgrammingAndScripting/ProgrammingWithCPP/Assets/Registry/#convertingfassetdatatouobject* That operation actually also invokes `LoadObject()` under the hood. https://github.com/EpicGames/UnrealEngine/blob/master/Engine/Source/Runtime/CoreUObject/Public/AssetRegistry/AssetData.h#L248 That way, we would not have to preprocess the path with `/Game/`, regardless of where the asset resides, either in Project's Content or Plugin's Content folder. Besides, it would be great if you could make the loading asynchronous as recommended here in case we have numerous xaml asset widgets: https://docs.unrealengine.com/en-US/ProgrammingAndScripting/ProgrammingWithCPP/Assets/AsyncLoading/index.html (2) Otherwise, it looks like in here: https://github.com/Noesis/UE4Plugin/blob/master/Source/NoesisRuntime/Private/NoesisXaml.cpp#L13 We could pass the UE asset path as it is directly like these: Noesis::GUI::LoadXaml(TCHARToNsString(*(GetPackage()->GetPathName())).Str()); Noesis::GUI::LoadComponent(Component, TCHARToNsString(*(GetPackage()->GetPathName())).Str()); If so, that path could be forwarded to FNoesisXamlProvider::LoadXaml() and fed well to `LoadObject`, without having to use AssetRegistry I guess. | ||||
Tags | No tags attached. | ||||
Platform | Linux | ||||
Date Modified | Username | Field | Change |
---|---|---|---|
2021-03-26 15:29 | Tadinu | New Issue | |
2021-03-26 15:29 | Tadinu | Status | new => assigned |
2021-03-26 15:29 | Tadinu | Assigned To | => hcpizzi |
2021-03-26 15:36 | jsantos | Target Version | => 3.0.12 |
2021-03-28 08:50 | Tadinu | Description Updated | |
2021-03-31 05:18 | Tadinu | Description Updated | |
2021-03-31 05:19 | Tadinu | Description Updated | |
2021-04-19 12:15 | sfernandez | Target Version | 3.0.12 => |
2021-04-19 12:16 | sfernandez | Relationship added | duplicate of 0001961 |
2022-03-02 12:31 | sfernandez | Status | assigned => resolved |
2022-03-02 12:31 | sfernandez | Resolution | open => fixed |
2022-03-02 12:31 | sfernandez | Fixed in Version | => 3.1.3 |
2022-03-02 12:31 | sfernandez | Target Version | => 3.1.3 |