feat: SetOrInherit mode in MA Mesh Settings for EasySetupOutfit (#981)

* feat: SetOrInherit for MA Mesh Settings

* chore: use SetOrInherit in EasySetupOutfit

* test: fix test data

* Delete Editor/CheckBoneMapping.cs
This commit is contained in:
anatawa12 2024-08-13 10:45:51 +09:00 committed by GitHub
parent e2e0b88dfa
commit f4ab86fedc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
10 changed files with 546 additions and 144 deletions

View File

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 6445045a83084d77a5f455165ded177d
timeCreated: 1714652822

View File

@ -204,8 +204,8 @@ namespace nadena.dev.modular_avatar.core.editor
rootBone = avatarRoot.transform; rootBone = avatarRoot.transform;
} }
meshSettings.InheritProbeAnchor = ModularAvatarMeshSettings.InheritMode.Set; meshSettings.InheritProbeAnchor = ModularAvatarMeshSettings.InheritMode.SetOrInherit;
meshSettings.InheritBounds = ModularAvatarMeshSettings.InheritMode.Set; meshSettings.InheritBounds = ModularAvatarMeshSettings.InheritMode.SetOrInherit;
meshSettings.ProbeAnchor = new AvatarObjectReference(); meshSettings.ProbeAnchor = new AvatarObjectReference();
meshSettings.ProbeAnchor.referencePath = RuntimeUtil.RelativePath(avatarRoot, probeAnchor.gameObject); meshSettings.ProbeAnchor.referencePath = RuntimeUtil.RelativePath(avatarRoot, probeAnchor.gameObject);

View File

