hello folks!
can somebody please enlighten me?
since 3dsmax is now shipped with python "support", i'm trying to use some global functions and variables from existing py-files which we are using for our pipeline.
i can't get this to work and since i'm only familiar with maxscript i'm wondering if i do something completely wrong....
lets say i have a lib.py file, containing several variables and functions i want to use,
for example var01, var02, function01 etc....
so in maxscript i use:
python.executefile "lib.py" ---> results in "#success"
now i can call these functions and variables:
python.execute "print var01" ---> results in "expectedValue" AND "#success
i'm also able to call functions:
python.execute "function01" ----> results in "expectedValue" AND "#success"
BUT
i want to further use these results in maxscript.... and i don't know how....
when i try to access the variables as usual (after executing the py file of course):
(like in MXS):
var01 it returns "undefined"
when i try to assign it as a "python function" like this:
myVariable = (python.execute "print var01") it results in "expectedValue" AND "#success"
so myVariable always contains "#success" but not the Value i actually wanted...
can someone clarify this, please ?
thx in advance
There's a throwOnError:false argument which should do that but I couldn't spot a difference. If you are okay with parsing listener output yourself, that's another way:
( clearListener() python.Execute "print 'hello'" throwOnError:false local ls = listener as stringStream for i in i = -1/0. to -1/0. while not eof ls collect readLine ls )
IMHO there should be a better python integration!