D10.1.6 error with max 2021 (python 2 -> python 3)

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…

Then you are good to go :slight_smile:

Much More Sexy:
So if user use Python 2 in 2021, this still should work :slight_smile:

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
		),

Come One Thinkbox, still not implemented in 10.1.8.5 …and it’s supposed to be a fix on it
3ds Max

  • Fixed a bug in SubmitMaxToDeadline when using IFL (Image File List) where Python errors were not being caught and handled properly

But no, 10.1.8.5 still not abble to collect IFL, in 2021 because python 3 is not python 2, you got the code, just add it…

Edited : it was the wrong zip file, corrected
SubmitMaxToDeadline_Functions.zip (109.0 KB)

Sorry I forgot about this!

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.

Oups no , i’m still on old SMTD if there is a new one, I update nothing except my repo…then lunch luncher…

For my fix, i cheat, i edit this during 2021 beta :stuck_out_tongue: and take me a long time before hitting the bug (need to use IFL texture)

Still present in 10.1.9.2…seriously :expressionless: :expressionless: :expressionless:

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
		),

SubmitMaxToDeadline_Functions.zip (110.0 KB)

Privacy | Site terms | Cookie preferences