Skip to content

Commit

Permalink
version 0.6.1
Browse files Browse the repository at this point in the history
  • Loading branch information
izayoijiichan committed Jan 22, 2020
1 parent ac41788 commit b348096
Show file tree
Hide file tree
Showing 122 changed files with 374 additions and 269 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Change Log

## [0.6.1] - 2020-01-20
- Refactored source code

## [0.6.0] - 2020-01-17
- Added `VGO_materials` property to materials extension.
- Added `VRMC_materials_mtoon` property to materials extension.
Expand Down
2 changes: 1 addition & 1 deletion UniGLTFforUniVgo/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ The main design pattern of this plugin is abstracted from ousttrue's UniGLTF.
* https://github.com/ousttrue/UniGLTF

___
Last updated: 1 January, 2020
Last updated: 1 January, 2020
Editor: Izayoi Jiichan

*Copyright (C) 2020 Izayoi Jiichan. All Rights Reserved.*
5 changes: 5 additions & 0 deletions UniGLTFforUniVgo/Runtime/Extensions/UnityExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,11 @@ public static float[] ToArray(this Quaternion q)
return new float[] { q.x, q.y, q.z, q.w };
}

public static float[] ToArray(this Vector2 v)
{
return new float[] { v.x, v.y };
}

public static float[] ToArray(this Vector3 v)
{
return new float[] { v.x, v.y, v.z };
Expand Down
12 changes: 3 additions & 9 deletions UniGLTFforUniVgo/Runtime/IO/MaterialExporter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -221,11 +221,8 @@ static glTFMaterial CreateUnlitMaterialDefault(Material m)
},
extensions = new glTFMaterial_extensions
{
KHR_materials_unlit = new glTF_KHR_materials_unlit(),
VGO_materials = new glTF_VGO_materials()
{
shaderName = m.shader.name,
}
VGO_materials = new VGO_materials(m.shader.name),
KHR_materials_unlit = new KHR_materials_unlit(),
},
};
}
Expand Down Expand Up @@ -301,10 +298,7 @@ static glTFMaterial Export_Standard(Material m)
pbrMetallicRoughness = new glTFPbrMetallicRoughness(),
extensions = new glTFMaterial_extensions
{
VGO_materials = new glTF_VGO_materials()
{
shaderName = m.shader.name,
}
VGO_materials = new VGO_materials(m.shader.name),
},
};

Expand Down
2 changes: 1 addition & 1 deletion UniGLTFforUniVgo/Runtime/IO/gltfExporter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ protected virtual IEnumerable<string> ExtensionUsed
{
get
{
yield return glTF_KHR_materials_unlit.ExtensionName;
yield return KHR_materials_unlit.ExtensionName;
}
}

Expand Down
12 changes: 0 additions & 12 deletions UniGLTFforUniVgo/Runtime/Schema/Extensions/KHR_materials_unlit.cs

This file was deleted.

