Skip to content

Commit

Permalink
fixes rgb to bgr
Browse files Browse the repository at this point in the history
fixes broken preview
  • Loading branch information
ARRAKIS\IAAdmin committed Apr 15, 2024
1 parent 6a90c96 commit c3c3e49
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Texture sharing addon V6.0.4 for Blender 3.x upwards
# Texture sharing addon V6.0.5 for Blender 3.x upwards

Blender addon that allows to share textures via [Spout](http://spout.zeal.co/) or [Syphon](https://syphon.github.io/) or [NDI](https://ndi.video) from and to blender.

Expand Down
2 changes: 1 addition & 1 deletion __init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"author" : "Martin Froehlich, Florian Bruggisser",
"description" : "Sharing Textures via NDI, Spout or Syphon from Blender",
"blender" : (3, 0, 0),
"version" : (6, 0, 0),
"version" : (6, 0, 5),
"doc_url" : "https://github.com/maybites/blender-texture-sharing",
"location" : "Properties > Camera > Camera data",
"category" : "Render",
Expand Down
7 changes: 4 additions & 3 deletions fbs/ndi/NDIServer.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import NDIlib as ndi

import gpu
from gpu_extras.presets import draw_texture_2d

from ..FrameBufferSharingServer import FrameBufferSharingServer

Expand All @@ -29,11 +30,11 @@ def setup(self):
self.ndi_send = ndi.send_create(self.send_settings)

self.video_frame = ndi.VideoFrameV2()
self.video_frame.FourCC = ndi.FOURCC_VIDEO_TYPE_BGRX
self.video_frame.FourCC = ndi.FOURCC_VIDEO_TYPE_RGBX
self.video_frame.frame_format_type = ndi.FRAME_FORMAT_TYPE_PROGRESSIVE

def draw_texture(self, offscreen: gpu.types.GPUOffScreen, rect_pos: tuple[int, int], width: int, height: int):
draw_texture_2d(offscreen.color_texture, rect_pos, width, height)
draw_texture_2d(offscreen.texture_color, rect_pos, width, height)

def send_texture(self, offscreen: gpu.types.GPUOffScreen, width: int, height: int, is_flipped: bool = False):
# offscreen is type https://docs.blender.org/api/current/gpu.types.html#gpu.types.GPUOffScreen
Expand All @@ -44,7 +45,7 @@ def send_texture(self, offscreen: gpu.types.GPUOffScreen, width: int, height: i
self.width = texture.width
self.video_frame.xres = self.width
self.video_frame.yres = self.height

self.video_frame.data = texture.read()
self.video_frame.line_stride_in_bytes = self.width * 4

Expand Down
2 changes: 1 addition & 1 deletion fbs/spout/SpoutServer.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def setup(self):
self.ctx.setSenderName(self.name)

def draw_texture(self, offscreen: gpu.types.GPUOffScreen, rect_pos: tuple[int, int], width: int, height: int):
draw_texture_2d(offscreen.color_texture, rect_pos, width, height)
draw_texture_2d(offscreen.texture_color, rect_pos, width, height)

def send_texture(self, offscreen: gpu.types.GPUOffScreen, width: int, height: int, is_flipped: bool = False):
texture = offscreen.color_texture
Expand Down

0 comments on commit c3c3e49

Please sign in to comment.