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

Convert Sketch SymbolMaster overrideProperties into PBDLOverrideProperties #31

Open
ivan-015 opened this issue Jul 13, 2021 · 0 comments

Comments

@ivan-015
Copy link
Contributor

ivan-015 commented Jul 13, 2021

In Sketch, we are already given the overrideProperties that can be overridden by Symbolinstances. Therefore, these OverrideProperties can be mapped relatively directly.

The following image is a sample SymbolMaster from Sketch's JSON

Screen Shot 2021-07-13 at 3 04 09 PM

For each overrideProperty, we have access to the overrideName and canOverride.

Firstly, Parabeac-Core shall only convert override properties with canOverride set to `true.

Secondly, we need to extract some information from the overrideName.

  • The first thing we need is the UUID of the overridable element. This is the String to the left of the _(underscore). This string will be mapped to the UUID property of the PBDLOverrideProperty
  • The second thing we need is the type of the overridable property. This is the String to the right of the _(underscore). This string will be used to determine the type of overridable property.

Thirdly, for each OverrideProperty, we need to perform a lookup to find the default value of the property. This can be done by traversing the layers of the symbol master and finding the UUID that matches the UUID inside of overrideName (discussed above). This will allow us to populate the properties value for each overridableProperty.

@ivan-015 ivan-015 changed the title Convert Sketch SymbolMaster into PBDLSharedMasterNode Convert Sketch SymbolMaster overrideProperties into PBDLOverrideProperties Jul 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant