CreateMeshOutput

Hi I have a little question. I’m trying to get into making my own plugins for vvvv. I’m trying to get the PluginMeshTemplate project to compile. I dowloaded and installed the SlimDX SDK, so that stuff works. But there’s still one thing. In the example the IPluginHost (FHost) has a method called CreateMeshOutput. I can’t find any info about it anywhere, but it seems to be in the svn multiple places… What’s up with that?

FHost.CreateMeshOutput(“Mesh”, TSliceMode.Dynamic, TPinVisibility.True, out FMyMeshOutput);

ryan

Alternatively, how do I output a mesh from a plugin?

helo scloopy,

the mesh-stuff is not yet released. it will only work with beta>=21. but still you can get some further info already from the xml-doc comments in the current plugininterfaces branch:
https://vvvv.svn.sourceforge.net/svnroot/vvvv/plugins/c#/_PluginInterfaces/branches/DXResources

hope that helps.

ah i get it. pre-release stuff. that’s what i get for digging. thanks for the reply :)

so if i want to output a mesh with the current release, should i output position(xyz), normal(xyz), and uv(xy) and then combine with a VertexBuffer node? Or is there a simpler way?

thanks!
ryan

right, for the moment that is what you can do. see also the metaballs plugin by majortom.

Hi All,
I’m trying too. I can create a Mesh, instead of a teapot in the pluginMeshTemplate I can output a Sphere using a SlimDX function but my problem is that I can’ t modify it, for example changing the radius. Do you know if I have to destroy the Mesh before? Cause it doesn’t want to change, is always the first Mesh I create.

In Metaballs there is

public void Evaluate(int SpreadMax)
{
FMyMeshOutput.SliceCount = 1;
}

instead of

public void Evaluate(int SpreadMax)
{
FMyMeshOutput.SliceCount = SpreadMax;
}

Is it necessary if I have a single Mesh?

How can I shure that the Node calls the method

UpdateResource(IPluginOut ForPin, int OnDevice)

??

In Metaballs there is a phantomatic bollean “update”.

Sorry for my spaghetti english,

thanx in advance.

hi fibo,
i suppose your GetMesh method is the same as in the PluginMeshTemplate, so all you have to do is update the FDeviceMeshes dictionary with your new sphere and make sure before updating to dispose the old spheres.

for example your goal would be a sphere node, which gets the radius as input and outputs a sphere of given radius. based on the PluginMeshTemplate the following steps would be necessary:

  • add a field called FRadius of type int to your node.
  • update the evaluate method in a way that whenever FRadius is written, all meshes in FDeviceMeshes are disposed and FDeviceMeshes is cleared afterwards. (that way you force the UpdateResource method to create a new mesh, because the try { } block will fail).
  • update the UpdateResource method to create a sphere of radius FRadius.

and that should be it (i hope).

concerning the slicecount of a mesh output:
slicecount for a mesh pin refers to the number of subsets and not the number of meshes, because in vvvv there is no support for multiple meshes. but let’s say you want to output a box and a sphere you would have to use Mesh.Concatenate to make one mesh out of those two. i’m not sure if concatenate puts those two meshes in different attribute groups, if not, you would have to set the attribute group manually for each mesh before concatenation.

How can I shure that the Node calls the method
UpdateResource(IPluginOut ForPin, int OnDevice)
it is called every frame.

Thank you very much Elias, I think I got it.

I also found very usefull the TestMeshOutput in the _Samples directory of the svn repository.

You know, the first time you bang your head with something sometimes you need some hints, just to move your first steps. After I red your post I understood, but before I was really in the darkness.

Thank you, I have now a sphere with a radius pin.

Now I can build a Moebius band, lolololololololololololololol.

Hi I have a little question. I’m trying to get into making my own plugins for vvvv. I’m trying to get the PluginMeshTemplate project to compile. I dowloaded and installed the SlimDX SDK, so that stuff works. But there’s still one thing. In the example the IPluginHost (FHost) has a method called CreateMeshOutput. I can’t find any info about it anywhere, but it seems to be in the svn multiple places… What’s up with that?

FHost.CreateMeshOutput(“Mesh”, TSliceMode.Dynamic, TPinVisibility.True, out FMyMeshOutput);

ryan

Hi all, I wrote some Mesh plugins, in particular a plugin that outputs the Mesh of a 5-cell. By now I’m using the SlimDX Vector3 but I see that in the VVVV namespace there a Vector3D. Which one is better? Is there a way to cast a Vector3D to a Vector3 and viceversa? Yes, I know, it’s just about to cast a double to a float but I wouldn’t like to reinvent the wheel so my question is:

is there a standard function in the VVVV namespace I should use to cast a Vector3D to a Vector? (I really can’t find it in the svn)

Thanks for your attention,
fibo

ai fibo,

we introduced the our own double matrices and vectors for use in plugins, for cases where you’re not using any SlimDX functionality. if you’re using SlimDX already, then use its matrices and vectors and only do casts to vvvvs for in/output via pins.

as of now there are only conversion routines for matrices, not for vectors. see:
_\SharedSources\SlimDXUtils.cs
on the server. your project is supposed to include that file, rather than making a copy of it to your project. please feel free to add the vector conversions and commit the file back.