Why does a conversion error occur when I am expecting a flag argument to be a float?

 
 
 

Some flags, for example, the -alpha flag of the polyColorPerVertex command, may return a float array instead of a float. Therefore, if you query the flag argument as follows:

float $a = `polyColorPerVertex -q -a pCube1.vtx[0]`; 

You will obtain the following error:

// Error : Cannot convert data of type float[] to float. 

The correct way to query this flag is as follows:

float $a[] = `polyColorPerVertex -q -a pCube1.vtx[0]`;