Modifying FreeFrame plugin to use FRF files from app resources.... finding composition's URL

gtoledo3's picture

Ok, setting aside any disdain for Freeframe for a moment... ;-)

I want to modify the Freeframe to plugin to draw it's FRF files from an application resource folder instead of Library.

Right now, the freeframe plugin has this code :

{
   if(_plugInList == NULL) {
      _plugInList = CFDictionaryCreateMutable(kCFAllocatorDefault, 0, NULL, NULL);
 
      [self registerFreeFramePlugInsAtPath:@"/Library/Graphics/FreeFrame Plug-Ins"];
      [self registerFreeFramePlugInsAtPath:[@"~/Library/Graphics/FreeFrame Plug-Ins" stringByExpandingTildeInPath]];
   }
}
 
@end

Is this the code that looks like it needs to be changed? If I have it register at the composition URL, will this solve the problem, and make the frf files get drawn from the resource bundle? If so, how do I properly do that?

This is something that I'm not interested in keeping private, but would gladly post the result.

Editing the nib is obviously trivial...

gtoledo3's picture
Re: Modifying FreeFrame plugin to use FRF files from app ...

Whoops, sorry for the way that code imbedded in the post. Can't edit it now...

[admin: fixed]

cwright's picture
Re: Modifying FreeFrame plugin to use FRF files from app ...

yes, this is the part to change. No, your approach is totally wrong. Forget about compositions and composition URLs, they don't matter here.

In your app, you'll do something like this:

[self registerFFPluginsAtPath:[[NSBundle mainBundle] resourcePath]];

That'll tell the plugin to also load FrFs from YourCoolApp.app/Contents/Resources/

cybero's picture
Re: Modifying FreeFrame plugin to use FRF files from app ...

BTW are the Free Frame plugins meant to be 10.6 compatible ?

I'm able to compile a loadable Host plugin on 10.6.x, but cannot get any of the FreeFrame plug ins to load, despite their being in the correct location.

gtoledo3's picture
Re: Modifying FreeFrame plugin to use FRF files from app ...

Just so I'm clear, those lines in the Free Frame project need to be changed though as well, to have it draw from the resource path?

...Or you are saying that line in the app will just make the Free Frame plugin load FrF's from the app resources, regardless of the way the plugin is currently setup? Interesting.

cwright's picture
Re: Modifying FreeFrame plugin to use FRF files from app ...

In the plugin, of course. In the app, self won't refer to the correct object (you'd need call that on each instance of the plugin object, which QC won't provide to you without a fight).

gtoledo3's picture
Re: Modifying FreeFrame plugin to use FRF files from app ...

Cool... the only reason I was scratching my head was because prefacing your lines of code it says "in your app"... I took that to meant the plugin in the context of the app it was used in, because it didn't make sense to me otherwise, but I wanted to make sure I wasn't way off base.

gtoledo3's picture
Re: Modifying FreeFrame plugin to use FRF files from app ...

The Freeframe project definitely works in SL when QC is run in 32 bit mode. I haven't looked at 64 bit mode at all with that one...