8 changes: 8 additions & 0 deletions UniGLTFforUniVgo/Runtime/Schema/Extensions/Materials.meta

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
@@ -1,23 +1,20 @@
// ----------------------------------------------------------------------
// @Namespace : UniGLTFforUniVgo
// @Class : glTF_VGO_materials
// @Class : KHR_materials_unlit
// ----------------------------------------------------------------------
namespace UniGLTFforUniVgo
{
using Newtonsoft.Json;
using System;

/// <summary>
///
/// KHR materials unlit
/// </summary>
[Serializable]
public class glTF_VGO_materials
[JsonObject("material.extensions.KHR_materials_unlit")]
public class KHR_materials_unlit
{
/// <summary>Shader Name</summary>
[JsonProperty("shaderName", Required = Required.Always)]
public string shaderName = null;

[JsonIgnore]
public static string ExtensionName => "VGO_materials";
public static string ExtensionName => "KHR_materials_unlit";
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
// ----------------------------------------------------------------------
// @Namespace : UniGLTFforUniVgo
// @Class : VGO_materials
// ----------------------------------------------------------------------
namespace UniGLTFforUniVgo
{
using Newtonsoft.Json;
using System;

/// <summary>
/// VGO materials
/// </summary>
[Serializable]
[JsonObject("material.extensions.VGO_materials")]
public class VGO_materials
{
/// <summary>Shader Name</summary>
[JsonProperty("shaderName", Required = Required.Always)]
public string shaderName = null;

[JsonIgnore]
public static string ExtensionName => "VGO_materials";

#region Constructors

/// <summary>
///
/// </summary>
public VGO_materials()
{
}

/// <summary>
///
/// </summary>
/// <param name="shaderName"></param>
public VGO_materials(string shaderName)
{
this.shaderName = shaderName;
}

#endregion
}
}

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
@@ -1,6 +1,6 @@
// ----------------------------------------------------------------------
// @Namespace : UniGLTFforUniVgo
// @Class : glTF_VRMC_materials_mtoon
// @Class : VRMC_materials_mtoon
// ----------------------------------------------------------------------
namespace UniGLTFforUniVgo
{
Expand Down Expand Up @@ -60,7 +60,8 @@ public enum MToonRenderMode
/// VRM/MToon shader properties
/// </summary>
[Serializable]
public class glTF_VRMC_materials_mtoon
[JsonObject("material.extensions.VRMC_materials_mtoon")]
public class VRMC_materials_mtoon
{
/// <summary>_MToonVersion</summary>
[JsonProperty("version")]
Expand Down

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
Expand Up @@ -11,18 +11,19 @@ namespace UniGLTFforUniVgo
/// glTF Material extensions
/// </summary>
[Serializable]
public partial class glTFMaterial_extensions : ExtensionsBase<glTFMaterial_extensions>
[JsonObject("material.extensions")]
public class glTFMaterial_extensions
{
/// <summary></summary>
[JsonProperty("KHR_materials_unlit")]
public glTF_KHR_materials_unlit KHR_materials_unlit;
[JsonProperty("VGO_materials")]
public VGO_materials VGO_materials = null;

/// <summary></summary>
[JsonProperty("VGO_materials")]
public glTF_VGO_materials VGO_materials;
[JsonProperty("KHR_materials_unlit")]
public KHR_materials_unlit KHR_materials_unlit = null;

/// <summary></summary>
[JsonProperty("VRMC_materials_mtoon")]
public glTF_VRMC_materials_mtoon VRMC_materials_mtoon;
public VRMC_materials_mtoon VRMC_materials_mtoon = null;
}
}

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

8 changes: 8 additions & 0 deletions UniGLTFforUniVgo/Runtime/Schema/Extensions/Nodes.meta

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
@@ -1,6 +1,6 @@
// ----------------------------------------------------------------------
// @Namespace : UniGLTFforUniVgo
// @Class : glTFNode_VGO_Collider
// @Class : VGO_Collider
// ----------------------------------------------------------------------
namespace UniGLTFforUniVgo
{
Expand All @@ -25,7 +25,7 @@ public enum ColliderType
/// </summary>
[Serializable]
[JsonObject("node.vgo.collider")]
public class glTFNode_VGO_Collider
public class VGO_Collider
{
/// <summary>Enabled</summary>
[JsonProperty("enabled", DefaultValueHandling = DefaultValueHandling.IgnoreAndPopulate)]
Expand Down Expand Up @@ -65,6 +65,6 @@ public class glTFNode_VGO_Collider

/// <summary>Physic Material</summary>
[JsonProperty("physicMaterial")]
public glTFNode_VGO_PhysicMaterial physicMaterial = null;
public VGO_PhysicMaterial physicMaterial = null;
}
}

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
@@ -1,6 +1,6 @@
// ----------------------------------------------------------------------
// @Namespace : UniGLTFforUniVgo
// @Class : glTFNode_VGO_GameObject
// @Class : VGO_GameObject
// ----------------------------------------------------------------------
namespace UniGLTFforUniVgo
{
Expand All @@ -15,7 +15,7 @@ namespace UniGLTFforUniVgo
/// </summary>
[Serializable]
[JsonObject("node.vgo.gameobject")]
public class glTFNode_VGO_GameObject
public class VGO_GameObject
{
/// <summary>Is Active</summary>
[JsonProperty("isActive", DefaultValueHandling = DefaultValueHandling.IgnoreAndPopulate)]
Expand Down

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
@@ -1,6 +1,6 @@
// ----------------------------------------------------------------------
// @Namespace : UniGLTFforUniVgo
// @Class : glTFNode_VGO_Light
// @Class : VGO_Light
// ----------------------------------------------------------------------
namespace UniGLTFforUniVgo
{
Expand All @@ -14,7 +14,7 @@ namespace UniGLTFforUniVgo
/// glTF Node VGO Light
/// </summary>
[Serializable]
public class glTFNode_VGO_Light
public class VGO_Light
{
/// <summary>Enabled</summary>
[JsonProperty("enabled", DefaultValueHandling = DefaultValueHandling.IgnoreAndPopulate)]
Expand Down
11 changes: 11 additions & 0 deletions UniGLTFforUniVgo/Runtime/Schema/Extensions/Nodes/VGO_Light.cs.meta

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
@@ -1,6 +1,6 @@
// ----------------------------------------------------------------------
// @Namespace : UniGLTFforUniVgo
// @Class : glTFNode_VGO_Rigidbody
// @Class : VGO_Rigidbody
// ----------------------------------------------------------------------
namespace UniGLTFforUniVgo
{
Expand All @@ -14,7 +14,7 @@ namespace UniGLTFforUniVgo
/// </summary>
[Serializable]
[JsonObject("node.vgo.rigidbody")]
public class glTFNode_VGO_Rigidbody
public class VGO_Rigidbody
{
/// <summary>Mass</summary>
[JsonProperty("mass")]
Expand Down

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

Loading

0 comments on commit b348096

Please sign in to comment.