@joreg could you provide a simple example of how building custom regions work? This is a pretty cool feature. But totally hidden. I know the grey book says the workflow still needs some love… I would be interested if something like this could be done already:
The “SceneToggle” activates scenes that come into the users’ view. And “Scene” just adds the layers to corresponding scene-object. scene-objects are managed by my scenecontroller. It moves them around, preloads and deactivates non visible scenes.
I would like to integrate the cach region, the upper and lower BW node into one custom region. The region in- and outputs my project wide context datatype. (inside, it could also provide additional data for the skia and stride objects, like in-and out animation times, the scene name and so on…
Yep, I already went through that, I also had a look at those regions mentioned in the grey book. Still, I do not understand how it works. Nodes placed in the region are available as “objects” and I don’t know how to process them.
Regarding your last question about Scene region: To me it looks like something that the customRegion API can’t do yet and the other solutions are a bit cumbersome to use still.
What you’d like to have is a region with named pins inside the region, right? At least named outputs for Layer and Entity? For that you can try to define a delegate in C# to get named outputs in your region. But you’d need to use that approach together with the “UserPatch” trick in order to get a stateful region. And this sounds very challenging.
Of course you can also use CustomRegion API and search for the first outputBCP that has the desired type and collect the data this way (fetch first outputBCP of type Layer, feed that into BW_Scene, fetch first outputBCP of type Entity, feed that into another pin of BW_Scene…). The CustomRegion API doesn’t offer pins inside the region yet. Is that something you would prefer to work with in this case?
Nodes placed in the region are available as “objects” and I don’t know how to process them.
You can’t. The user might have patched a small or funny or big patch inside your region, you don’t know and you can’t reflect over the nodes inside the region. Via the custom region API all you can do is control the data that flows into the region and out of the region.
regarding the questions further up:
yes. that’s the point. you can
modify the data that flows into the region (be it via links crossing the region border or via input BCPs)
modify the data that flows out of the region via output BCPs
Making the CustomRegion API more versatile is planned, but we currently promise when this gets shipped.
Let me attach two patches that address your first two posts in this thread, in order to show you what can be done right now with two different approaches. MyCustomRegion.vl (13.7 KB) AddToDictionary.vl (14.5 KB)