Several folks are using xlights as the playback for pixelnet currently as the playback is MUCH smoother. One of the issues is that the current build of LSP exports LOR S2 files with startIntensity, endIntensity, and Intensity values of 1 instead of 0 like they should read. This means that people are having to edit the files manually - not a big deal, but when you're pressed for time, let's speed things up.
I've created a powershell script that will search for startIntensity="1", endIntensity="1", and Intensity="1" and replace those lines of text with appropriate files. The script will search ALL files and subdirectories of c:\xlights. Any text file in this folder or subfolders will get the treatment. I cannot take credit for the code as I modified it from here:
You are not allowed to view links.
Register or
LoginDownload the text file. Change the name to replaceintensity.ps1. If you've never used powershell, you'll likely need to open it as administrator and type:
set-executionpolicy unrestricted
To execute the script, you can open a command prompt and type powershell replaceintensity.ps1. This will kick off the script. You can also open powershell ISE and load the file that way.
I've uploaded a .txt file - simply download and rename to .ps1.
Alternatively, you can make your own PS1 file, copy the contents into a text file or powershell ISE and save as filename.ps1:
function ReplaceIntensity($fileInfo)
{
if( $_.GetType().Name -ne 'FileInfo')
{
# i.e. reject DirectoryInfo and other types
return
}
$old = 'intensity="1"'
$new = 'intensity="0"'
(Get-Content $fileInfo.FullName) | % {$_ -replace $old, $new} | Set-Content -path $fileInfo.FullName
"Processed: " + $fileInfo.FullName
}
function ReplaceStartIntensity($fileInfo)
{
if( $_.GetType().Name -ne 'FileInfo')
{
# i.e. reject DirectoryInfo and other types
return
}
$old = 'startIntensity="1"'
$new = 'startIntensity="0"'
(Get-Content $fileInfo.FullName) | % {$_ -replace $old, $new} | Set-Content -path $fileInfo.FullName
"Processed: " + $fileInfo.FullName
}
function ReplaceEndIntensity($fileInfo)
{
if( $_.GetType().Name -ne 'FileInfo')
{
# i.e. reject DirectoryInfo and other types
return
}
$old = 'endIntensity="1"'
$new = 'endIntensity="0"'
(Get-Content $fileInfo.FullName) | % {$_ -replace $old, $new} | Set-Content -path $fileInfo.FullName
"Processed: " + $fileInfo.FullName
}
$loc = 'c:\xlights'
cd $loc
$files = Get-ChildItem . -recurse
$files | % { ReplaceIntensity( $_ ) }
$files | % { ReplaceStartIntensity( $_ ) }
$files | % { ReplaceEndIntensity( $_ ) }