Skip to content
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

親をたどる時、非アクティブなTransformが取得できなくなっていたのを修正 #546

Merged
merged 1 commit into from
Sep 11, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Assets/VRM/UniVRM/Editor/ExporterExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Linq;
using MeshUtility;
using UnityEngine;

namespace VRM
Expand All @@ -7,7 +8,7 @@ public static class ExporterExtensions
{
public static bool EnableForExport(this Component mono)
{
if (mono.transform.GetComponentsInParent<Transform>().Any(x => !x.gameObject.activeSelf))
if (mono.transform.Ancestors().Any(x => !x.gameObject.activeSelf))
{
// 自分か祖先に !activeSelf がいる
return false;
Expand Down
2 changes: 1 addition & 1 deletion Assets/VRM/UniVRM/Scripts/FirstPerson/VRMFirstPerson.cs
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ private static Mesh CreateHeadlessModelForSkinnedMeshRenderer(SkinnedMeshRendere
var eraseBones = bones.Select((x, i) =>
{
// 祖先に削除対象が存在するか
bool erase = x.GetComponentsInParent<Transform>().Any(y => y == eraseRoot);
bool erase = x.Ancestors().Any(y => y == eraseRoot);
return new
{
i,
Expand Down