It seems like that the TdEngine is not using the EnvironmentContext to load virtual environments.
I made sure that the tox-file is located at the same directory as the project it originates from but I do get an error (love that we can read them now, yaih!) from the engine that it can not find the specified module.
On a second note for that, it would be great if we could define, similiar to TouchEngine, a link to the ProjectRoot folder. This would remove the need for the tox to live in the root directory of the project which can get cramped when we have more then one tox-file.
Ah yes, sorry for not specifing that. I am talking about the TDPyEnvManagerContext.yaml / entries of the pyproject.toml
Regarding the TouchEngine bit:
To force a specific version of TouchDesigner to be used with TouchEngine I can either create a copy of a TD-Install-Folder or create a Shortcut to the Installationfolder called TouchEngine.
In a similiar manner, I would like to be able to create a similiar shortcut with a specified name to tell the TouchEngine in which place the engine should create the virtual .toe file that is used to mount the .tox file. (This is currently happening at the location of the .tox file i.E. if you print out project.folder in an engine it points to the folder of the tox-file.)
The TDPyEnvManager was not really tested in the engine context. I assume that the issue here is that the path injection does not kick in, and that the paths from the main process are not passed to the engine process. I’ll have a look and confirm.
For the project.folder issue, this is purely a touchengine behaviour which might have to be discussed internally for design.
You can control this in a limited way in an Engine COMP using the Asset Paths parameter - set it to Relative to Project File (.toe) so TouchEngine will use the project rather than the component directory.
We are using TouchEngine in Pixera so I think this is not an option there but good to know for TD-Internal setups. (I assume this will not touch the RelativePath parameter set on the toxfile itself though?)
Ah - that would be a feature request for Pixera in that case - it’s possible for a host to control it programmatically.
I’m pretty sure the RelativePath parameter should work in conjunction with the setting from TouchEngine - so if the .tox is set to use the project directory, the project directory will be the directory set from TouchEngine.
I started looking into the issue and I can reproduce. This is not something related to the TDPyEnvManager though, so I’m unsure how soon that will get fixed.
Could someone from the engine team maybe give an estimate if and when this could be fixed/implmented? We are actively moving in the direction where a lot of our components are part of packages and not being able to use them in an engine just does not feel good when it works so (extremly) well in Designer itself (thanks to the EnvManagerContext. Could not live without it.)
It is somewhat perplexing that this is not possible as running heavy ML-Projects in an engine feels much better then trying to do it using threading (which still has the issue of the GIL…)