Skip to content

OSL mx_geompropvalue_filename never returns the geomprop value #3003

Description

@anderslanglands

https://github.com/AcademySoftwareFoundation/MaterialX/blob/main/libraries/stdlib/genosl/mx_geompropvalue_filename.osl

I'm no OSL expoert, but it appears as though the found geomprop is only assigned when it is not found, i.e. it's never assigned:

void mx_geompropvalue_filename(string geomprop, textureresource defaultVal, output textureresource out)
{
    // Initialize to the default
    out = defaultVal;

    // Replace the filename component from the geomprop
    string defaultFilename = defaultVal.filename;
    if (getattribute(geomprop, defaultFilename) == 0)   // <--- this should be == 1 I think?
        out.filename = defaultFilename;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions