def render_obj(obj_path, path, objid, obj_name, temp_folder):
    ' render one obj file by a given viewpoint list\n    a wrapper function for render()\n\n    Args:\n        obj_path: a string variable indicate the obj file path\n    '
    vps_path = random.sample(g_view_point_file, 1)[0]
    vps = list(load_viewpoint(vps_path))
    random.shuffle(vps)
    save_path = os.path.join(path, '{}_{:04d}.png'.format(obj_name, objid))
    gt_path = os.path.join(path, 'GT', '{}_{:04d}'.format(obj_name, objid))
    video_path = os.path.join(path, '{}_{:04d}.avi'.format(obj_name, objid))
    if (not os.path.exists(gt_path)):
        os.mkdir(gt_path)
    image_output_node = bpy.context.scene.node_tree.nodes[1]
    image_output_node.base_path = gt_path
    for imt in bpy.data.images:
        bpy.data.images.remove(imt)
    if g_apply_texture:
        for oi in range(len(bpy.data.objects)):
            if ((bpy.data.objects[oi].type == 'CAMERA') or (bpy.data.objects[oi].type == 'LAMP')):
                continue
            bpy.context.scene.objects.active = bpy.data.objects[oi]
            bpy.ops.object.editmode_toggle()
            bpy.ops.uv.cube_project()
            bpy.ops.object.editmode_toggle()
            texture_images = os.listdir(g_texture_path)
            texture = random.choice(texture_images)
            tex_path = os.path.join(g_texture_path, texture)
            for mat in bpy.data.materials:
                nodes = mat.node_tree.nodes
                links = mat.node_tree.links
                textureNode = nodes.new('ShaderNodeTexImage')
                textureNode.image = bpy.data.images.load(tex_path)
                links.new(nodes['Diffuse BSDF'].inputs['Color'], textureNode.outputs['Color'])
    tri = 0
    while (tri <= g_max_trials):
        tri += 1
        vp = random.sample(vps, 1)[0]
        (sample_different_object, sample_different_vp) = render(obj_path, vp, temp_folder)
        if sample_different_vp:
            if sample_different_object:
                print('Transparent object!')
                return False
            print('Rendering failed, repeating')
            continue
        success = make_fmo(save_path, gt_path, video_path)
        if success:
            return True
        print('Making FMO failed, repeating')
    return False
render one obj file by a given viewpoint list
a wrapper function for render()

Args:
    obj_path: a string variable indicate the obj file path
def render_obj(obj_path, path, objid, obj_name, temp_folder):
    ' render one obj file by a given viewpoint list\n    a wrapper function for render()\n\n    Args:\n        obj_path: a string variable indicate the obj file path\n    '
    vps_path = random.sample(g_view_point_file, 1)[0]
    vps = list(load_viewpoint(vps_path))
    random.shuffle(vps)
    save_path = os.path.join(path, '{}_{:04d}.png'.format(obj_name, objid))
    gt_path = os.path.join(path, 'GT', '{}_{:04d}'.format(obj_name, objid))
    video_path = os.path.join(path, '{}_{:04d}.avi'.format(obj_name, objid))
    if (not os.path.exists(gt_path)):
        os.mkdir(gt_path)
    image_output_node = bpy.context.scene.node_tree.nodes[1]
    image_output_node.base_path = gt_path
    for imt in bpy.data.images:
        bpy.data.images.remove(imt)
    if g_apply_texture:
        for oi in range(len(bpy.data.objects)):
            if ((bpy.data.objects[oi].type == 'CAMERA') or (bpy.data.objects[oi].type == 'LAMP')):
                continue
            bpy.context.scene.objects.active = bpy.data.objects[oi]
            bpy.ops.object.editmode_toggle()
            bpy.ops.uv.cube_project()
            bpy.ops.object.editmode_toggle()
            texture_images = os.listdir(g_texture_path)
            texture = random.choice(texture_images)
            tex_path = os.path.join(g_texture_path, texture)
            for mat in bpy.data.materials:
                nodes = mat.node_tree.nodes
                links = mat.node_tree.links
                textureNode = nodes.new('ShaderNodeTexImage')
                textureNode.image = bpy.data.images.load(tex_path)
                links.new(nodes['Diffuse BSDF'].inputs['Color'], textureNode.outputs['Color'])
    tri = 0
    while (tri <= g_max_trials):
        tri += 1
        vp = random.sample(vps, 1)[0]
        (sample_different_object, sample_different_vp) = render(obj_path, vp, temp_folder)
        if sample_different_vp:
            if sample_different_object:
                print('Transparent object!')
                return False
            print('Rendering failed, repeating')
            continue
        success = make_fmo(save_path, gt_path, video_path)
        if success:
            return True
        print('Making FMO failed, repeating')
    return False