@ -54,7 +54,7 @@ namespace nadena.dev.modular_avatar.core.editor
EditorGUILayout.LabelField(G("mesh_settings.header_probe_anchor"), EditorStyles.boldLabel); EditorGUILayout.LabelField(G("mesh_settings.header_probe_anchor"), EditorStyles.boldLabel);
EditorGUILayout.PropertyField(_prop_inherit_probe_anchor, G("mesh_settings.inherit_probe_anchor")); EditorGUILayout.PropertyField(_prop_inherit_probe_anchor, G("mesh_settings.inherit_probe_anchor"));
if (_prop_inherit_probe_anchor.enumValueIndex == (int) ModularAvatarMeshSettings.InheritMode.Set) if (_prop_inherit_probe_anchor.enumValueIndex is (int) ModularAvatarMeshSettings.InheritMode.Set or (int) ModularAvatarMeshSettings.InheritMode.SetOrInherit)
{ {
EditorGUILayout.PropertyField(_prop_probe_anchor, G("mesh_settings.probe_anchor")); EditorGUILayout.PropertyField(_prop_probe_anchor, G("mesh_settings.probe_anchor"));
} }
@ -72,7 +72,7 @@ namespace nadena.dev.modular_avatar.core.editor
EditorGUILayout.LabelField(G("mesh_settings.header_bounds"), EditorStyles.boldLabel); EditorGUILayout.LabelField(G("mesh_settings.header_bounds"), EditorStyles.boldLabel);
EditorGUILayout.PropertyField(_prop_inherit_bounds, G("mesh_settings.inherit_bounds")); EditorGUILayout.PropertyField(_prop_inherit_bounds, G("mesh_settings.inherit_bounds"));
if (_prop_inherit_bounds.enumValueIndex == (int) ModularAvatarMeshSettings.InheritMode.Set) if (_prop_inherit_bounds.enumValueIndex is (int) ModularAvatarMeshSettings.InheritMode.Set or (int) ModularAvatarMeshSettings.InheritMode.SetOrInherit)
{ {
EditorGUILayout.PropertyField(_prop_root_bone, G("mesh_settings.root_bone")); EditorGUILayout.PropertyField(_prop_root_bone, G("mesh_settings.root_bone"));
EditorGUILayout.PropertyField(_prop_bounds, G("mesh_settings.bounds")); EditorGUILayout.PropertyField(_prop_bounds, G("mesh_settings.bounds"));

View File

@ -126,6 +126,7 @@
"mesh_settings.inherit_mode.Inherit": "Inherit", "mesh_settings.inherit_mode.Inherit": "Inherit",
"mesh_settings.inherit_mode.Set": "Set", "mesh_settings.inherit_mode.Set": "Set",
"mesh_settings.inherit_mode.DontSet": "Don't Set (use mesh as-is)", "mesh_settings.inherit_mode.DontSet": "Don't Set (use mesh as-is)",
"mesh_settings.inherit_mode.SetOrInherit": "Set or inherit if set by parent",
"pb_blocker.help": "This object will not be affected by PhysBones attached to parents.", "pb_blocker.help": "This object will not be affected by PhysBones attached to parents.",
"hint.bad_vrcsdk": "Incompatible version of VRCSDK detected.\n\nPlease try upgrading your VRCSDK; if this does not work, check for a newer version of Modular Avatar as well.", "hint.bad_vrcsdk": "Incompatible version of VRCSDK detected.\n\nPlease try upgrading your VRCSDK; if this does not work, check for a newer version of Modular Avatar as well.",
"error.stack_trace": "Stack trace (provide this when reporting bugs!)", "error.stack_trace": "Stack trace (provide this when reporting bugs!)",

View File

@ -122,6 +122,7 @@
"mesh_settings.inherit_mode.Inherit": "継承", "mesh_settings.inherit_mode.Inherit": "継承",
"mesh_settings.inherit_mode.Set": "設定", "mesh_settings.inherit_mode.Set": "設定",
"mesh_settings.inherit_mode.DontSet": "設定しない(メッシュ本体の設定のまま)", "mesh_settings.inherit_mode.DontSet": "設定しない(メッシュ本体の設定のまま)",
"mesh_settings.inherit_mode.SetOrInherit": "親が指定されてる時は継承、または設定",
"pb_blocker.help": "このオブジェクトは親のPhysBoneから影響を受けなくなります。", "pb_blocker.help": "このオブジェクトは親のPhysBoneから影響を受けなくなります。",
"hint.bad_vrcsdk": "使用中のVRCSDKのバージョンとは互換性がありません。\n\nVRCSDKを更新してみてください。それでもだめでしたら、Modular Avatarにも最新版が出てないかチェックしてください。", "hint.bad_vrcsdk": "使用中のVRCSDKのバージョンとは互換性がありません。\n\nVRCSDKを更新してみてください。それでもだめでしたら、Modular Avatarにも最新版が出てないかチェックしてください。",
"error.stack_trace": "スタックトレース(バグを報告する時は必ず添付してください!)", "error.stack_trace": "スタックトレース(バグを報告する時は必ず添付してください!)",

View File

@ -7,7 +7,7 @@ namespace nadena.dev.modular_avatar.core.editor
{ {
internal static bool NotFinal(this ModularAvatarMeshSettings.InheritMode mode) internal static bool NotFinal(this ModularAvatarMeshSettings.InheritMode mode)
{ {
return mode == ModularAvatarMeshSettings.InheritMode.Inherit; return mode is ModularAvatarMeshSettings.InheritMode.Inherit or ModularAvatarMeshSettings.InheritMode.SetOrInherit;
} }
} }
@ -37,15 +37,45 @@ namespace nadena.dev.modular_avatar.core.editor
public Bounds Bounds; public Bounds Bounds;
} }
private static bool Inherit(ref ModularAvatarMeshSettings.InheritMode mode, // current Mode is the mode of current value, and the current value is came from MA Mesh Settings of child GameObject
ModularAvatarMeshSettings.InheritMode srcmode) // the srcMode is the mode of currently processing MA Mesh Settings, which is the parent component of the current value
private static bool ShouldUseSrcValue(
ref ModularAvatarMeshSettings.InheritMode currentMode,
ModularAvatarMeshSettings.InheritMode srcMode)
{ {
if (mode != ModularAvatarMeshSettings.InheritMode.Inherit || switch (currentMode, srcMode)
srcmode == ModularAvatarMeshSettings.InheritMode.Inherit) {
// invalid cases
case (not (ModularAvatarMeshSettings.InheritMode.Set
or ModularAvatarMeshSettings.InheritMode.Inherit
or ModularAvatarMeshSettings.InheritMode.DontSet
or ModularAvatarMeshSettings.InheritMode.SetOrInherit), _):
throw new System.InvalidOperationException($"Logic failure: invalid InheritMode: {currentMode}");
case (_, not (ModularAvatarMeshSettings.InheritMode.Set
or ModularAvatarMeshSettings.InheritMode.Inherit
or ModularAvatarMeshSettings.InheritMode.DontSet
or ModularAvatarMeshSettings.InheritMode.SetOrInherit)):
throw new System.ArgumentOutOfRangeException(nameof(srcMode), $"Invalid InheritMode: {srcMode}");
// If current value is came from Set or DontSet, it should not be changed
case (ModularAvatarMeshSettings.InheritMode.Set, _):
case (ModularAvatarMeshSettings.InheritMode.DontSet, _):
return false;
// If srcMode is Inherit, it should not be changed
case (_, ModularAvatarMeshSettings.InheritMode.Inherit):
return false; return false;
mode = srcmode; // If srcMode is DontSet, the value will not be used but mode should be used
case (_, ModularAvatarMeshSettings.InheritMode.DontSet):
currentMode = srcMode;
return true; return true;
// if SrcMode is Set or SetOrInherit, it should be used.
case (_, ModularAvatarMeshSettings.InheritMode.Set):
case (_, ModularAvatarMeshSettings.InheritMode.SetOrInherit):
currentMode = srcMode;
return true;
}
} }
internal static MergedSettings MergeSettings(Transform avatarRoot, Transform referenceObject) internal static MergedSettings MergeSettings(Transform avatarRoot, Transform referenceObject)
@ -74,20 +104,20 @@ namespace nadena.dev.modular_avatar.core.editor
continue; continue;
} }
if (Inherit(ref inheritProbeAnchor, settings.InheritProbeAnchor)) if (ShouldUseSrcValue(ref inheritProbeAnchor, settings.InheritProbeAnchor))
{ {
merged.ProbeAnchor = settings.ProbeAnchor.Get(settings)?.transform; merged.ProbeAnchor = settings.ProbeAnchor.Get(settings)?.transform;
} }
if (Inherit(ref inheritBounds, settings.InheritBounds)) if (ShouldUseSrcValue(ref inheritBounds, settings.InheritBounds))
{ {
merged.RootBone = settings.RootBone.Get(settings)?.transform; merged.RootBone = settings.RootBone.Get(settings)?.transform;
merged.Bounds = settings.Bounds; merged.Bounds = settings.Bounds;
} }
} while (current != null && (inheritProbeAnchor.NotFinal() || inheritBounds.NotFinal())); } while (current != null && (inheritProbeAnchor.NotFinal() || inheritBounds.NotFinal()));
merged.SetAnchor = inheritProbeAnchor == ModularAvatarMeshSettings.InheritMode.Set; merged.SetAnchor = inheritProbeAnchor is ModularAvatarMeshSettings.InheritMode.Set or ModularAvatarMeshSettings.InheritMode.SetOrInherit;
merged.SetBounds = inheritBounds == ModularAvatarMeshSettings.InheritMode.Set; merged.SetBounds = inheritBounds is ModularAvatarMeshSettings.InheritMode.Set or ModularAvatarMeshSettings.InheritMode.SetOrInherit;
return merged; return merged;
} }

