@quenty/rigbuilderutils 3.1.2 → 3.2.1-canary.8533eea.0

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 CHANGED
@@ -3,6 +3,28 @@
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
+ ## [3.2.1-canary.8533eea.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/rigbuilderutils@3.2.0...@quenty/rigbuilderutils@3.2.1-canary.8533eea.0) (2021-12-18)
7
+
8
+
9
+ ### Features
10
+
11
+ * Add RigBuilderUtils.promiseR15Rig() and RigBuilderUtils.promisePlayerRig(userId) ([accf109](https://github.com/Quenty/NevermoreEngine/commit/accf10919ad4484aefa40a1f296ad928c8cb02d9))
12
+
13
+
14
+
15
+
16
+
17
+ # [3.2.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/rigbuilderutils@3.1.2...@quenty/rigbuilderutils@3.2.0) (2021-11-20)
18
+
19
+
20
+ ### Bug Fixes
21
+
22
+ * Support MacOS syncing ([#225](https://github.com/Quenty/NevermoreEngine/issues/225)) ([03f9183](https://github.com/Quenty/NevermoreEngine/commit/03f918392c6a5bdd33f8a17c38de371d1e06c67a))
23
+
24
+
25
+
26
+
27
+
6
28
  ## [3.1.2](https://github.com/Quenty/NevermoreEngine/compare/@quenty/rigbuilderutils@3.1.1...@quenty/rigbuilderutils@3.1.2) (2021-10-30)
7
29
 
8
30
  **Note:** Version bump only for package @quenty/rigbuilderutils
package/LICENSE.md CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2014 Quenty
3
+ Copyright (c) 2014-2021 Quenty
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quenty/rigbuilderutils",
3
- "version": "3.1.2",
3
+ "version": "3.2.1-canary.8533eea.0",
4
4
  "description": "Utility functions for debugging, builds a Roblox character rig",
5
5
  "keywords": [
6
6
  "Roblox",
@@ -26,16 +26,17 @@
26
26
  "Quenty"
27
27
  ],
28
28
  "dependencies": {
29
- "@quenty/insertserviceutils": "^3.1.2",
30
- "@quenty/loader": "^3.1.1",
31
- "@quenty/promise": "^3.1.2"
29
+ "@quenty/humanoiddescriptionutils": "3.2.1-canary.8533eea.0",
30
+ "@quenty/insertserviceutils": "3.2.1-canary.8533eea.0",
31
+ "@quenty/loader": "3.1.1",
32
+ "@quenty/promise": "3.2.1-canary.8533eea.0"
32
33
  },
33
34
  "devDependencies": {
34
- "@quenty/camerastoryutils": "^3.1.2",
35
- "@quenty/maid": "^2.0.1"
35
+ "@quenty/camerastoryutils": "3.2.1-canary.8533eea.0",
36
+ "@quenty/maid": "2.0.1"
36
37
  },
37
38
  "publishConfig": {
38
39
  "access": "public"
39
40
  },
40
- "gitHead": "e9cd4223c7fda7c852db9743ef844baa19cacb13"
41
+ "gitHead": "8533eeade3bf6835c0295785c1c326b9abee3222"
41
42
  }
@@ -1,11 +1,16 @@
1
- ---
1
+ --- Helps build player characters
2
2
  -- @module RigBuilderUtils
3
3
 
4
4
  local require = require(script.Parent.loader).load(script)
5
5
 
6
+ local ServerScriptService = game:GetService("ServerScriptService")
7
+ local HttpService = game:GetService("HttpService")
8
+
6
9
  local InsertServiceUtils = require("InsertServiceUtils")
7
10
  local PromiseUtils = require("PromiseUtils")
8
11
  local AssetServiceUtils = require("AssetServiceUtils")
12
+ local Promise = require("Promise")
13
+ local HumanoidDescriptionUtils = require("HumanoidDescriptionUtils")
9
14
 
10
15
  local RigBuilderUtils = {}
11
16
 
@@ -367,6 +372,33 @@ function RigBuilderUtils.promiseR15PackageRig(packageAssetId)
367
372
  end)
368
373
  end
369
374
 
375
+ function RigBuilderUtils.promiseR15Rig()
376
+ return InsertServiceUtils.promiseAsset(1664543044)
377
+ :Then(function(inserted)
378
+ local character = inserted:GetChildren()[1]
379
+ if not character then
380
+ return Promise.rejected("No character from model")
381
+ end
382
+
383
+ local humanoid = character:FindFirstChildOfClass("Humanoid")
384
+ if humanoid then
385
+ humanoid:BuildRigFromAttachments()
386
+ end
387
+
388
+ local r15Head = character:FindFirstChild("Head")
389
+
390
+ local existingFace = r15Head:FindFirstChild("face") or r15Head:FindFirstChild("Face")
391
+ if existingFace == nil then
392
+ local face = Instance.new("Decal")
393
+ face.Name = "face"
394
+ face.Texture = "rbxasset://textures/face.png"
395
+ face.Parent = r15Head
396
+ end
397
+
398
+ return character
399
+ end)
400
+ end
401
+
370
402
  function RigBuilderUtils.promiseR15ManRig()
371
403
  return RigBuilderUtils.promiseR15PackageRig(86500185)
372
404
  end
@@ -379,4 +411,38 @@ function RigBuilderUtils.promiseR15MeshRig()
379
411
  return RigBuilderUtils.promiseR15PackageRig(27112438)
380
412
  end
381
413
 
414
+ function RigBuilderUtils.promisePlayerRig(userId)
415
+ assert(type(userId) == "number", "Bad userId")
416
+
417
+ return PromiseUtils.all({
418
+ RigBuilderUtils.promiseR15Rig(),
419
+ HumanoidDescriptionUtils.promiseFromUserId(userId)
420
+ }):Then(function(meshRig, humanoidDescription)
421
+ local humanoid = meshRig:FindFirstChildWhichIsA("Humanoid")
422
+ if not humanoid then
423
+ return Promise.rejected("No humanoid from rig builder")
424
+ end
425
+
426
+ meshRig.Archivable = false
427
+ local originalName = meshRig.Name
428
+
429
+ -- Hack! Apparently we need to parent this to the datamodel to apply the description
430
+ meshRig.Name = "RigBuilderUtils_LoadingHumanoid_" .. HttpService:GenerateGUID(false)
431
+ meshRig.Parent = ServerScriptService -- somewhere that does not replicate
432
+
433
+ return HumanoidDescriptionUtils.promiseApplyDescription(humanoid, humanoidDescription)
434
+ :Then(function()
435
+ meshRig.Parent = nil
436
+ meshRig.Archivable = true
437
+ meshRig.Name = originalName
438
+
439
+ return meshRig
440
+ end, function(...)
441
+ -- cleanup
442
+ meshRig:Destroy()
443
+ return Promise.rejected(...)
444
+ end)
445
+ end)
446
+ end
447
+
382
448
  return RigBuilderUtils
@@ -4,6 +4,8 @@
4
4
 
5
5
  local require = require(game:GetService("ServerScriptService"):FindFirstChild("LoaderUtils", true).Parent).load(script)
6
6
 
7
+ local Workspace = game:GetService("Workspace")
8
+
7
9
  local Maid = require("Maid")
8
10
  local RigBuilderUtils = require("RigBuilderUtils")
9
11
  local CameraStoryUtils = require("CameraStoryUtils")
@@ -13,12 +15,12 @@ local function spawnRig(offset, maid, viewportFrame, rig)
13
15
  maid:GiveTask(rig)
14
16
 
15
17
  -- Is Roblox being weird about this? Yes.
16
- rig.Parent = workspace
18
+ rig.Parent = Workspace
17
19
  spawn(function()
18
20
  rig.Parent = viewportFrame
19
21
  end)
20
22
 
21
- rig:SetPrimaryPartCFrame(workspace.CurrentCamera.CFrame
23
+ rig:SetPrimaryPartCFrame(Workspace.CurrentCamera.CFrame
22
24
  * CFrame.new(0, 0, -15)
23
25
  * CFrame.new(offset, 0, 0)
24
26
  * CFrame.Angles(0, math.pi, 0))
@@ -37,6 +39,10 @@ return function(target)
37
39
  RigBuilderUtils.promiseR15ManRig(),
38
40
  RigBuilderUtils.promiseR15WomanRig(),
39
41
  RigBuilderUtils.promiseR15MeshRig(),
42
+ RigBuilderUtils.promiseR15Rig(),
43
+ RigBuilderUtils.promisePlayerRig(4397833),
44
+ RigBuilderUtils.promisePlayerRig(9360463),
45
+ RigBuilderUtils.promisePlayerRig(676056)
40
46
  }
41
47
 
42
48
  for index, rig in pairs(rigs) do
@@ -2,6 +2,6 @@
2
2
  "name": "node_modules",
3
3
  "globIgnorePaths": [ "**/.package-lock.json" ],
4
4
  "tree": {
5
- "$path": { "optional": "..\\node_modules" }
5
+ "$path": { "optional": "../node_modules" }
6
6
  }
7
7
  }