armory3d / armsdk

Single-clone Armory SDK
37 stars 30 forks source link

Reload SDK when SDK source type has changed #41

Closed MoritzBrueckner closed 2 years ago

MoritzBrueckner commented 2 years ago

If Blender was started with a CWD relative to an armsdk folder and that armsdk folder was at the same path than the SDK path set in the user preferences, subsequent loads of Blender files didn't result in an update of the local_sdk variable that is passed to Armory upon startup/restart. This would then cause havoc later.

To correctly update that variable, the SDK is now also reloaded in case the type of SDK source (env var, local, prefs) changes. Ideally the local_sdk variable should get removed completely in its current form and the utils.get_sdk_path() function should get refactored, it currently still uses code from a time where the SDK could come bundled with Blender.

Thanks to the Discord user wuaieyo for report :)