View File

@ -15,7 +15,9 @@ namespace nadena.dev.modular_avatar.core
{ {
Inherit, Inherit,
Set, Set,
DontSet DontSet,
// Inherit if there is parent settings, set otherwise
SetOrInherit,
} }
//[Header("Probe anchor configuration")] //[Header("Probe anchor configuration")]

View File

@ -171,8 +171,7 @@ MonoBehaviour:
isDefault: 1 isDefault: 1
- isEnabled: 0 - isEnabled: 0
type: 5 type: 5
animatorController: {fileID: 9100000, guid: 1be58bb091803cb488c7005def284caa, animatorController: {fileID: 9100000, guid: 1be58bb091803cb488c7005def284caa, type: 2}
type: 2}
mask: {fileID: 0} mask: {fileID: 0}
isDefault: 0 isDefault: 0
specialAnimationLayers: specialAnimationLayers:
@ -333,98 +332,79 @@ PrefabInstance:
serializedVersion: 3 serializedVersion: 3
m_TransformParent: {fileID: 3825275463613500751} m_TransformParent: {fileID: 3825275463613500751}
m_Modifications: m_Modifications:
- target: {fileID: -8679921383154817045, guid: 14ac2ad30c5d3444ca37f76cea5a7047, - target: {fileID: -8679921383154817045, guid: 14ac2ad30c5d3444ca37f76cea5a7047, type: 3}
type: 3}
propertyPath: m_RootOrder propertyPath: m_RootOrder
value: 0 value: 0
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 14ac2ad30c5d3444ca37f76cea5a7047, - target: {fileID: -8679921383154817045, guid: 14ac2ad30c5d3444ca37f76cea5a7047, type: 3}
type: 3}
propertyPath: m_LocalScale.x propertyPath: m_LocalScale.x
value: 0.1 value: 0.1
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 14ac2ad30c5d3444ca37f76cea5a7047, - target: {fileID: -8679921383154817045, guid: 14ac2ad30c5d3444ca37f76cea5a7047, type: 3}
type: 3}
propertyPath: m_LocalScale.y propertyPath: m_LocalScale.y
value: 0.1 value: 0.1
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 14ac2ad30c5d3444ca37f76cea5a7047, - target: {fileID: -8679921383154817045, guid: 14ac2ad30c5d3444ca37f76cea5a7047, type: 3}
type: 3}
propertyPath: m_LocalScale.z propertyPath: m_LocalScale.z
value: 0.1 value: 0.1
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 14ac2ad30c5d3444ca37f76cea5a7047, - target: {fileID: -8679921383154817045, guid: 14ac2ad30c5d3444ca37f76cea5a7047, type: 3}
type: 3}
propertyPath: m_LocalPosition.x propertyPath: m_LocalPosition.x
value: -0.023681391 value: -0.023681391
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 14ac2ad30c5d3444ca37f76cea5a7047, - target: {fileID: -8679921383154817045, guid: 14ac2ad30c5d3444ca37f76cea5a7047, type: 3}
type: 3}
propertyPath: m_LocalPosition.y propertyPath: m_LocalPosition.y
value: -1.0559628 value: -1.0559628
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 14ac2ad30c5d3444ca37f76cea5a7047, - target: {fileID: -8679921383154817045, guid: 14ac2ad30c5d3444ca37f76cea5a7047, type: 3}
type: 3}
propertyPath: m_LocalPosition.z propertyPath: m_LocalPosition.z
value: 0.6872994 value: 0.6872994
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 14ac2ad30c5d3444ca37f76cea5a7047, - target: {fileID: -8679921383154817045, guid: 14ac2ad30c5d3444ca37f76cea5a7047, type: 3}
type: 3}
propertyPath: m_LocalRotation.w propertyPath: m_LocalRotation.w
value: 0.7071067 value: 0.7071067
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 14ac2ad30c5d3444ca37f76cea5a7047, - target: {fileID: -8679921383154817045, guid: 14ac2ad30c5d3444ca37f76cea5a7047, type: 3}
type: 3}
propertyPath: m_LocalRotation.x propertyPath: m_LocalRotation.x
value: -0.7071068 value: -0.7071068
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 14ac2ad30c5d3444ca37f76cea5a7047, - target: {fileID: -8679921383154817045, guid: 14ac2ad30c5d3444ca37f76cea5a7047, type: 3}
type: 3}
propertyPath: m_LocalRotation.y propertyPath: m_LocalRotation.y
value: -0 value: -0
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 14ac2ad30c5d3444ca37f76cea5a7047, - target: {fileID: -8679921383154817045, guid: 14ac2ad30c5d3444ca37f76cea5a7047, type: 3}
type: 3}
propertyPath: m_LocalRotation.z propertyPath: m_LocalRotation.z
value: -0 value: -0
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 14ac2ad30c5d3444ca37f76cea5a7047, - target: {fileID: -8679921383154817045, guid: 14ac2ad30c5d3444ca37f76cea5a7047, type: 3}
type: 3}
propertyPath: m_LocalEulerAnglesHint.x propertyPath: m_LocalEulerAnglesHint.x
value: 0 value: 0
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 14ac2ad30c5d3444ca37f76cea5a7047, - target: {fileID: -8679921383154817045, guid: 14ac2ad30c5d3444ca37f76cea5a7047, type: 3}
type: 3}
propertyPath: m_LocalEulerAnglesHint.y propertyPath: m_LocalEulerAnglesHint.y
value: 0 value: 0
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 14ac2ad30c5d3444ca37f76cea5a7047, - target: {fileID: -8679921383154817045, guid: 14ac2ad30c5d3444ca37f76cea5a7047, type: 3}
type: 3}
propertyPath: m_LocalEulerAnglesHint.z propertyPath: m_LocalEulerAnglesHint.z
value: 0 value: 0
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: -3887185075125053422, guid: 14ac2ad30c5d3444ca37f76cea5a7047, - target: {fileID: -3887185075125053422, guid: 14ac2ad30c5d3444ca37f76cea5a7047, type: 3}
type: 3}
propertyPath: m_DirtyAABB propertyPath: m_DirtyAABB
value: 0 value: 0
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: -3887185075125053422, guid: 14ac2ad30c5d3444ca37f76cea5a7047, - target: {fileID: -3887185075125053422, guid: 14ac2ad30c5d3444ca37f76cea5a7047, type: 3}
type: 3}
propertyPath: m_AABB.m_Extent.x propertyPath: m_AABB.m_Extent.x
value: 1 value: 1
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: -3887185075125053422, guid: 14ac2ad30c5d3444ca37f76cea5a7047, - target: {fileID: -3887185075125053422, guid: 14ac2ad30c5d3444ca37f76cea5a7047, type: 3}
type: 3}
propertyPath: m_AABB.m_Extent.y propertyPath: m_AABB.m_Extent.y
value: 1 value: 1
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: -3887185075125053422, guid: 14ac2ad30c5d3444ca37f76cea5a7047, - target: {fileID: -3887185075125053422, guid: 14ac2ad30c5d3444ca37f76cea5a7047, type: 3}
type: 3}
propertyPath: m_AABB.m_Extent.z propertyPath: m_AABB.m_Extent.z
value: 1 value: 1
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 919132149155446097, guid: 14ac2ad30c5d3444ca37f76cea5a7047, - target: {fileID: 919132149155446097, guid: 14ac2ad30c5d3444ca37f76cea5a7047, type: 3}
type: 3}
propertyPath: m_Name propertyPath: m_Name
value: BaseMesh value: BaseMesh
objectReference: {fileID: 0} objectReference: {fileID: 0}
@ -435,8 +415,7 @@ PrefabInstance:
m_SourcePrefab: {fileID: 100100000, guid: 14ac2ad30c5d3444ca37f76cea5a7047, type: 3} m_SourcePrefab: {fileID: 100100000, guid: 14ac2ad30c5d3444ca37f76cea5a7047, type: 3}
--- !u!4 &3646968714803193661 stripped --- !u!4 &3646968714803193661 stripped
Transform: Transform:
m_CorrespondingSourceObject: {fileID: -8679921383154817045, guid: 14ac2ad30c5d3444ca37f76cea5a7047, m_CorrespondingSourceObject: {fileID: -8679921383154817045, guid: 14ac2ad30c5d3444ca37f76cea5a7047, type: 3}
type: 3}
m_PrefabInstance: {fileID: 3825275463173128406} m_PrefabInstance: {fileID: 3825275463173128406}
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
--- !u!1001 &3825275463971368607 --- !u!1001 &3825275463971368607
@ -447,103 +426,83 @@ PrefabInstance:
serializedVersion: 3 serializedVersion: 3
m_TransformParent: {fileID: 3825275463613500751} m_TransformParent: {fileID: 3825275463613500751}
m_Modifications: m_Modifications:
- target: {fileID: -8679921383154817045, guid: 14ac2ad30c5d3444ca37f76cea5a7047, - target: {fileID: -8679921383154817045, guid: 14ac2ad30c5d3444ca37f76cea5a7047, type: 3}
type: 3}
propertyPath: m_RootOrder propertyPath: m_RootOrder
value: 1 value: 1
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 14ac2ad30c5d3444ca37f76cea5a7047, - target: {fileID: -8679921383154817045, guid: 14ac2ad30c5d3444ca37f76cea5a7047, type: 3}
type: 3}
propertyPath: m_LocalScale.x propertyPath: m_LocalScale.x
value: 0.1 value: 0.1
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 14ac2ad30c5d3444ca37f76cea5a7047, - target: {fileID: -8679921383154817045, guid: 14ac2ad30c5d3444ca37f76cea5a7047, type: 3}
type: 3}
propertyPath: m_LocalScale.y propertyPath: m_LocalScale.y
value: 0.1 value: 0.1
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 14ac2ad30c5d3444ca37f76cea5a7047, - target: {fileID: -8679921383154817045, guid: 14ac2ad30c5d3444ca37f76cea5a7047, type: 3}
type: 3}
propertyPath: m_LocalScale.z propertyPath: m_LocalScale.z
value: 0.1 value: 0.1
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 14ac2ad30c5d3444ca37f76cea5a7047, - target: {fileID: -8679921383154817045, guid: 14ac2ad30c5d3444ca37f76cea5a7047, type: 3}
type: 3}
propertyPath: m_LocalPosition.x propertyPath: m_LocalPosition.x
value: -0.023681391 value: -0.023681391
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 14ac2ad30c5d3444ca37f76cea5a7047, - target: {fileID: -8679921383154817045, guid: 14ac2ad30c5d3444ca37f76cea5a7047, type: 3}
type: 3}
propertyPath: m_LocalPosition.y propertyPath: m_LocalPosition.y
value: -1.0559628 value: -1.0559628
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 14ac2ad30c5d3444ca37f76cea5a7047, - target: {fileID: -8679921383154817045, guid: 14ac2ad30c5d3444ca37f76cea5a7047, type: 3}
type: 3}
propertyPath: m_LocalPosition.z propertyPath: m_LocalPosition.z
value: 0.6872994 value: 0.6872994
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 14ac2ad30c5d3444ca37f76cea5a7047, - target: {fileID: -8679921383154817045, guid: 14ac2ad30c5d3444ca37f76cea5a7047, type: 3}
type: 3}
propertyPath: m_LocalRotation.w propertyPath: m_LocalRotation.w
value: 0.7071067 value: 0.7071067
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 14ac2ad30c5d3444ca37f76cea5a7047, - target: {fileID: -8679921383154817045, guid: 14ac2ad30c5d3444ca37f76cea5a7047, type: 3}
type: 3}
propertyPath: m_LocalRotation.x propertyPath: m_LocalRotation.x
value: -0.7071068 value: -0.7071068
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 14ac2ad30c5d3444ca37f76cea5a7047, - target: {fileID: -8679921383154817045, guid: 14ac2ad30c5d3444ca37f76cea5a7047, type: 3}
type: 3}
propertyPath: m_LocalRotation.y propertyPath: m_LocalRotation.y
value: -0 value: -0
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 14ac2ad30c5d3444ca37f76cea5a7047, - target: {fileID: -8679921383154817045, guid: 14ac2ad30c5d3444ca37f76cea5a7047, type: 3}
type: 3}
propertyPath: m_LocalRotation.z propertyPath: m_LocalRotation.z
value: -0 value: -0
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 14ac2ad30c5d3444ca37f76cea5a7047, - target: {fileID: -8679921383154817045, guid: 14ac2ad30c5d3444ca37f76cea5a7047, type: 3}
type: 3}
propertyPath: m_LocalEulerAnglesHint.x propertyPath: m_LocalEulerAnglesHint.x
value: 0 value: 0
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 14ac2ad30c5d3444ca37f76cea5a7047, - target: {fileID: -8679921383154817045, guid: 14ac2ad30c5d3444ca37f76cea5a7047, type: 3}
type: 3}
propertyPath: m_LocalEulerAnglesHint.y propertyPath: m_LocalEulerAnglesHint.y
value: 0 value: 0
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: 14ac2ad30c5d3444ca37f76cea5a7047, - target: {fileID: -8679921383154817045, guid: 14ac2ad30c5d3444ca37f76cea5a7047, type: 3}
type: 3}
propertyPath: m_LocalEulerAnglesHint.z propertyPath: m_LocalEulerAnglesHint.z
value: 0 value: 0
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: -3887185075125053422, guid: 14ac2ad30c5d3444ca37f76cea5a7047, - target: {fileID: -3887185075125053422, guid: 14ac2ad30c5d3444ca37f76cea5a7047, type: 3}
type: 3}
propertyPath: m_DirtyAABB propertyPath: m_DirtyAABB
value: 0 value: 0
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: -3887185075125053422, guid: 14ac2ad30c5d3444ca37f76cea5a7047, - target: {fileID: -3887185075125053422, guid: 14ac2ad30c5d3444ca37f76cea5a7047, type: 3}
type: 3}
propertyPath: m_AABB.m_Extent.x propertyPath: m_AABB.m_Extent.x
value: 1 value: 1
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: -3887185075125053422, guid: 14ac2ad30c5d3444ca37f76cea5a7047, - target: {fileID: -3887185075125053422, guid: 14ac2ad30c5d3444ca37f76cea5a7047, type: 3}
type: 3}
propertyPath: m_AABB.m_Extent.y propertyPath: m_AABB.m_Extent.y
value: 1 value: 1
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: -3887185075125053422, guid: 14ac2ad30c5d3444ca37f76cea5a7047, - target: {fileID: -3887185075125053422, guid: 14ac2ad30c5d3444ca37f76cea5a7047, type: 3}
type: 3}
propertyPath: m_AABB.m_Extent.z propertyPath: m_AABB.m_Extent.z
value: 1 value: 1
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: -3887185075125053422, guid: 14ac2ad30c5d3444ca37f76cea5a7047, - target: {fileID: -3887185075125053422, guid: 14ac2ad30c5d3444ca37f76cea5a7047, type: 3}
type: 3}
propertyPath: m_BlendShapeWeights.Array.size propertyPath: m_BlendShapeWeights.Array.size
value: 5 value: 5
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 919132149155446097, guid: 14ac2ad30c5d3444ca37f76cea5a7047, - target: {fileID: 919132149155446097, guid: 14ac2ad30c5d3444ca37f76cea5a7047, type: 3}
type: 3}
propertyPath: m_Name propertyPath: m_Name
value: SyncedMesh value: SyncedMesh
objectReference: {fileID: 0} objectReference: {fileID: 0}
@ -551,21 +510,18 @@ PrefabInstance:
m_RemovedGameObjects: [] m_RemovedGameObjects: []
m_AddedGameObjects: [] m_AddedGameObjects: []
m_AddedComponents: m_AddedComponents:
- targetCorrespondingSourceObject: {fileID: 919132149155446097, guid: 14ac2ad30c5d3444ca37f76cea5a7047, - targetCorrespondingSourceObject: {fileID: 919132149155446097, guid: 14ac2ad30c5d3444ca37f76cea5a7047, type: 3}
type: 3}
insertIndex: -1 insertIndex: -1
addedObject: {fileID: 3825275463971368602} addedObject: {fileID: 3825275463971368602}
m_SourcePrefab: {fileID: 100100000, guid: 14ac2ad30c5d3444ca37f76cea5a7047, type: 3} m_SourcePrefab: {fileID: 100100000, guid: 14ac2ad30c5d3444ca37f76cea5a7047, type: 3}
--- !u!4 &3646968713996568948 stripped --- !u!4 &3646968713996568948 stripped
Transform: Transform:
m_CorrespondingSourceObject: {fileID: -8679921383154817045, guid: 14ac2ad30c5d3444ca37f76cea5a7047, m_CorrespondingSourceObject: {fileID: -8679921383154817045, guid: 14ac2ad30c5d3444ca37f76cea5a7047, type: 3}
type: 3}
m_PrefabInstance: {fileID: 3825275463971368607} m_PrefabInstance: {fileID: 3825275463971368607}
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
--- !u!1 &4167925416990528462 stripped --- !u!1 &4167925416990528462 stripped
GameObject: GameObject:
m_CorrespondingSourceObject: {fileID: 919132149155446097, guid: 14ac2ad30c5d3444ca37f76cea5a7047, m_CorrespondingSourceObject: {fileID: 919132149155446097, guid: 14ac2ad30c5d3444ca37f76cea5a7047, type: 3}
type: 3}
m_PrefabInstance: {fileID: 3825275463971368607} m_PrefabInstance: {fileID: 3825275463971368607}
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
--- !u!114 &3825275463971368602 --- !u!114 &3825275463971368602

