-
Notifications
You must be signed in to change notification settings - Fork 668
[DYN-9082] All Python Engines should be loaded correctly in D4R #16388
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
Conversation
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why was this needed?
Aren't we adding the engine from another location?
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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