Resource icon

OBS Lua Transformer 1.0

#1
bromagosa submitted a new resource:

Transformer - Animate a size, position and rotation transformation over a source (or group)

Fill in the origin and destination positions, dimensions and rotations for a source or group of sources, select an easing function among the 22 available ones and click on "Do it!" to trigger the animation.

You can also trigger the animation via a hotkey.

Thanks to Mun Films for sponsoring the creation of this script.
Read more about this resource...
 
#2
Hello,
I am trying a two-phase animation, launching second animation with a delay on a second copy of script.

once the second script starts getting a "failed to call tick for lua_tick" error, OBS hangs, makes OBS crash and make fine tuning animation "miserable"
i would like the script to stop on errors so that oBS can recover.
also,
to make this script alot more user firendly, is it possible to select a different source and send a command like "get current transforms for "in" and for "out"

ps:I think i am over-utilizing your script;

In my usage scenario, i am using multiple copies of the script by renaming and adding them again.

but the problem is, the script inputs the original dimensions/positions as soon as the script is launched. I would rather have it input the initials just before the delay ends.

I overcame the problem by using 3 copies of the script.

first one makes it "0" pixel width
second one makes it appear but stay still
and the third one takes it from visible state to animated state.

very dirty i know...
 
Last edited:
#4
That's quite an impressive use of the script! Thanks for using it and sharing the video!

You're totally right, this wasn't meant to be used to concatenate several transitions (or run them at the same time). I'm not even sure it's possible to pull the current dimensions and position into the script UI. Scrips have a limited API...

Maybe someone with more experience in OBS scripting can shed a light, though!
 
#5
Glad you liked it.
i would like to suggest an easy upgrade for this script:
currently script moves the source from A to B and there is a hotkey assigned for it.

How about:
You let us have three hotkeys instead of one, first hotkey does the "A to B" thing, and second hotkey does the "B to A" thing. like a reverse mode which uses origin as destination and destination as origin.
Third one is a ping-pong hotkey, "A to B" or if it s already at "B", "B to A".

I tried my best to explain myself , really :)

BTW:
The example i showed had a "one frame glitch" that prematurely showed the source even though it was not supposed to. Sometimes it does it sometimes not, but i totally fixed it by having a blank png as a starting image.
 

bazza

New Member
#7
I added this on tick so I could send similar OSC animation commands.
It's still something simple, just send 1 data. but it works.

Code:
function script_tick(seconds)
local handle = io.popen("nc 127.0.0.1 8080")
    result = handle:read("*a")
    handle:close()
    if (result > "" ) then
        obs.obs_sceneitem_set_rot(sceneItem, result)
        local pos = obs.vec2()
        pos.x = result
        pos.y = result
        obs.obs_sceneitem_set_pos(sceneItem, pos)
        local bounds = obs.vec2()
        bounds.x = result
        bounds.y = result
        obs.obs_sceneitem_set_bounds(sceneItem, bounds)
Remote:

Bash:
echo "$[RANDOM % 1000]" | nc -l 8080
 
#10
Hello,
(sorry english is not my native language, so perhaps it is not easy for to understand me :D )

I love this script.
With it, I can do animated grafics like lowerthirds and overlays...
Only one thing I am missing, to trigger this script from a remote computer.
Is there a possibility to implement this function? I can use http, telnet ot something like this


Edit:
I tried to use
local handle = io.popen("nc 127.0.0.1 8080")
result = handle:read("*a")
handle:close()
from bazza, but my windows starts flickering, and I have to close OBS to stop, what did I wrong?
Hilde
 
Last edited:
#11
Update:

To change how the hotkey will appear on your OBS hotkeys section, simply open the lua script in note pad and replace 'Trigger Transformer' with 'Your choice of name'.

Also more importantly, if the script gives you infinite number of errors on using , change the animation mode to something other than "linear", also, you can change the animation type while the script is crazily giving out errors, so you dont have to let the OBS crash.

Hello again,

Can you make the script create "hotkey entry" name based on it's target source?
in other words, if the script targets a source Called "Cam", the hotkey name becomes "Transformer: Cam" in the hotkeys section.
Capture.PNG
 
Last edited:
Top