Skip to content

Instantly share code, notes, and snippets.

@mottosso
Created July 12, 2019 15:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mottosso/59266bdce57aa21656617d4a0a821c9f to your computer and use it in GitHub Desktop.
Save mottosso/59266bdce57aa21656617d4a0a821c9f to your computer and use it in GitHub Desktop.
12th July 2019 - No Local

Today I had a look at helping the developer separate between what is a local development package, and what is publicly available.


No Local

Rez has a flag for excluding packages that reside on the REZ_LOCAL_PACKAGES_PATH. That's useful when you want to experience what other users are experiencing, without accidental inteference from your development repository.

allzpark_localdev

For symmetry, I also added an option to exclude any localised packages.


Exclusion Filter

This one was special.

Most options in the GUI are saved on exit, and restored on next launch. This one could have been that too, but since we want filters to be configurable globally, across all machines via allzparkconfig.py, there's now a conflict.

  1. Should we fetch the initial value from allzparkconfig.py, and store the value locally per machine? What happens when the admin changes the filter? It wouldn't update on an artist's machine
  2. Should we read from allzparkconfig.py only? In which case it wouldn't be saved/restored like other options, resulting in a potentially frustrating change having to be made again and again.

As a start, I went with (2), of not storing this value on the local machine. It can be edited, but is intended for development/testing purposes only.

allzpark_filter


Defaults

As options grow, it's becoming increasingly important to keep track of which values differ from their defaults. So I've added a button to visualise when a value has changed, and enable the user to restore it to its default.

One of the challenges here was that QSettings is terrible at serialising types. In that, it just doesn't do it. It's especially apparent with boolean types.

from Qt.QtCore import QSettings
settings = QSettings()
settings.write("myBool", True)
settings.read("myBool") == "true"

Note that string value of what looks like the JavaScript/JSON representation of True. That's an issue, because it means when we're fetching defaults from disk, they'll differ from their corresponding option widget; a QCheckBox will be getting a string value of "true" as opposed to a boolean True.

allzpark_defaults


Tomorrow

Weekend! Whop whop! Next week I'll dive into styling and make Allzpark the prettiest girl out there.

We've got about 10 more days till release, with 3 to spare.

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