Skip to content

Commit 2e6e290

Browse files
committed
Initial Commit
1 parent e26aa35 commit 2e6e290

File tree

1,688 files changed

+144264
-55
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,688 files changed

+144264
-55
lines changed

.gitignore

+34-53
Original file line numberDiff line numberDiff line change
@@ -1,60 +1,41 @@
1-
# This .gitignore file should be placed at the root of your Unity project directory
2-
#
3-
# Get latest from https://github.com/github/gitignore/blob/master/Unity.gitignore
4-
#
5-
/[Ll]ibrary/
6-
/[Tt]emp/
7-
/[Oo]bj/
8-
/[Bb]uild/
9-
/[Bb]uilds/
10-
/[Ll]ogs/
11-
/[Mm]emoryCaptures/
12-
13-
# Asset meta data should only be ignored when the corresponding asset is also ignored
14-
!/[Aa]ssets/**/*.meta
15-
16-
# Uncomment this line if you wish to ignore the asset store tools plugin
17-
# /[Aa]ssets/AssetStoreTools*
18-
19-
# Autogenerated Jetbrains Rider plugin
20-
[Aa]ssets/Plugins/Editor/JetBrains*
21-
22-
# Visual Studio cache directory
23-
.vs/
24-
25-
# Gradle cache directory
26-
.gradle/
1+
###
2+
# Unity folders and files
3+
###
4+
[Aa]ssets/AssetStoreTools*
5+
[Bb]uild/
6+
[Ll]ibrary/
7+
[Ll]ocal[Cc]ache/
8+
[Oo]bj/
9+
[Tt]emp/
10+
[Uu]nityGenerated/
11+
# file on crash reports
12+
sysinfo.txt
13+
# Unity3D generated meta files
14+
*.pidb.meta
2715

28-
# Autogenerated VS/MD/Consulo solution and project files
29-
ExportedObj/
30-
.consulo/
16+
###
17+
# VS/MD solution and project files
18+
###
19+
[Ee]xportedObj/
20+
*.booproj
3121
*.csproj
32-
*.unityproj
3322
*.sln
3423
*.suo
35-
*.tmp
24+
*.svd
25+
*.unityproj
3626
*.user
3727
*.userprefs
3828
*.pidb
39-
*.booproj
40-
*.svd
41-
*.pdb
42-
*.mdb
43-
*.opendb
44-
*.VC.db
45-
46-
# Unity3D generated meta files
47-
*.pidb.meta
48-
*.pdb.meta
49-
*.mdb.meta
50-
51-
# Unity3D generated file on crash reports
52-
sysinfo.txt
53-
54-
# Builds
55-
*.apk
56-
*.unitypackage
57-
58-
# Crashlytics generated file
59-
crashlytics-build.properties
60-
29+
.DS_Store
30+
31+
###
32+
# OS generated
33+
###
34+
.DS_Store
35+
.DS_Store?
36+
._*
37+
.Spotlight-V100
38+
.Trashes
39+
Icon?
40+
ehthumbs.db
41+
Thumbs.db

Expression Maker/.vs/VRoid Expression Maker/FileContentIndex/read.lock

Whitespace-only changes.
Binary file not shown.

Expression Maker/.vsconfig

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"version": "1.0",
3+
"components": [
4+
"Microsoft.VisualStudio.Workload.ManagedGame"
5+
]
6+
}

Expression Maker/Assets/Plugins.meta

+8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Expression Maker/Assets/Plugins/UniGLTF.meta

+8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Expression Maker/Assets/Plugins/UniGLTF/Editor.meta

+8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Expression Maker/Assets/Plugins/UniGLTF/Editor/Animation.meta

