ofxQCPlugin - use Open Frameworks with Quartz Composer

Hello,

Ive been doing some work on getting Quartz Composer and Open Frameworks to talk to one another. I have a very very alpha version of my work, called ofxQCPlugin available on Google Code, here:

http://code.google.com/p/ofxqcplugin/

It allows you to:

  • Use Open Frameworks to render into the Quartz Composer GL world, alongside existing Quartz Composer geometry

  • Post process your Open Frameworks rendering with Quartz Composers plethora of image filters and Core Image effects.

  • Pass images and other data from Quartz Composer into Open Frameworks, from Open Frameworks into Quartz Composer to allow you to build image sources or effects using Open Frameworks.

  • And finally and I think most interesting, is allowing you to use Open Frameworks within 3rd party applications that currently leverages Quartz Composer, like VJ apps, iChat, Photo booth, (even Final Cut and After Effects if you have 3rd party programs to convert Quartz Composer documents to plugins).

Clearly this is Mac only, and right now the XCode project may have some linking issues on other systems, but I think this is in an interesting enough place to post.

Things ive verified working:

  • Passing QC Images into Open Frameworks as ofTextures and drawing them to 3D geometry

  • Passing ofTextures out of Open Frameworks into Quartz Composer as QC Images and using them elsewhere in Quartz Composer.

  • Loading resources from the QC plugins bundle folder, like images, and rendering them.

  • Using the video camera input straight from Open Frameworks in the plugin.

  • Loading video straight from Open Frameworks.

  • Image Saving

  • Sound playback and FFT analysis

  • Basic geometry drawn into the Quartz Composer GL world

Things that kind of work but are weird:

  • the ofx3Dmodel loader loads geometry properly, but textures, or the texture coordinates are very strange.

I have not had a chance to test compatibility with all of the add-ons (or even standard functions), so there is GOING to be some weird issues, but hopefully its far enough along for folks to do something interesting with it?

Thanks! Let me know.

Great project! I just quickly wanted to try it, but it seems like you have made most of the paths absolute to your computer :slight_smile:

[quote author=“halfdanj”]Great project! I just quickly wanted to try it, but it seems like you have made most of the paths absolute to your computer :wink: I added a path variable in the XCode project, just change one path there.

my bad… i didn’t :roll:

Hi.
Great work, first of all, I really appreciate it that you came up with this.

I think I didn’t understand the instructions very well either, which path parameter are we taking about?

In xcode, I do get info on the group (or something, whatever those folders are called) openFrameworks, and there I edit the absolute path of my own openframeworks.

When I try to compile this way, it does not find any of the header files. If I instead point that path to

…/openFrameworks/libs/openFrameworks

then I don’t get a problem of finding the openFr headers, but this time get a problem finding the headers from Glee, Poco, etc.

I suspect I’m missing some sort of setting in my xcode to search for a couple of directories below the given path. Am I right, or is it supposed to be done somehow differently at first place?

(sorry, this is my first xcode experience).

[quote author=“halfdanj”]my bad… i didn’t :slight_smile:

[quote author=“yetkin”]Hi.
Great work, first of all, I really appreciate it that you came up with this.

I think I didn’t understand the instructions very well either, which path parameter are we taking about?

In xcode, I do get info on the group (or something, whatever those folders are called) openFrameworks, and there I edit the absolute path of my own openframeworks.

When I try to compile this way, it does not find any of the header files. If I instead point that path to

…/openFrameworks/libs/openFrameworks

then I don’t get a problem of finding the openFr headers, but this time get a problem finding the headers from Glee, Poco, etc.

I suspect I’m missing some sort of setting in my xcode to search for a couple of directories below the given path. Am I right, or is it supposed to be done somehow differently at first place?

(sorry, this is my first xcode experience).[/quote]

No worries, thats not quite what I had meant. Yes you will have to point XCode to the missing libraries, etc, but you will also have to

Click on Targets, and select the plugin target (not the build and copy target)

Get info on it, and then select the build tab, and scroll down. Edit the path that says “OpenFrameWorksPath”, and since its a variable, all other paths should update automagically and it should find your headers :slight_smile:

