Last active
December 9, 2015 11:39
-
-
Save AndrewHazelden/494c27166ce740177248 to your computer and use it in GitHub Desktop.
Use Maxwell Render's PyMaxwell tool to scan the camera's lens model
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Return the lens type name as a string | |
# Example: it = CmaxwellCameraIterator(); camera = it.first(scene); cameraLens = cameraParams.getLensType(); lens = mxa_lensTypeName(cameraLens) | |
def mxa_lensTypeName(cameraLens): | |
lensTypeName = '' | |
if cameraLens[0] == TYPE_CYLINDRICAL_LENS: | |
lensTypeName = 'cylindrical' | |
elif cameraLens[0] == TYPE_EXTENSION_LENS: | |
lensTypeName = 'extension lens' | |
elif cameraLens[0] == TYPE_FISHEYE_LENS: | |
lensTypeName = 'fisheye' | |
elif cameraLens[0] == TYPE_ORTHO_LENS: | |
lensTypeName = 'ortho' | |
elif cameraLens[0] == TYPE_PINHOLE_LENS: | |
lensTypeName = 'pinhole' | |
elif cameraLens[0] == TYPE_SPHERICAL_LENS: | |
lensTypeName = 'spherical' | |
elif cameraLens[0] == TYPE_THIN_LENS: | |
lensTypeName = 'thin' | |
return lensTypeName |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment