Skip to content

Commit

Permalink
version 2.5.17
Browse files Browse the repository at this point in the history
  • Loading branch information
izayoijiichan committed Aug 27, 2023
1 parent 7f9b6ee commit 7e52e01
Show file tree
Hide file tree
Showing 26 changed files with 3,482 additions and 2,216 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Change Log

## [2.5.17] - 2023-08-27

- Features
- Enabled to use Stream argument for Load method of VgoImporter.
- Fixes
- [Editor] Fixed a bug that occurred in BlendShape of Scripted Importer.
- [Editor] Fixed a bug in v2.5.16 that caused error when declaring `UNIVGO_USE_UNITASK`.

## [2.5.16] - 2023-08-24

- Experiments
Expand Down
34 changes: 17 additions & 17 deletions Documentation~/UniVGO/Installation.ja.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ Unity 2021.1 以下のバージョンを使用する場合
|com.izayoi.liltoon.shader.utility|IzayoiJiichan|GitHub||1.4.0|2023年5月30日|
|com.izayoi.unishaders|IzayoiJiichan|GitHub||1.6.1|2023年8月1日|
|com.izayoi.vgospringbone|IzayoiJiichan|GitHub||1.1.2|2022年8月24日|
|com.izayoi.univgo|IzayoiJiichan|GitHub|VGO 2.5|2.5.16|2023年8月24日|
|com.izayoi.univgo|IzayoiJiichan|GitHub|VGO 2.5|2.5.17|2023年8月27日|

#### 追加パッケージ

