Problems playing/using Quartz Movie with custom plugin

callum's picture

I have an application where I need to make a Quartz movie using Quartz Composer and a custom plugin and have it run in a 3rd party application which is capable of playing Quartz movies.

As a first step I successfully developed my custom plug in using Xcode and 'built' a composition in Quartz Composer. I got this all running in Quartz Composer and this works totally fine in the viewer inside Quartz Composer.

Subsequently I tried to play it in the 3rd party application and it would not play, other parts of the movie played but my plugin simply did not function. I then tried QuickTime player and on one machine it behaved exactly the same - movie played but my plugin didn't function. On another machine I get the error "Quicktime player quit unexpectedly while using the "My Plugin Name" plug-in.

After this I was a little baffled and I read the forums and I came across the notion of Safe and Unsafe patches. I am wondering if this is why my patch doesn't work in applications other than Quartz composer.

If I enable the "Indicate Unsafe Patches" menu item then it shows an unlocked padlock icon on plug in presumably indicating it is in fact Unsafe.

On reading the forums further I came across mention of the Kineme Core plug in for QC, and that it had a UI for telling the system which patches were safe for which applications. I installed this and selected the KinemeCore Preferences, Unsafe mode, I successfully added the QuickTime player application to the application list but it fails to show my 'Custom patch' in the list of unsafe patches...

Some questions:

Am I on the right track, is it not playing my custom plugin because it is considered unsafe?
How can I tell 'an application' or the system that it is safe?
What is the correct way do achieve what I am wanting to do?
Any ideas on why I can't see my patch in the KinemeCore preferences Unsafe Mode list...
Any other ideas, useful information welcome.

I should also say I am mostly a Windows developer so I am new to Quartz technolgy and developing on a Mac.

Thank you,
Kind Regards,

Is it SL Compatible or Broken (?), Plug-Ins / Patches - Discussion

gtoledo3's picture

After some back and forth with Offonoll, it came to mind that a forum topic needed to be started which catalogues in one central location what does or doesn't work in QC4, Snow Leopard, that did work in QC3.

I'm not talking about aberrations in the app itself (like Editor or Viewer issues), but about issues with plug-ins and patches. I would also like this to apply to Apple "patches"; the stock ones, available via the the QC patch library interface.

(Do not devolve into discussing app bugs that involved the Editor or Viewer, focus of app windows, etc., if possible.)

It would be great if people could use this as a thread to gather all of this info into one place, for easy reference.

Some thoughts to keep this as constructive as possible:

-A plugin/patch may appear to work, but may have various functions or "sub-patches" that work improperly. That said, it's not always going to be a straightforward answer about whether a plugin or patch works or doesn't work. We will probably see many that work "overall" but with some lingering broken functionality.

-Please indicate if you are running QC in 32 bit mode of 64 bit mode.

Some plugins and patches will run fine in QC, when the QC app is run in 32 bit mode, but won't run in 64 bit. Find the app in your Developer folder, do a "get info" and check the 32 bit mode to run in 32 bit).

-Indicate what OS version you are running. ("Apple" logo on the menu bar/ "about this Mac".)

-Generality doesn't help, while specificity does. Be as specific as possible about what you were doing when something didn't work, and possibly include sample qtz's or other needed code.

No one shall write "yo, ___ doesn't work". Pretty please.

-This isn't explicitly about Kineme patches at all.

This is about ALL patches, mainly 3rd party, obscure and rare ones, Kineme or otherwise, but also function that is broken in Apple patches, if applicable. It would also be more productive if this wasn't only centered on what is broken, but also what has been vetted to work well; if something works perfectly in your estimation, please share that info.

Similarly, if anyone notes that any bugs can be mitigated by following certain steps (eg., it works when QC is run in 32 bit, but not 64 bit, or another plugin of feature has superseded the old one), please let that be known as well.

Let's try to keep new patches/features out of this, or it could simply turn into a discussion about OpenCL issues.

Quartz Composer Snow Leopard - New Patches and Features

gtoledo3's picture

There are some pretty cool things in the new edition of QC Snow Leopard, notwithstanding any glitches. Leopard had those too (well, some never DID get fixed).

Here are some things I've noted:

-The Shadow feature on the lighting patch, is a way of doing some dynamic shadows with your lighting. The default color value seems a little heavy to me for most purposes. Backing the alpha value off to taste is a good way of taming this.

There's also a quality control! A setting of "1" will give a nice smooth edge, and decreasing that value will seem to cause the edge to get jagged, like there's an increasing amount of aliasing going on.

When I decrease the quality on the Intel X3100, I see decent gain in fps. On the NVIDIA 9600, not at all.

The shadow patch doesn't work with iterators, and toggling it back and forth can do something to "lock" the state of the Lighting environment, which can affect flat/smooth shading. While this is one of my TOP Quartz Composer feature requests, it's also to be used cautiously.

-DAE/Collada loading. The thing that's fairly handy about this is the way that all of the associated textures get loaded.

