]> git.pld-linux.org Git - packages/cura.git/blob - cura-dont-show-nc-stls.patch
- rel 2; compile py files (so py_postclean won't delete all our files)
[packages/cura.git] / cura-dont-show-nc-stls.patch
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 @@
6  
7                 size = [profile.getMachineSettingFloat('machine_width'), profile.getMachineSettingFloat('machine_depth'), profile.getMachineSettingFloat('machine_height')]
8  
9 -               machine_type = profile.getMachineSetting('machine_type')
10 -               if machine_type not in self._platformMesh:
11 -                       self._platformMesh[machine_type] = None
12 -
13 -                       filename = None
14 -                       texture_name = None
15 -                       offset = [0,0,0]
16 -                       texture_offset = [0,0,0]
17 -                       texture_scale = 1.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'
28 -                               texture_scale = 0.9
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')
36 -                               offset = [0,0,2.5]
37 -                       elif machine_type == 'Witbox':
38 -                               filename = resources.getPathForMesh('Witbox_platform.stl')
39 -                               offset = [0,-37,145]
40 -
41 -                       if filename is not None:
42 -                               meshes = meshLoader.loadMeshes(filename)
43 -                               if len(meshes) > 0:
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()
57 -
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)
62 -                               glPushMatrix()
63 -                               glColor4f(1,1,1,1)
64 -
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)
67 -                               h = 50
68 -                               d = 8
69 -                               w = 100
70 -                               glEnable(GL_BLEND)
71 -                               glBlendFunc(GL_DST_COLOR, GL_ONE_MINUS_SRC_ALPHA)
72 -                               glEnable(GL_ALPHA_TEST)
73 -                               glAlphaFunc(GL_GREATER, 0.0)
74 -                               glBegin(GL_QUADS)
75 -                               glTexCoord2f(1, 0)
76 -                               glVertex3f( w, 0, h)
77 -                               glTexCoord2f(0, 0)
78 -                               glVertex3f(-w, 0, h)
79 -                               glTexCoord2f(0, 1)
80 -                               glVertex3f(-w, 0, 0)
81 -                               glTexCoord2f(1, 1)
82 -                               glVertex3f( w, 0, 0)
83 -
84 -                               glTexCoord2f(1, 0)
85 -                               glVertex3f(-w, d, h)
86 -                               glTexCoord2f(0, 0)
87 -                               glVertex3f( w, d, h)
88 -                               glTexCoord2f(0, 1)
89 -                               glVertex3f( w, d, 0)
90 -                               glTexCoord2f(1, 1)
91 -                               glVertex3f(-w, d, 0)
92 -                               glEnd()
93 -                               glDisable(GL_TEXTURE_2D)
94 -                               glDisable(GL_ALPHA_TEST)
95 -                               glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA)
96 -                               glPopMatrix()
97 -               else:
98 -                       glColor4f(0,0,0,1)
99 -                       glLineWidth(3)
100 -                       glBegin(GL_LINES)
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)
107 -                       glEnd()
108 +               glColor4f(0,0,0,1)
109 +               glLineWidth(3)
110 +               glBegin(GL_LINES)
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)
117 +               glEnd()
118  
119                 glDepthMask(False)
120  
This page took 0.079287 seconds and 3 git commands to generate.