» creating and deleting pins at runtime
This site relies heavily on Javascript. You should enable it if you want the full experience. Learn more.

creating and deleting pins at runtime

there're situations were one needs to create pins at runtime depending on the value of some config pin. for example consider the Expr (Value) node. it creates input pins for each given variable name.

with beta28 coming up this kind of task got considerably easier to do with a new interface called IIOFactory.
it basically provides a method to create so called IO containers, containing the actual "view" on the pin data (such as ISpread) and controlling the lifetime of it.

say we want to create an ISpread<ISpread<T>> during runtime, we do something like this:

[Import] 
IIOFactory FIOFactory;
...
var inputAttribute = new InputAttribute("Input Foo");
var inputFooContainer = FIOFactory.CreateIOContainer<ISpread<ISpread<T>>>(inputAttribute);
var inputFooSpread = inputFooContainer.IOObject;
...

in case we decide to get rid of those two pins which are used by inputFooSpread we simply call Dispose on the associated IO container:

...
inputFooContainer.Dispose();
...

for details and as a starting point have a look at the new dynamic plugin template contained in beta28, which creates inputs and outputs on the fly, when changing the associated config pins.

Elias, Tuesday, Aug 7th 2012 Digg | Tweet | Delicious 0 comments  
  • 1

anonymous user login

Shoutbox

~7h ago

beyon: tekcor: no, but I have a old Roland DXY-980 plotter depending on your needs

~2d ago

tekcor: Hey, does someone has an AxisDraw V3/A3 for sale?

~7d ago

nanotekt: vvvv+blender=lovvvve :D https://youtu.be/dUyeoi9mBIc

~7d ago

Patxi7: Pepper's Ghost & vvvv https://vimeo.com/632159133

~12d ago

mediadog: @manuelgonzalvez Needed to explicitly install VLC for VLC2; I use 3.0.6-win64 for stability.

~12d ago

mediadog: @manuelgonzalvez 42 getting crashes from DX11 VLC lib after last Win10 update. Switched to VLC2 plugin OK so far.

~13d ago

sunep: Looks interesting. Can't find a price though https://en.ids-imaging.com/ensenso-3d-camera-s-series.html

~24d ago

joreg: @guest re svg export: i'm afraid not.

~24d ago

joreg: @manuelgonzalvez what's stopping you? now is the time!

~24d ago

joreg: @schlonzo glad you like it!