Hi Matt, You should use the GetPortAt method to retrieve ports. From the C++ Operator reference: // For each port group for ( LONG idxGroup = 0; idxGroup < op.GetNumPortGroups(); idxGroup++ ) // for each instance in a port group for ( LONG idxInstance = 0; idxInstance < op.GetNumInstancesInGroup( idxGroup ); idxInstance++ ) // for each port in a port group instance for ( LONG idxPort = 0; idxPort < op.GetNumPortsInGroup( idxGroup ); idxPort++ ) // get a specific port Port port = op.GetPortAt( idxPort, idxGroup, idxInstance );
Cheers, Aloys On Thu, Oct 2, 2014 at 1:21 PM, Matt Lind <[email protected]> wrote: > I have a Custom Operator written using the C++ SDK, and it uses dynamic > port connections. > > > > 1) From inside the _Update() callback, how can I determine the number of > connected ports in a dynamic custom operator where the number of input > ports is arbitrary and not known ahead of time? For example, the envelope > operator – how does it know how many deformers and kinematic state > properties are plugged into it? > > > > 2) How can I determine if an individual port is connected to anything? So > far I’ve been creating an object of the expected type then calling > .IsValid(). > > > > For example: > > > > X3DObject oObject = oOperator.GetInput( PortIndex ); > > If ( !oObject.IsValid() ) > > { > > return( CStatus::Fail ); > > } > > > > Is this the recommended way to validate a port connection? > > > > > > Thanks, > > > > > > > > Matt > > > > > > > > > -- Aloys Baillet Lead Software Developer @ Animal Logic The LEGO Movie

