Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions usdmanager/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ def compile(self):
r'[^\t\n\r\f\v\'"]*?' # 0 or more (greedy) non-whitespace characters (regular spaces are ok) and no quotes followed by a period, then 1 of the acceptable file extensions.
r'\.(?:'+'|'.join(exts)+r')' # followed by a period, then 1 of the acceptable file extensions
r'|\${[\w/${}:.-]+}' # One or more of these characters -- A-Za-z0-9_-/${}:. -- inside the variable curly brackets -- ${}
r'|[a-z]+[:]/[^\'"@]+' # An Asset URI/IRI
r')' # end group 1
r'(?:[\'"@]|\\\")' # 1 of: single quote, double quote, backslash followed by double quote, or at symbol.
)
Expand Down
4 changes: 3 additions & 1 deletion usdmanager/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,8 @@ def expandPath(path, parentPath=None, sdf_format_args=None, extractedDir=None):
if parentPath is None:
anchoredPath = path
elif hasattr(resolver, "CreateIdentifier"):
anchoredPath = resolver.CreateIdentifier(path)
anchor = resolver.Resolve(parentPath)
anchoredPath = resolver.CreateIdentifier(path, anchor)
else:
anchoredPath = resolver.AnchorRelativePath(parentPath, path)
resolved = resolver.Resolve(anchoredPath)
Expand Down Expand Up @@ -723,6 +724,7 @@ def usdRegEx(exts):
r'[^\t\n\r\f\v\'"]*?' # 0 or more (greedy) non-whitespace characters (regular spaces are ok) and no quotes followed by a period, then 1 of the acceptable file extensions. NOTE: Backslash exclusion removed for Windows support; make sure this doesn't negatively affect other systems.
r'\.(?:'+'|'.join(exts)+r')' # followed by a period, then 1 of the acceptable file extensions
r'|\${[\w/${}:.-]+}' # One or more of these characters -- A-Za-z0-9_-/${}:. -- inside the variable curly brackets -- ${}
r'|[a-z]+[:]/[^\'"@]+' # An Asset URI/IRI
r')' # end group 1
r'(?:\[(.*?)\])?' # Optional layer reference for a usdz file as group 2. TODO: Figure out how to only match this if the extension matched was .usdz (e.g. foo.usdz[path/to/file/within/package.usd])
r'(?::SDF_FORMAT_ARGS:(.*?))?' # Optional :SDF_FORMAT_ARGS:key=value&foo=bar, with the query string parameters as group 3
Expand Down