Access VRayLightMeter values during MEL script execution

​Hi, as the title says, i would like to iterate through the values of the “Total” array of the VRayLightMeter utility during a script execution to calculate the average number.
Currently i have to export the values as an CSV file and calculate there the “average” value of the “Total” array value numbers.
My question is, is it possible to access those directly through MEL?
I could not find any examples for calculating the average sum in the documentation.

I know there was a way in MAX Script for this (see example).

// Get the average value of VRayLightMeter points
function lightMeterAverage &vrayObject = (
arrayMean vrayObject.total
)

Is there a MEL equivalent?

In excel can you just sum the column then divide the amount in this case 35.

Hi stezza, thanks for the reply.
Is there a way to do this directly in MEL, without the need to use excel?

I wouldnt have a clue as to where those numbers are stored, devs should know if they are accessible to mel.
sorry dude, cant help on this one.

Hi, this function is completed. It returns the average value of the VRayLightMeter with vray getLightmeterAverageValue function. For more information you can check our docs page: V-Ray for Maya The function is implemented in v6.20.02, revision 32566 from Apr 25 2024.

vray getLightmeterAverageValue VRayLightMeter1 "total";
// VRayLightMeter1 is the name of the Lightmeter.

​​

Amazing, thank you!! :slight_smile: