Resource icon

OBS Lua Transformer 1.0

bromagosa

New Member
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...
 

I3ordo

Member
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:

bromagosa

New Member
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!
 

I3ordo

Member
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.
 

bromagosa

New Member
That sounds quite feasible and it's a good compromise.

I'm currently swamped with work and family, but when I get some free time I'll see to it :)
 

bazza

New Member
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.

Lua:
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
 

Komodo

New Member
Was wondering if you could add ability for 'Crop' that is also a feature in the Item Transform inside OBS?
 

wildehile

New Member
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:

I3ordo

Member
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:

Digitalchou

New Member
Hi, awesome script, but it dont work anymore on 27.0.0RC3 on MACOS.
The script runs well when loaded and setting up on a scene with OBS 26.1.2, and hen opened this scene on 27.0.0.
But if I load the script on 27.0.0, I cant set the "Source" value from the guy, it dont work and when i close and reopen the scrip dialog,
some other values are not correct, "destination width" changes from 1798 to 17 , and "destination height" changes from 1100 to 1.
Also sometimes when selecting source on script window it opens a log window that i cant close or copy because it never stops to update itself. The only way to stop this is closing OBS.
Looks like this:
Captura de pantalla 2021-05-06 a las 11.40.28.png

* "ZOOM 04 IN" is like I renamed the script.
The workaround here is open the escene on 26.1.2, set the script values, and reopen it on 27RC3.
This is not a good solution, because 26.1.2 havent browser panel support, and open that version modifies global.ini,
so when I come back to 27RC3 I need to add the browser panel every time, or backup/restore global.ini ,and this make mi workflow awfull.

I think the method used by the script to get the GUI values is not valid anymore, but I dont have the knowledge to fix it.
Someone knows how to fix this and can explain here , or make and update of the script and submit it ?
Thanks for this wonderfull script.
 
Top