Updated from_path call to support pipeline configurations with no path using descriptors #492
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
With the new zero config and descriptors setup, the python api can no longer check if a path is part of a particular pipeline configuration. This is because paths are currently being used to do the check, and when using a descriptor the pipeline configuration has no path set. This becomes extremely obvious in the error message that occurs stating that the path is "None":
# Error: TankError: file C:\...\pipelineconfig_factory.py line 247: You are trying to start Toolkit using the pipeline configuration located in 'C:\...\p180c71.basic.desktop\cfg'. The path 'R:\...\scene.ma' you are trying to load is not associated with that configuration. Instead, it is associated with the following pipeline configurations: 'None' (Pipeline config id 71, Project id 180).
This small suggested change switches the check to look at ID which we know is always unique rather than a path. This fixes the issues with using descriptors while also providing a likely safer way of verifying a path is part of a pipeline configuration. We already have the ID for associated pipeline configurations so we only have to add a small piece of code to get the ID for the current pipeline configuration.