View File

@ -21,11 +21,13 @@ namespace modular_avatar_tests
var obj2 = prefab.transform.Find("ProbeTargetRenderers/MeshRenderer").GetComponent<Renderer>(); var obj2 = prefab.transform.Find("ProbeTargetRenderers/MeshRenderer").GetComponent<Renderer>();
var obj3 = prefab.transform.Find("ProbeTargetRenderers/ParticleSystemRenderer").GetComponent<Renderer>(); var obj3 = prefab.transform.Find("ProbeTargetRenderers/ParticleSystemRenderer").GetComponent<Renderer>();
var obj4 = prefab.transform.Find("ProbeTargetRenderers/TrailRenderer").GetComponent<Renderer>(); var obj4 = prefab.transform.Find("ProbeTargetRenderers/TrailRenderer").GetComponent<Renderer>();
var obj5 = prefab.transform.Find("ProbeTargetRenderers/SetOrInherit").GetComponent<Renderer>();
Assert.AreEqual(target, obj1.probeAnchor); Assert.AreEqual(target, obj1.probeAnchor);
Assert.AreEqual(target, obj2.probeAnchor); Assert.AreEqual(target, obj2.probeAnchor);
Assert.AreEqual(target, obj3.probeAnchor); Assert.AreEqual(target, obj3.probeAnchor);
Assert.AreEqual(target, obj4.probeAnchor); Assert.AreEqual(target, obj4.probeAnchor);
Assert.AreEqual(target, obj5.probeAnchor);
} }
[Test] [Test]
@ -37,9 +39,11 @@ namespace modular_avatar_tests
var noninherit = prefab.transform.Find("ProbeTargetRenderers/NonInherited").GetComponent<MeshRenderer>(); var noninherit = prefab.transform.Find("ProbeTargetRenderers/NonInherited").GetComponent<MeshRenderer>();
var overrideset = prefab.transform.Find("ProbeTargetRenderers/OverrideSet").GetComponent<MeshRenderer>(); var overrideset = prefab.transform.Find("ProbeTargetRenderers/OverrideSet").GetComponent<MeshRenderer>();
var setOrInherit = prefab.transform.Find("ProbeTargetRenderers SetOrInherit No Parent").GetComponent<MeshRenderer>();
Assert.AreEqual(noninherit.transform.Find("Target"), noninherit.probeAnchor); Assert.AreEqual(noninherit.transform.Find("Target"), noninherit.probeAnchor);
Assert.AreEqual(overrideset.transform.Find("Target"), overrideset.probeAnchor); Assert.AreEqual(overrideset.transform.Find("Target"), overrideset.probeAnchor);
Assert.AreEqual(setOrInherit.transform.Find("Target"), setOrInherit.probeAnchor);
} }
[Test] [Test]

File diff suppressed because it is too large Load Diff