diff --git a/.vscode/launch.json b/.vscode/launch.json index 846fbdb5..fb664b8d 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -2,7 +2,7 @@ // Use IntelliSense to learn about possible attributes. // Hover to view descriptions of existing attributes. // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 - "version": "0.6.0", + "version": "0.6.1", "configurations": [ { "name": "Generate Models", diff --git a/README.md b/README.md index b168c4c5..ca69b255 100644 --- a/README.md +++ b/README.md @@ -37,6 +37,7 @@ This project covers these requirements, with more to come: Please refer to the [Feature Roadmap](https://github.com/KhronosGroup/glTF-Asset-Generator/issues/63) # Download Assets +- [ v0.6.1 ](https://github.com/KhronosGroup/glTF-Asset-Generator/releases/download/v0.6.1/GeneratedAssets-0.6.1.zip) - [ v0.6.0 ](https://github.com/KhronosGroup/glTF-Asset-Generator/releases/download/v0.6.0/GeneratedAssets-0.6.0.zip) - [ v0.5.0 ](https://github.com/KhronosGroup/glTF-Asset-Generator/releases/download/v0.5.0/GeneratedAssets-0.5.0.zip) - [ v0.4.0 ](https://github.com/KhronosGroup/glTF-Asset-Generator/releases/download/v0.4.0/GeneratedAssets-0.4.0.zip) diff --git a/SampleImageHelper.ps1 b/SampleImageHelper.ps1 deleted file mode 100644 index 9d4ede69..00000000 --- a/SampleImageHelper.ps1 +++ /dev/null @@ -1,111 +0,0 @@ -$outputFolder = "Output" -$sourceFolder = "Source" -$figuresFolder = "Figures" -$tempFolder = "tempImages" -$imagesFolder = Join-Path -Path $sourceFolder -ChildPath "SampleImages" -$thumbnailsFolder = Join-Path -Path $imagesFolder -ChildPath "Thumbnails" -$tempImagesFolder = Join-Path -Path $tempFolder -ChildPath "SampleImages" -$tempthumbnailsFolder = Join-Path -Path $tempFolder -ChildPath "Thumbnails" -$defaultImage = Join-Path -Path $SourceFolder -ChildPath "Resources" | Join-Path -ChildPath $figuresFolder | Join-Path -ChildPath "NYI.png" -$manifestPath = Join-Path -Path $outputFolder -ChildPath "Manifest.json" -$screenshotGeneratorPath = Join-Path -Path "pythonScripts" -ChildPath "dist" | Join-Path -ChildPath "resizeImages.exe" - -# Run the image generator -$tempFolderFromChild = Join-Path -Path ".." -ChildPath $tempFolder -$manifestPathFromChild = Join-Path -Path ".." -ChildPath $manifestPath -$tempsourceSampleImageFolder = Join-Path -Path $tempFolderFromChild -ChildPath "SampleImages" -$sourceSampleThumbnailFolder = Join-Path -Path $tempFolderFromChild -ChildPath "Thumbnails" -New-Item -ItemType Directory -Path $tempFolder -Force | Out-Null -cd "ScreenshotGenerator" -New-Item -ItemType Directory -Path $sourceSampleThumbnailFolder -Force | Out-Null -npm start -- "headless=true" "manifest=$manifestPathFromChild" "outputDirectory=$tempsourceSampleImageFolder" # Creates the sample images -Start-Process -Wait -Filepath $screenshotGeneratorPath -ArgumentList "--dir=$tempsourceSampleImageFolder --outputDir=$sourceSampleThumbnailFolder --width=72 --height=72" -cd ".." -$tempImagesFolder = Join-Path -Path $tempFolder -ChildPath "SampleImages" - -# Verify the image generator output against the sample images folder -$existingImageList = [System.Collections.ArrayList]@() -Get-ChildItem $tempImagesFolder -File | Foreach-Object { - $imageExists = Join-Path -Path $sourceFolder -ChildPath "Resources" | Join-Path -ChildPath "Figures" | Join-Path -ChildPath "SampleImages" | Join-Path -ChildPath $_.Name - - if (Test-Path $imageExists) - { - $existingImageList.Add($_.Name) - } -} - -if ($existingImageList.Count -gt 0) -{ - Write-Warning "The following generated sample image(s) will not be used, due to there already being a custom sample image" - Foreach-Object -InputObject $existingImageList { - $_ - } -} - -# Load the JSON manifest file. -$manifest = Get-Content $manifestPath | ConvertFrom-Json - -# Move the sample images and thumbnails into their respective folders. -# If a sample image is missing, replace it with a copy of the default image instead. -For ($x=0; $x -lt $manifest.Length; $x++) -{ - $modelGroup = $manifest[$x].folder - $modelGroupPath = Join-Path -Path $outputFolder -ChildPath $modelGroup - - For ($y=0; $y -lt $manifest[$x].models.Length; $y++) - { - $model = $manifest[$x].models[$y] - $thumbnailName = [regex]::Replace($model.sampleImageName, "SampleImages", "Thumbnails") - - if ($model.sampleImageName -ne $Null) - { - # Builds paths to the expected generated images and their destinations - $overrideSampleImage = Join-Path -Path $sourceFolder -ChildPath "Resources" | Join-Path -ChildPath $model.sampleImageName - $overrideSampleThumbnail = Join-Path -Path $sourceFolder -ChildPath "Resources" | Join-Path -ChildPath $thumbnailName - $sourceSampleImage = Join-Path -Path $tempFolder -ChildPath $model.sampleImageName - $sourceSampleImage = $sourceSampleImage -replace "Figures\\", "" - $sourceSampleThumbnail = Join-Path -Path $tempFolder -ChildPath $thumbnailName - $sourceSampleThumbnail = $sourceSampleThumbnail -replace "Figures\\", "" - $destinationSampleImage = Join-Path -Path $modelGroupPath -ChildPath $model.sampleImageName - $destinationSampleThumbnail = Join-Path -Path $modelGroupPath -ChildPath $thumbnailName - - # 'Touch' the destination files first to create the directory if it doesn't exist - New-Item -ItemType File -Path $destinationSampleImage -Force - New-Item -ItemType File -Path $destinationSampleThumbnail -Force - - # Check that there isn't an override sample image - $override = $False - if ($existingImageList.Count -gt 0) - { - foreach($existingImage in $existingImageList){ - if ($existingImage -eq (Split-Path $model.sampleImageName -Leaf)) - { - $override = $True - } - } - } - - if ($override -eq $True) - { - # There is an override for the sample image, so use that instead of the generated one - Copy-Item -Path $overrideSampleImage -Destination $destinationSampleImage - Copy-Item -Path $overrideSampleThumbnail -Destination $destinationSampleThumbnail - } - elseif ((Test-Path $sourceSampleImage)) - { - # There is a sample image, so copy it and the thumbnail into the correct folder in the Output directory - Copy-Item -Path $sourceSampleImage -Destination $destinationSampleImage - Copy-Item -Path $sourceSampleThumbnail -Destination $destinationSampleThumbnail - } - else - { - # There is no sample image, so replace it and the thumbnail with a copy of the default image instead. - Copy-Item -Path $defaultImage -Destination $destinationSampleImage - Copy-Item -Path $defaultImage -Destination $destinationSampleThumbnail - } - } - } -} - -# Cleanup the image generator output directory -Remove-Item -Recurse -Force $tempFolder diff --git a/Source/ReadmeTemplates/Page_Main.md b/Source/ReadmeTemplates/Page_Main.md index ff301be1..72b49bfc 100644 --- a/Source/ReadmeTemplates/Page_Main.md +++ b/Source/ReadmeTemplates/Page_Main.md @@ -11,6 +11,7 @@ This project covers these requirements, with more to come: Please refer to the [Feature Roadmap](https://github.com/KhronosGroup/glTF-Asset-Generator/issues/63) # Download Assets +- [ v0.6.1 ](https://github.com/KhronosGroup/glTF-Asset-Generator/releases/download/v0.6.1/GeneratedAssets-0.6.1.zip) - [ v0.6.0 ](https://github.com/KhronosGroup/glTF-Asset-Generator/releases/download/v0.6.0/GeneratedAssets-0.6.0.zip) - [ v0.5.0 ](https://github.com/KhronosGroup/glTF-Asset-Generator/releases/download/v0.5.0/GeneratedAssets-0.5.0.zip) - [ v0.4.0 ](https://github.com/KhronosGroup/glTF-Asset-Generator/releases/download/v0.4.0/GeneratedAssets-0.4.0.zip)