Instead of manipulating parts of the DAE with structure patches, we have "Get Mesh Texture" and "Get Mesh Component" as well as "Set Mesh Texture" and "Set Mesh Component". The texture patches are for manipulating the associated texture/image files... allowing you to "break off" the textures, do what you will, and re"set" the texture, or the component. A "component" is one part of the structure or a complex 3D object; this is familiar to anyone who has used Kineme3D.

The DAE models can be dragged onto the editor, which is slick, and familiar to Kineme3D users.

The 3D dae/collada models need to be rendered with a "mesh renderer". So the chain needed is something like mesh->mesh renderer, or mesh->mesh filter ->mesh renderer.

The mesh filters live in the patch list as repository compositions/ "qtz" patches, so each actually has an extensive underbelly that can be investigated, which aren't exposed by looking at the patch right off the bat.

Some of them are colored like providers (assuming that green=black), but some are actually externally driven by default, and hence, are purple (old blue=purple now)! To wit, look at Mesh Jiggle and see the way it interplays with the mouse.

It's worth noting now that when you make a macro, you can control+click, and get an option for "explode macro". THIS is awesome. I would love to see this type of feature become available with these type of virtual qtz patches that are leaned on very heavily in this OS.

-Other mesh stuff: To create meshes you use the... ta da(!)... Mesh Creator! It needs vertices... and you can also pipe it normals, colors, textures, texture coordinates, and colors.

You can feed it with Javascript or OpenCL. THAT is actually pretty cool.. and the mesh utilities actually make use of it as well.

For a good take on powering it with javascript, "Mouse Trails.qtz" is a good one, and it's linked to inside the actual patch list under mesh creator. That one might look familiar to anyone that's paid attention to the travails of tobyspark.

For a less obvious one that uses OpenCL to generate the mesh, go to the Developer folder and look in Library/Quartz Composer/Examples/Patches, and take a gander at "Grid.qtz" and "Quad.qtz". "N-body.qtz" is a more intense, but similar setup in some ways, that shows how to derive a particle system, and how to use a mesh creator/queue with iteration.

-Feedback patch. This is an interesting one. All of the qtz's that have "Inertia" in the title and that are in the same Patches folder, are really good examples of this one in action, as well as the 2D Fluid Simulation, which is in the System/Library/Graphics/Quartz Composer Patches (qtz's that Quartz Composer hinges upon are now loosely strung throughout the OS, so think wisely before editing or accidentally saving over one that QC needs).

Now, don't confuse this with "video feedback"... which is just a classic video/accumulator qtz setup hiding in the patch list, and which doesn't incorporate any new patches (this one actually reminded me of smokris's GL Spline example with a video input plugged in, instead of splines).

-The Interaction patch, and it's weird "outie" port and blue noodle. The Iteration Counter and Iterator Selection qtz's show this one in action.

-This brings up one of the BIG changes in QC. Now we don't have "just" enable ports on Render patches. We have "interaction" ports up above them!

This one strikes me as odd, and the ramifications of it aren't totally obvious yet, as far as how it affects the scene graph.

-Deleting or Cutting a renderer patch doesn't "kill" it in the Viewer. It stays active until you restart the viewer, or do something else. This may be a "feature" to help performance. I find it to be a bug, because it necessitates that one do an extra step to get the Viewer to reflect the ACTUAL state of the editor. This feels like it may be considered a feature (though I think it's a horrible idea).

-Multisampling in the Viewer. This one is cool, and looks like it works on the GPU. Option+Preferences, and there it is in the Editor settings. Check it "ON", do a restart of QC, and there you are... jagged edges somewhat mitigated, if it's on supported on your GPU. It doesn't smooth things out 100% but it's better than nothing, and adds a more professional look to the real-time visual output.

-The opening Template.

This one is actually amazing.... look inside of QC and take a gander at the qtz that powers it. This is a really well done qtz. At the same time, it removes the dynamic template loading, so as much as the engineering of it is beautiful and well done, it reduces function in some ways, while providing some good documentation that wasn't formerly included in the Template choice screen. It's as if this has been made a kind of qtz based brochure of function and documentation.

-... and if you unhide patches, our old friend CISmallGaussianBlur, the dead patch entry is still there! We would have missed you buddy!

-The "mystery" qtz's that wouldn't restore in the old system and that were leveraged in some apps, appear to now be in the System/Library/Compositions in some cases.

-Apple is using the Skanky SDK...maybe :) They are now loading (this pertains to the mystery qtz's working) the Backdrops.plugin and ImageDifferPatch.plugin... from the Quartz Composer Patches folder. So, now we are given GFPlugin(s) from Apple, officially. One thing that's of note is the "GFPluginExclusiveHosts", which is used in the Backdrops.plugin

So, those are some of my thoughts at the moment, and looking towards the silver linings. I've noted a decent amount of other features and/or issues, but this is about all I have in me for this post :)