custom QC plug : how to mix ObjC with C++

franz's picture

Hi all, i'm trying to make a QC plug using a C++ library to generate noisy numbers. While it seems pretty trivial to mix objC and c++ in a regular app by renaming main.m to .mm, there's not much info on how to do this in a bundle plugin. I would be extremely gratefull if someone had the kindness to point me a link or something.

Note: i'm trying to link the libnoise in my plug, and i guess it is also used in KnM Texture tools... didn't manage to find the source on this site tho' - but as far as i remember it is somewehre here -, maybe this could be helpfull.

thanks

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

toneburst's picture
Re: custom QC plug : how to mix ObjC with C++

I'm sure it's possible. You might like to get in touch with vade about it, as I happen to know he's worked (successfully) on integrating the C++ OpenFrameworks libraries into a QC plugin.

a|x

franz's picture
Re: custom QC plug : how to mix ObjC with C++

OF integrated in QC ! that's a massive news ! Anton, can you confirm ?

edited: just found the thread on OF forums. My bad. Great work vade !

toneburst's picture
Re: custom QC plug : how to mix ObjC with C++

It's pretty cool, isn't it.... haven't had time to investigate, sadly, but it looks promising!

a|x

smokris's picture
Re: custom QC plug : how to mix ObjC with C++

The TexturePatch source probably won't be too helpful, as it's based on the SkankySDK, not the official API, and it's complicated by the fact that we're outputting texture images, not just individual numbers. The parts of TexturePatch that use libnoise are just based on the examples provided with the library --- nothing more complicated than that.

Compiling Objective-C++ code for plugin bundles isn't any more complicated than compiling for standalone applications --- just call the file ".mm" and the rest is handled automatically.

cwright's picture
Re: custom QC plug : how to mix ObjC with C++

(just to close this topic up -- franz and I discussed the details of the particular project, changed source and build settings as necessary, and now he's up and running.)

franz's picture
Re: custom QC plug : how to mix ObjC with C++

yeah, thanks both Chris and Steve for your patience and kind cooperation, a tiny little push was enough to put me back in the right direction !

Here's the compiled plugin, if anyone's interested. It's a Perlin 2d noise number generator, with seeding input. Currently doesn't work as expected inside an iterator. It outputs X and Y coords and has the ability to morph outputs to an external path (such as Timeline of LFO) based on a MixAmout. Since it is Perlin noise, everything is time-scratchable, with predictable results. I can provide a sample comp eventually ....

BTW, the skanky sdk looks uberfriendly, much more readable than apple's - from what i've seen from your source .....

PreviewAttachmentSize
FRZ01.plugin.zip48.53 KB

cwright's picture
Re: custom QC plug : how to mix ObjC with C++

franz wrote:
BTW, the skanky sdk looks uberfriendly, much more readable than apple's - from what i've seen from your source .....

If you think that looks friendly, you should see it now (I spent a couple weeks updating everything for Snow Leopard/64bit -- it's beautiful now, with properties and more type information and auto-synced headers/functions and everything...) :) It's geared for in-house use only now though :/

I'm glad you like it though -- always good to hear that it's not absolutely horrible :)