rocksdanister / lively

Free and open-source software that allows users to set animated desktop wallpapers and screensavers powered by WinUI 3.
https://rocksdanister.com/lively
GNU General Public License v3.0
14.81k stars 1.05k forks source link

Lively API values into Unity/Godot? #1767

Open rocksdanister opened 1 year ago

rocksdanister commented 1 year ago

Discussed in https://github.com/rocksdanister/lively/discussions/1766

Originally posted by **Symmasolan** June 24, 2023 I know that the wiki guide is literally named "Web Guide", but the way the README is worded for the [Lively API](https://github.com/rocksdanister/lively#lively-api) feature section gives me some small hope that it's possible to get the API System and/or Interaction Data values in a Unity-driven wallpaper. Is it at all possible to get the Interaction or System Data values from the Lively API in a Unity (or Godot) project?
rocksdanister commented 1 year ago

Is it possible this could be added as a feature suggestion for the future? I'd love to make a few Unity-based wallpapers using the API. I understand if not though, since this (awesome!) project has been around for a decent while and I seem to have been the first person to ask for it.

Sure, no problem.

Here is the plan, suggestions welcome: On the wallpaper developer side the pipe name will be sent as startup argument --input-ipc-server=[name] to the program. Using it will have to create Named Pipe Server: https://learn.microsoft.com/en-us/dotnet/api/system.io.pipes.namedpipeserverstream?view=net-7.0

Can create helper libraries in the future if required.

Symmasolan commented 1 year ago

Just looking at the documentation you shared, I could for sure figure out the code Unity-side. My only question is, what will the data being sent look like? I'm assuming a json-like string result similar to the Web Wallpaper API?

rocksdanister commented 1 year ago

Yes it will be serialized json, it can be converted to c# object: https://www.newtonsoft.com/json/help/html/deserializeobject.htm

I do plan to make LivelyProperties also json in the future https://github.com/rocksdanister/lively/issues/229