Thanks christopher! You saved the day again :P

I do have NSlogs everywhere (actually [QCPlugInContext logMessage], not
sure you can use NSLog with the official setup), but I didn't know any of
this stuff about different bundles - now looking at the path that comes
out, its an absolute path! Doesn't matter I guess as long as it works... 

Cheers,

P.S. my opengl texture appears upside down even though i'm sure my mapping
coordinates are correct :S I guess I can just flip the coordinates, but is
it a setting somewhere or is it normal? (difference in coordinate system
perhaps?)

Memo.

On Fri, 6 Jun 2008 12:53:11 -0400, Christopher Wright <[EMAIL PROTECTED]>
wrote:
>> Hi all, in my QCPlugIn, i'm trying to load a bunch of images (some
>> of you might remember my problem that sending them in as a struct
>> from QC doesn't work).
> Some Cocoa magic is afoot here:
> 
>>      NSString *imagePath = [[NSBundle mainBundle]
>> pathForImageResource:@"yes"];
> 
> It's great that you're using bundle paths.  that's the Right Thing to
> do in this case.
> 
> However, you're using the wrong bundle.  ;)
> 
> [NSBundle mainBundle] will _Always_ refer to the running application's
> bundle (QC in this case, QuickTime if you were loading the composition
> there, Safari if in a webpage, keynote, whatever, you get the idea).
> This is completely not what you want (since the file you're looking
> for is in the plugin's bundle, not the app's bundle).
> 
> To get the plugin's bundle, you need to do something like this:
> 
>       NSBundle *thisBundle=[NSBundle bundleForClass:[self class]];
>       NSString *path=[thisBundle pathForResource:@"yes" ofType:@"png"];
> 
> the -bundleForClass:[self class] part should get the bundle that
> contains the current method's class (the plugin), and then the lookup
> proceeds as normal.
> 
> Developer to Developer: don't be afraid to put NSLog(@"blah")'s _All
> Over The Place_ with returned values -- this would show the incorrect
> path, to help narrow down what's going on. :)  paths can be tricky
> like that :)
> 
> --
> [ christopher wright ]
> [EMAIL PROTECTED]
> http://kineme.net/
-- 
----------------------------
Mehmet S. Akten

[EMAIL PROTECTED]
www.memo.tv

+44 7958 783 832
+44 20 8123 9986

29 Ironworks
Dace Rd.
London E3 2NX
UK


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Quartzcomposer-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/quartzcomposer-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to