-
Notifications
You must be signed in to change notification settings - Fork 49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix WorldPivotData not being written in studio #238
Conversation
rbx_dom_lua/src/database.json
Outdated
@@ -394,7 +420,7 @@ | |||
"BinaryString": "" | |||
}, | |||
"CancelAirMomentum": { | |||
"Bool": true | |||
"Bool": false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Huh, this is kinda weird. I wonder what's up with this diff!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It'll break everything randomly and we don't even know it yet.
patches/model-pivot.yml
Outdated
Add: | ||
Model: | ||
WorldPivotData: | ||
Serialization: | ||
Type: Serializes | ||
DataType: | ||
Value: OptionalCFrame | ||
Scriptability: Custom |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
WorldPivotData
is kind of a funny name. That's what this property serializes as, but we should surface it as WorldPivot
to the user. There is a little bit of guidance in this document that might help: https://dom.rojo.space/patching-database.html
You can also look at the patches in instance.yml
that add support for attributes. They serialize as AttributesSerialize
but we expose them as Attributes
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I made it use an alias like you suggested in the latest commit.
…without studio plugins path
WorldPivotData can either be a CFrame or an OptionalCFrame. I don't know what that depends on, but models seem to be resaved to use OptionalCFrame every time. Is there anything implemented to handle cases like this in the reflection db? |
I made a questionable? fix that just treats CFrames like OptionalCFrames in rbx_binary, if this problem is encountered. I don't know if this occurs in rbxlx since every rbxlx file I have uses OptionalCoordinateFrame as the XML tag. |
…_binary to fix deserialization of some rbxms
NeedsPivotMigration has to be defined as false inside workspace for the WorldPivot CFrame to be correct when opening the rbxlx. I don't know what to do about this. |
Can confirm, as well as @MaximumADHD. This cannot be worked around by setting the property in the rojo project file since it's an unknown property. |
You can always set a property in Rojo, you just have to spell out the type. You aren't stopped from setting properties that Rojo doesn't know about. "$properties": {
"NeedsPivotMigration": { "Bool": false }
} |
I'm assuming no because there's been no comment on this in 7 months, but is this still something that needs to be resolved? |
@Dekkonot I went ahead and tested it with Rojo 7.3.0 and this is still an issue. |
Hey @blackshibe, do you have any roblox model files that exhibit this behavior that you can PR to rojo-rbx/rbx-test-files? We like to have real files to test against whenever we run into discrepancies like this one, both to ensure that the fix works, and also to prevent future regressions. |
I haven't touched this in a while but I can try to give you a few soon |
the issue mentioned in the original post for this issue has a model as well as the intended behavior. I simplified it down to this:
I'm looking over the branch changes to verify whether it's fixed |
Hi, are there any updates on this? |
…rames & match model-pivot.yml with working db test
I know the JSON database equivalent for the database.json for WorldPivot inside Rojo - this works if put inside the plugin directly: "WorldPivot": {
"Name": "WorldPivot",
"Scriptability": "ReadWrite",
"DataType": {
"Value": "CFrame"
},
"Tags": [
"NotReplicated"
],
"Kind": {
"Canonical": {
"SerializesAs": "WorldPivotData"
}
}
},
"WorldPivotData": {
"AliasFor": "WorldPivot",
"Name": "WorldPivotData",
"Scriptability": "None",
"DataType": {
"Value": "OptionalCFrame"
},
"Tags": [
"Hidden"
],
"Kind": {
"Alias": {
"AliasFor": "WorldPivot"
}
}
} patchfile in latest commits. |
merge upstream changes
I'm not well acquainted with rbx-dom, but I'm willing to help with testing! I believe this bug is causing issues with my game's workflow, by using Lune to manage assets - losing pivots on models. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, sorry for taking so long to follow up on this. I've been busy with work so I haven't given this the attention it deserves. If you'll have yet more patience, I should be able to give it some time either this week or next week to look into this.
If you want to do some stuff in the mean time, I have a bit of feedback for this pull request. The big thing I'm noticing at a glance is that we use rbx_reflector
instead of generate_reflection
now (this is confusing and I'm planning on removing generate_reflection
soon) and this needs a test file just to verify we've actually fixed it and to prevent regressions. The test file would have to be submitted to rbx-test-files
.
I think there are two different issues being conflated here. First, model pivots don't work with Second, Rojo's plugin does not set model pivots. The cause is pretty straightforward: rbx_dom_lua is missing a custom getter/setter for |
Regarding |
There is no documentation for this property because it's internal, and likely a mechanism that Roblox used to fix a mistake they made in the early rollout of pivots. It's a member of |
I'm looking into working on the above changes. Should I create a new PR to address both problems, starting over? |
I've created an issue at #385 for the "missing |
@Crystalflxme @blackshibe I've created an issue over at rojo-rbx/rojo#866 and a corresponding one for this project at #391, and I've also hacked a fix together for the |
fixes issue mentioned in rojo-rbx/rojo#628
I don't know if there is anything implemented to do this without using the Custom scriptable property.
Review welcome.