Hers a picture:

First of all: great work! this should be a lot of fun to play with!

I’m having some trouble setting it up though…

I’ve managed to find all the red files and turn em black (except two OfxQCImageUtilities files which weren’t in the svn checkout), but I’m still getting some funky build warnings and errors (see screenshot below)

a funny thing I noticed when locating the core libs was that I would locate for example fmodex and it turned black, but then the lib folder inside it was still red and I had to add that too… strange

Any idea what could be wrong?

Hm, thats odd. Are you using the SVN version of OpenFrameworks core?

One thing that may be happening is if you add link to the library folders in the “library” section you should be careful to delete any code accidentally included in the compile. I had an issue that was a pain in the ass to debug where somehow XCode thought I wanted to compile out the static libraries. Check your targets.

I’ll admit the linking / paths are not handled well, but having things in the OF Folder for qcPlugins is kind of awkward and not really suitable, at least for me. Has anyone else gotten this to compile? :slight_smile:

I was using the prerelease 0.06, should I use latest svn version instead?

I’m on Snow Leopard BTW, also tried GCC 4.0 but same errors.

Not sure what you meant with the targets though, I tried deleting the standard oF files in the target but same errors.

Yea, the SVN version, is ‘newer’ than 0.06 and is required as it has some new functions like ofxGetAppPtr() that are needed for this and things like Memos Cocoa window wrapper.

When you pointed the XCode project to the OF libraries, did you also include (or did XCode by mistake) include the headers for the libraries? XCode will do that (the libraries are statically linked but the folders the libraries are in also include their respective headers), so make sure that you DONT have those, as they may get added to the target for compilation and can cause errors. Ive seen that before and accidentally did that once or twice and it was rage inducing.

So basically make sure your Libs/Core/Libs does not also have the headers in there, and they are not included in the target. (I mean in the XCode project , you want them on disk).

It sounds like the XCode project may have gotten dinged. Try getting the project again and relink those libraries and see if that helps.

The only other issue I can imagine is for some reason you are trying to build x86_64, and not i386?

Let me know if that was helpful at all.

nope, the libs only have .a files and a .dylib
Also tried on svn version… same result

i opened up one of the warnings, goes a lil something like this

  
  
ProcessPCH++ "/var/folders/Ky/Ky7-Q-RSH249QaeUQLxOW++++TI/-Caches-/com.apple.Xcode.501/SharedPrecompiledHeaders/QC Plugin Test_Prefix-fkyltajmqezebbbgxopdtijblzxu/QC Plugin Test_Prefix.pch.gch" "QC Plugin Test_Prefix.pch" normal x86_64 objective-c++ com.apple.compilers.gcc.4_2  
cd /Users/Robotfunk/Documents/_dev/ofx-dev/apps/quartzComposer/QCtoOFImageDemo  
setenv LANG en_US.US-ASCII  
/Developer/usr/bin/gcc-4.2 -x objective-c++-header -arch x86_64 -fmessage-length=0 -pipe -Wno-trigraphs -fpascal-strings -fasm-blocks -O0 -Wreturn-type -isysroot /Developer/SDKs/MacOSX10.6.sdk -mfix-and-continue -Wno-deprecated-declarations -Wno-invalid-offsetof -mmacosx-version-min=10.6 -gdwarf-2 -I/Users/Robotfunk/Documents/_dev/ofx-dev/apps/quartzComposer/QCtoOFImageDemo/build/QCtoOFImageDemo.build/Release/QCtoOFImageDemo.build/QCtoOFImageDemo.hmap -F/Users/Robotfunk/Documents/_dev/ofx-dev/apps/quartzComposer/QCtoOFImageDemo/build/Release -I/Users/Robotfunk/Documents/_dev/ofx-dev/apps/quartzComposer/QCtoOFImageDemo/build/Release/include -IJilt-van-Moorsts-MacBook-Pro-15:ofx-dev/libs/poco/include -I/Users/Robotfunk/Documents/_dev/ofx-dev/apps/quartzComposer/QCtoOFImageDemo/build/QCtoOFImageDemo.build/Release/QCtoOFImageDemo.build/DerivedSources/x86_64 -I/Users/Robotfunk/Documents/_dev/ofx-dev/apps/quartzComposer/QCtoOFImageDemo/build/QCtoOFImageDemo.build/Release/QCtoOFImageDemo.build/DerivedSources -D__MACOSX_CORE__ -lpthread -c "/Users/Robotfunk/Documents/_dev/ofx-dev/apps/quartzComposer/QCtoOFImageDemo/QC Plugin Test_Prefix.pch" -o "/var/folders/Ky/Ky7-Q-RSH249QaeUQLxOW++++TI/-Caches-/com.apple.Xcode.501/SharedPrecompiledHeaders/QC Plugin Test_Prefix-fkyltajmqezebbbgxopdtijblzxu/QC Plugin Test_Prefix.pch.gch"  
  
