Skip to content
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

feat: Only load plugins if builtin python is available. #1012

Merged
merged 5 commits into from
Dec 20, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Body/AAUHuman/BodyModels/GenericBodyModel/BM_Plugin.any
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#if ANYBODY_BUILTIN_PYTHON_AVAILABLE

AnyGUIPlugin BMPlugin = {

#ifndef __BMPLUGIN_PATH__
Expand Down Expand Up @@ -65,3 +67,4 @@ AnyGUIPlugin BMPlugin = {
#endif
};

#endif
21 changes: 20 additions & 1 deletion Body/AAUHuman/HumanModel.defs.any
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ Error("ANYBODY_PATH_TOOLBOX is deprecated. Use ANYBODY_PATH_MODELUTILS instead")


#define ANYBODY_PYTHON_AVAILABLE 0
#define ANYBODY_BUILTIN_PYTHON_AVAILABLE 0

#ifdef ANYBODY_PATH_PYTHONHOME
#ifpathexists "<ANYBODY_PATH_PYTHONHOME>/python.exe"
Expand All @@ -32,7 +33,25 @@ Error("ANYBODY_PATH_TOOLBOX is deprecated. Use ANYBODY_PATH_MODELUTILS instead")

#ifpathexists "<ANYBODY_PATH_INSTALLDIR>/Python/python.exe"
#undef ANYBODY_PYTHON_AVAILABLE
#undef ANYBODY_BUILTIN_PYTHON_AVAILABLE
#define ANYBODY_PYTHON_AVAILABLE 1
#define ANYBODY_BUILTIN_PYTHON_AVAILABLE 1
#endif


#ifndef ANYBODY_PYTHON_SUPPRESS_NOTICE
#if ANYBODY_PYTHON_AVAILABLE == 0
AnyMessage PythonMissing =
{
Type = MSG_Message;
TriggerPreProcess = On;
Message = strformat("\n\n"+
"------------------------------------------------------------------------------------------------------\n"+
" Python is not installed with the AnyBody Modeling System. \n"+
" Some functionality in the AMMR maybe missing. \n"+
" Reinstall AnyBody with Python or set ANYBODY_PATH_PYTHONHOME to an existing Python installation. \n"+
"\n"+
"Suppress this notice by setting: #define ANYBODY_PYTHON_SUPPRESS_NOTICE \n"+
"------------------------------------------------------------------------------------------------------\n");
};
#endif
#endif
5 changes: 3 additions & 2 deletions Tools/Plugins/ANSUR_Plugin.any
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@


#if ANYBODY_BUILTIN_PYTHON_AVAILABLE
AnyGUIPlugin ANSURPlugin = {
PluginFile = "ANSUR_Plugin-1.2.2-py3.11.egg";
ToolTip = "Change Model Scaling";
Console = Off;
Interactive = Off;
DisplayName = "ANSUR Configuration";
};


#endif
Loading
Loading