def _apply(self, *args):
selected = cmds.textScrollList(self.text_scroll, q=True, si=True)
fov = cmds.textFieldGrp(self.text_field, q=True, tx=True)
if not selected or not fov:
return
camera = selected[0]
vfa = cmds.getAttr(camera + ".verticalFilmAperture")
focal_length = 0.5 * vfa / math.tan(float(fov) / 2.0 / 57.29578) / 0.03937
cmds.setAttr(camera + ".focalLength", focal_length)
cmds.textFieldGrp(self.result_field, e=True, tx=round(focal_length, 3))
评论列表
文章目录