Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

File type is chosen from the path, rather than the resolved path #144

Closed
sirpalee opened this issue Jan 9, 2017 · 2 comments
Closed

File type is chosen from the path, rather than the resolved path #144

sirpalee opened this issue Jan 9, 2017 · 2 comments

Comments

@sirpalee
Copy link
Contributor

sirpalee commented Jan 9, 2017

Description of Issue

When loading a file, the file type is chosen using the original file path, instead of the resolved path. This is causing issues when there is a custom ArResolver in use, and the original path doesn't end up in an extension that USD knows how to handle.

The problem comes from SdfLayer::FindOrOpen, where the _ComputeInfoToFindOrOpenLayer is called before the path is resolved, so it only has access to the original path.

A better approach could be to first resolve the path, if the layerPath is not anonymous, then setup the layerInfo using the resolved path.

Steps to Reproduce

  1. Load up a custom resolver that generates a usda file, but the source path doesn't end with .usda.
  2. For example this proof of concept resolver: https://github.com/LumaPictures/luma_usd/blob/master/uberResolver/resolver.cpp
  3. Use this usda file.
#usda 1.0

over "ReferencedStuff" (
    add references = @sphere://hello@
)
{
}

System Information (OS, Hardware)

Doesn't matter.

Package Versions

ce52132

Build Flags

Doesn't matter.

@sirpalee sirpalee changed the title File type is chosen based on the reference path, rather than the resolved path File type is chosen from the path, rather than the resolved path Jan 9, 2017
@jtran56
Copy link

jtran56 commented Jan 9, 2017

Filed as internal issue #141641.

@frenchdog
Copy link

frenchdog commented Mar 6, 2018

A solution is to implement the resolver virtual function std::string GetExtension(const std::string& path) in your resolver.

// Example returning extension from a path looking like that:
// "@<asset>/<version>/<asset>.usda?asset=foo,version=v001@"
std::string RdoResolver::GetExtension(const std::string& path)
{
    auto mainTokens = TfStringSplit(path, "?");
    if (mainTokens.size() < 2)
    {
        return TfGetExtension(path);
    }

    auto pathTemplate = mainTokens[0];
    auto tokens = TfStringSplit(pathTemplate, ".");
    if(tokens.size() < 2)
    {
        return TfGetExtension(path);
    }

    return tokens.back();
}

AdamFelt pushed a commit to autodesk-forks/USD that referenced this issue Apr 16, 2024
…enericText) (PixarAnimationStudios#144)

U&O design https://wiki.autodesk.com/pages/viewpage.action?spaceKey=AGP&title=A+text+primitive+for+USD
U&O are different with other Text Style. They are not support by ATOM lib directly, so we need to draw lines of U&O in USD by basisCurve.

Add U&O to Text schema.
Implement U&O markup support in Components.(\L begins an underline, \O begins an overline, \l ends a underline, \o ends an overline). Then we can get the U&O values of a TextRun.
Compute and fills U&O geometries data in SimpleTextAdapter and GenericTextAdapter.
Add curve renderpass to Text workflow, use curve shader to draw underline and overline curve. Before this change, one Text GPrim has only one Text drawItems, after this change, one text corresponds to three drawItems(Text, overline and underline drawItems) . The U&O drawItems are bound to basisCurve shaders.
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants