Production setup documentation contains issues on provided code snippets
After following the documentation to get started with asset resolution, I encountered several issues in the provided code examples and explanations that could cause confusion or errors for new users:
-
Incorrect Path Separator Handling in
CreateRelativePathIdentifier:
The current snippet:anchor_path = anchor_path[:-1] if anchor_path[-1] == "/" else anchor_path[:anchor_path.rfind("/")]assumes the use of forward slashes. However, since
GetPathString()seems to return paths with backslashes on some systems, a more robust version would be:anchor_path = anchor_path[:-1] if anchor_path[-1] == os.path.sep else anchor_path[:anchor_path.rfind(os.path.sep)]or an equivalent platform-independent solution.
-
Incorrect Delimiter in Entity Parsing:
The following line:entity_element, entity_version = entity_element.split("-")should be updated to:
entity_element, entity_version = entity_element.split("_")since example files use underscores (
_) to separate the version. -
Incorrect Path Reference in Documentation:
In the [Loading our Shot] section, the documentation refers toshots/shotsA, which appears to be a typo. It should beshots/shotA. -
Missing Globals in Precompiled
PythonExpose.py:
The precompiled version ofPythonExpose.pydoes not include theGlobalssetup, likely by design, as this file is intended to be customized for production environments. However, a short section in the documentation covering these global variables would be helpful for less experienced users.
As it stands, running the copy-pasted example leads to the error:
Failed to call Resolver.ResolveAndCache in PythonExpose.py. Please verify that the python code is valid!
even though the code is taken directly from the docs.
Adding clarification around these points would make the onboarding process smoother and reduce friction for first-time users.
Thanks for the great work overall!