shotgunsoftware/tk-core — pull request #57 by manneohrstrom (2014-03-14 13:34:17+00:00)
Title: #24650 New default value logic for hooks and other parameters

Adds support for two new defaults:

1. Engine specific configuration values. It is possible to define multiple configuration defaults in an app manifest, based on engine. The following example parameter definition illustrates how this works:

```yaml
param_name:
type: str
default_value_tk-maya: "This value will be used when the app is installed in Maya."
default_value_tk-nuke: "This value will be used when the app is installed in Nuke."
default_value: "This value will be used in all other engines."
description: "Example of engine specific defaults."
```

2. New style hooks support a new style of default values, replacing the previous logic of `default`. The previous form is still supported and this change is fully backwards compatible. For example, consider the following manifest:

```yaml
hook_param:
type: hook
parameters: []
default_value: "{self}/{engine_name}_stuff.py"
description: Example of a new style hook default value.
```

When this parameter has its default written into an environment (typically either via the tank updates or install_app command), the default value will be resolved and copied across. For example, if the app is installed into the tk-nuke engine, the following environment setting would be written:

```yaml
hook_param: '{self}/tk-nuke_stuff.py'
```