Skip to content

Commit 03e21dd

Browse files
authored
Merge pull request #399 from stride3d/master
Deploy latest documentation updates to staging
2 parents 30e4948 + 56097ad commit 03e21dd

30 files changed

+218
-115
lines changed

en/contributors/documentation/major-release-workflow.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,5 @@ The `BuildDocs.ps1` script will manage the deployment to the `4.2` folder while
3434
- Update SDK version references
3535
1. Modify `manual\troubleshooting\stride-doesnt-run.md`
3636
- Update SDK version references
37+
1. Modify `manual\files-and-folders\distribute-a-game.md`
38+
- Update SDK version references

en/manual/animation/additive-animation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,4 +137,4 @@ You can use additive animations with animations that use the same skeleton and s
137137
* [Animation scripts](animation-scripts.md)
138138
* [Procedural animation](procedural-animation.md)
139139
* [Custom blend trees](custom-blend-trees.md)
140-
* [custom attributes](custom-attributes.md)
140+
* [Custom attributes](custom-attributes.md)

en/manual/animation/animation-scripts.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,4 +110,4 @@ You can also override the animation blend tree and do all animation blending in
110110
* [Procedural animation](procedural-animation.md)
111111
* [Custom blend trees](custom-blend-trees.md)
112112
* [Model node links](model-node-links.md)
113-
* [custom attributes](custom-attributes.md)
113+
* [Custom attributes](custom-attributes.md)

en/manual/animation/custom-blend-trees.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,4 +108,4 @@ public class AnimationBlendTree : SyncScript, IBlendTreeBuilder
108108
* [Additive animation](additive-animation.md)
109109
* [Procedural animation](procedural-animation.md)
110110
* [Model node links](model-node-links.md)
111-
* [custom attributes](custom-attributes.md)
111+
* [Custom attributes](custom-attributes.md)

