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

Save/load graph JSON #35

Open
eeropic opened this issue Jun 1, 2019 · 5 comments
Open

Save/load graph JSON #35

eeropic opened this issue Jun 1, 2019 · 5 comments

Comments

@eeropic
Copy link

@eeropic eeropic commented Jun 1, 2019

The ability to save and load graphs from Zdog .json files could be quite useful in the future, at least in gamedev purposes.

Arranged in a tree structure, i.e.
illustration:{
children:[
shape:{
children:[{},{}]
}
]
}

@eeropic eeropic changed the title Illustration graph serialization / deserialization [Feature request] Illustration graph serialization / deserialization Jun 1, 2019
@natemoo-re
Copy link

@natemoo-re natemoo-re commented Jun 1, 2019

This could be accomplished using the native JSON methods, although I'm not sure if there's a particular structure that would be the most efficient.

For serialization, a toJSON method could be added to Anchor (and Illustration?). For deserialization, a method could be exposed (Zdog.parse?) which extends JSON.parse by using a custom reviver parameter.

Loading

@desandro
Copy link
Member

@desandro desandro commented Jun 2, 2019

Add a 👍 reaction to this issue if you would like to see this feature added. Do not add +1 comments — They will be deleted.

Yeah, this one makes lots of sense.

Loading

@desandro desandro changed the title [Feature request] Illustration graph serialization / deserialization Save/load graph JSON Jun 2, 2019
@webocs
Copy link

@webocs webocs commented Jun 3, 2019

I'm working on an 3D editor that will be able to write/read zdog drawings, It'll be super cool to have an official format, or even several illos. I think the JSON needs, a name for each Illustration

[
  illustration:{
    name: "SomeName"
    children:[
       shape:{
         children:[
           {...},
           {...}
        ]
      }
   ]
  },
...
]

I'm thinking about something like this..

Loading

@newbold
Copy link

@newbold newbold commented Jun 4, 2019

It would also be super cool if there was a way to generate an STL file from a Zdog illustration (imagine 3D printing your Zdog creations!) or other formats (USDZ for ARKit fun!). I wouldn't imagine that kind of specialized output being a Zdog feature per se, but I'm adding this note here in case smart people can figure out how to harvest the 3D data from Zdog illustrations (or from the proposed JSON export, if that's added). ❤️

Loading

@gut4
Copy link

@gut4 gut4 commented Jun 28, 2019

Loading

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
6 participants