Skip to content

Commit

Permalink
Merge pull request #995 from beekama/colored-projector-pattern
Browse files Browse the repository at this point in the history
fix: integer cast issue for colored projector patterns
  • Loading branch information
cornerfarmer authored Oct 24, 2023
2 parents b518994 + a57f1d1 commit b6bc84b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions blenderproc/python/types/LightUtility.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,8 @@ def setup_as_projector(self, pattern: np.ndarray, frame: Optional[int] = None):
node_ox = nodes.get('Emission')

image_data = bpy.data.images.new('pattern', width=pattern.shape[1], height=pattern.shape[0], alpha=True)
if pattern.dtype == np.uint8:
pattern = pattern / 255.0 # manual cast to range [0,1] to avoid integer casting issues below
image_data.pixels = pattern.ravel()

# Set Up Nodes
Expand Down

0 comments on commit b6bc84b

Please sign in to comment.