From 88efbd433f12d3d05468a10c965b06009d2e9ecf Mon Sep 17 00:00:00 2001 From: Kenneth Loeffler Date: Tue, 20 Feb 2024 12:22:27 -0800 Subject: [PATCH] Backport #868 to 7.4 (custom pivot geter/setter) (#869) This PR backports some changes to rbx_dom_lua to fix serving model pivots --- CHANGELOG.md | 2 + plugin/rbx_dom_lua/EncodedValue.lua | 23 + plugin/rbx_dom_lua/allValues.json | 35 ++ plugin/rbx_dom_lua/customProperties.lua | 12 + plugin/rbx_dom_lua/database.json | 543 +++++++++++++++++++----- 5 files changed, 518 insertions(+), 97 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 675b02f4b..6f0f7a787 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ## Unreleased Changes * Fixed incorrect results when building model pivots ([#865]) +* Fixed incorrect results when serving model pivots ([#868]) * Rojo now converts any line endings to LF, preventing spurious diffs when syncing Lua files on Windows ([#854]) * Fixed Rojo plugin failing to connect when project contains certain unreadable properties ([#848]) * Fixed various cases where patch visualizer would not display sync failures ([#845], [#844]) @@ -13,6 +14,7 @@ [#847]: https://github.com/rojo-rbx/rojo/pull/847 [#854]: https://github.com/rojo-rbx/rojo/pull/854 [#865]: https://github.com/rojo-rbx/rojo/pull/865 +[#868]: https://github.com/rojo-rbx/rojo/pull/868 ## [7.4.0] - January 16, 2024 * Improved the visualization for array properties like Tags ([#829]) diff --git a/plugin/rbx_dom_lua/EncodedValue.lua b/plugin/rbx_dom_lua/EncodedValue.lua index e9dd0edd4..f2e9e3434 100644 --- a/plugin/rbx_dom_lua/EncodedValue.lua +++ b/plugin/rbx_dom_lua/EncodedValue.lua @@ -493,9 +493,32 @@ types = { }, } +types.OptionalCFrame = { + fromPod = function(pod) + if pod == nil then + return nil + else + return types.CFrame.fromPod(pod) + end + end, + + toPod = function(roblox) + if roblox == nil then + return nil + else + return types.CFrame.toPod(roblox) + end + end, +} + function EncodedValue.decode(encodedValue) local ty, value = next(encodedValue) + if ty == nil then + -- If the encoded pair is empty, assume it is an unoccupied optional value + return true, nil + end + local typeImpl = types[ty] if typeImpl == nil then return false, "Couldn't decode value " .. tostring(ty) diff --git a/plugin/rbx_dom_lua/allValues.json b/plugin/rbx_dom_lua/allValues.json index b233ab25b..9b07d7bf0 100644 --- a/plugin/rbx_dom_lua/allValues.json +++ b/plugin/rbx_dom_lua/allValues.json @@ -370,6 +370,41 @@ }, "ty": "NumberSequence" }, + "OptionalCFrame-None": { + "value": { + "OptionalCFrame": null + }, + "ty": "OptionalCFrame" + }, + "OptionalCFrame-Some": { + "value": { + "OptionalCFrame": { + "position": [ + 0.0, + 0.0, + 0.0 + ], + "orientation": [ + [ + 1.0, + 0.0, + 0.0 + ], + [ + 0.0, + 1.0, + 0.0 + ], + [ + 0.0, + 0.0, + 1.0 + ] + ] + } + }, + "ty": "OptionalCFrame" + }, "PhysicalProperties-Custom": { "value": { "PhysicalProperties": { diff --git a/plugin/rbx_dom_lua/customProperties.lua b/plugin/rbx_dom_lua/customProperties.lua index 072db9ef0..f115f7c82 100644 --- a/plugin/rbx_dom_lua/customProperties.lua +++ b/plugin/rbx_dom_lua/customProperties.lua @@ -111,6 +111,18 @@ return { return true, instance:ScaleTo(value) end, }, + WorldPivotData = { + read = function(instance) + return true, instance:GetPivot() + end, + write = function(instance, _, value) + if value == nil then + return true, nil + else + return true, instance:PivotTo(value) + end + end, + }, }, Terrain = { MaterialColors = { diff --git a/plugin/rbx_dom_lua/database.json b/plugin/rbx_dom_lua/database.json index 81424b27e..34be08b46 100644 --- a/plugin/rbx_dom_lua/database.json +++ b/plugin/rbx_dom_lua/database.json @@ -1,9 +1,9 @@ { "Version": [ 0, - 607, + 612, 0, - 6070550 + 6120532 ], "Classes": { "Accessory": { @@ -345,6 +345,17 @@ } } }, + "ActivityHistoryService": { + "Name": "ActivityHistoryService", + "Tags": [ + "NotCreatable", + "NotReplicated", + "Service" + ], + "Superclass": "Instance", + "Properties": {}, + "DefaultProperties": {} + }, "Actor": { "Name": "Actor", "Tags": [], @@ -11172,10 +11183,12 @@ "DataType": { "Value": "CFrame" }, - "Tags": [], + "Tags": [ + "Hidden" + ], "Kind": { "Canonical": { - "Serialization": "Serializes" + "Serialization": "DoesNotSerialize" } } }, @@ -11185,10 +11198,12 @@ "DataType": { "Value": "Int32" }, - "Tags": [], + "Tags": [ + "Hidden" + ], "Kind": { "Canonical": { - "Serialization": "Serializes" + "Serialization": "DoesNotSerialize" } } }, @@ -11198,10 +11213,12 @@ "DataType": { "Value": "String" }, - "Tags": [], + "Tags": [ + "Hidden" + ], "Kind": { "Canonical": { - "Serialization": "Serializes" + "Serialization": "DoesNotSerialize" } } }, @@ -11211,22 +11228,38 @@ "DataType": { "Value": "Int32" }, - "Tags": [], + "Tags": [ + "Hidden" + ], "Kind": { "Canonical": { - "Serialization": "Serializes" + "Serialization": "DoesNotSerialize" + } + } + }, + "IsIdle": { + "Name": "IsIdle", + "Scriptability": "ReadWrite", + "DataType": { + "Value": "Bool" + }, + "Tags": [ + "Hidden" + ], + "Kind": { + "Canonical": { + "Serialization": "DoesNotSerialize" } } }, "Status": { "Name": "Status", - "Scriptability": "None", + "Scriptability": "ReadWrite", "DataType": { "Enum": "CollaboratorStatus" }, "Tags": [ - "Hidden", - "NotScriptable" + "Hidden" ], "Kind": { "Canonical": { @@ -11240,10 +11273,12 @@ "DataType": { "Value": "Int64" }, - "Tags": [], + "Tags": [ + "Hidden" + ], "Kind": { "Canonical": { - "Serialization": "Serializes" + "Serialization": "DoesNotSerialize" } } }, @@ -11253,10 +11288,12 @@ "DataType": { "Value": "String" }, - "Tags": [], + "Tags": [ + "Hidden" + ], "Kind": { "Canonical": { - "Serialization": "Serializes" + "Serialization": "DoesNotSerialize" } } } @@ -12224,6 +12261,19 @@ "Serialization": "Serializes" } } + }, + "UpDirection": { + "Name": "UpDirection", + "Scriptability": "ReadWrite", + "DataType": { + "Value": "Vector3" + }, + "Tags": [], + "Kind": { + "Canonical": { + "Serialization": "Serializes" + } + } } }, "DefaultProperties": { @@ -12261,6 +12311,13 @@ }, "Tags": { "Tags": [] + }, + "UpDirection": { + "Vector3": [ + 0.0, + 1.0, + 0.0 + ] } } }, @@ -13286,7 +13343,9 @@ "DataType": { "Value": "Bool" }, - "Tags": [], + "Tags": [ + "Deprecated" + ], "Kind": { "Canonical": { "Serialization": "Serializes" @@ -15878,6 +15937,19 @@ } } }, + "PermissionPolicy": { + "Name": "PermissionPolicy", + "Scriptability": "ReadWrite", + "DataType": { + "Enum": "DragDetectorPermissionPolicy" + }, + "Tags": [], + "Kind": { + "Canonical": { + "Serialization": "Serializes" + } + } + }, "PhysicalDragClickedPart": { "Name": "PhysicalDragClickedPart", "Scriptability": "None", @@ -16168,10 +16240,13 @@ "Orientation": { "Vector3": [ -0.0, - 180.0, + 179.99998, 90.0 ] }, + "PermissionPolicy": { + "Enum": 1 + }, "ResponseStyle": { "Enum": 1 }, @@ -22285,7 +22360,9 @@ "DataType": { "Value": "Bool" }, - "Tags": [], + "Tags": [ + "Deprecated" + ], "Kind": { "Canonical": { "Serialization": "Serializes" @@ -31232,7 +31309,7 @@ }, "WorldPivotData": { "Name": "WorldPivotData", - "Scriptability": "None", + "Scriptability": "Custom", "DataType": { "Value": "OptionalCFrame" }, @@ -33071,7 +33148,7 @@ }, "SerializedDefaultAttributes": { "Name": "SerializedDefaultAttributes", - "Scriptability": "Read", + "Scriptability": "None", "DataType": { "Value": "BinaryString" }, @@ -35022,6 +35099,19 @@ "Serialization": "Serializes" } } + }, + "ZIndex": { + "Name": "ZIndex", + "Scriptability": "None", + "DataType": { + "Value": "Int32" + }, + "Tags": [], + "Kind": { + "Canonical": { + "Serialization": "Serializes" + } + } } }, "DefaultProperties": {} @@ -35734,6 +35824,58 @@ } } }, + "DrawConstraintsNetForce": { + "Name": "DrawConstraintsNetForce", + "Scriptability": "None", + "DataType": { + "Value": "Bool" + }, + "Tags": [], + "Kind": { + "Canonical": { + "Serialization": "Serializes" + } + } + }, + "DrawContactsNetForce": { + "Name": "DrawContactsNetForce", + "Scriptability": "None", + "DataType": { + "Value": "Bool" + }, + "Tags": [], + "Kind": { + "Canonical": { + "Serialization": "Serializes" + } + } + }, + "DrawTotalNetForce": { + "Name": "DrawTotalNetForce", + "Scriptability": "None", + "DataType": { + "Value": "Bool" + }, + "Tags": [], + "Kind": { + "Canonical": { + "Serialization": "Serializes" + } + } + }, + "EnableForceVisualizationSmoothing": { + "Name": "EnableForceVisualizationSmoothing", + "Scriptability": "None", + "DataType": { + "Value": "Bool" + }, + "Tags": [], + "Kind": { + "Canonical": { + "Serialization": "Serializes" + } + } + }, "FluidForceDrawScale": { "Name": "FluidForceDrawScale", "Scriptability": "None", @@ -35776,6 +35918,19 @@ } } }, + "ForceVisualizationSmoothingSteps": { + "Name": "ForceVisualizationSmoothingSteps", + "Scriptability": "None", + "DataType": { + "Value": "Int32" + }, + "Tags": [], + "Kind": { + "Canonical": { + "Serialization": "Serializes" + } + } + }, "IsInterpolationThrottleShown": { "Name": "IsInterpolationThrottleShown", "Scriptability": "ReadWrite", @@ -35893,6 +36048,19 @@ } } }, + "TorqueDrawScale": { + "Name": "TorqueDrawScale", + "Scriptability": "None", + "DataType": { + "Value": "Float32" + }, + "Tags": [], + "Kind": { + "Canonical": { + "Serialization": "Serializes" + } + } + }, "UseCSGv2": { "Name": "UseCSGv2", "Scriptability": "ReadWrite", @@ -38337,6 +38505,17 @@ } } }, + "ProjectFolderService": { + "Name": "ProjectFolderService", + "Tags": [ + "NotCreatable", + "NotReplicated", + "Service" + ], + "Superclass": "Instance", + "Properties": {}, + "DefaultProperties": {} + }, "ProximityPrompt": { "Name": "ProximityPrompt", "Tags": [], @@ -40859,6 +41038,19 @@ } } }, + "PreferredUploadId": { + "Name": "PreferredUploadId", + "Scriptability": "ReadWrite", + "DataType": { + "Value": "Int64" + }, + "Tags": [], + "Kind": { + "Canonical": { + "Serialization": "Serializes" + } + } + }, "RestPose": { "Name": "RestPose", "Scriptability": "ReadWrite", @@ -44505,7 +44697,9 @@ "DataType": { "Value": "Bool" }, - "Tags": [], + "Tags": [ + "Deprecated" + ], "Kind": { "Canonical": { "Serialization": "Serializes" @@ -46931,21 +47125,6 @@ } } }, - "AnimationCompositorMode": { - "Name": "AnimationCompositorMode", - "Scriptability": "ReadWrite", - "DataType": { - "Enum": "AnimationCompositorMode" - }, - "Tags": [ - "NotBrowsable" - ], - "Kind": { - "Canonical": { - "Serialization": "Serializes" - } - } - }, "AutoJumpEnabled": { "Name": "AutoJumpEnabled", "Scriptability": "ReadWrite", @@ -47488,21 +47667,6 @@ } } }, - "HumanoidStateMachineMode": { - "Name": "HumanoidStateMachineMode", - "Scriptability": "ReadWrite", - "DataType": { - "Enum": "HumanoidStateMachineMode" - }, - "Tags": [ - "NotBrowsable" - ], - "Kind": { - "Canonical": { - "Serialization": "Serializes" - } - } - }, "LoadCharacterAppearance": { "Name": "LoadCharacterAppearance", "Scriptability": "ReadWrite", @@ -47594,9 +47758,6 @@ "AllowCustomAnimations": { "Bool": true }, - "AnimationCompositorMode": { - "Enum": 0 - }, "Attributes": { "Attributes": {} }, @@ -47729,9 +47890,6 @@ "HealthDisplayDistance": { "Float32": 100.0 }, - "HumanoidStateMachineMode": { - "Enum": 0 - }, "LoadCharacterAppearance": { "Bool": true }, @@ -48619,6 +48777,136 @@ } } }, + "DraggerActiveColor": { + "Name": "DraggerActiveColor", + "Scriptability": "None", + "DataType": { + "Value": "Color3" + }, + "Tags": [], + "Kind": { + "Canonical": { + "Serialization": "Serializes" + } + } + }, + "DraggerMajorGridIncrement": { + "Name": "DraggerMajorGridIncrement", + "Scriptability": "None", + "DataType": { + "Value": "Int32" + }, + "Tags": [], + "Kind": { + "Canonical": { + "Serialization": "Serializes" + } + } + }, + "DraggerMaxSoftSnaps": { + "Name": "DraggerMaxSoftSnaps", + "Scriptability": "None", + "DataType": { + "Value": "Int32" + }, + "Tags": [], + "Kind": { + "Canonical": { + "Serialization": "Serializes" + } + } + }, + "DraggerPassiveColor": { + "Name": "DraggerPassiveColor", + "Scriptability": "None", + "DataType": { + "Value": "Color3" + }, + "Tags": [], + "Kind": { + "Canonical": { + "Serialization": "Serializes" + } + } + }, + "DraggerShowHoverRuler": { + "Name": "DraggerShowHoverRuler", + "Scriptability": "None", + "DataType": { + "Value": "Bool" + }, + "Tags": [], + "Kind": { + "Canonical": { + "Serialization": "Serializes" + } + } + }, + "DraggerShowMeasurement": { + "Name": "DraggerShowMeasurement", + "Scriptability": "None", + "DataType": { + "Value": "Bool" + }, + "Tags": [], + "Kind": { + "Canonical": { + "Serialization": "Serializes" + } + } + }, + "DraggerShowTargetSnap": { + "Name": "DraggerShowTargetSnap", + "Scriptability": "None", + "DataType": { + "Value": "Bool" + }, + "Tags": [], + "Kind": { + "Canonical": { + "Serialization": "Serializes" + } + } + }, + "DraggerSoftSnapMarginFactor": { + "Name": "DraggerSoftSnapMarginFactor", + "Scriptability": "None", + "DataType": { + "Value": "Float32" + }, + "Tags": [], + "Kind": { + "Canonical": { + "Serialization": "Serializes" + } + } + }, + "DraggerSummonMarginFactor": { + "Name": "DraggerSummonMarginFactor", + "Scriptability": "None", + "DataType": { + "Value": "Float32" + }, + "Tags": [], + "Kind": { + "Canonical": { + "Serialization": "Serializes" + } + } + }, + "DraggerTiltRotateDuration": { + "Name": "DraggerTiltRotateDuration", + "Scriptability": "None", + "DataType": { + "Value": "Float32" + }, + "Tags": [], + "Kind": { + "Canonical": { + "Serialization": "Serializes" + } + } + }, "Enable Autocomplete": { "Name": "Enable Autocomplete", "Scriptability": "ReadWrite", @@ -55907,6 +56195,17 @@ "Properties": {}, "DefaultProperties": {} }, + "TextureGenerationService": { + "Name": "TextureGenerationService", + "Tags": [ + "NotCreatable", + "NotReplicated", + "Service" + ], + "Superclass": "Instance", + "Properties": {}, + "DefaultProperties": {} + }, "ThirdPartyUserService": { "Name": "ThirdPartyUserService", "Tags": [ @@ -59590,6 +59889,22 @@ } } }, + "ChatTranslationLocale": { + "Name": "ChatTranslationLocale", + "Scriptability": "None", + "DataType": { + "Value": "String" + }, + "Tags": [ + "Hidden", + "NotReplicated" + ], + "Kind": { + "Canonical": { + "Serialization": "Serializes" + } + } + }, "ChatTranslationToggleEnabled": { "Name": "ChatTranslationToggleEnabled", "Scriptability": "None", @@ -59724,6 +60039,22 @@ } } }, + "FramerateCap": { + "Name": "FramerateCap", + "Scriptability": "None", + "DataType": { + "Value": "Int32" + }, + "Tags": [ + "Hidden", + "NotReplicated" + ], + "Kind": { + "Canonical": { + "Serialization": "Serializes" + } + } + }, "Fullscreen": { "Name": "Fullscreen", "Scriptability": "None", @@ -61068,6 +61399,7 @@ "VRService": { "Name": "VRService", "Tags": [ + "NotBrowsable", "NotCreatable", "Service" ], @@ -61084,7 +61416,22 @@ ], "Kind": { "Canonical": { - "Serialization": "DoesNotSerialize" + "Serialization": "Serializes" + } + } + }, + "AvatarGestures": { + "Name": "AvatarGestures", + "Scriptability": "ReadWrite", + "DataType": { + "Value": "Bool" + }, + "Tags": [ + "NotBrowsable" + ], + "Kind": { + "Canonical": { + "Serialization": "Serializes" } } }, @@ -61111,10 +61458,12 @@ "DataType": { "Value": "Bool" }, - "Tags": [], + "Tags": [ + "NotReplicated" + ], "Kind": { "Canonical": { - "Serialization": "DoesNotSerialize" + "Serialization": "Serializes" } } }, @@ -61124,7 +61473,9 @@ "DataType": { "Enum": "UserCFrame" }, - "Tags": [], + "Tags": [ + "NotReplicated" + ], "Kind": { "Canonical": { "Serialization": "DoesNotSerialize" @@ -61283,12 +61634,21 @@ "Attributes": { "Attributes": {} }, + "AutomaticScaling": { + "Enum": 0 + }, + "AvatarGestures": { + "Bool": false + }, "Capabilities": { "SecurityCapabilities": 0 }, "DefinesCapabilities": { "Bool": false }, + "FadeOutViewOnCollision": { + "Bool": true + }, "SourceAssetId": { "Int64": -1 }, @@ -62839,16 +63199,6 @@ "Properties": {}, "DefaultProperties": {} }, - "VisibilityService": { - "Name": "VisibilityService", - "Tags": [ - "NotCreatable", - "Service" - ], - "Superclass": "Instance", - "Properties": {}, - "DefaultProperties": {} - }, "Visit": { "Name": "Visit", "Tags": [ @@ -62933,9 +63283,7 @@ "DataType": { "Enum": "AudioApiRollout" }, - "Tags": [ - "NotBrowsable" - ], + "Tags": [], "Kind": { "Canonical": { "Serialization": "Serializes" @@ -65214,14 +65562,6 @@ "Timeout": 10 } }, - "AnimationCompositorMode": { - "name": "AnimationCompositorMode", - "items": { - "Default": 0, - "Disabled": 2, - "Enabled": 1 - } - }, "AnimationPriority": { "name": "AnimationPriority", "items": { @@ -65835,10 +66175,10 @@ "CollaboratorStatus": { "name": "CollaboratorStatus", "items": { - "Editing3D": 0, - "None": 3, - "PrivateScripting": 2, - "Scripting": 1 + "Editing3D": 1, + "None": 0, + "PrivateScripting": 3, + "Scripting": 2 } }, "CollisionFidelity": { @@ -66307,6 +66647,14 @@ "TranslateViewPlane": 4 } }, + "DragDetectorPermissionPolicy": { + "name": "DragDetectorPermissionPolicy", + "items": { + "Everybody": 1, + "Nobody": 0, + "Scriptable": 2 + } + }, "DragDetectorResponseStyle": { "name": "DragDetectorResponseStyle", "items": { @@ -66810,15 +67158,6 @@ "R6": 0 } }, - "HumanoidStateMachineMode": { - "name": "HumanoidStateMachineMode", - "items": { - "Default": 0, - "Legacy": 1, - "LuaStateMachine": 3, - "NoStateMachine": 2 - } - }, "HumanoidStateType": { "name": "HumanoidStateType", "items": { @@ -67469,6 +67808,16 @@ "PersistentPerPlayer": 3 } }, + "ModerationStatus": { + "name": "ModerationStatus", + "items": { + "Invalid": 5, + "NotApplicable": 4, + "NotReviewed": 3, + "ReviewedApproved": 1, + "ReviewedRejected": 2 + } + }, "ModifierKey": { "name": "ModifierKey", "items": {