I have written a custom MPXnode that is only used to store data, in the Initialize() section of mpxnode:
MFnCompoundAttribute compAttr;
MFnNumericAttribute numericAttr;
arrayCacheObj = numericAttr.create("doubleArrayC", "dAC", MFnNumericData::kDouble, 0.0);
numericAttr.setStorable(true);
numericAttr.setWritable(true);
numericAttr.setKeyable(true);
numericAttr.setReadable(true);
numericAttr.setArray(true);
arrayCacheCompObj = compAttr.create("doubleArray", "dA");
compAttr.setArray(true);
compAttr.addChild(arrayCacheObj);
addAttribute(arrayCacheCompObj);
I try to get child plug in my mpxcommand and set value:
MFnDependencyNode arrayCacheNodeFn(arrayCacheNode)
MPlug dAPlug = arrayCacheNodeFn.findPlug("doubleArray", true);
dAPlug.elementByLogicalIndex(0).elementByLogicalIndex(0).setValue(2);
enter image description here The command couldn't find the corresponding plug I thought, and I also tried the.child(0) method.What did I do wrong?