def clean_object_attributes(scenes):
  """Cleans attributes for objects, keeping only attributes and id.

  Args:
    scenes: Scene graph to clean

  Returns:
    scenes: Cleaned up scene graphs inplace
  """

  keys = ['shape', 'size', 'material', 'color', 'id']
  for scene_id, scene in enumerate(scenes['scenes']):
    for obj_id, obj in enumerate(scene['objects']):
      new_obj = {key: obj[key] for key in keys}
      scenes['scenes'][scene_id]['objects'][obj_id] = new_obj
  return scenes