mirror of
https://github.com/Ultimaker/Cura.git
synced 2026-01-06 06:37:46 -07:00
Merge branch '5.11' into CURA-12763_undo-redo-clear-does-not-invalidate-result
This commit is contained in:
commit
df5c34b9e4
4 changed files with 158 additions and 155 deletions
|
|
@ -770,15 +770,18 @@ class StartSliceJob(Job):
|
|||
node_texture = node.callDecoration("getPaintTexture")
|
||||
texture_data_mapping = node.callDecoration("getTextureDataMapping")
|
||||
if node_texture is not None and texture_data_mapping is not None and "extruder" in texture_data_mapping:
|
||||
texture_image = node_texture.getImage().copy()
|
||||
image_ptr = texture_image.bits()
|
||||
texture_image = node_texture.getImage()
|
||||
image_ptr = texture_image.constBits()
|
||||
image_ptr.setsize(texture_image.sizeInBytes())
|
||||
image_size = texture_image.height(), texture_image.width()
|
||||
image_array = numpy.frombuffer(image_ptr, dtype=numpy.uint32).reshape(image_size)
|
||||
|
||||
bit_range_start, bit_range_end = texture_data_mapping["extruder"]
|
||||
image_array = (image_array << (32 - 1 - (bit_range_end - bit_range_start))) >> (32 - 1 - bit_range_end)
|
||||
used_extruders = numpy.unique(image_array).tolist()
|
||||
full_int32 = 0xffffffff
|
||||
bit_mask = (((full_int32 << (32 - 1 - (bit_range_end - bit_range_start))) & full_int32) >> (
|
||||
32 - 1 - bit_range_end))
|
||||
|
||||
used_extruders = (numpy.unique(image_array & bit_mask) >> bit_range_start).tolist()
|
||||
|
||||
# There is no relevant painting data, just take the extruder associated to the model
|
||||
if not used_extruders:
|
||||
|
|
|
|||
|
|
@ -327,7 +327,7 @@ Item
|
|||
UM.Label
|
||||
{
|
||||
anchors.fill: parent
|
||||
text: catalog.i18nc("@label", "Select a single ungrouped model to start painting")
|
||||
text: catalog.i18nc("@label", "Select a single model to start painting")
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue