Skip to content

Commit

Permalink
Merge pull request #117 from StartAutomating/obs-powershell-updates
Browse files Browse the repository at this point in the history
obs-powershell 0.1.8
  • Loading branch information
StartAutomating authored Jun 1, 2023
2 parents 67c3eb4 + e719375 commit 2cd8dae
Show file tree
Hide file tree
Showing 665 changed files with 35,652 additions and 2,863 deletions.
1 change: 1 addition & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
github: [StartAutomating, nyanhp, I-Am-Jakoby]
31 changes: 0 additions & 31 deletions .github/workflows/GitPub.yml

This file was deleted.

3 changes: 3 additions & 0 deletions .github/workflows/build-obs-powershell.yml
Original file line number Diff line number Diff line change
Expand Up @@ -572,6 +572,9 @@ jobs:
steps:
- name: Check out repository
uses: actions/checkout@v2
- name: GitLogger
uses: GitLogging/GitLoggerAction@main
id: GitLogger
- name: Use PSSVG Action
uses: StartAutomating/PSSVG@main
id: PSSVG
Expand Down
16 changes: 16 additions & 0 deletions Assets/obs-powershell-animated-icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 14 additions & 0 deletions Assets/obs-powershell-icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 17 additions & 0 deletions Assets/obs-powershell-text-and-animated-icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 15 additions & 0 deletions Assets/obs-powershell-text-and-icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 12 additions & 4 deletions Assets/obs-powershell.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
36 changes: 36 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,39 @@
## obs-powershell 0.1.8:

