It's satisfying the condition:
if (plug.attribute().apiType() == MFn::kNumericAttribute) {
but after that it's not satisfying any of the attribute type condition.
Here is the Code
MPlug plug = nodeFn.findPlug(shaderAttributes[k],&status);
if(MStatus::kSuccess == status){
//All the Numeric Attributes = int,float,float3,double,double3
if (plug.attribute().apiType() == MFn::kNumericAttribute) {
MFnNumericAttribute mfnaTest(plug.attribute());
if (mfnaTest.type() == MFnNumericData::kBoolean) {
bool value;
plug.getValue(value);
}
if (mfnaTest.type() == MFnNumericData::kLong) {
double value;
plug.getValue(value);
}
if (mfnaTest.type() == MFnNumericData::kFloat) {
float value;
plug.getValue(value);
}
if(mfnaTest.type() == MFnNumericData::kDouble){
double value;
plug.getValue(value);
}
if(mfnaTest.type() == MFnNumericData::k3Double){
double3 value;
// get the plugs to the child attributes
MPlug value1 = plug.child(0);
MPlug value2 = plug.child(1);
MPlug value3 = plug.child(2);
// get the values from the child plugs
value1.getValue(value[0]);
value2.getValue(value[1]);
value3.getValue(value[2]);
}
if(mfnaTest.type() == MFnNumericData::k3Float){
float3 value;
// get the plugs to the child attributes
MPlug value1 = plug.child(0);
MPlug value2 = plug.child(1);
MPlug value3 = plug.child(2);
// get the values from the child plugs
value1.getValue(value[0]);
value2.getValue(value[1]);
value3.getValue(value[2]);
}
if(mfnaTest.type() == MFnNumericData::kInt){
int value;
plug.getValue(value);
}
}