Mike C Posted February 20, 2014 Share Posted February 20, 2014 When I apply SetBeamAngle to a spot light object, it doesn't appear to be setting the light to the proper angle. I can can create the light object "manually" within a symbol to an 15 degree beam angle, which produces the correct light output. But if I then set that same light object to an 15 degree angle with code, the edited light object outputs a larger angle (perhaps around 30 degrees?). I'm also editing color and intensity within the same script, so I know I'm affecting the correct light object. If GetTypeN(hndBody)=81 then begin {Light object} hndBeam := hndBody; SetLightInfo(hndBeam, 2, pIntensity, True, True); SetBeamAngle(hndBeam,15); SetSpreadAngle(hndBeam,18); SetLightFalloff(hndBeam,1,1); if pColor='' then begin ColorIndextoRGB(0,realRed,realGreen,realBlue); end else begin mcGelColor(pColor);{Internal subroutine to set RGB values} end; SetLightColorRGB(hndBeam, realRed, realGreen, realBlue); end; Thanks in advance. Quote Link to comment
Vectorworks, Inc Employee klinzey Posted February 20, 2014 Vectorworks, Inc Employee Share Posted February 20, 2014 You need to use 1/2 the angle when setting the value. You should be able to see the results in the OIP of the light. Quote Link to comment
Mike C Posted February 20, 2014 Author Share Posted February 20, 2014 Thanks, Kevin. That possibility dawned on me as I wrote "(possibly 30 degrees?)". Is that little tip documented anywhere, or is it a math function I'm not aware of? Since I don't need to divide the number in half when I enter it into the "Spot Light Specs" dialog box, it doesn't seem very intuitive to include it in the VS function. The light object I'm editing via Vectorscript is part of a PIO, so I didn't have the feedback of the OIP of the light itself. Thanks again. Quote Link to comment
Vectorworks, Inc Employee klinzey Posted February 20, 2014 Vectorworks, Inc Employee Share Posted February 20, 2014 It's simply the internal representation of the data. To the user the angle is measured from edge to edge, the internal angle is from center of the light. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.