@@ -127,6 +127,10 @@ def prepare_launch(self, exec_path, args, file_to_open=None):
127127 required_env .update (plugin_env )
128128 required_env ["PYTHONPATH" ] = os .environ ["PYTHONPATH" ]
129129
130+ # Pass the framework path explicitly for the embedded Python plugin,
131+ # which cannot safely use the full PYTHONPATH (stdlib version conflicts).
132+ required_env ["TK_FRAMEWORK_ALIAS_PYTHON_PATH" ] = framework_python_path
133+
130134 # Prepare the launch environment with variables required by the
131135 # classic bootstrap approach.
132136 required_env ["SGTK_ENGINE" ] = self .engine_name
@@ -141,6 +145,15 @@ def prepare_launch(self, exec_path, args, file_to_open=None):
141145 if file_to_open :
142146 required_env ["SGTK_FILE_TO_OPEN" ] = file_to_open
143147
148+ if not plugin_file_path :
149+ # No C++ plugin, use our Python plugin
150+ required_env ["ALIAS_INTERNAL_PYTHON_SCRIPT_FOLDER" ] = os .path .join (
151+ self .disk_location , "plugins"
152+ )
153+ # FIXME default to 0
154+ alias_debug = os .environ .get ("TK_ALIAS_DEBUG_CONSOLE" , "1" )
155+ required_env ["ALIAS_DEBUG_CONSOLE" ] = alias_debug
156+
144157 # Get the launch app path and args
145158 app_path , app_args = self .__prepare_launch_args (
146159 args , code_name , plugin_file_path , exec_path , server_python_exe
@@ -342,7 +355,7 @@ def __prepare_launch_args(
342355 :type args: str
343356 :parm code_name: The Alias code name.
344357 :type code_name: str
345- :parm plugin_file_path: The file path to the .lst file used to auto load plugins.
358+ :parm plugin_file_path: The file path to the .lst file used to auto load C++ plugins.
346359 :type plugin_file_path: str
347360 :param alias_exe: The file path to the Alias executable.
348361 :type alias_exe: str
@@ -363,15 +376,17 @@ def __prepare_launch_args(
363376 app_args += " " + code_name_flags
364377
365378 if python_exe is None :
366- # Launching Alias application directly - add the plugin file path to the Alias cmd
367- # line args to auto-load the plugin.
368- app_args += ' -P "{0}' .format (plugin_file_path )
369- app_args += '"'
379+ # Launching Alias application directly
380+ if plugin_file_path :
381+ # Add the C++ plugin file path to the Alias cmd line args to auto-load the plugin.
382+ app_args += ' -P "{0}' .format (plugin_file_path )
383+ app_args += '"'
370384 app_path = alias_exe
371385 else :
372386 # Launching Alias indirectly to ensure the Alias Plugin uses a specific Python
373387 # version - wrap the command line to launch Alias with the given python executable
374- app_args += f' -P \\ "{ plugin_file_path } \\ "'
388+ if plugin_file_path :
389+ app_args += f' -P \\ "{ plugin_file_path } \\ "'
375390 python_args = f'import os;os.system(r\' start /B \\ "App\\ " \\ "{ alias_exe } \\ " { app_args } \' )'
376391 app_args = f'-c "{ python_args } "'
377392 app_path = python_exe
0 commit comments