Expand Down Expand Up @@ -143,7 +143,7 @@ UniVGOを使用するために、以下の設定を追加してください。
"dependencies": {
"com.izayoi.liltoon.shader.utility": "https://github.com/izayoijiichan/lilToonShaderUtility.git#v1.4.0",
"com.izayoi.unishaders": "https://github.com/izayoijiichan/UniShaders.git#v1.6.1",
"com.izayoi.univgo": "https://github.com/izayoijiican/VGO.git#v2.5.16",
"com.izayoi.univgo": "https://github.com/izayoijiican/VGO.git#v2.5.17",
"com.izayoi.vgospringbone": "https://github.com/izayoijiichan/VgoSpringBone.git#v1.1.2",
"com.unity.nuget.newtonsoft-json": "3.2.1",
"com.unity.ugui": "1.0.0",
Expand Down Expand Up @@ -273,20 +273,20 @@ ___

|UniVRM|UniVGO|min Unity|
|:---:|:---:|:---:|
|0.100.0|2.5.16|2020.3|
|0.101.0|2.5.16|2020.3|
|0.102.0|2.5.16|2020.3|
|0.103.2|2.5.16|2020.3|
|0.104.2|2.5.16|2020.3|
|0.105.0|2.5.16|2020.3|
|0.106.0|2.5.16|2020.3|
|0.107.2|2.5.16|2020.3|
|0.108.0|2.5.16|2020.3|
|0.109.0|2.5.16|2020.3|
|0.110.0|2.5.16|2020.3|
|0.111.0|2.5.16|2020.3|
|0.112.0|2.5.16|2021.3|
|0.113.0|2.5.16|2021.3|
|0.100.0|2.5.17|2020.3|
|0.101.0|2.5.17|2020.3|
|0.102.0|2.5.17|2020.3|
|0.103.2|2.5.17|2020.3|
|0.104.2|2.5.17|2020.3|
|0.105.0|2.5.17|2020.3|
|0.106.0|2.5.17|2020.3|
|0.107.2|2.5.17|2020.3|
|0.108.0|2.5.17|2020.3|
|0.109.0|2.5.17|2020.3|
|0.110.0|2.5.17|2020.3|
|0.111.0|2.5.17|2020.3|
|0.112.0|2.5.17|2021.3|
|0.113.0|2.5.17|2021.3|

`<Project>/Packages/package.json` に以下の記述を行います。

Expand Down Expand Up @@ -317,7 +317,7 @@ https://github.com/izayoijiichan/VGO/wiki/How-to-use-UniVRM-and-UniVGO-together
|2022.3.0f1|BRP|UniVGO + UniVRM|[Link](https://github.com/izayoijiichan/univgo2.sample.unity.project/tree/unity2022.3.brp.univrm)|

___
最終更新日:2023年8月24日
最終更新日:2023年8月27日
編集者:十六夜おじいちゃん

*Copyright (C) 2020 Izayoi Jiichan. All Rights Reserved.*
34 changes: 17 additions & 17 deletions Documentation~/UniVGO/Installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ This package is required for any Unity version.
|com.izayoi.liltoon.shader.utility|IzayoiJiichan|GitHub||1.4.0|30 May, 2023|
|com.izayoi.unishaders|IzayoiJiichan|GitHub||1.6.1|1 Aug, 2023|
|com.izayoi.vgospringbone|IzayoiJiichan|GitHub||1.1.2|24 Aug, 2022|
|com.izayoi.univgo|IzayoiJiichan|GitHub|VGO 2.5|2.5.16|24 Aug, 2023|
|com.izayoi.univgo|IzayoiJiichan|GitHub|VGO 2.5|2.5.17|27 Aug, 2023|

#### Additional Packages

Expand Down Expand Up @@ -142,7 +142,7 @@ To use UniVGO, add the following settings.
"dependencies": {
"com.izayoi.liltoon.shader.utility": "https://github.com/izayoijiichan/lilToonShaderUtility.git#v1.4.0",
"com.izayoi.unishaders": "https://github.com/izayoijiichan/UniShaders.git#v1.6.1",
"com.izayoi.univgo": "https://github.com/izayoijiican/VGO.git#v2.5.16",
"com.izayoi.univgo": "https://github.com/izayoijiican/VGO.git#v2.5.17",
"com.izayoi.vgospringbone": "https://github.com/izayoijiichan/VgoSpringBone.git#v1.1.2",
"com.unity.nuget.newtonsoft-json": "3.2.1",
"com.unity.ugui": "1.0.0",
Expand Down Expand Up @@ -270,20 +270,20 @@ The version combinations are as follows.

|UniVRM|UniVGO|min Unity|
|:---:|:---:|:---:|
|0.100.0|2.5.16|2020.3|
|0.101.0|2.5.16|2020.3|
|0.102.0|2.5.16|2020.3|
|0.103.2|2.5.16|2020.3|
|0.104.2|2.5.16|2020.3|
|0.105.0|2.5.16|2020.3|
|0.106.0|2.5.16|2020.3|
|0.107.2|2.5.16|2020.3|
|0.108.0|2.5.16|2020.3|
|0.109.0|2.5.16|2020.3|
|0.110.0|2.5.16|2020.3|
|0.111.0|2.5.16|2020.3|
|0.112.0|2.5.16|2021.3|
|0.113.0|2.5.16|2021.3|
|0.100.0|2.5.17|2020.3|
|0.101.0|2.5.17|2020.3|
|0.102.0|2.5.17|2020.3|
|0.103.2|2.5.17|2020.3|
|0.104.2|2.5.17|2020.3|
|0.105.0|2.5.17|2020.3|
|0.106.0|2.5.17|2020.3|
|0.107.2|2.5.17|2020.3|
|0.108.0|2.5.17|2020.3|
|0.109.0|2.5.17|2020.3|
|0.110.0|2.5.17|2020.3|
|0.111.0|2.5.17|2020.3|
|0.112.0|2.5.17|2021.3|
|0.113.0|2.5.17|2021.3|

Write the following in `<Project> /Packages/package.json`.

Expand Down Expand Up @@ -313,7 +313,7 @@ https://github.com/izayoijiichan/VGO/wiki/How-to-use-UniVRM-and-UniVGO-together
|2022.3.0f1|BRP|UniVGO + UniVRM|[Link](https://github.com/izayoijiichan/univgo2.sample.unity.project/tree/unity2022.3.brp.univrm)|

___
Last updated: 24 August, 2023
Last updated: 27 August, 2023
Editor: Izayoi Jiichan

*Copyright (C) 2020 Izayoi Jiichan. All Rights Reserved.*
13 changes: 10 additions & 3 deletions NewtonVgo/Runtime/Buffers/ReadOnlyArraySegmentByteBuffer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,21 +25,28 @@ public class ReadOnlyArraySegmentByteBuffer : IByteBuffer
public int Capacity => _Bytes.Count;

/// <summary>Gets or sets the current length of the buffer in bytes.</summary>
public int Length { get; private set; }
public int Length => _Bytes.Count;

#endregion

#region Constructors

/// <summary>
/// Create a new instance of ReadOnlyArraySegmentByteBuffer with bytes.
/// </summary>
/// <param name="bytes">The data to store in the buffer.</param>
public ReadOnlyArraySegmentByteBuffer(byte[] bytes)
{
_Bytes = new ArraySegment<byte>(bytes);
}

/// <summary>
/// Create a new instance of ReadOnlyArraySegmentByteBuffer with bytes.
/// </summary>
/// <param name="bytes">The data to store in the buffer.</param>
public ReadOnlyArraySegmentByteBuffer(ArraySegment<byte> bytes)
{
_Bytes = bytes;

Length = bytes.Count;
}

#endregion
Expand Down
85 changes: 85 additions & 0 deletions NewtonVgo/Runtime/Chunks/VgoReadChunk.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
// ----------------------------------------------------------------------
// @Namespace : NewtonVgo
// @Class : VgoReadChunk
// ----------------------------------------------------------------------
#nullable enable
namespace NewtonVgo
{
/// <summary>
/// VGO Read Chunk
/// </summary>
public class VgoReadChunk
{
#region Fields

/// <summary>The chunk type ID.</summary>
public readonly VgoChunkTypeID _TypeId;

/// <summary>Length of the chunk data.</summary>
public readonly uint _DataLength;

/// <summary>The chunk data.</summary>
public readonly byte[] _ChunkData;

#endregion

#region Properties

/// <summary>The chunk type ID.</summary>
public VgoChunkTypeID TypeId => _TypeId;

/// <summary>Length of the chunk data.</summary>
public uint DataLength => _DataLength;

/// <summary>The chunk data.</summary>
public byte[] ChunkData => _ChunkData;

#endregion

#region Constructors

/// <summary>
/// Create a new instance of VgoReadChunk.
/// </summary>
/// <param name="chunkTypeId">The chunk type ID.</param>
/// <param name="chunkData">The chunk data.</param>
public VgoReadChunk(VgoChunkTypeID chunkTypeId, byte[] chunkData)
{
_TypeId = chunkTypeId;

_DataLength = (uint)chunkData.Length;

_ChunkData = chunkData;
}

/// <summary>
/// Create a new instance of VgoReadChunk.
/// </summary>
/// <param name="chunkTypeId">The chunk type ID.</param>
/// <param name="chunkDataLength">Length of the chunk data.</param>
/// <param name="chunkData">The chunk data.</param>
public VgoReadChunk(VgoChunkTypeID chunkTypeId, uint chunkDataLength, byte[] chunkData)
{
_TypeId = chunkTypeId;

_DataLength = chunkDataLength;

_ChunkData = chunkData;
}

#endregion

#region Public Methods

/// <summary>
/// Returns a string that represents the current object.
/// </summary>
/// <returns>A string that represents the current object.</returns>
public override string ToString()
{
return TypeId.ToString();
}

#endregion
}
}

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

103 changes: 103 additions & 0 deletions NewtonVgo/Runtime/Extensions/StreamExtensions.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
// ----------------------------------------------------------------------
// @Namespace : NewtonVgo
// @Class : StreamExtensions
// ----------------------------------------------------------------------
#nullable enable
namespace NewtonVgo
{
using System;
using System.Threading.Tasks;
using System.Threading;
using System.IO;

/// <summary>
/// Stream Extensions
/// </summary>
public static class StreamExtensions
{
/// <summary>
/// Reads a sequence of bytes from the current stream and advances the position within the stream by the number of bytes read.
/// </summary>
/// <param name="stream">The stream.</param>
/// <param name="count">The number of bytes to read.</param>
/// <returns>An array of bytes.</returns>
public static byte[] ReadBytes(this Stream stream, int count)
{
if (count < 0)
{
ThrowHelper.ThrowArgumentOutOfRangeException(nameof(count));
}

if (count == 0)
{
return Array.Empty<byte>();
}

byte[] buffer = new byte[count];

int numBytesToRead = count;

int numBytesRead = 0;

do
{
int n = stream.Read(buffer, offset: numBytesRead, count: numBytesToRead);

numBytesRead += n;

numBytesToRead -= n;
}
while (numBytesToRead > 0);

if (numBytesRead != count)
{
ThrowHelper.ThrowIOException();
}

return buffer;
}

/// <summary>
/// Reads a sequence of bytes from the current stream and advances the position within the stream by the number of bytes read.
/// </summary>
/// <param name="stream">The stream.</param>
/// <param name="count">The number of bytes to read.</param>
/// <param name="cancellationToken">The token to monitor for cancellation requests.</param>
/// <returns>An array of bytes.</returns>
public static async Task<byte[]> ReadBytesAsync(this Stream stream, int count, CancellationToken cancellationToken)
{
if (count < 0)
{
ThrowHelper.ThrowArgumentOutOfRangeException(nameof(count));
}

if (count == 0)
{
return Array.Empty<byte>();
}

byte[] buffer = new byte[count];

int numBytesToRead = count;

int numBytesRead = 0;

do
{
int n = await stream.ReadAsync(buffer, offset: numBytesRead, count: numBytesToRead, cancellationToken);

numBytesRead += n;

numBytesToRead -= n;
}
while (numBytesToRead > 0);

if (numBytesRead != count)
{
ThrowHelper.ThrowIOException();
}

return buffer;
}
}
}
11 changes: 11 additions & 0 deletions NewtonVgo/Runtime/Extensions/StreamExtensions.cs.meta

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

Loading

0 comments on commit 7e52e01

Please sign in to comment.