AcademySoftwareFoundation / OpenShadingLanguage

Advanced shading language for production GI renderers
BSD 3-Clause "New" or "Revised" License
2.09k stars 357 forks source link

Don't try to ReParameter symbols not in the group #1693

Closed aconty closed 1 year ago

aconty commented 1 year ago

Sometimes, after optimization, symbols tagged as interactive get removed because they are unused. But ReParameter is failing with errors because it goes looking for the removed symbol to master, which is, of course, not interactive. This patch avoids that so the symbol is not found, and then we just return false.

Description

We found this issue in production because code was being removed, then symbols too, then reparameter failed. There is no other way to prevent the error than from inside OSL. I'm suggesting this change but any other way to handle it would work for us.

Checklist: