I made a class using this and, while it might be easy (for someone with a bit of c sharp knowledge) to set it up in a dynamic plug-in, I would like to get it into vl somehow.
I’ve heard it mentioned that only a small modification is needed to import a source file into VL ( by sticking “< Node >” in it somewhere or something to that effect). Is that possible with the current version of VL?
yes it is possible, but we want to wait with an official announcement since there is more to it then meets the eye. There will be a document that tells you all the details.
but for your personal experimentation, here is the unofficial quick guide:
locate the VL.Core.dll in the alpha download
reference it in your C# project
write a using clause for VL.Core in your class
use the Type attribute over your class (this is always required in order to make the Node attribute work)
use the Node attribute on every public method/property/field of your class that you want to turn into a VL node
compile the project as a DLL
reference this DLL as dependency in your .vl document
voila, use the data type and its nodes
it might look like this:
using System;
using VL.Core;
namespace MyVLNodes
{
[Type] //this tells VL that the data type is available
public class MyClass
{
[Node] //this makes a get and set node for MyField
public int MyField;
[Node] //this will also make get and set nodes
public string MyProperty { get; set; }
[Node] //this makes the Create node
public MyClass(int initValue)
{
MyField = initValue;
}
[Node] //this makes a MyMethod node
public bool MyMethod(int value)
{
return value < MyField;
}
}
}
I know there used to be a way to do a class import to vl with an xml file accompanying the dll. AFAIR, this could be done with the prototype importer, or by hand.
Of course this is much better if you want to include a lib which you don’t own the source code, or where you don’t want to introduce dependencies to VL, so just want to ask, if that is still a way to go about?
you’re mentioning the typeimporter we’ve demoed at node15, which produces .vlimport (xml) files. it is useful for some scenarios, not so useful for others. all should be more clear once we provide proper documentation (which is still in the making) for the different options you have.
heads up on this thread…
as announced here: https://vvvv.org/blog/devvvvlopment-update-january-2017 the way we import libraries will change and infos leaked in this thread may no longer work (still shouldn’t be too hard to fix then, just saying…)
having said that…what have you done to get that error?
Having another look at MongoDB again with the alpha. Its quite a tricky library to import becaue it has Linq-style queries for finding for sifting, but they made their own probably for efficiency. Making a delegate with the right signature isn’t enough to build a query so I’m suspecting I may have to either muck around with the forwarding/ the interfaces or a combination of both and other things.
However, for now wanted to know how to make custom regions.
An example signature of the actual where operation as as found in the project manager is: