there is an issue in Max 2021 in D10.1.6
Max 2020 iis python 2, but max 2021, is python 3, resulting if we are using an ifl sequence a submitMaxTodeadline_functions to fail
fn getMaxscriptListFromPythonList pythonList =
(
maxscriptList = #()
if SMTDFunctions.getMaxVersionAsInteger() >= 2017 then -- Python wrappers added in 2017
(
bi = python.Import("__builtin__")
for i = 1 to bi.len(pythonList) do
(
append maxscriptList pythonList[i]
)
)
else
(
throw "function getMaxscriptListFromPythonList is only available in 3dsmax 2017 or later."
)
return maxscriptList
),
need a few more edit to work with 2021 :
fn getMaxscriptListFromPythonList pythonList =
(
maxscriptList = #()
if SMTDFunctions.getMaxVersionAsInteger() >= 2017 then -- Python wrappers added in 2017
(
If ( SMTDFunctions.getMaxVersionAsInteger() >= 2021 ) then
(
bi = python.Import("builtins")
)
else
(
bi = python.Import("__builtin__")
)
for i = 1 to bi.len(pythonList) do
(
append maxscriptList pythonList[i]
)
)
else
(
throw "function getMaxscriptListFromPythonList is only available in 3dsmax 2017 or later."
)
return maxscriptList
),
For user having the trouble, modify the one in /submission/3dsMax/main…
Much More Sexy:
So if user use Python 2 in 2021, this still should work
fn getMaxscriptListFromPythonList pythonList =
(
maxscriptList = #()
if SMTDFunctions.getMaxVersionAsInteger() >= 2017 then -- Python wrappers added in 2017
(
--check Python Version
local py_imp = python.import "sys"
local Py_Vers = ((py_imp.version) [1]) as integer --First give me version
--Depending of Py version
Case Py_Vers of
(
2: (bi = python.Import("__builtin__"))
3: (bi = python.Import("builtins"))
)
for i = 1 to bi.len(pythonList) do
(
append maxscriptList pythonList[i]
)
)
else
(
throw "function getMaxscriptListFromPythonList is only available in 3dsmax 2017 or later."
)
return maxscriptList
),
Good/bad news, the fix the release notes are mentioning an issue where sys.path.index(SMTDPaths.MainSubmissionDir) was wrapped in a Maxscript try/catch. Which doesn’t handle Python errors at all. Which seems an awful lot like the fix you’ve got here.
Just to be sure, you did install the new integrated submitter when you re-tested this? It looks like it’ll still fail but I haven’t done a hard test at this moment.
3dsMAX 2020 is python2 (so require “builtin” (with double underscore) in python for assets to be collected
3dsMAX 2021 is by default python3 (so require “builtins” instead in python else we CAN NOT SEND scenes to farm if using IFL textures (no matter if it’s a sim or a rendering job, the issue is not a small one, but max 2021 could be python2 too (just we need to force max 2021 to use python 2)
Please remplace in /submission/3dsMax/main/submitMaxTodeadline_functions.ms
your script code (that do NOT work) with this one for this function (this one work no matter if max will use python 2 or 3):
fn getMaxscriptListFromPythonList pythonList =
(
maxscriptList = #()
if SMTDFunctions.getMaxVersionAsInteger() >= 2017 then -- Python wrappers added in 2017
(
--check Python Version
local py_imp = python.import "sys"
local Py_Vers = ((py_imp.version) [1]) as integer --First give me version
--Depending of Py version
Case Py_Vers of
(
2: (bi = python.Import("__builtin__"))
3: (bi = python.Import("builtins"))
)
for i = 1 to bi.len(pythonList) do
(
append maxscriptList pythonList[i]
)
)
else
(
throw "function getMaxscriptListFromPythonList is only available in 3dsmax 2017 or later."
)
return maxscriptList
),