src/gl/partrenderer.cpp

changeset 77
028798a72591
parent 73
97df974b5ed5
child 78
97c3ce5aa498
child 90
e234edb5e613
--- a/src/gl/partrenderer.cpp	Mon Mar 09 22:12:50 2020 +0200
+++ b/src/gl/partrenderer.cpp	Mon Mar 09 23:42:26 2020 +0200
@@ -24,6 +24,7 @@
 #include <QAbstractButton>
 #include "geometry.h"
 #include "partrenderer.h"
+#include "model.h"
 
 PartRenderer::PartRenderer(
 	Model* model,
@@ -61,6 +62,10 @@
 	}
 	this->compiler->initialize();
 	this->compiler->build(this->model, this->documents, this->renderPreferences);
+	connect(this->model, &Model::dataChanged, [&]()
+	{
+		this->compiler->build(this->model, this->documents, this->renderPreferences);
+	});
 	this->initialized = true;
 	this->modelQuaternion = glm::angleAxis(glm::radians(30.0f), glm::vec3{-1, 0, 0});
 	this->modelQuaternion *= glm::angleAxis(glm::radians(225.0f), glm::vec3{-0, 1, 0});

mercurial