History

add gettable feature which lists texture names

ZappoMan committed 12 years ago

Commit c48d79a1 parent 786c08f7 files · +46 −0Browse files

Showing the changes to interface/src/renderer/GeometryCache.cpp (1 of 7 files). Show all

Unified · Split

interface/src/renderer/GeometryCache.cpp+23−0
@@ -734,6 +734,29 @@ void NetworkGeometry::setTextureWithNameToURL(const QString& name, const QUrl& u · 733 unmodified lines
734734 }
735735 }
736736
737+QStringList NetworkGeometry::getTextureNames() const {
738+ QStringList result;
739+ for (int i = 0; i < _meshes.size(); i++) {
740+ const NetworkMesh& mesh = _meshes[i];
741+ for (int j = 0; j < mesh.parts.size(); j++) {
742+ const NetworkMeshPart& part = mesh.parts[j];
743+
744+ if (!part.diffuseTextureName.isEmpty()) {
745+ result << part.diffuseTextureName;
746+ }
747+
748+ if (!part.normalTextureName.isEmpty()) {
749+ result << part.normalTextureName;
750+ }
751+
752+ if (!part.specularTextureName.isEmpty()) {
753+ result << part.specularTextureName;
754+ }
755+ }
756+ }
757+ return result;
758+}
759+
737760 /// Reads geometry in a worker thread.
738761 class GeometryReader : public QRunnable {
739762 public: