public List<ModelSubset> orderSubsetsInList(List<GameObject> list) {
		
		Comparator<ModelSubset> comp = new Comparator<ModelSubset>() {

			@Override
			public int compare(ModelSubset o1, ModelSubset o2) {
				if (o1.getMaterial().getTextureID()<o2.getMaterial().getTextureID())
					return -1;
				if (o1.getMaterial().getTextureID()>o2.getMaterial().getTextureID())
					return 1;
				return 0;
			}
		};
		
		List<ModelSubset> sets = new ArrayList<ModelSubset>();
		
		for (GameObject obj : list) {
			ModelSubset[] subarr = obj.getAnimatedModel().getSubsets();
			for (int i = 0; i<subarr.length; i++) {
				sets.add(subarr[i]);
			}
		}
		
		Collections.sort(sets, comp);
		
		return sets;
	}