@@ -121,12 +121,27 @@ export async function DebugScriptContentInScriptManager()
121
121
{ throw new Error ( "Unable to retrieve Cinema 4D path" ) ; }
122
122
123
123
let pythonPath = os . platform ( ) === 'win32' ?
124
- path . posix . join ( c4dPath , "resource" , "modules" , "python" , "libs" , "python39.win64.framework" , "python.exe" )
124
+ path . join ( c4dPath , "resource" , "modules" , "python" , "libs" , "python39.win64.framework" , "python.exe" )
125
125
:
126
- path . posix . join ( c4dPath , "resource" , "modules" , "python" , "libs" , "python39.macos.framework" , "python" , "Contents" , "MacOS" , "python" )
126
+ path . join ( c4dPath , "resource" , "modules" , "python" , "libs" , "python39.macos.framework" , "python" , "Contents" , "MacOS" , "python" )
127
127
;
128
+
129
+ if ( ! fs . existsSync ( pythonPath ) )
130
+ { pythonPath = os . platform ( ) === 'win32' ?
131
+ path . join ( c4dPath , "resource" , "modules" , "python" , "libs" , "python310.win64.framework" , "python.exe" )
132
+ :
133
+ path . join ( c4dPath , "resource" , "modules" , "python" , "libs" , "python310.macos.framework" , "python" , "Contents" , "MacOS" , "python" )
134
+ ; }
135
+
136
+ if ( ! fs . existsSync ( pythonPath ) )
137
+ { throw new Error ( "Incorrect path for the c4d python executable, debugger will not work." ) ; }
128
138
129
- let debugAdapterPath = path . posix . join ( c4dPath ! , "resource" , "modules" , "python" , "libs" , "python39" , "debugpy" , "adapter" ) ;
139
+ let debugAdapterPath = path . join ( c4dPath ! , "resource" , "modules" , "python" , "libs" , "python39" , "debugpy" , "adapter" ) ;
140
+ if ( ! fs . existsSync ( debugAdapterPath ) )
141
+ { debugAdapterPath = path . join ( c4dPath ! , "resource" , "modules" , "python" , "libs" , "python310" , "debugpy" , "adapter" ) ; }
142
+
143
+ if ( ! fs . existsSync ( pythonPath ) )
144
+ { throw new Error ( "Incorrect path for the debugpy, debugger will not work." ) ; }
130
145
131
146
let configName = `Python attached to Cinema 4D - PID ${ pid } ` ;
132
147
let configuration : vscode . DebugConfiguration =
@@ -169,7 +184,7 @@ export async function LoadTemplateScript()
169
184
170
185
fs . readdirSync ( templatePath ) . forEach ( fileName =>
171
186
{
172
- let file = path . posix . join ( templatePath , fileName ) ;
187
+ let file = path . join ( templatePath , fileName ) ;
173
188
if ( fileName . endsWith ( ".py" ) )
174
189
{
175
190
fileNames . push ( new FileItem ( file ) ) ;
0 commit comments