Skip to content

Commit

Permalink
feat: Regenerating and adding Zoom In / Out Effect ( Fixes #164 )
Browse files Browse the repository at this point in the history
  • Loading branch information
James Brundage committed Jan 22, 2024
1 parent e92bdb8 commit d423345
Showing 1 changed file with 57 additions and 0 deletions.
57 changes: 57 additions & 0 deletions Effects/ZoomInAndOut.OBS.FX.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
<#
.SYNOPSIS
Zooms In and Out again
.DESCRIPTION
Zooms an Input In and Out.
#>
param(
# The name of the scene.
[string]
$SceneName,

# The name
[string]
$SceneItemID,

# The duration (by default, one a half second)
[timespan]
$Duration = "00:00:00.5",

# The pause between (by default, one a half second)
[Timespan]
$PauseBetween = '00:00:00.5'
)

if (-not $SceneName -and $this -and $this.SceneName) {
$SceneName = $this.SceneName
}

if (-not $SceneItemID -and $this -and $this.SceneItemID) {
$SceneItemID = $this.SceneItemID
}

if (-not $SceneItemID -and $SceneName) { return }

$sceneItem = if ($this.SceneName -and $this.SceneItemID) {
$this
} elseif ($SceneItemID) {
Get-OBSSceneItem -SceneName $this.SceneName |
Where-Object {
$_.SceneItemID -eq $SceneItemID -or
$_.SourceName -eq $SceneItemID
}
}
# Fit it to the screen once, so we're centered correctly.
$sceneItem.FitToScreen()

#
$sceneItem.Scale(
"0%",
"150%",
$Duration,
$PauseBetween,
$Duration,
"0%",
$true
)

0 comments on commit d423345

Please sign in to comment.