importing.py 文件源码

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

项目:io_scene_bfres 作者: Syroot 项目源码 文件源码
def _convert_fmdl(self, fmdl):
        # If no parent is given, create an empty object holding the FSHP child mesh objects of this FMDL.
        if self.operator.parent_ob_name:
            fmdl_ob = None
        else:
            fmdl_ob = bpy.data.objects.new(fmdl.header.file_name_offset.name, None)
            Importer._add_object_to_group(fmdl_ob, "BFRES")
            bpy.context.scene.objects.link(fmdl_ob)
        # Go through the polygons in this model and create mesh objects representing them.
        for fshp_node in fmdl.fshp_index_group[1:]:
            fshp_ob = self._convert_fshp(fmdl, fshp_node.data)
            if self.operator.parent_ob_name:
                # Just parent the mesh object to the given object.
                fshp_ob.parent = bpy.data.objects[self.operator.parent_ob_name]
            else:
                # Parent to the empty FMDL object and link it to the scene.
                fshp_ob.parent = fmdl_ob
                Importer._add_object_to_group(fshp_ob, "BFRES")
                bpy.context.scene.objects.link(fshp_ob)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号