Skip to content

Commit

Permalink
Check if there is an available webcam in Webcam node
Browse files Browse the repository at this point in the history
  • Loading branch information
RodZill4 committed Jan 7, 2024
1 parent 8fffd0c commit 2575d20
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions addons/material_maker/engine/nodes/gen_webcam.gd
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ class MMCameraTexture:
set_webcam(webcam, feed)

func set_webcam(webcam : int, feed : int = 0):
var camfeed = CameraServer.feeds()[webcam]
print(camfeed.get_datatype())
texture.camera_feed_id = camfeed.get_id()
texture.camera_is_active = true
texture.which_feed = feed
if CameraServer.feeds().size() > webcam:
var camfeed = CameraServer.feeds()[webcam]
texture.camera_feed_id = camfeed.get_id()
texture.camera_is_active = true
texture.which_feed = feed

func get_texture_rid(target_rd : RenderingDevice) -> RID:
return RID()
Expand Down

0 comments on commit 2575d20

Please sign in to comment.