Writing custom plugins that interface with Kineme3DObject

alexmiller's picture

I'd like to write a custom patch that can interface with the Kineme 3D patches. It looks like they use Kineme3DObjectPort, which is a custom type. Is there a description anywhere of how to write a custom patch which uses this port type? Is that possible?

smokris's picture
Re: Writing custom plugins that interface with Kineme3DObject

@alexmiller, no, the Kineme3DObject class doesn't have a public API. Since Kineme3D reached end-of-life a few years ago, we don't have plans to develop a public API for it.

(On the other hand, our equivalent in Vuo, VuoSceneObject, is a public API, and there are already 3rd-party plugins using it.)

gtoledo3's picture
Re: Writing custom plugins that interface with Kineme3DObject

I would appreciate if the updated render methods for Kineme3D could be disclosed, and/or sample patches of the object renderer and the structure renderer could be shared. While it was in "Alpha 9", and even with Particle Tools, some elements of it were public - at least that was my impression.

At one point I had made a patch that interfaced with kineme3D - based on Particle Tools code, which allowed me to feed the rendering patch an indexed or keyed struct... the main difference between what I was doing and the patch you all eventually implemented, is that I could control color per object, texture per object, and maybe a few different things.

At some point, however one renders a K3D object changed, and I started getting exceptions.

Even though that may be considered distasteful to pass those things as full blown objects, it is fine for many use cases, and as computers have become speedier, it is much less of a performance problem.

Even though VUO is obviously the way going forward, it would be very helpful to me to be able to recreate that patch.

smokris's picture
Re: Writing custom plugins that interface with Kineme3DObject

render methods for Kineme3D could be disclosed

Here's the basic process for rendering a Kineme3DObject:

// ivars:
Kineme3DRenderer *renderer;
Kineme3DObjectPort *inputObject;
 
- (void)enable:(QCOpenGLContext *)context
{
   renderer = [[Kineme3DRenderer alloc] initWithCGLContextObj:[context CGLContextObj]];
   [renderer setPatch:self];
}
- (BOOL)execute:(QCOpenGLContext *)context time:(double)time arguments:(NSDictionary *)arguments
{
   Kineme3DObject *inObj = [inputObject rawValue];
 
   // Set up GL state
   …
 
   // Render
   [renderer setObject:inObj];
   unsigned int f, b;
   [renderer renderOnContext:[context CGLContextObj] withFrontPolygonMode:f withBackPolygonMode:b];
 
   // Restore GL state}
- (void)disable:(QCOpenGLContext *)context
{
   [renderer cleanupOnContext:[context CGLContextObj]];
   [renderer release];
}

gtoledo3's picture
Re: Writing custom plugins that interface with Kineme3DObject

Oh ok, I see... greatly appreciated, Steve!