Rotation Infinite Image Source LUA - 360 loop

Mr.Plaka

New Member
360 ROTATION INFINITE

LINUX MINT OBS FLATA-PACK. This rotation 360 iNFINITE LOOP is Extream super light CPU base in math calculation.. Work for images source,, name the image - select speed - change alignment in properties for different rotations loop moves.

1- Copy the code in a text note and named {''EXAMPLE;" 360Rotation} whit a { .lua } at the end. {dont know to add a text.lua file here so I copy the text at the end of the article, .}

2- Open OBS and go to - Tools - select Scripts - push the plus button image - select your LUA code you just save.

example333.png


------- First ... SELECT YOUR IMAGE SOURCE FOR ROTATE------- GO TO Edit -Edit Transform and Click whit the arrow mouse the center blue squaressss { or play whit others combinations }
example 111.png

example2222.png


3- {image 1 at top } At the Litt;e menu in your windows left - Name your image you want to rotate - add speed

well done!! --- linux Mint OBS Flat-Pack work whit a old API code. I'm new here and I happy for first time to help. I being looking for 2 days how to rotate a infinite image source and the only answer everyone have is the - MOVE PLUGGING - but that plugging don't work in my flat edition, i TRY MULTIPLE WAYS BUT NOT WORK { it work at the non-Flat edition - I don't liked because don't have WEB BROWSER source and crash more frequently } Im a semi-amateur in OBS and StreamBot. I learn here almoust evrithing, thanks for the comunity. Peace !!!!
- PDT -
I still not happy because i cant make VST audio plugging work in anny of my OBS Linux,, I LOOK AND LOOK AND LOOK and read read read but I cant make it.. no pop-up vst folder in OBS, I try .var .share .evrithyn shet and wont show in VST PLUGGINGS OBS, If you can help im here for lern...

''' Mr.Plaka''''

---CODE BELOW --


obs = obslua

source_name = ""
rotation_speed = 1.0 -- degrees per frame

----------------------------------------------------------

function script_description()
return "Simple infinite rotation (active scene, source name, speed)."
end

function script_properties()
local props = obs.obs_properties_create()

obs.obs_properties_add_text(
props,
"source",
"Source Name",
obs.OBS_TEXT_DEFAULT
)

obs.obs_properties_add_float(
props,
"speed",
"Rotation Speed (deg/frame)",
-20.0, 20.0, 0.1
)

return props
end

function script_update(settings)
source_name = obs.obs_data_get_string(settings, "source")
rotation_speed = obs.obs_data_get_double(settings, "speed")
end

----------------------------------------------------------

local function get_item_in_active_scene(src_name)
if src_name == "" then return nil, nil end

local scene_source = obs.obs_frontend_get_current_scene()
if scene_source == nil then
return nil, nil
end

local scene = obs.obs_scene_from_source(scene_source)
if scene == nil then
obs.obs_source_release(scene_source)
return nil, nil
end

local item = obs.obs_scene_find_source(scene, src_name)
if item == nil then
obs.obs_source_release(scene_source)
return nil, nil
end

return scene_source, item
end

function on_tick()
if source_name == "" then return end

local scene_source, item = get_item_in_active_scene(source_name)
if scene_source == nil or item == nil then
return
end

-- Old-style rotation API
local rot = obs.obs_sceneitem_get_rot(item)
if rot ~= nil then
rot = rot + rotation_speed
obs.obs_sceneitem_set_rot(item, rot)
end

obs.obs_source_release(scene_source)
end

----------------------------------------------------------

function script_load(settings)
obs.timer_add(on_tick, 16) -- ~60 FPS
end
 

Attachments

Back
Top