-
Notifications
You must be signed in to change notification settings - Fork 436
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[1.0] thumbnail の名前が無い時に SubAssetKey を作るのに失敗するのを修正 #1193
Conversation
FixTextureNameUnique を整理しました。 |
/// </summary> | ||
private static void FixTextureNameUnique(glTF GLTF) | ||
{ | ||
var used = new HashSet<string>(); | ||
for (var textureIdx = 0; textureIdx < GLTF.textures.Count; ++textureIdx) | ||
{ | ||
var gltfTexture = GLTF.textures[textureIdx]; | ||
var gltfImage = GLTF.images[gltfTexture.source]; | ||
if (!string.IsNullOrEmpty(gltfImage.uri) && !gltfImage.uri.StartsWith("data:")) | ||
if (gltfTexture.source != textureIdx) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ここに来ないことを 強く
期待している
やりなおし |
4d1c45f
to
aad1b12
Compare
{ | ||
imageName = THUMBNAIL_NAME; | ||
} | ||
var uniqueName = GlbLowLevelParser.FixNameUnique(used, imageName); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FixNameUnique で thumbnail 用の名前を作り出す !
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Specified な実装だが、致し方なし
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
よさそう
{ | ||
imageName = THUMBNAIL_NAME; | ||
} | ||
var uniqueName = GlbLowLevelParser.FixNameUnique(used, imageName); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Specified な実装だが、致し方なし
var textureIndex = kv.Value.GetInt32(); | ||
if (textureIndex == -1) | ||
{ | ||
meta.ThumbnailImage = -1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
サムネがない
else | ||
{ | ||
var gltfTexture = gltf.textures[textureIndex]; | ||
meta.ThumbnailImage = gltfTexture.source; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
サムネがある
var index = vrm.VrmExtension.Meta.ThumbnailImage.Value; | ||
|
||
// empty thumbnail name | ||
vrm.Data.GLTF.images[index].name = null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
image の name が null でもロードできる
#1188