1 # UltimakerPlatforms STLs were stripped from the tarball, don't crash because of that
2 diff -urN Cura-15.02.1.org/Cura/gui/sceneView.py Cura-15.02.1/Cura/gui/sceneView.py
3 --- Cura-15.02.1.org/Cura/gui/sceneView.py 2015-02-18 21:22:48.000000000 +0100
4 +++ Cura-15.02.1/Cura/gui/sceneView.py 2015-05-14 22:34:56.020409418 +0200
5 @@ -1320,105 +1320,16 @@
7 size = [profile.getMachineSettingFloat('machine_width'), profile.getMachineSettingFloat('machine_depth'), profile.getMachineSettingFloat('machine_height')]
9 - machine_type = profile.getMachineSetting('machine_type')
10 - if machine_type not in self._platformMesh:
11 - self._platformMesh[machine_type] = None
16 - texture_offset = [0,0,0]
18 - if machine_type == 'ultimaker2' or machine_type == 'ultimaker2extended':
19 - filename = resources.getPathForMesh('ultimaker2_platform.stl')
20 - offset = [-9,-37,145]
21 - texture_name = 'Ultimaker2backplate.png'
22 - texture_offset = [9,150,-5]
23 - elif machine_type == 'ultimaker2go':
24 - filename = resources.getPathForMesh('ultimaker2go_platform.stl')
25 - offset = [0,-42,145]
26 - texture_offset = [0,105,-5]
27 - texture_name = 'Ultimaker2backplate.png'
29 - elif machine_type == 'ultimaker_plus':
30 - filename = resources.getPathForMesh('ultimaker2_platform.stl')
31 - offset = [0,-37,145]
32 - texture_offset = [0,150,-5]
33 - texture_name = 'UltimakerPlusbackplate.png'
34 - elif machine_type == 'ultimaker':
35 - filename = resources.getPathForMesh('ultimaker_platform.stl')
37 - elif machine_type == 'Witbox':
38 - filename = resources.getPathForMesh('Witbox_platform.stl')
39 - offset = [0,-37,145]
41 - if filename is not None:
42 - meshes = meshLoader.loadMeshes(filename)
44 - self._platformMesh[machine_type] = meshes[0]
45 - self._platformMesh[machine_type]._drawOffset = numpy.array(offset, numpy.float32)
46 - self._platformMesh[machine_type].texture = None
47 - if texture_name is not None:
48 - self._platformMesh[machine_type].texture = openglHelpers.loadGLTexture(texture_name)
49 - self._platformMesh[machine_type].texture_offset = texture_offset
50 - self._platformMesh[machine_type].texture_scale = texture_scale
51 - if self._platformMesh[machine_type] is not None:
52 - mesh = self._platformMesh[machine_type]
53 - glColor4f(1,1,1,0.5)
54 - self._objectShader.bind()
55 - self._renderObject(mesh, False, False)
56 - self._objectShader.unbind()
58 - #For the Ultimaker 2 render the texture on the back plate to show the Ultimaker2 text.
59 - if mesh.texture is not None:
60 - glBindTexture(GL_TEXTURE_2D, mesh.texture)
61 - glEnable(GL_TEXTURE_2D)
65 - glTranslate(mesh.texture_offset[0], mesh.texture_offset[1], mesh.texture_offset[2])
66 - glScalef(mesh.texture_scale, mesh.texture_scale, mesh.texture_scale)
71 - glBlendFunc(GL_DST_COLOR, GL_ONE_MINUS_SRC_ALPHA)
72 - glEnable(GL_ALPHA_TEST)
73 - glAlphaFunc(GL_GREATER, 0.0)
76 - glVertex3f( w, 0, h)
78 - glVertex3f(-w, 0, h)
80 - glVertex3f(-w, 0, 0)
82 - glVertex3f( w, 0, 0)
85 - glVertex3f(-w, d, h)
87 - glVertex3f( w, d, h)
89 - glVertex3f( w, d, 0)
91 - glVertex3f(-w, d, 0)
93 - glDisable(GL_TEXTURE_2D)
94 - glDisable(GL_ALPHA_TEST)
95 - glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA)
101 - glVertex3f(-size[0] / 2, -size[1] / 2, 0)
102 - glVertex3f(-size[0] / 2, -size[1] / 2, 10)
103 - glVertex3f(-size[0] / 2, -size[1] / 2, 0)
104 - glVertex3f(-size[0] / 2+10, -size[1] / 2, 0)
105 - glVertex3f(-size[0] / 2, -size[1] / 2, 0)
106 - glVertex3f(-size[0] / 2, -size[1] / 2+10, 0)
111 + glVertex3f(-size[0] / 2, -size[1] / 2, 0)
112 + glVertex3f(-size[0] / 2, -size[1] / 2, 10)
113 + glVertex3f(-size[0] / 2, -size[1] / 2, 0)
114 + glVertex3f(-size[0] / 2+10, -size[1] / 2, 0)
115 + glVertex3f(-size[0] / 2, -size[1] / 2, 0)
116 + glVertex3f(-size[0] / 2, -size[1] / 2+10, 0)