Getting started with writing patches

Lango's picture

Hi everyone

Downloaded the Kineme xCode template for writting customer patches.

However i'm having some trouble with it.

My background is programming in Java, c, c++, python, etc.

I get the general gist of objective c, but i'm missing the basics of this template.

For example, i can see the following lines are the input/output parameters.

    QCBooleanPort *inputFoo;
 
    QCBooleanPort *outputBar;

From adding new arguments I can see that inputFoo should go to Foo, but in your patch it goes to 'Foo Foo'. Where does it tell it to do this?

I tried apple's programming guide but it doesn't seem to work with your template.

An example of this is that QCPortAttributeNameKey is undeclared, I think this is because you have extended QCPatch instead of QCPlugin. Is this correct?

Is there any tutorials anywhere that goes through the basics steps of using your template.

For my patch, I want to be able to read in an image and then read the pixels of that image.

Any help would be greatly appreciated.

cwright's picture
Re: Getting started with writing patches

why do you want to use our template, as opposed to apple's?

For most custom stuff, it's safer and easier to use apple's template. There are a few cases where using ours is handy (for example, if you're a QC Ninja, and you need magical powers), but if you're just getting started, stick to apple's.

More people use apple's template, apple supports their template (not ours), there's documentation for theirs, and it's more up to date (ours is very very old, because no one uses it -- in-house, we've got massive updates, but we don't bother updating the download anymore because it takes a ridiculous amount of time for zero users).

The "Foo Foo" stuff is declared in the patch's XML file (this is radically different from apple's official-api setup; we think strings-in-code is a pansy way of defining stuff like that ;). QCPortAttributeNameKey is undeclared because it doesn't fit in with QCPatch, just QCPlugIn (as you concluded).

gtoledo3's picture
Re: Getting started with writing patches

" (ours is very very old, because no one uses it -- in-house, we've got massive updates, but we don't bother updating the download anymore because it takes a ridiculous amount of time for zero users)."

OUCH! Lol.... Man... and here I've been trying to understand what is going on with that vs. the standard. Berry eenteresting.

cwright's picture
Re: Getting started with writing patches

Yeah, I think the latest release version is missing huge swaths of image stuff (so image handling is next to impossible), is missing lots of method signatures/types, and uses some stale conventions we've discarded internally... shrugs perhaps that's part of why we're the only people still using the skanky sdk...

Lango's picture
Re: Getting started with writing patches

cwright wrote:
why do you want to use our template, as opposed to apple's?

I might of misunderstood this

Creating QC Patches wrote:
Structures of "internal types" (images, mostly) do not work correctly (Plug-Ins cannot work with QCImages directly, they only know about QCPlugInImageProviders)

What I want to be able to do is read in an image, read some pixels then output a structure. I don't want to modify the image at all.

Is this possible with the official API?

Thanks for your reply Suppose I should of seen the date from your release (which is 2007).

cwright's picture
Re: Getting started with writing patches

a structure of images is if you have a Structure Port that contains images. This doesn't happen normally in QC, but it can be done with javascript, for example. Queue's too, I suppose.

Normal images (individually) are accessible in the official api, but it's kind of abstract and I can't help much with the details. Other official-api devs are probably more than capable of helping though, should the need arise.

Lango's picture
Re: Getting started with writing patches

Okay thanks for the tip.

It wasn't a structure of images I want to return, just a structure of doubles or floats.

I'll work with the official api for the next couple of days and see how I go.

Cheers