Nested ObjectEditors

hello hello,

Let’s say I have a Foo class that has two properties that are Channel<Bar> and Channel<Baz>.
I have created two IObjectEditor for Bar and Baz, and a third one for Foo that has just two ObjectEditor nodes in TabItem regions, for both Bar and Baz.

The two properties are Channels because I need to deserialize them from XML on startup, and react to changes (serialize them to disk) when edited. For that, I have the Deserialize operation fed to the Initial Value pin of the Channel node, and a ForEach (Channel) after that serializes and writes to disk, as follows :

image

So this is all working fine if I’m calling Bar on Foo, that gives me a Channel that I can feed to the ObjectEditor and update Bar. Cool.

What I don’t understand is how I’m supposed to edit Foo directly. I can see my custom editor if I create a Channel out of it and feed it to the ObjectEditor, but the values I tweak don’t get propagated back to Bar and Baz.

Generally I feel there’s something I still don’t get with Channels, for instance whether it’s good practice to have properties as Channels directly, or if I should only “make channels out of them” with Select (ByPath) ? Or why does the ForeEach (Channel) also accepts non-channels? Does it make channels out of them on the fly?

Thanks in advance :3

seb

EDIT
went for a different approach using a GlobalChannel, which makes sense here because this Bar thing shall be read in multiple places. I still don’t get though how I’m supposed to feed an instance of Foo to an ObjectEditor.

image

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.