fov_converter.py 文件源码

python
阅读 23 收藏 0 点赞 0 评论 0

项目:surume 作者: tm8r 项目源码 文件源码
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))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号