Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/Ultimaker/Cura.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJack Ha <j.ha@ultimaker.com>2016-12-28 17:20:14 +0300
committerJack Ha <j.ha@ultimaker.com>2016-12-28 17:20:14 +0300
commit0f2fb86cd9872843eb73d86cbb5e001c75ad93dd (patch)
tree4fb2279582a61627559973d3414e43904e653dad /cura/LayerDataBuilder.py
parent8d2b3654a4ff8d107b97fb2297cc27bd05315ed5 (diff)
Layer shader now uses own attribute for line dimensions instead of misusing uvs.
Diffstat (limited to 'cura/LayerDataBuilder.py')
-rw-r--r--cura/LayerDataBuilder.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/cura/LayerDataBuilder.py b/cura/LayerDataBuilder.py
index 7ff8a3737a..41c7790102 100644
--- a/cura/LayerDataBuilder.py
+++ b/cura/LayerDataBuilder.py
@@ -56,7 +56,6 @@ class LayerDataBuilder(MeshBuilder):
index_count += data.lineMeshElementCount()
vertices = numpy.empty((vertex_count, 3), numpy.float32)
- # normals = numpy.empty((vertex_count, 3), numpy.float32)
line_dimensions = numpy.empty((vertex_count, 2), numpy.float32)
colors = numpy.empty((vertex_count, 4), numpy.float32)
indices = numpy.empty((index_count, 2), numpy.int32)
@@ -70,10 +69,15 @@ class LayerDataBuilder(MeshBuilder):
self.addVertices(vertices)
self.addColors(colors)
self.addIndices(indices.flatten())
- self._uvs = line_dimensions
- #self._normals = normals
+ # self._uvs = line_dimensions
+ attributes = {
+ "line_dimensions": {
+ "value": line_dimensions,
+ "opengl_name": "a_line_dim",
+ "opengl_type": "vector2f"}
+ }
return LayerData(vertices=self.getVertices(), normals=self.getNormals(), indices=self.getIndices(),
colors=self.getColors(), uvs=self.getUVCoordinates(), file_name=self.getFileName(),
center_position=self.getCenterPosition(), layers=self._layers,
- element_counts=self._element_counts)
+ element_counts=self._element_counts, attributes=attributes)