Hey all,
I’m working on a data streamer in Maya API, so i have a socket reciving alot of data for different attributes and then i use MPlug.setValue() to apply it to the attributes i wish.
However, the locator i’m apply these values to are connected to other locators with regular connections and Set Driven keys, and these values do not update.
so i have two locators, A and B
translate X on A is connected to translate Y on B.
if i use the MPlug.SetValue and set the value of Translate X on A to 10, A will move 10 units, but B wont move at all.
This is the code i use to apply the values
void ApplyData(MStringArray lChannels, MStringArray lData, MFnDagNode &node)
{
for(unsigned int i = 0; i < lChannels.length(); i++)
{
MString attrName = lChannels[i];
MPlug attr = node.findPlug(attrName);
float value = lData[i].asFloat();
attr.setValue( value);
}
}
so either i need to get a pointer to the connected nodes or ask maya to reevaluate the whole scene, the latter sounds like something i wouldn’t want to do.