Everything related to SDK.
User avatar
By seghier
#395658
i download pyqt5 for python 2.7 ; i don't know why python 2.7 show the errors but other versions just crash without any information.
and the errors :
ok = scene.readMXS(self.edit_input_file.text(), Cmaxwell.SKIP_OBJECTS);
TypeError: in method 'Cmaxwell_readMXS', argument 2 of type 'char const *'

ok = scene.readMXS(mxsList);
TypeError: in method 'Cmaxwell_readMXS', argument 2 of type 'char const *'
User avatar
By seghier
#395662
problem solved ; with pyqt5 and python2.7 readMxs and writeMxs must add str()
but with pyqt5 and python 3.5 always problem in readMxs() ; even i use str()

scene.readMXS(mxsList) >> [python 2.7 / pyqt4] work
scene.readMXS(str(mxsList)) >> [python 2.7 / pyqt5] work
scene.readMXS(mxsList) or scene.readMXS(str(mxsList)) >> [python 3.5 / pyqt5] crash
User avatar
By seghier
#395663
when i run the script from terminal i got this error :

Warning: Warning in Method = readMXS
error = Path is NULL or Empty
During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "maxwell_toolv6.py", line 1842, in openMxmSorA
self.MXMopenMxs()
File "maxwell_toolv6.py", line 1870, in MXMopenMxs
ok = scene.readMXS(str(mxsList)) { or ok = scene.readMXS(mxsList)}
SystemError: <built-in function Cmaxwell_readMXS> returned a result with an error set
User avatar
By Brany
#395668
can you print the value of str(mxsList)? If it is a list, you must select one of the paths, readMXS does not admit a list of MXS paths ;)
User avatar
By seghier
#395672
everytime when i solve problem i find another !
with pyqt5 and python 3.5 some lines need new arrangement and that solve the problem of readMXS()
and now the problem with render parameter ; i used str(Re) but don't work
nn = self.engine_choice.currentIndex()
Code: Select all
if nn == 0:  # CPU production
                Re = 'RS1'
            elif nn == 1:  # CPU draft
                Re = 'RS0'
            elif nn == 2:  # GPU
                Re = 'RSC'
            scene.setRenderParameter('SAMPLING LEVEL', sl)
            scene.setRenderParameter('STOP TIME', st)
            scene.setRenderParameter('DO NOT SAVE MXI FILE', self.check_mxi.isChecked()==False and 1)
            scene.setRenderParameter('DO NOT SAVE IMAGE FILE', self.check_img.isChecked()==False and 1)
            scene.setRenderParameter('DENOISE ENABLED', self.enable_denoiser.isChecked() and 1)
            scene.setRenderParameter('DENOISE SHADOW', self.den_shad.isChecked() and 1)
            scene.setRenderParameter('DENOISE GPU', self.use_gpu.isChecked() and 1)
            scene.setRenderParameter('DO MOTION BLUR', self.motion_blur.isChecked() and 1)
            scene.setRenderParameter('DO DISPLACEMENT', self.displacement.isChecked() and 1)
            scene.setRenderParameter('DO DISPERSION', self.dispersion.isChecked() and 1)
            scene.setRenderParameter('ENGINE', Re)
and the error message :
Traceback (most recent call last):
File "maxwell_toolv6.py", line 791, in render
self.rendering()
File "maxwell_toolv6.py", line 935, in rendering
scene.setRenderParameter('ENGINE', Re)
SystemError: <built-in function Cmaxwell_setRenderParameter> returned a result with an error set
User avatar
By Brany
#395694
I found what is happening. This methods expects "bytes" instead of a "str", so you have to call it his way in Python 3.x:
Code: Select all
scene.setRenderParameter('ENGINE', b'RS0')
with that "b" before the text string.
User avatar
By seghier
#395701
thanks again ; it work fine :)
the error message disappear and there is a new one, i fix it by change MAXWELL3_ROOT to MAXWELL4_ROOT.
this __init__.py is : pymaxwell4.py from : "C:\Program Files\Next Limit\Maxwell Render 4\python\pymaxwell4\python3.5"
MAXWELL3_ROOT environment variable not found!
Traceback (most recent call last):
File "maxwell_toolv6.py", line 847, in render
self.rendering()
File "maxwell_toolv6.py", line 1003, in rendering
runMaxwell(parameters)
File "C:\Python35\lib\site-packages\pymaxwell\__init__.py", line 127, in runMaxwell
parameters.insert(0,mwroot+'/maxwell.exe');
UnboundLocalError: local variable 'mwroot' referenced before assignment

...and 3 Days later, 82.528 Views !!! ...NL, every[…]

Hello dear customers, We have just released a new[…]

grass generator extension

Just downloaded MWR5 for Rhino 6 and want to use g[…]

Hello everyone, I have a new bug with the latest M[…]