-
- landongrant
- Posts: 4
- Joined:
Unreal + Noesis Custom Converter Trouble
Hi, I am trying to create a custom converter in c# to use in xaml so that I can convert from a type like int/string to a source path of an image.
I believe that I have written the correct conversion logic in c# but for some reason my .xaml fails to identify the converter.
Not sure what I am missing, but I feel like the C# code isn't building.
I've tried putting the converter in:
- Source folder of my Unreal Project.
- Content/UI folder (where my xaml is located.)
Have also tried different variations
Does anyone have experience setting up custom converters with Noesis + Unreal?
I believe that I have written the correct conversion logic in c# but for some reason my .xaml fails to identify the converter.
Code: Select all
Unknown element type 'local:ValueToSourceConverter' (Project.ValueToSourceConverter)I've tried putting the converter in:
- Source folder of my Unreal Project.
- Content/UI folder (where my xaml is located.)
Have also tried different variations
Code: Select all
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:Project"
mc:Ignorable="d">
<local:ValueToSourceConverter x:Key="ValueToSourceConverter" /> -
-
sfernandez
Site Admin
- Posts: 3363
- Joined:
Re: Unreal + Noesis Custom Converter Trouble
Hi,
C# converters are only used by the Blend project. You have to create a C++ version of the Converter that is compiled in the Unreal project in order to use it in Unreal.
You can see how we're doing it in our DataBinding sample included with the .zip you downloaded. There is a class named OrbitConverter in C# under <SamplesProject>/Assets/DataBinding/DataBinding that is used in Blend to design and test the UI. Then there is a C++ version under <SamplesProject>/Source/DataBinding that is used by Unreal.
As explained in our documentation custom classes need to be registered as you can see in DataBindingGame.cpp:
Could you try that?
C# converters are only used by the Blend project. You have to create a C++ version of the Converter that is compiled in the Unreal project in order to use it in Unreal.
You can see how we're doing it in our DataBinding sample included with the .zip you downloaded. There is a class named OrbitConverter in C# under <SamplesProject>/Assets/DataBinding/DataBinding that is used in Blend to design and test the UI. Then there is a C++ version under <SamplesProject>/Source/DataBinding that is used by Unreal.
As explained in our documentation custom classes need to be registered as you can see in DataBindingGame.cpp:
Code: Select all
virtual void StartupModule() override
{
Noesis::RegisterComponent<DataBinding::OrbitConverter>();
}-
- landongrant
- Posts: 4
- Joined:
Re: Unreal + Noesis Custom Converter Trouble
Exactly what I was looking for!
Thank you so much.
Thank you so much.
Re: Unreal + Noesis Custom Converter Trouble
Thanks for the feedback! Marking this as solved
Who is online
Users browsing this forum: No registered users and 5 guests