def get_blender_object(self, obj: core.Object3D) -> bpy.types.Object:
    if isinstance(obj, bpy.types.Object):
        return obj
    elif isinstance(obj, core.Object3D):
        return self.objects_to_blend[obj]
    else:
        raise ValueError('Not a valid object {}'.format(obj))
def get_blender_object(self, obj: core.Object3D) -> bpy.types.Object:
    if isinstance(obj, bpy.types.Object):
        return obj
    elif isinstance(obj, core.Object3D):
        return self.objects_to_blend[obj]
    else:
        raise ValueError('Not a valid object {}'.format(obj))