-
Notifications
You must be signed in to change notification settings - Fork 51
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
Add environment variable to locate plugins #104
Conversation
I just copied how this was done in Ignition GUI Signed-off-by: Levi Armstrong <[email protected]>
I am not sure why the tests are failing on windows and I do not have a way to test this locally. |
This change solved the issue with locating the ignition rendering plugins within a snap package, but now at runtime Ogre does not have the OpenGL render plugin. I believe the Ignition Ogre Plugin is setting the path for ogre plugin but I am not certain. Does anyone have any thoughts on the issue? |
They were failing before, not this PR's fault.
Interesting, I wouldn't expect the existing plugins to be affected by this change. How are you loading Ogre? Would one of the existing examples in this package fail the same way? Are you loading Ogre using the environment variable? |
It looks like the path it looks for ogre plugins is set at compile time here. I am testing a solution at the moment to address this similar to how this is done in ogre. Another possible option would be to not provide the full path for the ogre plugins as done here but only include the names when loading ogre plugins. The only reason I can see to not make this change, is it would not support switching to the debug version. The reason behind only using the plugin name is that Ogre already supports bundling so it would detect that it inside a snap package and correctly locate its resources if the plugin name was only provided. |
So with these changes I have been able to successfully create a snap package leveraging ignition gui. Below is a app configuration setting leveraging the environment variables so resources are located within the snap package.
|
If you find these changes acceptable, I can go through and update OGRE2 plugin also. |
The approach looks reasonable to me. The only thing I'm wondering is whether we can avoid exposing engine specific configuration to downstream users. So I could see I'm not 100% sure this is a good idea though. Not sure what @iche033 thinks of this? |
One small edge case issue I can think of for using a shared env variable like |
Another option is how ogre does this. The only reason I had to expose the OGRE_RESOURCE_PATH environment variable was because I am bundling it using snap. In this case ogre looks for the environment variable SNAP and if it exists it prepends the path as shown here.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's go with the OGRE_RESOURCE_PATH
approach for now as it's working. The changes look good to me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Besides the inline comment, I'd like to clarify whether this is enough to close #100 (i.e. can we load rendering engine plugins other than Ogre and Optix?).
I suspect that the answer is no, which is fine and shouldn't block this PR.
Signed-off-by: Levi Armstrong <[email protected]>
I believe it should be enough to load plugins outside this package. Essential that is what is happening when I am bundling this into a snap. Everything is being loaded from the environment variables because the location of all resources are not in the location of the original install location. |
@chapulina and @iche033 I added one more commit which makes the same change in the ogre2 plugin. |
Signed-off-by: Levi Armstrong <[email protected]>
That sounds great, thanks! Unrelated to this PR, but I'd say we need some documentation and a demo on how to load a custom engine before closing #100. Similar to the ign-physics examples. I haven't tried to do it myself, but looking at the code, I'm concerned about some assumptions made about the "default engines" in places like this: |
Is this good to merge? |
merging! |
I just copied how this was done in Ignition GUI