Anybody have success creating a scripted operator with multiple output
ports by Class ID that connect to parameters?
I wrote a scripted operator which functions exactly as it should from a
user's point of view. The problem is my script to apply the operator
specifies it should connect to 2 parameters: the 'projtrsu' and
'projtrsv' of a texture projection def property. But for some reason
XSI is not connecting the operator to the specified parameters directly,
instead it's connecting the operator to the texture projection def
property which owns the parameters. Our game exporter automatically
detects animated parameters on scene elements and dumps values for the
entire frame range, but since my scripted operator is not connecting to
the parameters directly, our exporter doesn't detect they're animated,
and therefore does not export them. Querying both the parameters and
property via Parameter.IsAnimated(), Property.NodeAnimatedParameters,
Property.AnimatedParameters(), and so on all return false/null/not
animated/whatever. Very irritating to say the least.
Can anybody shed some light on the situation? I need to connect the
operator directly to the specified parameters.
//-----------------------------------------
// Create an empty operator to start
var oCustomOperator = XSIFactory.CreateObject( "NC_EyeOperator" );
// Output PortGroups
oOutputPortGroupU = oCustomOperator.AddPortGroup( "OutputU", 1, 2 );
oCustomOperator.AddOutputPortByClassID( siParameterID, "TranslationU",
oOutputPortGroupU.Index );
oOutputPortGroupV = oCustomOperator.AddPortGroup( "OutputV", 1, 2 );
oCustomOperator.AddOutputPortByClassID( siParameterID, "TranslationV",
oOutputPortGroupV.Index );
// Input PortGroups
var oInputSourceReferencePortGroup = oCustomOperator.AddPortGroup(
"InputSourceReference", 1, 2 );
oCustomOperator.AddInputPortByClassID( siKinematicsID,
"SourceReferenceGlobal", oInputSourceReferencePortGroup.Index );
var oInputTargetReferencePortGroup = oCustomOperator.AddPortGroup(
"InputTargetReference", 1, 2 );
oCustomOperator.AddInputPortByClassID( siKinematicsID,
"TargetReferenceGlobal", oInputTargetReferencePortGroup.Index );
// Establish connections
var oParameterU = oTextureSpaceDef.Parameters( "projtrsu" );
var oParameterV = oTextureSpaceDef.Parameters( "projtrsv" );
oCustomOperator.ConnectToGroup( oOutputPortGroupU.Index, oParameterU );
oCustomOperator.ConnectToGroup( oOutputPortGroupV.Index, oParameterV );
oCustomOperator.ConnectToGroup( oInputSourceReferencePortGroup.Index,
oSourceReference.Kinematics.Global );
oCustomOperator.ConnectToGroup( oInputTargetReferencePortGroup.Index,
oTargetReference.Kinematics.Global );
//--------------------------------------------------------
thanks,
Matt
---
Unsubscribe? Mail Majordomo(at)Softimage.COM with the following text in body:
unsubscribe xsi