Validation and VC of Assets
Asset Validation
Always thinking about all the different requirements and remembering what the team agreed upon, can be difficult while working on a group project. But since aspects like texture resolution, poly count, or the scale of meshes, are very important to consider, for example in terms of performance. Also having meshes with different scales inside of Unity can be a huge pain, as it was in our P3 project, when fixing the scale had to be done for the majority of the meshes, during the end phase of the project.
So I the goal was to validate the assets inside of Unity and to prevent commiting them, if the validation failed.
Workflow - Asset Validation
Activating the Asset VCS/Validation system, via a toggle in the GUI
- a folder
VersionControlledAssets
is created
- inside of it a ScriptableObject of type AssetValidationSettings
, where the rules can be defined
- now all assets inside of this root directory will be validated with those rules
Different rules in different Folders
- each Rules Object only applies to the assets, that are stored at the save folder level as the object itself
- so one can create subfolders with individual rules
Consequences of a failed validation
- on failed validation the result of
false
is written to a.allow_commit
file (root of repo) - this file is then read by a script, that runs on the
pre-commit git hook
- depending on if the file contains
true
orfalse
the commit is aborted
Asset Version Control
Workflow - Asset Version Control
All the commits that contain the asset can be selected from a dropdown
- by clicking
Switch Version
agit checkout
is performed
Changing version of asset
- by clicking
Update Version
the current selected state of the asset gets commited - the commit message then is:
asset_name -> v: hash-of-selected-version
TODO
- [ ] user tests
- [ ] make git hook setup happen automatically
- [ ] add the date of commit to the version drop down
- [ ] better user feedback (why the validation failed)
- [ ] possible make asset change version automaticly, not by another button
- [ ] seperate VCS ans Validation system
- [ ] write reason for failed validation to allow_commit file and show it to user
- [ ] improvements on UI, usability
Future Ideas
- have to versions 'checked out' at the same time for direct comparison