Skip to content
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

Meta Files for Tools Grip property causes Snapshot error #430

Closed
cskeogh opened this issue Jun 13, 2021 · 2 comments
Closed

Meta Files for Tools Grip property causes Snapshot error #430

cskeogh opened this issue Jun 13, 2021 · 2 comments

Comments

@cskeogh
Copy link

cskeogh commented Jun 13, 2021

I created a file init.meta.json identical to the documentation Meta Files for Tools:

{
    "className": "Tool",
    "properties": {
        "Grip": [
            0, 0, 0,
            1, 0, 0,
            0, 1, 0,
            0, 0, 1
        ]
    }
}

Results in error:

[ERROR] Snapshot error: File contained malformed init.meta.json data: init.meta.json
        
        Caused by:
            data did not match any variant of untagged enum UnresolvedValue at line 10 column 5

I am using Rojo v7.0.0-alpha.4

@LPGhatguy LPGhatguy added this to the Rojo 7 Blockers milestone Jun 13, 2021
@LPGhatguy
Copy link
Contributor

LPGhatguy commented Jun 13, 2021

Hello, thank you for the report. Your meta file is correct for Rojo 6.x. This is related to #421.

We have been working on tweaking Rojo's JSON property format to make it easier to use. This is going to be a breaking change from 6.x, but should be for the best. Unfortunately, the 7.0 alphas are in kind of an awkward middle state. Fixing this (and releasing a tool for people to migrate their projects) is the last remaining blocker for Rojo 7.0's stable release.

I recently introduced some tests for the JSON property shorthand syntax. We also have a more explicit property syntax. Not all property types have a shorthand version.

In Rojo 7.0.0-alpha.4, we don't have a shorthand syntax to specify CFrame values. You should be able to specify a CFrame values using the explicit syntax like this:

{
    "className": "Tool",
    "properties": {
        "Grip": {
            "Type": "CFrame",
            "Value": {
                "Position": [0, 0, 0],
                "Orientation": [
                    [1, 0, 0],
                    [0, 1, 0],
                    [0, 0, 1]
                ]
            }
        }
    }
}

This is obviously not ideal. We are on track to update the explicit value syntax in the next 7.0 alpha with this:

{
    "className": "Tool",
    "properties": {
        "Grip": {
            "CFrame": {
                "position": [0, 0, 0],
                "orientation": [
                    [1, 0, 0],
                    [0, 1, 0],
                    [0, 0, 1]
                ]
            }
        }
    }
}

Note that Type and Value are gone and the casing of values is different. We could also reintroduce the same shorthand syntax for CFrame values, which would make your original model work:

{
    "className": "Tool",
    "properties": {
        "Grip": [
            0, 0, 0,
            1, 0, 0,
            0, 1, 0,
            0, 0, 1
        ]
    }
}

I had originally removed the CFrame shorthand during the port to rbx_dom_weak v2 because I didn't remember that people hand-wrote CFrame values for Tool.Grip. Reintroducing it for the next release feels like an easy change that we can make.

@LPGhatguy
Copy link
Contributor

Sorry for the long turnaround on this, should be good to go on the master branch.

Dekkonot pushed a commit to UpliftGames/rojo that referenced this issue Jan 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants