Robert-N7 / abmatt

ANoob's Brres Material Tool for Mario Kart Wii
GNU General Public License v3.0
14 stars 3 forks source link

AttributeError: 'NoneType' object has no attribute 'iter' #37

Closed Heath123 closed 3 years ago

Heath123 commented 3 years ago

In this model, doing a replacement on the original Luigi Circuit BRRES:

Converting /home/heath/luigi/dae2/edit-basic/course.dae... 
Traceback (most recent call last):
  File "/home/heath/Downloads/abmatt/abmatt/__main__.py", line 35, in <module>
    main()
  File "/home/heath/Downloads/abmatt/abmatt/__main__.py", line 24, in main
    files = load_config.parse_args(argv, base_path)
  File "/home/heath/Downloads/abmatt/abmatt/load_config.py", line 291, in parse_args
    if not Command.run_commands(cmds):
  File "/home/heath/Downloads/abmatt/abmatt/command.py", line 690, in run_commands
    cmd.run_cmd()
  File "/home/heath/Downloads/abmatt/abmatt/command.py", line 750, in run_cmd
    return self.run_convert()
  File "/home/heath/Downloads/abmatt/abmatt/command.py", line 822, in run_convert
    mdl = converter.load_model(model)
  File "/home/heath/Downloads/abmatt/abmatt/converters/convert_dae.py", line 34, in load_model
    self.__parse_nodes(dae.get_scene(), material_geometry_map, matrix)
  File "/home/heath/Downloads/abmatt/abmatt/converters/dae.py", line 88, in get_scene
    node = self.decode_node(x)
  File "/home/heath/Downloads/abmatt/abmatt/converters/dae.py", line 140, in decode_node
    target = self.__get_bound_material(child)
  File "/home/heath/Downloads/abmatt/abmatt/converters/dae.py", line 659, in __get_bound_material
    bound_material = first(first(first(node, 'bind_material'), 'technique_common'), 'instance_material')
  File "/home/heath/Downloads/abmatt/abmatt/converters/dae.py", line 30, in first
    for x in element.iter(item):
AttributeError: 'NoneType' object has no attribute 'iter'
Robert-N7 commented 3 years ago

The cube does not have a material, I might change it to create a default if it isn't found.