@quenty/animationgroup 10.8.0 → 10.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +11 -0
- package/package.json +6 -6
- package/src/Shared/AnimationGroup.lua +2 -2
- package/src/Shared/AnimationGroupUtils.lua +14 -10
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,17 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [10.8.1](https://github.com/Quenty/NevermoreEngine/compare/@quenty/animationgroup@10.8.0...@quenty/animationgroup@10.8.1) (2025-04-05)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* Add types to packages ([2374fb2](https://github.com/Quenty/NevermoreEngine/commit/2374fb2b043cfbe0e9b507b3316eec46a4e353a0))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
6
17
|
# [10.8.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/animationgroup@10.7.1...@quenty/animationgroup@10.8.0) (2025-02-18)
|
|
7
18
|
|
|
8
19
|
**Note:** Version bump only for package @quenty/animationgroup
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quenty/animationgroup",
|
|
3
|
-
"version": "10.8.
|
|
3
|
+
"version": "10.8.1",
|
|
4
4
|
"description": "A group of weighted tracks that can be played back with weighted probability. The closest example to this is the idle animation that looks around at a 1:10 ratio when you're standing still in default Roblox animation script.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Roblox",
|
|
@@ -26,13 +26,13 @@
|
|
|
26
26
|
"Quenty"
|
|
27
27
|
],
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@quenty/animationtrackutils": "^2.2.
|
|
30
|
-
"@quenty/baseobject": "^10.8.
|
|
31
|
-
"@quenty/loader": "^10.8.
|
|
32
|
-
"@quenty/maid": "^3.4.
|
|
29
|
+
"@quenty/animationtrackutils": "^2.2.1",
|
|
30
|
+
"@quenty/baseobject": "^10.8.1",
|
|
31
|
+
"@quenty/loader": "^10.8.1",
|
|
32
|
+
"@quenty/maid": "^3.4.1"
|
|
33
33
|
},
|
|
34
34
|
"publishConfig": {
|
|
35
35
|
"access": "public"
|
|
36
36
|
},
|
|
37
|
-
"gitHead": "
|
|
37
|
+
"gitHead": "78c3ac0ab08dd18085b6e6e6e4f745e76ed99f68"
|
|
38
38
|
}
|
|
@@ -52,13 +52,13 @@ end
|
|
|
52
52
|
|
|
53
53
|
--[=[
|
|
54
54
|
@param weightedTracks { WeightedTrack }
|
|
55
|
-
@param transitionTime number
|
|
55
|
+
@param transitionTime number?
|
|
56
56
|
]=]
|
|
57
57
|
function AnimationGroup:SetWeightedTracks(weightedTracks, transitionTime)
|
|
58
58
|
assert(type(weightedTracks) == "table", "Bad weightedTracks")
|
|
59
59
|
assert(type(transitionTime) == "number" or transitionTime == nil, "Bad transitionTime")
|
|
60
60
|
|
|
61
|
-
for _, animation in
|
|
61
|
+
for _, animation in weightedTracks do
|
|
62
62
|
assert(animation.track, "Bad animation.track")
|
|
63
63
|
assert(animation.weight, "Bad animation.weight")
|
|
64
64
|
end
|
|
@@ -37,13 +37,17 @@ function AnimationGroupUtils.createdWeightedTracks(animatorOrHumanoid, weightedA
|
|
|
37
37
|
|
|
38
38
|
local tracks = {}
|
|
39
39
|
|
|
40
|
-
for _, weightedAnimation in
|
|
40
|
+
for _, weightedAnimation in weightedAnimationList do
|
|
41
41
|
assert(weightedAnimation.animationId, "Bad weightedAnimation.animationId")
|
|
42
42
|
assert(weightedAnimation.weight, "Bad weightedAnimation.weight")
|
|
43
43
|
|
|
44
|
-
table.insert(
|
|
45
|
-
|
|
46
|
-
|
|
44
|
+
table.insert(
|
|
45
|
+
tracks,
|
|
46
|
+
AnimationGroupUtils.createdWeightedTrack(
|
|
47
|
+
AnimationTrackUtils.loadAnimationFromId(animatorOrHumanoid, weightedAnimation.animationId),
|
|
48
|
+
weightedAnimation.weight
|
|
49
|
+
)
|
|
50
|
+
)
|
|
47
51
|
end
|
|
48
52
|
|
|
49
53
|
return tracks
|
|
@@ -61,8 +65,8 @@ function AnimationGroupUtils.createdWeightedAnimation(animationId, weight)
|
|
|
61
65
|
assert(type(weight) == "number", "Bad weight")
|
|
62
66
|
|
|
63
67
|
return {
|
|
64
|
-
animationId = animationId
|
|
65
|
-
weight = weight
|
|
68
|
+
animationId = animationId,
|
|
69
|
+
weight = weight,
|
|
66
70
|
}
|
|
67
71
|
end
|
|
68
72
|
|
|
@@ -78,8 +82,8 @@ function AnimationGroupUtils.createdWeightedTrack(track, weight)
|
|
|
78
82
|
assert(type(weight) == "number", "Bad weight")
|
|
79
83
|
|
|
80
84
|
return {
|
|
81
|
-
track = track
|
|
82
|
-
weight = weight
|
|
85
|
+
track = track,
|
|
86
|
+
weight = weight,
|
|
83
87
|
}
|
|
84
88
|
end
|
|
85
89
|
|
|
@@ -98,7 +102,7 @@ function AnimationGroupUtils.selectFromWeightedTracks(weightedTracks)
|
|
|
98
102
|
end
|
|
99
103
|
|
|
100
104
|
local totalWeight = 0
|
|
101
|
-
for _, animationData in
|
|
105
|
+
for _, animationData in weightedTracks do
|
|
102
106
|
totalWeight = totalWeight + animationData.weight
|
|
103
107
|
end
|
|
104
108
|
|
|
@@ -107,7 +111,7 @@ function AnimationGroupUtils.selectFromWeightedTracks(weightedTracks)
|
|
|
107
111
|
local selection = math.random()
|
|
108
112
|
|
|
109
113
|
local total = 0
|
|
110
|
-
for _, option in
|
|
114
|
+
for _, option in weightedTracks do
|
|
111
115
|
local threshold = total + option.weight/totalWeight
|
|
112
116
|
total = total + threshold
|
|
113
117
|
|