Skip to content

Commit

Permalink
fix: image.pack() should be called after setting the pixels, otherwis…
Browse files Browse the repository at this point in the history
…e Blender treats it as 'dirty'
  • Loading branch information
ntamas committed Jul 14, 2023
1 parent b2a11f6 commit eaa0248
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ def execute_on_formation(self, formation, context):
color = next_color
pixels.extend(list(color.as_vector()))
image.pixels.foreach_set(pixels)
image.pack()

return {"FINISHED"}

Expand Down
1 change: 1 addition & 0 deletions src/modules/sbstudio/plugin/operators/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ def execute_on_formation(self, formation, context):
height=len(colors),
)
image.pixels.foreach_set(list(colors.flat))
image.pack()

return {"FINISHED"}

Expand Down

0 comments on commit eaa0248

Please sign in to comment.