fix int->bool cast when collect materials