Skip to content

Commit

Permalink
Merge pull request #2364 from Santarh/mtoonSubmoduleDeinit
Browse files Browse the repository at this point in the history
Replace MToon submodule with copying
  • Loading branch information
Santarh authored Jul 19, 2024
2 parents 4e7bd4b + f0947fb commit 35f9007
Show file tree
Hide file tree
Showing 53 changed files with 4,490 additions and 1 deletion.
1 change: 0 additions & 1 deletion Assets/VRMShaders/VRM/MToon
Submodule MToon deleted from 42b031
34 changes: 34 additions & 0 deletions Assets/VRMShaders/VRM/MToon/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/[Ll]ibrary/
/[Tt]emp/
/[Oo]bj/
/[Bb]uild/
/[Bb]uilds/
/Assets/AssetStoreTools*

# Visual Studio 2015 cache directory
/.vs/

# Autogenerated VS/MD/Consulo solution and project files
ExportedObj/
.consulo/
*.csproj
*.unityproj
*.sln
*.suo
*.tmp
*.user
*.userprefs
*.pidb
*.booproj
*.svd
*.pdb

# Unity3D generated meta files
*.pidb.meta

# Unity3D Generated File On Crash Reports
sysinfo.txt

# Builds
*.apk
*.unitypackage
21 changes: 21 additions & 0 deletions Assets/VRMShaders/VRM/MToon/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2018 Masataka SUMI

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
7 changes: 7 additions & 0 deletions Assets/VRMShaders/VRM/MToon/LICENSE.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions Assets/VRMShaders/VRM/MToon/MToon.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions Assets/VRMShaders/VRM/MToon/MToon/Editor.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions Assets/VRMShaders/VRM/MToon/MToon/Editor/EditorEnums.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
namespace MToon
{
public enum EditorRotationUnit
{
Rounds = 0,
Degrees = 1,
Radians = 2,
}
}
3 changes: 3 additions & 0 deletions Assets/VRMShaders/VRM/MToon/MToon/Editor/EditorEnums.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

61 changes: 61 additions & 0 deletions Assets/VRMShaders/VRM/MToon/MToon/Editor/EditorUtils.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
using System.IO;
using System.Text.RegularExpressions;
using UnityEditor;
using UnityEngine;

namespace MToon
{
public static class EditorUtils
{
private static string BasePath { get { return Path.Combine(Application.dataPath, "VRM/MToon"); } }

private static string ShaderFilePath { get { return Path.Combine(BasePath, "MToon/Resources/Shaders/MToon.shader"); } }
private static string ReadMeFilePath { get { return Path.Combine(BasePath, "README.md"); } }
private static string VersionFilePath { get { return Path.Combine(BasePath, "MToon/Scripts/UtilsVersion.cs"); } }


//[MenuItem("VRM/MToon Version Up")]
private static void VerUp(string version)
{
UpdateShaderFile(version);
UpdateReadMeFile(version);
UpdateVersionFile(version);
}

private static void UpdateShaderFile(string version)
{
var file = File.ReadAllText(ShaderFilePath);
file = Regex.Replace(
file,
"(_MToonVersion \\(\"_MToonVersion\", Float\\) = )(\\d+)",
"${1}" + version
);
File.WriteAllText(ShaderFilePath, file);
}

private static void UpdateReadMeFile(string version)
{
version = "v" + version.Substring(0, version.Length - 1) + "." + version[version.Length - 1];

var file = File.ReadAllText(ReadMeFilePath);
file = Regex.Replace(
file,
"v(\\d+)\\.(\\d+)",
version
);
File.WriteAllText(ReadMeFilePath, file);
}

private static void UpdateVersionFile(string version)
{
var file = File.ReadAllText(VersionFilePath);
file = Regex.Replace(
file,
"(public const int VersionNumber = )(\\d+)(;)",
"${1}" + version + "${3}"
);
File.WriteAllText(VersionFilePath, file);

}
}
}
3 changes: 3 additions & 0 deletions Assets/VRMShaders/VRM/MToon/MToon/Editor/EditorUtils.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions Assets/VRMShaders/VRM/MToon/MToon/Editor/MToon.Editor.asmdef
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"name": "MToon.Editor",
"references": [
"GUID:a9bc101fb0471f94a8f99fd242fdd934"
],
"includePlatforms": [
"Editor"
],
"excludePlatforms": [],
"allowUnsafeCode": false,
"overrideReferences": false,
"precompiledReferences": [],
"autoReferenced": false,
"defineConstraints": [],
"versionDefines": [],
"noEngineReferences": false
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 35f9007

Please sign in to comment.