Created
September 12, 2018 13:23
-
-
Save ronyx69/29dfd41933b6735ac3a442455e1ef6ee to your computer and use it in GitHub Desktop.
Recalculates tangents for mesh and lod mesh, necessary if you used the mesh rotation feature in the importer, since that results in broken tangents which makes the normal map behave incorrectly. The normal map must +X +Y which means you DO NOT need to flip any channels.
This file contains hidden or 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
// prop | |
var asset = ToolsModifierControl.toolController.m_editPrefabInfo as PropInfo; | |
if(asset.m_mesh != null) asset.m_mesh.RecalculateTangents(); | |
if(asset.m_lodMesh != null) asset.m_lodMesh.RecalculateTangents(); | |
// building | |
var asset = ToolsModifierControl.toolController.m_editPrefabInfo as BuildingInfo; | |
if(asset.m_mesh != null) asset.m_mesh.RecalculateTangents(); | |
if(asset.m_lodMesh != null) asset.m_lodMesh.RecalculateTangents(); | |
// vehicle | |
var asset = ToolsModifierControl.toolController.m_editPrefabInfo as VehicleInfo; | |
if(asset.m_mesh != null) asset.m_mesh.RecalculateTangents(); | |
if(asset.m_lodMesh != null) asset.m_lodMesh.RecalculateTangents(); | |
// tree | |
var asset = ToolsModifierControl.toolController.m_editPrefabInfo as TreeInfo; | |
if(asset.m_mesh != null) asset.m_mesh.RecalculateTangents(); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment