sceneloader: depend on material.
build.py: Fix bug that incorrectly caused cyclic dependencies to be detected when building the topological order.