i686-apple-darwin10-gcc-4.2.1: /Users/Robotfunk/Documents/_dev/ofx-dev/apps/quartzComposer/QCtoOFImageDemo/QC Plugin Test_Prefix.pch: No such file or directory  
Command /Developer/usr/bin/gcc-4.2 failed with exit code 1  

-arch x86_64

i386.

I had the active architecture set to i386 but it seems XCode compiles for all architectures unless you set it to only compile the active one.
The error I pasted was from the first one, if I turn on ‘only compile active architecture’ I get only 2 gcc fails (had 6 before, so 2 for each architecture I guess)

thanks for your help so far BTW, I’ll keep trying some things here.

[quote author=“robotfunk”]I had the active architecture set to i386 but it seems XCode compiles for all architectures unless you set it to only compile the active one.
The error I pasted was from the first one, if I turn on ‘only compile active architecture’ I get only 2 gcc fails (had 6 before, so 2 for each architecture I guess)

thanks for your help so far BTW, I’ll keep trying some things here.[/quote]

No prob :slight_smile:

My concern in your error log there is saying the pre compiled header is missing. Thats fairly significant. Do you have “QC Plugin Test_Prefix.pch” in your XCode project??

Nope, I couldn’t find a file with that name in either any of the example projects, or in the files I got from SVN. Where should I find it?
Also missing are two ofxQCImageUtilities files (h and cpp), I assumed you chose not to use these (deleted from SVN).

Odd. I have some updates and new ported plugins that need to go to svn. I’ll update today. I’m on my phone but I’ll check later. Hope I did not fuck that up too bad!

Well I looked at the current svn on google code and all plugins have a pre compiled header file. Maybe you need to ipdate or check out a fresh copy?

grr, driving me nuts!

did it over and over, check out fresh copy , fix the paths … always the same error on only the ‘QC Plugin Test_Prefix.pch’ file
I find pch files for the example projects (eg ‘QCtoOFImageDemoPlugin.pch’) but none with that name…

just to be sure:

-should QC Plugin Test_Prefix.pch’ exist or should it get compiled? if it should exist should there be a physical file on my hd with that name? or in the project where should I find it?
-the OfxQCImageUtilities it can’t find aren’t used and references can be deleted?

thanks again

[quote author=“robotfunk”]grr, driving me nuts!

did it over and over, check out fresh copy , fix the paths … always the same error on only the ‘QC Plugin Test_Prefix.pch’ file
I find pch files for the example projects (eg ‘QCtoOFImageDemoPlugin.pch’) but none with that name…

just to be sure:

-should QC Plugin Test_Prefix.pch’ exist or should it get compiled? if it should exist should there be a physical file on my hd with that name? or in the project where should I find it?
-the OfxQCImageUtilities it can’t find aren’t used and references can be deleted?

thanks again[/quote]

Thats really odd. However, I am a bit confused, as “QC Plugin Test_Prefix.pch” has not been part of the latest revisions for a while. I only just realized this now after having committed some small updates. Are you sure you checked out a fresh copy of the *latest* sources? You should have a few test plugins, the Sound Player FFT Example port, an OF to QC images, and QC to OF Images… and each has a properly named pch for each project.

I just updated some of the code in the SVN. Try with a fresh export of the latest revision. Im sorry this is giving you such a headache… :oops: