Hah! change ob = add_object(OB_EMPTY); in PutRaw() to ob = add_object(OB_MESH); the usercount for the mesh might be zero but we need a mesh object to link it to not an empty object.