Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- using UnityEditor;
- public class RemoveScale : MonoBehaviour {
- class Postprocessing : AssetPostprocessor {
- void OnPreprocessModel (){
- ((ModelImporter)assetImporter).isReadable = false; //doesn't change anything
- }
- void OnPostprocessModel (GameObject g){
- Apply(g);
- }
- static int numRemoved = 0;
- void Apply(GameObject g)
- {
- Debug.Log ("Post Precessing:" + g);
- List<AnimationClip> animationClipList = new List<AnimationClip>();
- AnimationClip[] objectList = UnityEngine.Object.FindObjectsOfType (typeof(AnimationClip)) as AnimationClip[];
- animationClipList.AddRange(objectList);
- foreach (AnimationClip animationClip in animationClipList)
- {
- foreach (EditorCurveBinding curveBinding in AnimationUtility.GetCurveBindings(animationClip))
- {
- string name = curveBinding.propertyName.ToLower();
- if (name.Contains("m_localscale"))
- {
- AnimationUtility.SetEditorCurve(animationClip, curveBinding, null);
- numRemoved += 1;
- }
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement