1 diff -urN Cura-15.02.1.org/Cura/gui/sceneView.py Cura-15.02.1/Cura/gui/sceneView.py
2 --- Cura-15.02.1.org/Cura/gui/sceneView.py 2015-02-18 21:22:48.000000000 +0100
3 +++ Cura-15.02.1/Cura/gui/sceneView.py 2015-05-14 22:34:56.020409418 +0200
4 @@ -1320,105 +1320,16 @@
6 size = [profile.getMachineSettingFloat('machine_width'), profile.getMachineSettingFloat('machine_depth'), profile.getMachineSettingFloat('machine_height')]
8 - machine_type = profile.getMachineSetting('machine_type')
9 - if machine_type not in self._platformMesh:
10 - self._platformMesh[machine_type] = None
15 - texture_offset = [0,0,0]
17 - if machine_type == 'ultimaker2' or machine_type == 'ultimaker2extended':
18 - filename = resources.getPathForMesh('ultimaker2_platform.stl')
19 - offset = [-9,-37,145]
20 - texture_name = 'Ultimaker2backplate.png'
21 - texture_offset = [9,150,-5]
22 - elif machine_type == 'ultimaker2go':
23 - filename = resources.getPathForMesh('ultimaker2go_platform.stl')
24 - offset = [0,-42,145]
25 - texture_offset = [0,105,-5]
26 - texture_name = 'Ultimaker2backplate.png'
28 - elif machine_type == 'ultimaker_plus':
29 - filename = resources.getPathForMesh('ultimaker2_platform.stl')
30 - offset = [0,-37,145]
31 - texture_offset = [0,150,-5]
32 - texture_name = 'UltimakerPlusbackplate.png'
33 - elif machine_type == 'ultimaker':
34 - filename = resources.getPathForMesh('ultimaker_platform.stl')
36 - elif machine_type == 'Witbox':
37 - filename = resources.getPathForMesh('Witbox_platform.stl')
38 - offset = [0,-37,145]
40 - if filename is not None:
41 - meshes = meshLoader.loadMeshes(filename)
43 - self._platformMesh[machine_type] = meshes[0]
44 - self._platformMesh[machine_type]._drawOffset = numpy.array(offset, numpy.float32)
45 - self._platformMesh[machine_type].texture = None
46 - if texture_name is not None:
47 - self._platformMesh[machine_type].texture = openglHelpers.loadGLTexture(texture_name)
48 - self._platformMesh[machine_type].texture_offset = texture_offset
49 - self._platformMesh[machine_type].texture_scale = texture_scale
50 - if self._platformMesh[machine_type] is not None:
51 - mesh = self._platformMesh[machine_type]
52 - glColor4f(1,1,1,0.5)
53 - self._objectShader.bind()
54 - self._renderObject(mesh, False, False)
55 - self._objectShader.unbind()
57 - #For the Ultimaker 2 render the texture on the back plate to show the Ultimaker2 text.
58 - if mesh.texture is not None:
59 - glBindTexture(GL_TEXTURE_2D, mesh.texture)
60 - glEnable(GL_TEXTURE_2D)
64 - glTranslate(mesh.texture_offset[0], mesh.texture_offset[1], mesh.texture_offset[2])
65 - glScalef(mesh.texture_scale, mesh.texture_scale, mesh.texture_scale)
70 - glBlendFunc(GL_DST_COLOR, GL_ONE_MINUS_SRC_ALPHA)
71 - glEnable(GL_ALPHA_TEST)
72 - glAlphaFunc(GL_GREATER, 0.0)
75 - glVertex3f( w, 0, h)
77 - glVertex3f(-w, 0, h)
79 - glVertex3f(-w, 0, 0)
81 - glVertex3f( w, 0, 0)
84 - glVertex3f(-w, d, h)
86 - glVertex3f( w, d, h)
88 - glVertex3f( w, d, 0)
90 - glVertex3f(-w, d, 0)
92 - glDisable(GL_TEXTURE_2D)
93 - glDisable(GL_ALPHA_TEST)
94 - glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA)
100 - glVertex3f(-size[0] / 2, -size[1] / 2, 0)
101 - glVertex3f(-size[0] / 2, -size[1] / 2, 10)
102 - glVertex3f(-size[0] / 2, -size[1] / 2, 0)
103 - glVertex3f(-size[0] / 2+10, -size[1] / 2, 0)
104 - glVertex3f(-size[0] / 2, -size[1] / 2, 0)
105 - glVertex3f(-size[0] / 2, -size[1] / 2+10, 0)
110 + glVertex3f(-size[0] / 2, -size[1] / 2, 0)
111 + glVertex3f(-size[0] / 2, -size[1] / 2, 10)
112 + glVertex3f(-size[0] / 2, -size[1] / 2, 0)
113 + glVertex3f(-size[0] / 2+10, -size[1] / 2, 0)
114 + glVertex3f(-size[0] / 2, -size[1] / 2, 0)
115 + glVertex3f(-size[0] / 2, -size[1] / 2+10, 0)