Skip to content

Commit

Permalink
rbx_dom_lua rojo-rbx/rbx-dom@6ccd30f (custom pivot get/set) (rojo-rbx…
Browse files Browse the repository at this point in the history
  • Loading branch information
kennethloeffler committed Feb 20, 2024
1 parent f716928 commit d53f57e
Show file tree
Hide file tree
Showing 5 changed files with 518 additions and 97 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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])
Expand All @@ -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])
Expand Down
23 changes: 23 additions & 0 deletions plugin/rbx_dom_lua/EncodedValue.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
35 changes: 35 additions & 0 deletions plugin/rbx_dom_lua/allValues.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
12 changes: 12 additions & 0 deletions plugin/rbx_dom_lua/customProperties.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
Loading

0 comments on commit d53f57e

Please sign in to comment.