From: daid Date: Fri, 20 Sep 2013 06:06:59 +0000 (+0200) Subject: Added proper Ultimaker2 platform text. X-Git-Tag: 13.10~64 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=dcd007504e5e83137b4795f13f44d54abf7333e4;p=cura.git Added proper Ultimaker2 platform text. --- diff --git a/Cura/gui/sceneView.py b/Cura/gui/sceneView.py index 25dcffe9..5380bb9f 100644 --- a/Cura/gui/sceneView.py +++ b/Cura/gui/sceneView.py @@ -1170,7 +1170,7 @@ void main(void) self._platformMesh[machine] = meshes[0] else: self._platformMesh[machine] = None - if profile.getMachineSetting('machine_type') == 'ultimaker2': + if machine == 'ultimaker2': self._platformMesh[machine]._drawOffset = numpy.array([0,-37,145], numpy.float32) else: self._platformMesh[machine]._drawOffset = numpy.array([0,0,2.5], numpy.float32) @@ -1178,6 +1178,44 @@ void main(void) self._objectShader.bind() self._renderObject(self._platformMesh[machine], False, False) self._objectShader.unbind() + + #For the Ultimaker 2 render the texture on the back plate to show the Ultimaker2 text. + if machine == 'ultimaker2': + if not hasattr(self._platformMesh[machine], 'texture'): + self._platformMesh[machine].texture = opengl.loadGLTexture('Ultimaker2backplate.png') + glBindTexture(GL_TEXTURE_2D, self._platformMesh[machine].texture) + glEnable(GL_TEXTURE_2D) + glPushMatrix() + glColor4f(1,1,1,1) + + glTranslate(0,150,-5) + h = 50 + d = 8 + w = 100 + glEnable(GL_BLEND) + glBlendFunc(GL_DST_COLOR, GL_ZERO) + glBegin(GL_QUADS) + glTexCoord2f(1, 0) + glVertex3f( w, 0, h) + glTexCoord2f(0, 0) + glVertex3f(-w, 0, h) + glTexCoord2f(0, 1) + glVertex3f(-w, 0, 0) + glTexCoord2f(1, 1) + glVertex3f( w, 0, 0) + + glTexCoord2f(1, 0) + glVertex3f(-w, d, h) + glTexCoord2f(0, 0) + glVertex3f( w, d, h) + glTexCoord2f(0, 1) + glVertex3f( w, d, 0) + glTexCoord2f(1, 1) + glVertex3f(-w, d, 0) + glEnd() + glDisable(GL_TEXTURE_2D) + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA) + glPopMatrix() else: glColor4f(0,0,0,1) glLineWidth(3) diff --git a/Cura/resources/images/Ultimaker2backplate.png b/Cura/resources/images/Ultimaker2backplate.png new file mode 100644 index 00000000..9b663bf1 Binary files /dev/null and b/Cura/resources/images/Ultimaker2backplate.png differ diff --git a/Cura/resources/meshes/ultimaker2_platform.stl b/Cura/resources/meshes/ultimaker2_platform.stl index 9c764450..5a1bb140 100644 Binary files a/Cura/resources/meshes/ultimaker2_platform.stl and b/Cura/resources/meshes/ultimaker2_platform.stl differ