-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
*.ipch | ||
*.sdf | ||
*.opendb | ||
*.db | ||
*.user | ||
*.log | ||
*.tlog | ||
|
||
*.exe | ||
*.dll | ||
*.bundle | ||
*.dylib | ||
*.so | ||
*.unitypackage | ||
|
||
*.fbx | ||
*.obj | ||
|
||
.vs/ | ||
_out/ | ||
_tmp/ | ||
_build_*/ | ||
external/ | ||
Library/ | ||
Temp/ | ||
|
||
TestLocal/ | ||
TestLocal.meta | ||
|
||
/*.csproj | ||
/*.sln |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#if UNITY_EDITOR | ||
using UnityEngine; | ||
using UnityEditor; | ||
|
||
|
||
public class BlendShapeBuilderPackaging | ||
{ | ||
[MenuItem("Assets/Make BlendShapeBuilder.unitypackage")] | ||
public static void MakePackage() | ||
{ | ||
string[] files = new string[] | ||
{ | ||
"Assets/UTJ/BlendShapeBuilder", | ||
}; | ||
AssetDatabase.ExportPackage(files, "BlendShapeBuilder.unitypackage", ExportPackageOptions.Recurse); | ||
} | ||
|
||
} | ||
#endif // UNITY_EDITOR |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
%YAML 1.1 | ||
%TAG !u! tag:unity3d.com,2011: | ||
--- !u!114 &11400000 | ||
MonoBehaviour: | ||
m_ObjectHideFlags: 0 | ||
m_PrefabParentObject: {fileID: 0} | ||
m_PrefabInternal: {fileID: 0} | ||
m_GameObject: {fileID: 0} | ||
m_Enabled: 1 | ||
m_EditorHideFlags: 0 | ||
m_Script: {fileID: 11500000, guid: d0973484e77d2fb45b910d8acec902e0, type: 3} | ||
m_Name: BlendShapeBuilderSettings | ||
m_EditorClassIdentifier: | ||
baseMesh: {fileID: 0} | ||
preserveExistingBlendShapes: 1 | ||
blendShapeData: [] |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
using UnityEngine; | ||
using UnityEditor; | ||
using System; | ||
using System.Collections.Generic; | ||
|
||
namespace UTJ.BlendShapeBuilder | ||
{ | ||
[Serializable] | ||
public class BlendShapeFrameData | ||
{ | ||
public float weight = 100.0f; | ||
public UnityEngine.Object mesh; | ||
public bool vertex = true; | ||
public bool normal = true; | ||
public bool tangent = true; | ||
} | ||
|
||
[Serializable] | ||
public class BlendShapeData | ||
{ | ||
public bool fold = true; | ||
public string name = ""; | ||
public List<BlendShapeFrameData> frames = new List<BlendShapeFrameData>(); | ||
|
||
public void ClearInvalidFrames() | ||
{ | ||
frames.RemoveAll(item => { return item.mesh == null; }); | ||
} | ||
|
||
public void NormalizeWeights() | ||
{ | ||
int n = frames.Count; | ||
float step = 100.0f / n; | ||
for (int i = 0; i < n; ++i) | ||
{ | ||
frames[i].weight = step * (i + 1); | ||
} | ||
} | ||
|
||
public void SortByWeights() | ||
{ | ||
frames.Sort((x, y) => x.weight.CompareTo(y.weight)); | ||
} | ||
} | ||
|
||
[Serializable] | ||
public class BlendShapeBuilderData : ScriptableObject | ||
{ | ||
public UnityEngine.Object baseMesh; | ||
public bool preserveExistingBlendShapes = true; | ||
public List<BlendShapeData> blendShapeData = new List<BlendShapeData>(); | ||
} | ||
} | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.