Adsk Contrib - Merge configs feature#2179
Conversation
Signed-off-by: Doug Walker <doug.walker@autodesk.com> (cherry picked from commit 08a3adf) Signed-off-by: Doug Walker <doug.walker@autodesk.com>
Signed-off-by: Doug Walker <doug.walker@autodesk.com> (cherry picked from commit fadef86) Signed-off-by: Doug Walker <doug.walker@autodesk.com>
Signed-off-by: Doug Walker <doug.walker@autodesk.com> (cherry picked from commit 008ad27) Signed-off-by: Doug Walker <doug.walker@autodesk.com>
Signed-off-by: Doug Walker <doug.walker@autodesk.com> (cherry picked from commit cbc0f0e) Signed-off-by: Doug Walker <doug.walker@autodesk.com>
Signed-off-by: Doug Walker <doug.walker@autodesk.com> (cherry picked from commit 9871ef4) Signed-off-by: Doug Walker <doug.walker@autodesk.com>
Signed-off-by: Doug Walker <doug.walker@autodesk.com> (cherry picked from commit 914b2f0) Signed-off-by: Doug Walker <doug.walker@autodesk.com>
Signed-off-by: Doug Walker <doug.walker@autodesk.com> (cherry picked from commit f60e990) Signed-off-by: Doug Walker <doug.walker@autodesk.com>
Signed-off-by: Doug Walker <doug.walker@autodesk.com>
Signed-off-by: Doug Walker <doug.walker@autodesk.com>
Signed-off-by: Doug Walker <doug.walker@autodesk.com>
|
UPDATE: In my most recent commit I removed support for OCIOM files in Config::CreateFromFile. This was done in response to Mark Boorer's concerns that inexperienced users could get into trouble with this capability. With this change, it will now require more work to use merging. The first step will be to use the ociomergeconfigs command-line tool to process the OCIOM file and generate the merged config. That config may then be used as usual. Adding this additional friction will allow us to roll out the merge functionality more gradually. The only people who will be able to use merging will be those who have installed the command-line tools, which will limit the audience to the power-users who hopefully have a better understanding of potential issues. This will give us time to watch how people use the technology and respond to feedback and any issues people may find. Thank you Mark, for your feedback on this feature. |
Signed-off-by: Doug Walker <doug.walker@autodesk.com>
Signed-off-by: Doug Walker <doug.walker@autodesk.com>
Signed-off-by: Doug Walker <doug.walker@autodesk.com>
|
Thank you for the comments Remi! I've addressed them in the latest commit. Note: The unit tests do pass, but I will need to rebase to pull in the recent CI fixes. |
Signed-off-by: Doug Walker <doug.walker@autodesk.com>
|
Per the decision at the TSC meeting, I am merging this. It will be documented as a "preview release" feature. |
Per issue #1359, this PR adds the ability to merge config files.
This feature relies only on the public API and is added under apphelpers rather than the core library.
The target config for the merge is called the "base" config, and the "input" config is merged into it. This may be done in memory, or the ociomergeconfigs command-line tool may be used to merge files.
There are basically five merge strategies and these may be applied locally to different sections of the config:
There is an option to avoid more than one copy of a color space in the merged config. This is based on a "fingerprint" of the color spaces. When combining duplicate color spaces, the name and aliases of the one are added as aliases of the other, so the merged color space will respond to the union of all the base and input names.
There is an option to detect differences in the reference spaces between the base and input configs. The color spaces from the input config will be modified to use the reference space of the base config.
A set of overrides is supported to modify properties such as name, description, search_path, context vars, active displays/views, and inactive color spaces. An option is provided to add a prefix to the family attribute in order to group merged color spaces under their own sub-menu hierarchy.
The following sections of a config may be merged using separate strategies:
Please see OpenColorAppHelpers.h for a more detailed description of the functionality.
An additional function is provided to merge a single color space into a config.
A new file format named OCIOM (.ociom extension) is provided to hold the parameters that control a merge. It may actually define a pipeline of merge operations involving multiple configs.
Similar to an OCIOZ archive file, an OCIOM file may be provided to functions such as Config::CreateFromFile that take a config file. (UPDATE: Based on feedback, I've removed the ability to use an OCIOM in place of a config.)
An extensive set of unit tests has been provided.