* Added Sponsorship, Please support obs-powershell (#78)
* Added OBS-PowerShell Effects (#109)
* Effect Commands
* Get-OBSEffect
* Import-OBSEffect
* Start-OBSEffect
* Stop-OBSEffect
* Remove-OBSEffect
* ColorLoop (#113)
* FadeIn (#112)
* FadeOut (#114) (thanks @I-Am-Jakoby !)
* Adding Commands for Filtering
* Set/Add-OBSGainFilter (#94)
* Set/Add-OBSColorFilter (#92)
* Set/Add-OBSScrollFilter (#93)
* Set/Add-OBSSharpnessFilter (#95)
* Set/Add-OBSRenderDelayFilter (#96)
* Set/Add-OBSEqualizerFilter (#97)
* New Easy Sources
* Set/Add-OBSAudioOutputSource (#110)
* Set/Add-OBSWindowSource (#104)
* Set/Add-OBSVLCSource (#102)
* Scene Items Can Now Do A Lot More
* Animate allows for multiple steps and is more careful (#75 and #73)
* Move, Scale, Rotate are written using animate (#80, #81, #89)
* Extending Inputs (#99)
* Autogenerating help for extended types, thanks to a new version of [HelpOut](https://github.com/StartAutomating/HelpOut)
* Improving Performance and Stability of Send/Receive/Watch-OBS (#77, #90, #86, #106, #107)


* Also, new logo (#76)

---

## obs-powershell 0.1.7:

* New Commands:
Expand Down
46 changes: 46 additions & 0 deletions Commands/Effects/Get-OBSEffect.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
function Get-OBSEffect
{
<#
.SYNOPSIS
Gets OBS Effects
.DESCRIPTION
Gets effects currently loaded into OBS-PowerShell.
An effect can be thought of as a name with a series of messages to OBS.
Those messages can be defined in a .json file or a script, in any module that tags OBS.
They can also be defined in a function or script named like:
* `*.OBS.FX.*`
* `*.OBS.Effect.*`
* `*.OBS.Effects.*`
.LINK
Import-OBSEffect
.LINK
Remove-OBSEffect
#>
param(
# The name of the effect.
[Parameter(ValueFromPipelineByPropertyName)]
[Alias('EffectName')]
[string]
$Name
)

begin {
if (-not $script:OBSFX) {
$script:OBSFX = [Ordered]@{}
}
}

process {

if (-not $Name) {
$script:OBSFX.Values
} elseif ($script:OBSFX[$name]) {
$script:OBSFX[$name]
}
}
}
139 changes: 139 additions & 0 deletions Commands/Effects/Import-OBSEffect.ps.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
function Import-OBSEffect
{
<#
.SYNOPSIS
Imports Effects
.DESCRIPTION
Imports obs-powershell effects
.EXAMPLE
Import-OBSEffect -Path (Get-Module obs-powershell)
.LINK
Get-OBSEffect
#>
param(
# The source location of the effect.
# This can be a string, file, directory, command, or module.
[vfp(vbn,Mandatory)]
[Alias(
'FromPath',
'FromModule',
'FromScript',
'FromFunction',
'FullName',
'Path',
'Source'
)]
[ValidateTypes(TypeName={
[string],
[IO.FileInfo],
[IO.DirectoryInfo]
[Management.Automation.CommandInfo]
[Management.Automation.PSModuleInfo]
})]
$From
)

begin {
if (-not $script:OBSFX) {
$script:OBSFX = [Ordered]@{}
}

$newEffects = @()
$obsEffectsPattern = [Regex]::new('
(?>
^OBS.(?>fx|effects?)\p{P}
|
[\p{P}-[-]]OBS\.(?>fx|effects?)$
|
\p{P}OBS.(?>fx|effects?)\.(?>ps1|json)$
)
','IgnoreCase,IgnorePatternWhitespace')
}

process {
# Since -From can be many things, but a metric has to be a command,
# the purpose of this function is to essentially resolve many things to a command,
# and then cache that command.

# If -From was a string
if ($From -is [string]) {
# It could be a module, so check those first.
:ResolveFromString do {
foreach ($loadedModule in @(Get-Module)) {
# If we find the module, don't try to resolve -From as a path
break ResolveFromString
if ($loadedModule.Name -eq $from) {
# (just set -From again and let the function continue)
$from = $fromModule = $loadedModule
}
}
# If we think from was a path
$resolvedPath = $ExecutionContext.SessionState.Path.GetResolvedPSPathFromPSPath($from)
# attempt to resolve it
if ($resolvedPath) {
$from = Get-Item -LiteralPath $resolvedPath
}
} while ($false)
}

# If -From is a module
if ($from -is [Management.Automation.PSModuleInfo]) {
# recursively call ourselves with all matching commands
@($from.ExportedCommands.Values) -match $obsEffectsPattern |
Import-OBSEffect
# then, make -From a directory
if ($from.Path) {
$from = Get-Item ($from.Path | Split-Path) -ErrorAction SilentlyContinue
}
}

# If -From is a directory
if ($from -is [IO.DirectoryInfo]) {
$FromDirectory = $from
# recursively call ourselves with all matching scripts
Get-ChildItem -LiteralPath $from.FullName -Recurse -File |
Where-Object Name -match '\.obs\.(?>fx|effects?).(?>ps1|json)$' |
Import-OBSEffect
return
}

# If -From is a file
if ($from -is [IO.FileInfo]) {
# and it matches the naming convention
return if $from.Name -notmatch '\.obs\.(?>fx|effects?).(?>ps1|json)$'
# make -From a command.
$from = $ExecutionContext.SessionState.InvokeCommand.GetCommand($from.FullName, 'ExternalScript,Application')
}

# If -From is a command
if ($from -is [Management.Automation.CommandInfo]) {
# decorate the command
if ($from.pstypenames -notcontains 'OBS.PowerShell.Effect') {
$from.pstypenames.insert(0,'OBS.PowerShell.Effect')
}

if ($from -is [Management.Automation.ApplicationInfo]) {
$effectName = $from.Name -replace '\.obs\.(?>fx|effects?).(?>ps1|json)$'
$newEffect = [PSCustomObject][Ordered]@{
PSTypeName = 'OBS.PowerShell.Effect'
Messages = Get-Content -Raw -Path $From.Source | ConvertFrom-Json
EffectName = $effectName
TypeName = $TypeName
}
$script:OBSFX[$effectName] = $newEffect
$newEffects += $newEffect
$newEffect
} else {
if ($from.pstypenames -notcontains 'OBS.PowerShell.Effect.Command') {
$from.pstypenames.insert(0,'OBS.PowerShell.Effect.Command')
}
# and add it to our list of new metrics
$newEffects+= $from
$script:OBSFX[$from.EffectName] = $from
$from
}
}
}


}
Loading

0 comments on commit 2cd8dae

Please sign in to comment.