You want to drive opacity based on distance to the render camera so you need to measure how far the particle is from the camera. First, in a runtime expression get camera position: vector $camPos = renderCam.tx, renderCam.ty, renderCam.tz;**
**make sure you place double carrots( shift+, and shift+.) around the renderCam.tx...declaration. I keep trying to get them in there but the post is intrepreting them as html, so anything inbetween them isn't show in up.
Subtract camera postion form particle position:
float $distance = mag($camPos -particleshape1.worldPostion);
mag is a simple function, if you want to know how it works, look it up. Now you can drive opacity with your $distance variable and another function:
particleShape.opacityPP = linstep(min,max,$distance);
here maya tells you particle to have no opacity at any $distance below the "min" argument and full opacity at any $distance above the "max" argument. Maya will fade opacity relative to any valves that fall in between min and max. For example if min is 1 and max is 3, a particle that is .45 away from the camera will have no opacity, 3.6 away will have full opacity and 2.5 away will have 75% opacity. To utilize your ramp, create a new custom attribute, slap your opacity ramp on it and multiply your opacityPP linstep function by you new custom attribute:
particleShape.opacityPP = linstep(min,max,$distance)*particleShape.customAttribute;