Skip to content

Commit

Permalink
fixed adaptive gaze in the sample scene, fixed typos
Browse files Browse the repository at this point in the history
  • Loading branch information
BenediktHensen committed Mar 14, 2024
1 parent 357804d commit 3dac918
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public static void TurnAvataraIntoAgent()
// If a custom Prefab is defined by the user, use that one, otherwise use the default one
if (customPrefabGuids.Length == 0)
{
Debug.Log("Using default preset prefab. Optianally a prefab named \"CustomAgentWithoutModel\" based on the \"com.i5.virtualagents/Runtime/Prefabs/AgentWithoutModel.prefab\" can be used to modify all following imports. ");
Debug.Log("Using default preset prefab. Optionally a prefab named \"CustomAgentWithoutModel\" based on the \"com.i5.virtualagents/Runtime/Prefabs/AgentWithoutModel.prefab\" can be used to modify all following imports. ");
if (prefabGuids.Length == 0)
{
Debug.LogError("Prefab not found: " + prefabName);
Expand Down Expand Up @@ -115,7 +115,7 @@ private static void CheckAnimatorAvatar()
if (!selectedObject.TryGetComponent<Agent>(out _))
{
selectedObject.name = "Failed" + selectedObject.name;
Debug.LogError("No agent component found. Please check that the CustomAgentWithoutModel prefab has an agent component.");
Debug.LogError("No agent component found. Please check that the CustomAgentWithoutModel prefab has an Agent component.");
return;
}
if (!selectedObject.TryGetComponent<Animator>(out var animator))
Expand All @@ -128,7 +128,7 @@ private static void CheckAnimatorAvatar()
if (animator.GetBoneTransform(HumanBodyBones.Hips) == null && animator.GetBoneTransform(HumanBodyBones.RightLowerArm) == null)
{
selectedObject.name = "Failed" + selectedObject.name;
Debug.LogError("The Avatar " + animator.avatar.name + " doesn't fit the provided model. Please change the Avatar to the Avatar that comes with the Model, i.g. MaxculineAnimationAvatar.");
Debug.LogError("The Avatar " + animator.avatar.name + " doesn't fit the provided model. Please change the Avatar to the Avatar that comes with the Model, e.g. MasculineAnimationAvatar.");
}
else
{
Expand All @@ -141,7 +141,7 @@ private static void CheckAnimatorAvatar()

private static void FixAnimationRiggingBasedOnAnimatoravatar(GameObject selectedObject, Animator animator)
{
//Add correct Source Objects to MeshSockets
// Add correct Source Objects to MeshSockets
WeightedTransform weightedTransform = new(animator.GetBoneTransform(HumanBodyBones.RightHand), 1.0f);
selectedObject.transform.Find("AnimationRigging/MeshSockets/RightHandSocket").GetComponent<MultiParentConstraint>().data.sourceObjects.Add(weightedTransform);
weightedTransform = new WeightedTransform(animator.GetBoneTransform(HumanBodyBones.LeftHand), 1.0f);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ protected virtual void Start()
{
if (agent == null)
{
Debug.LogError("No agent set in the inspector. Please set an agent or implement your own version of the SampleScheduleController to set agent in code.s");
Debug.LogError("No agent set in the inspector. Please set an agent or implement your own version of the SampleScheduleController to set agent in code.");
}
taskSystem = (ScheduleBasedTaskSystem)agent.TaskSystem;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3439,28 +3439,28 @@ MonoBehaviour:
m_EditorClassIdentifier:
title:
description: "This scene demonstrates how the agent can automatically and dynamically
look at objects that the agent is seeing. Here the agent walks past multiple
look at objects that the agent is seeing. Here, the agent walks past multiple
objects with the AdaptiveGazeTarget component and looks at them dynamically.
\r\nThe `AdaptiveGazeSampleController` adds multiple waypoint where the agent
\r\nThe `AdaptiveGazeSampleController` adds multiple waypoints where the agent
should walk. Optionally, the sample controller also provides options to overwrite
the adaptive gaze at the beginning for a specified `AimAtTime`. Alternatively,
while in play mode any object can be dragged into the `OverwriteGazeTarget` attribute
of the adaptive gaze component to make the agent look at it constantly.\nThe
`AdaptiveGazeSampleController` also showes an example of how the Shortcut Taskactions
can be used to adaptiv gazin. Activate `useTaskActionsForAdaptiveGaze` to use
that example in playmode.\n\nTo enable this feature the following needs to be
added:\n1. The agent needs a AdaptiveGaze component :\n1.2 Targets that can be
looked at need to be on specific layers, specified in `seeLayers`\n1.3 Objects
that should obstruct the view of the agent need to be on specific layers, specified
in `occlisonLayers`\n\n2 Objects that should be looked at need the AdaptiveGazeTarget
component\r\n 2.1 AdaptiveGazeTarget needs to be on one of the `seeLayers` that
was specified in the agent. The layer can be changed in the top right corner
of the inspector \r\n 2.2 (optional) A collider that makes sense for the Target,
if no target is added a standard collider will be added, see `ExampleOfAutoCollider`
in the sample scene\n\nUse the scene view during play mode to inspect the scene
freely while the agent is walking around.\nIf Objects are changed in the szene:
Select the GameObject \"NavMesh Surfave\" and bake the NavMesh again before running
the scene."
configured:\n1. The agent needs a AdaptiveGaze component :\n1.2 Targets that
can be looked at need to be on specific layers, specified in `seeLayers`\n1.3
Objects that should obstruct the view of the agent need to be on specific layers,
specified in `occlisonLayers`\n\n2 Objects that should be looked at need the
AdaptiveGazeTarget component\r\n 2.1 AdaptiveGazeTarget needs to be on one of
the `seeLayers` that was specified in the agent. The layer can be changed in
the top right corner of the inspector \r\n 2.2 (optional) A collider that makes
sense for the Target, if no target is added a standard collider will be added,
see `ExampleOfAutoCollider` in the sample scene\n\nUse the scene view during
play mode to inspect the scene freely while the agent is walking around.\nIf
Objects are changed in the szene: Select the GameObject \"NavMesh Surfave\" and
bake the NavMesh again before running the scene."
type: 0
url: https://rwth-acis.github.io/Virtual-Agents-Framework/1.2.1/manual/adaptive-gaze.html
--- !u!4 &1264251852
Expand Down Expand Up @@ -6146,6 +6146,10 @@ PrefabInstance:
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2054765473159481603, guid: 2962848ab48f0e4459691ff3d6d1eed0, type: 3}
propertyPath: seeLayers.m_Bits
value: 64
objectReference: {fileID: 0}
- target: {fileID: 6870636111335835452, guid: 2962848ab48f0e4459691ff3d6d1eed0, type: 3}
propertyPath: m_WarningMessage
value:
Expand Down

0 comments on commit 3dac918

Please sign in to comment.