Page 1 of 1

getPath() doesn't work on pymaxwell5

Posted: Fri Jan 14, 2022 9:39 am
by Mingfae Wong 20210811011621
Hi,
I have a simple code to get the render channel path, it works fine with pymaxwell4 but got error with pymaxwell, anyone can help?
renderPath = scene.getPath('RENDER')
TypeError: in method 'Cmaxwell_getPath', argument 2 of type 'mx::RenderChannels'


from pymaxwell5 import *
filepath = "C:/Users/wong.mingfae/Desktop/model.mxs"
scene = Cmaxwell(mwcallback_cb)
scene.readMXS(filepath)
renderPath = scene.getPath('RENDER')
print(renderPath)

Re: getPath() doesn't work on pymaxwell5

Posted: Mon Jan 17, 2022 6:24 pm
by Brany
Hello Mingfae,

we removed the "string" input parameter for getPath, use the FLAG_RENDER variable instead:

renderPath = scene.getPath(FLAG_RENDER)

Re: getPath() doesn't work on pymaxwell5

Posted: Tue Jan 18, 2022 8:01 am
by Mingfae Wong 20210811011621
Thank you Brain, I have change all parameter to FLAG_**** and works great, only these 3 channels doesn't work, do you know what's correct name it is?
FLAG_OBJECT
FLAG_MATERIAL
FLAG_SHADOW

Re: getPath() doesn't work on pymaxwell5

Posted: Tue Jan 18, 2022 9:02 pm
by Brany
Those ones are FLAG_ID_OBJECT, FLAG_ID_MATERIAL and FLAG_SHADOW_PASS
You can take a look at the c++ SDK header maxwellenums.h

Re: getPath() doesn't work on pymaxwell5

Posted: Thu Jan 20, 2022 6:15 am
by Mingfae Wong 20210811011621
I see, I only read the Python part, never think about that.
Thank you Brain!