validate_normals.py 文件源码

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

项目:pyblish-starter 作者: pyblish 项目源码 文件源码
def process(self, instance):
        from maya import cmds

        invalid = list()
        for mesh in cmds.ls(instance, type="mesh", long=True):
            faces = cmds.polyListComponentConversion(mesh, toVertexFace=True)
            locked = cmds.polyNormalPerVertex(faces,
                                              query=True,
                                              freezeNormal=True)

            invalid.append(mesh) if any(locked) else None

        # On locked normals, indicate that validation has failed
        # with a friendly message for the user.
        assert not invalid, (
            "Meshes found with locked normals: %s" % invalid)

        self.log.info("The normals of \"%s\" are correct." % instance)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号