code: def draw(instance):
      
      # Draw Wavefront instance
      if isinstance(instance, Wavefront):
          draw_materials(instance.materials)
      # Draw single material
      elif isinstance(instance, Material):
          draw_material(instance)
      # Draw dict of materials
      elif isinstance(instance, dict):
          draw_materials(instance)
      else:
          raise ValueError("Cannot figure out how to draw: {}".format(instance))
docs: Generic draw function