This already looks wrong, but the enum dropdown does not appear in the 3dsmax Settings / Render Option, so we cant fix it (without resubmit). How can this happen?
It has been like that forever.
Here is the relevant code:
[code] if forceCamera == “” then --no forced camera
(
local theCam = viewport.getCamera() --get viewport camera
if isValidNode theCam then --if it is valid, output it
format “Camera=%\n” (theCam.name) to:JobInfoFile
else
format “Camera=\n” to:JobInfoFile --if viewport is not a camera, output no camera.
)
else
format “Camera=%\n” forceCamera to:JobInfoFile --if camera was supplied, force output to it.
format "Camera0=\n" to:JobInfoFile
--Write out all cameras found in the current scene:
local theCameras = for c in objects where findItem Camera.classes (classof c) > 0 collect c
for c = 1 to theCameras.count do
format "Camera%=%\n" c theCameras[c].name to:JobInfoFile
[/code]
So the first line is the current camera. In your case, that happens to be a Light.
The Camera0= is always empty. It seems that it is there so you can turn the camera off. Not sure how useful this is, but I don’t even think this was my code originally. It could have been yours or Grant’s from before 2004
Then we output Cameras 1 to N.
I guess we could check if the current view is NOT on the cameras list and add it too. I assume the list is considered “corrupt” because the active camera is not on the list, so the list does not show up at all.
I would not like to include ALL lights on the list, but if the current view IS a light, it probably should be included so the list is valid.
I tried this as a fix and it seems to work with a light as viewport:
[code] local theCam = viewport.getCamera() --get viewport camera
if forceCamera == “” then --no forced camera
(
if isValidNode theCam then --if it is valid, output it
format “Camera=%\n” (theCam.name) to:JobInfoFile
else
format “Camera=\n” to:JobInfoFile --if viewport is not a camera, output no camera.
)
else
format “Camera=%\n” forceCamera to:JobInfoFile --if camera was supplied, force output to it.
format "Camera0=\n" to:JobInfoFile
--Write out all cameras found in the current scene:
local theCameras = for c in objects where findItem Camera.classes (classof c) > 0 collect c
for c = 1 to theCameras.count do
format "Camera%=%\n" c theCameras[c].name to:JobInfoFile
--If the current view is not a camera (it could be a light for example), make sure it is added to the list, otherwise the list would be invalid
if isValidNode theCam AND findItem theCameras theCam == 0 do
format "Camera%=%\n" (theCameras.count+1) theCam.name to:JobInfoFile[/code]