-
-
Save noisecrime/a2f13fd0aeb8a01ffd8d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Place this file into a directory called Editor inside of your Assets directory. | |
// Models imported after you do that will have: | |
// - Smoothing Angle seto to 180. | |
// - Normals set to Import. | |
// - Tangents set to Calculate. | |
// - Tangents set to Split Tangents. | |
// Any models that are already imported can have this applied by selecting them in | |
// the Project panel, right clicking and selecting "Reimport" from the pop-op menu. | |
// These are the settings required for using tangent space maps generated by: | |
// - UnityTSpace xNormal Plugin | |
// - www.farfarer.com/blog/2012/06/12/unity3d-tangent-basis-plugin-xnormal/ | |
// - Handplane3D's Unity output | |
// - www.handplane3d.com | |
class SmoothingAngleFix extends AssetPostprocessor { | |
function OnPreprocessModel () { | |
var modelImporter : ModelImporter = (assetImporter as ModelImporter); | |
// Set Smoothing Angle to 180. | |
modelImporter.normalImportMode = ModelImporterTangentSpaceMode.Calculate; | |
modelImporter.normalSmoothingAngle = 180.0; | |
// Set Normals to Import. | |
modelImporter.normalImportMode = ModelImporterTangentSpaceMode.Import; | |
// Set Tangents to Calculate. | |
modelImporter.tangentImportMode = ModelImporterTangentSpaceMode.Calculate; | |
// Set Split Tangents to True. | |
modelImporter.splitTangentsAcrossSeams = true; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment