This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
S = obslua | |
local function skip_tick_render(ctx) | |
local target = S.obs_filter_get_target(ctx.source) | |
local width, height; | |
if target == nil then width = 0; height = 0; else | |
width = S.obs_source_get_base_width(target) | |
height = S.obs_source_get_base_height(target) | |
end | |
ctx.width, ctx.height = width , height |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
obs = obslua | |
S = obs | |
ffi = require "ffi" | |
function try_load_library(alias, name) | |
if ffi.os == "OSX" then name = name .. ".0.dylib" end | |
ok, _G[alias] = pcall(ffi.load, name) | |
if not ok then | |
print(("WARNING:%s:Has failed to load, %s is nil"):format(name, alias)) | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
------------------------------------------------------- | |
-- version 0.1.2 .obj 3D model viewer for OBS Studio -- | |
-- upgradeQ 2024 -- | |
-- Released to the Public Domain -- | |
------------------------------------------------------- | |
local S = obslua | |
local time = 0.0 | |
local vertex_num = 0 | |
local clear_color = S.vec4() | |
local MODEL_FILENAME = "suzanne.obj" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from types import SimpleNamespace as _G | |
from ctypes import * | |
from ctypes.util import find_library | |
import obspython as S | |
G, ffi = _G(), _G() | |
ffi.obsffi = CDLL(find_library("obs")) # ? PyDLL | |
G.lock = False | |
G.start_delay = 2 | |
G.duration = 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
S = obslua | |
local ffi = require"ffi" | |
local C = ffi.C | |
local _OR = bit.bor | |
ffi.cdef[[ | |
typedef struct {int x, y;} Point; | |
bool GetCursorPos(Point *lpPoint); | |
]] | |
RESOLUTION = {2560,1440}; | |
local mouse_pos = ffi.new("Point") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local obs = obslua | |
local ffi = require 'ffi' | |
local jit = require 'jit' | |
local obsffi | |
if ffi.os == "OSX" then | |
obsffi = ffi.load("obs.0.dylib") | |
else | |
obsffi = ffi.load("obs") | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local obs = obslua | |
local ffi = require 'ffi' | |
local obsffi | |
if ffi.os == "OSX" then | |
obsffi = ffi.load("obs.0.dylib") | |
else | |
obsffi = ffi.load("obs") | |
end | |
ffi.cdef[[ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local obs = obslua | |
local coroutine = require 'coroutine' | |
local math = require 'math' | |
local Timer = {} | |
function Timer:init(o) | |
o = o or {} | |
setmetatable(o,self) | |
self.__index = self | |
return o |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local obs = obslua | |
--- name of a scene item | |
local source_name = '' | |
--- get the name of the current scene | |
local function current_scene_name() | |
local source = obs.obs_frontend_get_current_scene() | |
local name = obs.obs_source_get_name(source) | |
obs.obs_source_release(source) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- https://obsproject.com/forum/threads/how-to-enumerate-script-properties-in-lua.83406/#post-397381 | |
-- create source with name tmp , then add Color Correction filter named color | |
local obs = obslua | |
local ffi = require("ffi") | |
local obsffi | |
ffi.cdef[[ | |
struct obs_source; |
NewerOlder