[DYN-9082] All Python Engines should be loaded correctly in D4R#16388
[DYN-9082] All Python Engines should be loaded correctly in D4R#16388zeusongit merged 1 commit intoDynamoDS:masterfrom
Conversation
There was a problem hiding this comment.
See the ticket for this pull request: https://jira.autodesk.com/browse/DYN-9082
| { | ||
| PythonServices.PythonEngineManager.Instance.LoadDefaultPythonEngine(AppDomain.CurrentDomain.GetAssemblies(). | ||
| FirstOrDefault(a => a != null && a.GetName().Name == PythonServices.PythonEngineManager.CPythonAssemblyName)); | ||
| } |
There was a problem hiding this comment.
why was this needed?
Aren't we adding the engine from another location?
There was a problem hiding this comment.
The default engine is added only when initializing the PythonEngineManager instance(inside the constructor) and when we cleared AvailableEngines collection, it was not added back. So loading it only when the available engines is still empty after initializing the PythonEngineManager.
There was a problem hiding this comment.
when we cleared AvailableEngines collection
Where was AvailableEngines being cleared before this change?
loading it only when the available engines is still empty after initializing the PythonEngineManager
I don't understand how the available engines collection can still be empty after initializing the PythonEngineManager on Dynamo startup?
There was a problem hiding this comment.
It was never being cleared before, so when dynamo was reopened in Revit, the AvailableEngines collection is not changed and PythonEngineAdded is not triggered.
When Dynamo is reopened, it still has access to the same PythonEngineManager instance(maybe since it is a static variable and uses lazy loading instance) from before and AvailableEngines are empty.
(cherry picked from commit 4ad6b39)
|
Successfully created backport PR for |
Purpose
When Dynamo is closed and reopened in D4R, the AvailableEngines collection under PythonEngineManager is not changed so the PythonEngineAdded is never triggered when Dynamo is reopened. This has caused this bug https://jira.autodesk.com/browse/DYN-9082.
So now, when Dynamo is closed, we clear the AvailableEngines collection and add the default python engine back when it s started back. The rest of the python engines, if any, will be loaded from the packages extension.
Declarations
Check these if you believe they are true
*.resxfilesRelease Notes
[DYN-9082] All Python Engines should be loaded correctly in D4R
Reviewers
@DynamoDS/eidos