Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

IECoreUSD : Load prototype paths inside a PointInstancer as relative #1451

Merged
merged 1 commit into from
Feb 25, 2025

Conversation

danieldresser-ie
Copy link
Contributor

This implements the approach to relative PointInstancer prototype paths we've discussed.

Known issues:
I've made this check whether GAFFERSCENE_INSTANCER_EXPLICITABSOLUTEPATHS, and use future-style relative paths if Gaffer supports them. It's probably weird to make this depend on a Gaffer env var ... should I just hardcode to prefix the paths with "./", and then we'll have to do another cleanup pass to fix this at some indeterminate point in the future?

I've currently made the env var to enable this "GAFFERUSD_POINTINSTANCER_RELATIVEPROTOTYPES". Since this ends up being implemented in Cortex, I guess it should be "IECOREUSD_POINTINSTANCER_RELATIVEPROTOTYPES"? Not that this is a distinction that users are likely to care about.

@danieldresser-ie
Copy link
Contributor Author

One other known issue - the tests are currently weird: I wrote 3 tests for the 3 different env var configurations that make sense, but they rely on the person running the tests to set the env vars appropriately in order to run them. Gaffer has tests which set env vars and then relaunch themselves in a subprocess, but I wasn't sure how to do that in the Cortex test setup.

@danieldresser-ie
Copy link
Contributor Author

OK, I think I've now addressed everything outstanding, and updated the Changes file.

@johnhaddon
Copy link
Member

Thanks Daniel. I've pushed a fixup which tweaks the env-var name, slightly simplifies the logic and expands the test coverage. Could you give that a quick check over?

@danieldresser-ie
Copy link
Contributor Author

Changes LGTM.

If you set the env var IECOREUSD_POINTINSTANCER_RELATIVEPROTOTYPES=1, if an instancer named "/inst" contains an internal prototype path like "/inst/Prototypes/proto", that prototype path will now be loaded as "./Prototypes/proto". This is compatible with how point instancers will now be handled in Gaffer, allowing them to be relocated within the scene hierarchy.
@johnhaddon johnhaddon merged commit 3c163a8 into ImageEngine:RB-10.5 Feb 25, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants