File tree Expand file tree Collapse file tree 1 file changed +38
-0
lines changed
Types/OBS.GetSceneItemList.Response Expand file tree Collapse file tree 1 file changed +38
-0
lines changed Original file line number Diff line number Diff line change 1+ param (
2+ [double []]
3+ $ScaleX = 1 ,
4+
5+ [double []]
6+ $ScaleY = 1 ,
7+
8+ # The timespan the animation will take
9+ [TimeSpan ]
10+ $TimeSpan = [timespan ]::fromSeconds(1 )
11+ )
12+
13+ if ($scaleX.Length -eq 1 -and $scaleY.Length -eq 1 ) {
14+ $this | Set-OBSSceneItemTransform - SceneItemTransform @ {
15+ scaleX = $ScaleX [0 ]
16+ scaleY = $scaleY [0 ]
17+ }
18+ return
19+ }
20+
21+ $thisTransform = $this | Get-OBSSceneItemTransform
22+
23+ $fromValue = [Ordered ]@ {
24+ scaleX = $thisTransform.scaleX
25+ scaleY = $thisTransform.scaleY
26+ }
27+
28+ $durationPerStep = [TimeSpan ]::FromMilliseconds($TimeSpan.TotalMilliseconds / $ScaleX.Length )
29+
30+ for ($stepNumber = 0 ; $stepNumber -lt $ScaleX.Length ; $stepNumber ++ ) {
31+ $toValue = [Ordered ]@ {
32+ scaleX = $ScaleX [$stepNumber ]
33+ scaleY = $ScaleY [$stepNumber ]
34+ }
35+ $this.Animate ($fromValue , $toValue , $durationPerStep )
36+ $fromValue = $toValue
37+ }
38+
You can’t perform that action at this time.
0 commit comments