Demonstrates registration and usage of a custom node type.
A plugin may wish to define its own metanodes if it wants to store data in the tree in a structure not accommodated by any other metanodes.
For this is should use the function from the Metanodes section of the API.
For our example we will define a metanode to describe the location of a PDF file and a page number. On its own this will not do anything other than provide a way of storing this data. The section on implementing observers will follow on from this section to suggest ways of responding to instances of this metanode.
HMeta m = VRCreateMetaNode("PDF");
VRAddPropertyFile(m, "File", "PDF Files|*.pdf");
VRAddPropertyInt(m, "Page", 1);
In order to keep this simple, we will create an instance of this node using the Lua console in Visionary Render.
Enter the following into the console and press CTRL + E to run it.
CTRL + E
vrCreateNode(vrTreeRoot().Libraries, "PDF", "PDF")
Provide a Lua Function
Implement an Update Function