mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-12 01:39:03 +08:00
Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
99f4c1a2d3
@ -54,7 +54,7 @@ class PickingPass(RenderPass):
|
|||||||
# Fill up the batch with objects that can be sliced. `
|
# Fill up the batch with objects that can be sliced. `
|
||||||
for node in DepthFirstIterator(self._scene.getRoot()): #type: ignore #Ignore type error because iter() should get called automatically by Python syntax.
|
for node in DepthFirstIterator(self._scene.getRoot()): #type: ignore #Ignore type error because iter() should get called automatically by Python syntax.
|
||||||
if node.callDecoration("isSliceable") and node.getMeshData() and node.isVisible():
|
if node.callDecoration("isSliceable") and node.getMeshData() and node.isVisible():
|
||||||
batch.addItem(node.getWorldTransformation(copy = False), node.getMeshData())
|
batch.addItem(node.getWorldTransformation(copy = False), node.getMeshData(), normal_transformation=node.getCachedNormalMatrix())
|
||||||
|
|
||||||
self.bind()
|
self.bind()
|
||||||
batch.render(self._scene.getActiveCamera())
|
batch.render(self._scene.getActiveCamera())
|
||||||
|
@ -61,6 +61,7 @@ class ConvexHullNode(SceneNode):
|
|||||||
if hull_mesh_builder.addConvexPolygon(
|
if hull_mesh_builder.addConvexPolygon(
|
||||||
self._hull.getPoints()[::], # bottom layer is reversed
|
self._hull.getPoints()[::], # bottom layer is reversed
|
||||||
self._mesh_height, color = self._color):
|
self._mesh_height, color = self._color):
|
||||||
|
hull_mesh_builder.resetNormals()
|
||||||
|
|
||||||
hull_mesh = hull_mesh_builder.build()
|
hull_mesh = hull_mesh_builder.build()
|
||||||
self.setMeshData(hull_mesh)
|
self.setMeshData(hull_mesh)
|
||||||
@ -68,7 +69,7 @@ class ConvexHullNode(SceneNode):
|
|||||||
if hull_mesh_builder.addConvexPolygonExtrusion(
|
if hull_mesh_builder.addConvexPolygonExtrusion(
|
||||||
self._hull.getPoints()[::-1], # bottom layer is reversed
|
self._hull.getPoints()[::-1], # bottom layer is reversed
|
||||||
self._mesh_height - thickness, self._mesh_height, color = self._color):
|
self._mesh_height - thickness, self._mesh_height, color = self._color):
|
||||||
|
hull_mesh_builder.resetNormals()
|
||||||
hull_mesh = hull_mesh_builder.build()
|
hull_mesh = hull_mesh_builder.build()
|
||||||
self.setMeshData(hull_mesh)
|
self.setMeshData(hull_mesh)
|
||||||
|
|
||||||
|
@ -29,7 +29,7 @@ class XRayPass(RenderPass):
|
|||||||
batch = RenderBatch(self._shader, type = RenderBatch.RenderType.NoType, backface_cull = False, blend_mode = RenderBatch.BlendMode.Additive)
|
batch = RenderBatch(self._shader, type = RenderBatch.RenderType.NoType, backface_cull = False, blend_mode = RenderBatch.BlendMode.Additive)
|
||||||
for node in DepthFirstIterator(self._scene.getRoot()):
|
for node in DepthFirstIterator(self._scene.getRoot()):
|
||||||
if isinstance(node, CuraSceneNode) and node.getMeshData() and node.isVisible():
|
if isinstance(node, CuraSceneNode) and node.getMeshData() and node.isVisible():
|
||||||
batch.addItem(node.getWorldTransformation(copy = False), node.getMeshData())
|
batch.addItem(node.getWorldTransformation(copy = False), node.getMeshData(), normal_transformation=node.getCachedNormalMatrix())
|
||||||
|
|
||||||
self.bind()
|
self.bind()
|
||||||
|
|
||||||
|
@ -244,7 +244,7 @@ class SolidView(View):
|
|||||||
else:
|
else:
|
||||||
renderer.queueNode(node, shader = self._non_printing_shader, transparent = True)
|
renderer.queueNode(node, shader = self._non_printing_shader, transparent = True)
|
||||||
elif getattr(node, "_outside_buildarea", False):
|
elif getattr(node, "_outside_buildarea", False):
|
||||||
disabled_batch.addItem(node.getWorldTransformation(copy = False), node.getMeshData())
|
disabled_batch.addItem(node.getWorldTransformation(copy = False), node.getMeshData(), normal_transformation = node.getCachedNormalMatrix())
|
||||||
elif per_mesh_stack and node.callDecoration("isSupportMesh"):
|
elif per_mesh_stack and node.callDecoration("isSupportMesh"):
|
||||||
# Render support meshes with a vertical stripe that is darker
|
# Render support meshes with a vertical stripe that is darker
|
||||||
shade_factor = 0.6
|
shade_factor = 0.6
|
||||||
@ -256,7 +256,7 @@ class SolidView(View):
|
|||||||
]
|
]
|
||||||
renderer.queueNode(node, shader = self._support_mesh_shader, uniforms = uniforms)
|
renderer.queueNode(node, shader = self._support_mesh_shader, uniforms = uniforms)
|
||||||
else:
|
else:
|
||||||
normal_object_batch.addItem(node.getWorldTransformation(copy=False), node.getMeshData(), uniforms=uniforms)
|
normal_object_batch.addItem(node.getWorldTransformation(copy=False), node.getMeshData(), uniforms=uniforms, normal_transformation = node.getCachedNormalMatrix())
|
||||||
if node.callDecoration("isGroup") and Selection.isSelected(node):
|
if node.callDecoration("isGroup") and Selection.isSelected(node):
|
||||||
renderer.queueNode(scene.getRoot(), mesh = node.getBoundingBoxMesh(), mode = RenderBatch.RenderMode.LineLoop)
|
renderer.queueNode(scene.getRoot(), mesh = node.getBoundingBoxMesh(), mode = RenderBatch.RenderMode.LineLoop)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user