I poked around some and found my project file for that patch. Using
this some format and the skanky sdk, you should be able to test for
any kind of port / data type.
The .m file:

#import "QCMeshValidate.h"

@implementation QCMeshValidate
+(BOOL)isSafe
{
        return NO;
}

+(BOOL)allowsSubpatchesWithIdentifier:(id)identifier
{
        return NO;
}

+(int)executionModeWithIdentifier:(id)identifier
{
        return 0;
}

+(int)timeModeWithIdentifier:(id)identifier
{
        return 0;
}

-(id)initWithIdentifier:(id)identifier
{
        if(self = [super initWithIdentifier:identifier])
        {
                [[self userInfo] setObject:@"QCMeshValidate" forKey:@"name"];
        }
        return self;
}

-(BOOL)setup:(QCOpenGLContext*)context
{
        return YES;
}

-(void)cleanup:(QCOpenGLContext*)context
{
}

-(void)enable:(QCOpenGLContext*)context
{
}

-(void)disable:(QCOpenGLContext*)context
{
}

-(BOOL)execute:(QCOpenGLContext*)context time:(double)time
arguments:(NSDictionary*)arguments
{
        [outputResult setIndexValue:([inputMesh meshValue] ? 1 : 0)];
        
        return YES;
}

@end


...and the header (.h file):


@interface QCMeshValidate : QCPatch
{
        QCMeshPort *inputMesh;
        QCIndexPort *outputResult;
}

+(BOOL)isSafe;
+(BOOL)allowsSubpatchesWithIdentifier:(id)identifier;
+(int)executionModeWithIdentifier:(id)identifier;
+(int)timeModeWithIdentifier:(id)identifier;
-(id)initWithIdentifier:(id)identifier;
-(BOOL)setup:(QCOpenGLContext*)context;
-(void)cleanup:(QCOpenGLContext*)context;
-(void)enable:(QCOpenGLContext*)context;
-(void)disable:(QCOpenGLContext*)context;
-(BOOL)execute:(QCOpenGLContext*)context time:(double)time
arguments:(NSDictionary*)arguments;

@end

If you look at the download and install the skanky sdk
(http://kineme.net), and make a new project, you should be able to use
this general setup to test for any kind of port type.

You can consult the skanky sdk example patches for implementing the
xml file for if you want to customize your key and attributes for
ports, etc., (it's not strictly necessary).

Best regards,
gt

On Fri, May 13, 2011 at 8:51 AM, George Toledo <[email protected]> wrote:
> http://www.box.net/shared/qluq7v87hy#/shared/qluq7v87hy/1/17527532/655933849/1
>
> This plugin will return a true/false that indicates if you have a
> valid qcmesh. Insert it in a Quartz Composer Patches folder. Look for
> QCMeshValidate in your patch list.
>
> I think that you should probably be able to use that in combo with
> image validate to get it working for you.
>
> On Fri, May 13, 2011 at 8:36 AM, Nisar Ahmed <[email protected]> wrote:
>> Dear Members,
>> Is there a way to detect and find out the type of an output port. I have a
>> structure which can contain mesh or image, I need to know what type of
>> object it contains at a specified index so that I can select and render it
>> with the appropriate consumer for at runtime.
>> Thanks
>> Nisar
>>  _______________________________________________
>> 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/gtoledo3%40gmail.com
>>
>> This email sent to [email protected]
>>
>>
>
>
>
> --
> George Toledo
> [email protected]
> www.georgetoledo.com
>



-- 
George Toledo
[email protected]
www.georgetoledo.com
 _______________________________________________
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