Tiled2Unity – Using normal maps for your tiled projects

I needed to use normal maps to my Tiled project with Tiled2Unity and this was not support by default. So I did some script changes to make this happen. Below is the instruction how to use the new code changes.

How to use Ti led with Tiled2Unity to attach Normal Maps to your Tiled project:

  • Add a new map property named “UseNormalMap” and assign the value 1 to it. This will indicate to the script in unity that a normal map is to searched and applied to the project once exported from Tiled2Unity.

tiled2Unitynormalmapproperties

tiled2unityNormalMapProperty

  • Next add you normal map texture to the Tiled project, make sure that the normal map texture file has the following characters just before the file extension: _n, example: hyptosis_til-art-batch-2_n.png. This will tell the importer code which texture file is the normal map file. So it is the same file name as the original texture file but with the _n characters. Then add a new layer and name it “NormalMapLayer”. IMPORTANT: Add some tiles from the normal map texture to the layer. This is so that the normal map texture is exported to Unity. If this is not done the normal map texture is not exported by the tool Tiled2Unity.tiled2UnityNormalMapLayer
  • After this simply do what you would normally do to export your tiled project to Unity using Tiled2Unity. This of course implies that you have the code changes which support this new feature for normal maps.
  • NOTICE: There is a new shader called TextureTintSnapNormal which is used for normal mapping.

My changes to Tiled2Unity Scripts for Unity: https://github.com/lionadi/Tiled2Unity/tree/master/unity/Tiled2Unity/Scripts/Editor

And the custom shader: https://github.com/lionadi/Tiled2Unity/tree/master/unity/Tiled2Unity/Shaders

Original project: http://www.seanba.com/tiled2unity

Tiled project: http://www.mapeditor.org/

 

Normal tools for 2D art:

https://www.codeandweb.com/spriteilluminator

http://www.2deegameart.com/p/sprite-dlight.html

http://www.snakehillgames.com/spritelamp/

http://crazybump.com/

https://github.com/spritebuilder/NormalMixer

Export SharePoint solution packages from your environment

Hi,

I created a script that might help someone out there who wants to backup their SharePoint solution packages. This script is able to export specific solutions or all if no solution names are passed to the script.

Sample script calling for specific solutions:

.\script.ps1 –Solutions MYWSPNUM1.wsp,MYWSPNUM2.wsp

Or if you want to export all available solutions then simply call the script without any parameters:

.\script.ps1

# Get Script params, in this case solution names to the -Solution attribute. Separate solutions names by , char
param([String[]] $Solutions)

Add-PSSnapin Microsoft.SharePoint.PowerShell –erroraction SilentlyContinue

#==================================================================================
# Functions definitions
#==================================================================================

#———————————————————————————-
# This function will export all available solutions in your environment
#———————————————————————————-
function ExportAllSolutions
{
$location = get-location
Write-Host Exporting all available solutions to: $location
foreach ($solution in Get-SPSolution)
{
$id = $Solution.SolutionID
$title = $Solution.Name
$filename = $Solution.SolutionFile.Name

try {
$solution.SolutionFile.SaveAs(“$(get-location)\$filename”)
Write-Host “Exported solution package – ‘$title’:” -foreground green
}
catch
{
Write-Host ” Error with solution package – ‘$title’: $_” -foreground red
}
}
}

#———————————————————————————-
# This Function will export a single solution by solution name
#———————————————————————————-
function ExportSolution
{
param([String] $solutionName)
$location = get-location
Write-Host Exporting solution to: $location
$Solution = Get-SPSolution -Identity $solutionName

$id = $Solution.SolutionID
$title = $Solution.Name
$filename = $Solution.SolutionFile.Name

try {
$solution.SolutionFile.SaveAs(“$(get-location)\$filename”)
Write-Host “Exported solution package – ‘$title’:” -foreground green
}
catch
{
Write-Host ” Error with solution package – ‘$title’: $_” -foreground red
}

}

#==================================================================================
# End of function definitions
#==================================================================================

#==================================================================================
# Main operations for the script
#==================================================================================

# If solutions names are passed then export only those solutions
if($Solutions.count -gt 0)
{
foreach ($solutionName in $Solutions)
{
Write-Host $solutionName
ExportSolution $solutionName
}
}
# If no solultions passed then export all solutions
else
{
ExportAllSolutions
}
#==================================================================================
# End of main operations
#==================================================================================