How to Cycle through pfSwitch nodes

 

Vega Code Example

 

 

 
 

This  example function illustrates how to cycle through  Performer pfSwitch node children

Use findNamedSwitchNodeInVgObject to find a pfSwitch instance

 

 
   
 

 

 
 
 
 

 

#include "vg.h"          // Required for the standard Vega classes
#include "pf.h"          // Required for the standard Performer classes

 

 

void

cycleNextpfSwitch( pfSwitch *swNode ){

// #######################################################

// #

// #  Public function

// #

// #  Cycle through the passed pfSwitch's children or the

// #  Multigen creator masks settings

// #

// ########################################################

 

 

    //

    // Sanity check we need a pointer

    //

    if( swNode == NULL )

        return;

 

    

    //

    // Get the current child node or switch mask index

    //

    int value = pfGetSwitchVal( swNode );

 

 

    //

    // Calculate the next child node or switch mask index to display

    //

    int vchld = ((value >= pfGetNumChildren(swNode)-1) || (value < 0)) ? 0 : value+1;

 

 

    //

    // Display the next child node or switch mask

    //

    pfSwitchVal( swNode, vchld );

 

 

} // cycleNextpfSwitch

 

 

 

 

 

 

 
 

 

 

Copyright 2004 Gordon Tomlinson  All Rights Reserved.

All logos, trademarks and copyrights in this site are property of their respective owner.