flatten to LOPs camera

//thanks David Krepelka!!! modified camera culling to flatten_to_CAM_9holeint n = usd_attriblen(0, @primpath, "points"); // make sure to have the mesh set under "Primitves" so @primpath worksvector pos[] = usd_attrib(0, @primpath, "points");//string campath = chs("camera"); // select the camera primitivestring campath = ch("`opinputpath(".", 1)`"+“/primpath”);//pipe camera into second wrangle input (and must be somewhere upstream in first input). maybe fudgy?matrix mcam = usd_worldtransform(0, campath);matrix mprim = usd_worldtransform(0, @primpath);float focal = usd_attrib(0, campath, "focalLength");float hap = usd_attrib(0, campath, "horizontalAperture");float vap = usd_attrib(0, campath, "verticalAperture");
for(int i=0; i<n; i++){
    vector pprim = pos[i] * mprim;    vector pcam = pprim * invert(mcam); // get point positions into camera space        float xcam = (focal * pcam.x / (hap/2))/pcam.z;    float ycam = (focal * pcam.y / (vap/2)/(hap/vap))/pcam.z;
    pcam = set(-xcam,-ycam,pcam.z);        pcam.z *= 0;    pcam.z-=1;        //seems really dumb to just reverse above, better way?    pcam.x= ((-pcam.x*focal)*(hap*2))*pcam.z;    pcam.y= ((-pcam.y*focal)*(vap*2)*(hap/vap))*pcam.z;        pcam = pcam * mcam;    pcam = pcam * invert(mprim);        usd_setattribelement(0, @primpath, "points", i, pcam);}