glTFast icon indicating copy to clipboard operation
glTFast copied to clipboard

Contribution & Development Setup Docs

Open FreakTheMighty opened this issue 1 year ago • 1 comments

Is your feature request related to a problem? Please describe. I'd like to setup the project, run tests and perform development to contribute improvements.

Describe the solution you'd like I'd like the CONTRIBUTING documentation to include docs on how to setup the repository for development and for running tests.

FreakTheMighty avatar Jul 28 '22 19:07 FreakTheMighty

Hi @FreakTheMighty,

that's a very good point. The development setup I personally use is not super easy to setup, but is probably worth using if you intend to do more work on glTFast.

I acknowledge that a proper documentation is outstanding, but here's a quick starting point:

Setup

For development I use another project repository:

https://github.com/atteneder/glTFastTest

It contains glTFast, test assets, various test projects and other helper packages. It uses GIT submodules, so make sure you initialize and clone those submodules as well when cloning the repository.

Play Mode Loading

Open any of the projects und /projects to the Unity version of your likes.

There's a bunch of scenes under Packages/glTF Tests/Runtime/Scenes. TestLoadScene is the one I use most often. It provides a minimal UI to load test assets. Open it, enter play mode and select a sample set and finally a glTF to load. It should be loaded and appear.

What glTFs are shown in this UI menu is controlled a SampleSetCollection in Packages/glTF Tests/Runtime/SampleSets/AllSampleSets. Feel free to create your own SampleSet (setting its baseLocalPathto a local folder containing your glTFs and click Find in Path in the inspector) and add it to AllSampleSets

Unit Tests

When you open the Test Runner you should be able to see PlayMode and EditMode tests and you can instantly run them to validate if your changes broke anything.

There's more to it that needs documentation:

  • Performance testing
  • CI scripts that run tests on all projects
  • Code coverage
  • Export test and glTF validation

I hope that's a starting point until I find time for proper docs.

atteneder avatar Aug 24 '22 09:08 atteneder