» VL Dynamic instancing without Delegates
This site relies heavily on Javascript. You should enable it if you want the full experience. Learn more.

VL Dynamic instancing without Delegates

demo reflection vl



I was wondering how to instance an arbitrary object based on its type name in VL for a while.

For now I offer this solution that uses the built-in Deserialize functionality, inspired by the arbitrary object spread demo in the VL Serialization help patch.

Although not perfect (any object you expect to instance has to be explicitly used in the patch (inspired by elias's LINK experience)), it's the closest solution I know of until this functionality gets native support. Is it better than Delegates with a Dictionary? You decide!

Any simplification tips appreciated.

Until next time!

Elias 21/01/2019 - 17:12

Hey Dominik,
nice to put this out there. I'll report back once I get to VL and dynamic instantiation again.

microdee 22/01/2019 - 12:26

Is there a limitation of why Activator.CreateInstance wouldn't work in vl? at least it should work in script region https://docs.microsoft.com/en-us/dotnet/api/system.activator.createinstance?view=netframework-4.7.2

also for more reflection goodies check out fasterflect https://github.com/buunguyen/fasterflect ;)

Elias 23/01/2019 - 12:31

CteateInstance should also work but maybe little tricky to know what values to feed for the arguments. Would be easier if a default ctor would be present in target code.

anonymous user login


~2h ago

~3d ago

domj: Stuck in your patching or eager to share what you made or came across? Join Midweek Patch Therapy at 17:30 https://therapy.domj.net/

~4d ago

david: vvvv meetup 3. new stream link. again youtube made us nuts.. please send everybody to https://youtu.be/pa3HRQ7kj6w

~4d ago

joreg: Reminder: Join us this evening, 8pm CET for the 3rd worldwide #vvvv meetup: 3.-worldwide-vvvv-meetup

~4d ago

sinus: @evvvvil: very impressive stuff! keep on marching the rays!You´ll never walk alone!

~5d ago

evvvvil: @mediadog, thankx for pointing it out broski. Wicked.

~6d ago

domj: Catching up with the Midweek Patch Therapy excerpts, expect more videos over the week. https://youtu.be/36r8LnHaS7g

~7d ago

mediadog: @evvvvil hey you made the webgl-dev-list cool stuff list: http://gfxprose.blogspot.com/2020/05/cool-webgl-stuff-2020-05-21.html

~8d ago

evvvvil: Yo I'm live doing a VJ set made in vvvv for OUTLINE demoparty with OddJohn DJing! Come see us play here: https://www.twitch.tv/outlinedemoparty/

~9d ago

domj: A blast to read with great references. Thoughts on how to make programming more learnable and understandable. http://worrydream.com/LearnableProgramming/