+3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,140 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using UnityEngine;
5+
#if UNITY_EDITOR
6+
using UnityEditor;
7+
#endif
8+
9+
10+
namespace UniGLTF
11+
{
12+
class AnimationCurveData
13+
{
14+
#if UNITY_EDITOR
15+
public AnimationUtility.TangentMode TangentMode { get; private set; }
16+
public glTFAnimationTarget.AnimationProperties AnimationProperty { get; private set; }
17+
public int SamplerIndex { get; private set; }
18+
public int ElementCount { get; private set; }
19+
public readonly List<AnimationKeyframeData> Keyframes = new List<AnimationKeyframeData>();
20+
21+
[Obsolete]
22+
public AnimationCurveData(AnimationUtility.TangentMode tangentMode, glTFAnimationTarget.AnimationPropertys property, int samplerIndex, int elementCount)
23+
: this(tangentMode, glTFAnimationTarget.AnimationPropertysToAnimationProperties(property), samplerIndex, elementCount)
24+
{
25+
}
26+
27+
public AnimationCurveData(AnimationUtility.TangentMode tangentMode, glTFAnimationTarget.AnimationProperties property, int samplerIndex, int elementCount)
28+
{
29+
TangentMode = tangentMode;
30+
AnimationProperty = property;
31+
SamplerIndex = samplerIndex;
32+
ElementCount = elementCount;
33+
}
34+
35+
public string GetInterpolation()
36+
{
37+
switch (TangentMode)
38+
{
39+
case AnimationUtility.TangentMode.Linear:
40+
return glTFAnimationTarget.Interpolations.LINEAR.ToString();
41+
case AnimationUtility.TangentMode.Constant:
42+
return glTFAnimationTarget.Interpolations.STEP.ToString();
43+
default:
44+
return glTFAnimationTarget.Interpolations.LINEAR.ToString();
45+
}
46+
}
47+
48+
/// <summary>
49+
/// キーフレームのデータを入力する
50+
/// </summary>
51+
/// <param name="time"></param>
52+
/// <param name="value"></param>
53+
/// <param name="valueOffset"></param>
54+
public void SetKeyframeData(float time, float value, int valueOffset)
55+
{
56+
var existKeyframe = Keyframes.FirstOrDefault(x => x.Time == time);
57+
if (existKeyframe != null)
58+
{
59+
existKeyframe.SetValue(value, valueOffset);
60+
}
61+
else
62+
{
63+
var newKeyframe = GetKeyframeData(AnimationProperty, ElementCount);
64+
newKeyframe.Time = time;
65+
newKeyframe.SetValue(value, valueOffset);
66+
Keyframes.Add(newKeyframe);
67+
}
68+
}
69+
70+
/// <summary>
71+
/// キー情報がなかった要素に対して直前のキーの値を入力する
72+
/// </summary>
73+
public void RecountEmptyKeyframe()
74+
{
75+
if (Keyframes.Count == 0)
76+
{
77+
return;
78+
}
79+
80+
Keyframes.Sort((x, y) => (x.Time < y.Time) ? -1 : 1);
81+
82+
for (int i = 1; i < Keyframes.Count; i++)
83+
{
84+
var current = Keyframes[i];
85+
var last = Keyframes[i - 1];
86+
for (int j = 0; j < current.EnterValues.Length; j++)
87+
{
88+
if (!current.EnterValues[j])
89+
{
90+
Keyframes[i].SetValue(last.Values[j], j);
91+
}
92+
}
93+
94+
}
95+
}
96+
97+
/// <summary>
98+
/// アニメーションプロパティに対応したキーフレームを挿入する
99+
/// </summary>
100+
/// <param name="property"></param>
101+
/// <returns></returns>
102+
[Obsolete]
103+
private static AnimationKeyframeData GetKeyframeData(glTFAnimationTarget.AnimationPropertys property,
104+
int elementCount)
105+
{
106+
return GetKeyframeData(glTFAnimationTarget.AnimationPropertysToAnimationProperties(property), elementCount);
107+
}
108+
109+
/// <summary>
110+
/// アニメーションプロパティに対応したキーフレームを挿入する
111+
/// </summary>
112+
/// <param name="property"></param>
113+
/// <returns></returns>
114+
private static AnimationKeyframeData GetKeyframeData(glTFAnimationTarget.AnimationProperties property, int elementCount)
115+
{
116+
switch (property)
117+
{
118+
case glTFAnimationTarget.AnimationProperties.Translation:
119+
return new AnimationKeyframeData(elementCount, (values) =>
120+
{
121+
var temp = new Vector3(values[0], values[1], values[2]);
122+
return temp.ReverseZ().ToArray();
123+
});
124+
case glTFAnimationTarget.AnimationProperties.Rotation:
125+
return new AnimationKeyframeData(elementCount, (values) =>
126+
{
127+
var temp = new Quaternion(values[0], values[1], values[2], values[3]);
128+
return temp.ReverseZ().ToArray();
129+
});
130+
case glTFAnimationTarget.AnimationProperties.Scale:
131+
return new AnimationKeyframeData(elementCount, null);
132+
case glTFAnimationTarget.AnimationProperties.BlendShape:
133+
return new AnimationKeyframeData(elementCount, null);
134+
default:
135+
return null;
136+
}
137+
}
138+
#endif
139+
}
140+
}

Expression Maker/Assets/Plugins/UniGLTF/Editor/Animation/AnimationCurveData.cs.meta

+11
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)