API - Trigger compute from child of array attr


#1

Hi,
I feel like this should be obvious but the solution escapes me - I have a simple (locator derived) node which has an input attribute which is an array attribute (the output is an outMesh).
It’s set up as follows:

	aInCurves = typedAttr.create("inCurves", "crv", MFnData::kNurbsCurve );
	CHECK_MSTATUS ( typedAttr.setStorable(false) );
	CHECK_MSTATUS ( typedAttr.setKeyable(true) );
	CHECK_MSTATUS ( typedAttr.setReadable(false) ) ;
	CHECK_MSTATUS ( typedAttr.setWritable(true) );
	CHECK_MSTATUS ( typedAttr.setArray(true) );
	CHECK_MSTATUS ( typedAttr.setIndexMatters(false) );
	CHECK_MSTATUS ( typedAttr.setUsesArrayDataBuilder(true) );
	CHECK_MSTATUS ( typedAttr.setDisconnectBehavior(MFnAttribute::kDelete));
	CHECK_MSTATUS ( addAttribute(aInCurves ) );
	CHECK_MSTATUS ( attributeAffects( aInCurves , aOutMesh ));

However because I can’t explicitly setup the attributeAffects for each child of this attribute I find the once in use the changes to the array elements (dynamically created by maya for each connection) don’t trigger the compute.

What is the method for setting up this type of dependency?

Thanks


#2

You should use ‘MPxNode::setDependentsDirty’ and ask specifically for your input element.


#3

Ah, thanks. Will give that a go.