code: def main():
      argparser = argparse.ArgumentParser()
      argparser.add_argument(
          "--host",
          metavar="H",
          default="127.0.0.1",
          help="IP of the host server (default: 127.0.0.1)",
      )
      argparser.add_argument(
          "-p",
          "--port",
          metavar="P",
          default=2000,
          type=int,
          help="TCP port to listen to (default: 2000)",
      )
      argparser.add_argument(
          "-d",
          "--diffuse",
          type=str,
          default="",
          help="Path to diffuse image to update",
      )
      argparser.add_argument(
          "-o", "--object-name", type=str, help="Object name"
      )
      argparser.add_argument(
          "-l",
          "--list",
          action="store_true",
          help="Prints names of all objects in the scene",
      )
      argparser.add_argument(
          "-n",
          "--normal",
          type=str,
          default="",
          help="Path to normal map to update",
      )
      argparser.add_argument(
          "--ao_roughness_metallic_emissive",
          type=str,
          default="",
          help="Path to normal map to update",
      )
      args = argparser.parse_args()
  
      client = carla.Client(args.host, args.port)
      client.set_timeout(20.0)
  
      world = client.get_world()
  
      if args.list:
          names = world.get_names_of_all_objects()
          for name in names:
              print(name)
          return
  
      if args.object_name is "":
          print("Error: missing object name to apply texture")
          return
  
      diffuse = None
      normal = None
      ao_r_m_e = None
      if args.diffuse is not "":
          diffuse = imageio.imread(args.diffuse)
      if args.normal is not "":
          normal = imageio.imread(args.normal)
      if args.ao_roughness_metallic_emissive is not "":
          ao_r_m_e = imageio.imread(args.ao_roughness_metallic_emissive)
  
      tex_diffuse = get_8bit_texture(diffuse)
      tex_normal = get_float_texture(normal)
      tex_ao_r_m_e = get_float_texture(ao_r_m_e)
  
      world.apply_textures_to_object(
          args.object_name,
          tex_diffuse,
          carla.TextureFloatColor(0, 0),
          tex_normal,
          tex_ao_r_m_e,
      )
  
file_path: carla/PythonAPI/util/apply_texture.py
imports: import glob
  import os
  import sys
  import argparse
  import math
  import time
  import queue
  import imageio
  import carla
label_desc: Use image node_id 3 for calling a global function with example usage: main() without return types