playcanvas / playcanvas-sync

Real-time synchronization of files between PlayCanvas and your local machine
https://playcanvas.com/
MIT License
74 stars 17 forks source link

Not all asset types are supported #36

Open timleader opened 2 years ago

timleader commented 2 years ago

I am looking to use the approach described here https://github.com/playcanvas/playcanvas-sync#case-2-single-user-per-playcanvas-branch-with-git though am running into issues when trying to sync certain asset types, eg. material, animation graph. I feel that if we don't place all assets into the VCS of our choice we will have a nightmare of trying to keep our VCS branches in sync with PlayCanvas VCS. Can all asset type be supported? Do I not have the right approach?

C:\playcanvas\pc_test>pcsync pullAll -y -e js,cube,png,html,css,anim
C:\playcanvas\playcanvas-sync\src\api-client.js:85
    const name = asset.file.filename;
                            ^

TypeError: Cannot read properties of null (reading 'filename')
    at ApiClient.makeDownloadStream (C:\playcanvas\playcanvas-sync\src\api-client.js:85:29)
    at ApiClient.loadAssetToFile (C:\playcanvas\playcanvas-sync\src\api-client.js:73:25)
    at OverwriteAllLocalWithRemote.fetchFile (C:\playcanvas\playcanvas-sync\src\sync-commands\overwrite-all-local-with-remote.js:51:32)
    at OverwriteAllLocalWithRemote.handleAllFiles (C:\playcanvas\playcanvas-sync\src\sync-commands\overwrite-all-local-with-remote.js:44:24)
    at OverwriteAllLocalWithRemote.run (C:\playcanvas\playcanvas-sync\src\sync-commands\overwrite-all-local-with-remote.js:15:20)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
yaustar commented 2 years ago

playcanvas-sync was originally designed for textural based formats such as JS and JSON.

The pcsync and pcwatch utilities allow editing copies of JavaScript and other textual files of a PlayCanvas project locally on your own computer, in a text editor of your choice.

It can support binary files such as JPGs PNGs as mentioned here: https://github.com/playcanvas/playcanvas-sync#using-pcsync-for-non-text-files

It doesn't support all assets such as materials and anim state graph unfortunately.

We are looking to make the parts of the PlayCanvas Version Control public in the next few months that will make it easier to create scripts/workflows to have the external and PlayCanvas Version Control in sync.

Ticket: https://github.com/playcanvas/editor/issues/498

We are thinking of ways to be able to get all the assets locally but it's not straightforward due to how that data is stored on projects in databases. They aren't files on storage unlike texture and model files hence it's not possible at the moment.