en/manual/animation/import-animations.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,4 +63,4 @@ To use an animation asset, add an [AnimationComponent](xref:Stride.Engine.Animat
6363
* [Procedural animation](procedural-animation.md)
6464
* [Custom blend trees](custom-blend-trees.md)
6565
* [Model node links](model-node-links.md)
66-
* [custom attributes](custom-attributes.md)
66+
* [Custom attributes](custom-attributes.md)

en/manual/animation/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,4 +53,4 @@ The templates **First-person shooter**, **Third-person platformer** and **Top-do
5353
* [Procedural animation](procedural-animation.md)
5454
* [Custom blend trees](custom-blend-trees.md)
5555
* [Model node links](model-node-links.md)
56-
* [custom attributes](custom-attributes.md)
56+
* [Custom attributes](custom-attributes.md)

en/manual/animation/model-node-links.md

Lines changed: 44 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,15 @@ The **model node link** component attaches an entity to a node of a skeleton on
1010

1111
For example, imagine you have two models: a knight, and a sword. The character has a sword swinging animation. You can use a model link node to place the sword in the knight's hand and attach it to the correct node in the knight skeleton, so the sword swings with the knight animation.
1212

13-
<p>
13+
<div class="ratio ratio-16x9 mb-3">
1414
<video autoplay loop class="responsive-video" poster="../particles/tutorials/media/sword-slash-1.jpg">
1515
<source src="../particles/tutorials/media/sword-slash-1.mp4" type="video/mp4">
1616
</video>
17-
</p>
17+
</div>
1818

1919
## Set up a model node link component
2020

2121
1. In the **Scene Editor**, select the entity you want to link to a node in another entity.
22-
2322
2. In the **Property Grid**, click **Add component** and select **Model node link**.
2423

2524
![Add component](../particles/tutorials/media/add-model-node-link.png)
@@ -38,11 +37,11 @@ For example, imagine you have two models: a knight, and a sword. The character h
3837

3938
4. Select the model you want to link the entity to and click **OK**.
4039

41-
>[!Note]
42-
>The entity you link to must have a model with a skeleton, even if the model isn't visible at runtime.
40+
> [!Note]
41+
> The entity you link to must have a model with a skeleton, even if the model isn't visible at runtime.
4342
44-
>[!Tip]
45-
>If you don't specify a model, Stride links the entity to the model on the parent entity.
43+
> [!Tip]
44+
> If you don't specify a model, Stride links the entity to the model on the parent entity.
4645
4746
5. In **Node name**, select the node in the model you want to attach this entity to.
4847

@@ -58,8 +57,43 @@ To add an offset to the linked entity, use the entity's [TransformComponent](xre
5857

5958
![Transform](media/transform-component.png)
6059

61-
>[!Note]
62-
>If you don't want to add an offset, make sure the values are all set to `0,0,0`.
60+
> [!Note]
61+
> If you don't want to add an offset, make sure the values are all set to `0,0,0`.
62+
63+
## Example script
64+
65+
This script demonstrates how to link one entity (such as a `SwordModel`) to a specific bone (`weapon_bone_R`) in another entity's skeleton hierarchy (in this case, the `mannequinModel`) using Stride's `ModelNodeLinkComponent`.
66+
67+
```csharp
68+
public class BoneLink : StartupScript
69+
{
70+
// This example assumes you've created a project with the default Stride models
71+
// "mannequinModel" and "SwordModel." Add them from the "Assets/Models" folder to your scene,
72+
// and then attach this script to the "SwordModel" entity
73+
74+
ModelNodeLinkComponent boneLink;
75+
76+
public override void Start()
77+
{
78+
// Initialize the script
79+
// Here we locate the entity named "mannequinModel" by searching the root scene's entities
80+
Entity owner = SceneSystem.SceneInstance.RootScene.Entities.Where(e => e.Name == "mannequinModel").Single();
81+
82+
boneLink = new ModelNodeLinkComponent
83+
{
84+
// This is the ModelComponent on the target entity (mannequinModel)
85+
Target = owner.Get<ModelComponent>(),
86+
87+
// We set a "hard link" to Nodes[70], which corresponds to "weapon_bone_R"
88+
// in the target's skeleton hierarchy
89+
NodeName = owner.Get<ModelComponent>().Model.Skeleton.Nodes[70].Name
90+
};
91+
92+
// Finally, add this link component to our current (SwordModel) entity
93+
base.Entity.Components.Add(boneLink);
94+
}
95+
}
96+
```
6397

6498
## See also
6599

@@ -71,7 +105,7 @@ To add an offset to the linked entity, use the entity's [TransformComponent](xre
71105
* [Additive animation](additive-animation.md)
72106
* [Procedural animation](procedural-animation.md)
73107
* [Custom blend trees](custom-blend-trees.md)
74-
* [custom attributes](custom-attributes.md)
108+
* [Custom attributes](custom-attributes.md)
75109

76110
For examples of how model node links are used, see:
77111

en/manual/animation/preview-animations.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,4 +48,4 @@ The animation preview uses the model selected in the **preview model** in the **
4848
* [Procedural animation](procedural-animation.md)
4949
* [Custom blend trees](custom-blend-trees.md)
5050
* [Model node links](model-node-links.md)
51-
* [custom attributes](custom-attributes.md)
51+
* [Custom attributes](custom-attributes.md)

en/manual/animation/procedural-animation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,4 +139,4 @@ public class AnimationLight : StartupScript
139139
* [Additive animation](additive-animation.md)
140140
* [Custom blend trees](custom-blend-trees.md)
141141
* [Model node links](model-node-links.md)
142-
* [custom attributes](custom-attributes.md)
142+
* [Custom attributes](custom-attributes.md)

en/manual/animation/set-up-animations.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,13 @@ After you add animations to an entity, you need to play them with a [script](../
5555
### Example script
5656

5757
```cs
58-
public class SimpleAnimationScript : StartupScript
58+
public class SimpleAnimationScript : StartupScript
59+
{
60+
public override void Start()
5961
{
60-
public override void Start()
61-
{
62-
Entity.Get<AnimationComponent>().Play("Walk");
63-
}
62+
Entity.Get<AnimationComponent>().Play("Walk");
6463
}
64+
}
6565
```
6666

6767
This script looks for an animation with the name *Walk* under the animation component on the entity.
@@ -93,4 +93,4 @@ Game Studio adds the script as a component. You can adjust [public variables you
9393
* [Procedural animation](procedural-animation.md)
9494
* [Custom blend trees](custom-blend-trees.md)
9595
* [Model node links](model-node-links.md)
96-
* [custom attributes](custom-attributes.md)
96+
* [Custom attributes](custom-attributes.md)

0 commit comments

Comments
 (0)