Page 1 of 2

PyLuxCoreTools GUI

Posted: Thu Mar 15, 2018 1:25 pm
by Dade
I'm working on the graphical user interface for PyLuxCoreTools in order to make some feature, like network rendering, accessible to everyone. This is the GUI of PyLuxCoreNetNode:
ui.png
It is written with PySide (aka QT4) and designed with QtDesigner. The GUI can be accessed with the following commands:

Code: Select all

pyluxcoretool

or

pyluxcoretool netnodeui

Re: PyLuxCoreTools GUI

Posted: Fri Mar 16, 2018 7:40 am
by B.Y.O.B.
Cool. I'll try to test it on the weekend.

Re: PyLuxCoreTools GUI

Posted: Sat Mar 17, 2018 12:43 am
by B.Y.O.B.
I think the build script need to be changed so they install PySide along with the other dependencies.
Or it should be added to the readme?

I'm currently installing PySide via pip3, I guess when that's done and I recompile LuxCore, the pyluxcoretools binary will no longer throw this error?

Code: Select all

~/P/l/L/t/LuxCore› ./pyluxcoretool 
Traceback (most recent call last):
  File "pyluxcoretool.py", line 42, in <module>
  File "/tmp/_MEIdbMKTC/pyluxcoretools.zip/pyluxcoretools/pyluxcorenetconsole/ui.py", line 25, in <module>
ImportError: No module named 'PySide'
[28652] Failed to execute script pyluxcoretool
edit: Hm, I still get the same error.
Doing import PySide in a Python3 interpreter works.

Re: PyLuxCoreTools GUI

Posted: Sat Mar 17, 2018 1:08 am
by Dade
While developing/editing the sources, it is a lot faster to just use the following command inside the LuxCore directory:

Code: Select all

make -j 12 pyluxcoretools ; python3 samples/pyluxcoretool/pyluxcoretool.py netnodeui
The problem you having is related to PyInstaller but I have updated the packaging scripts (https://github.com/LuxCoreRender/LuxCor ... x.spec#L18
see the "hiddenimports=['uuid', 'PySide.QtCore','PySide.QtGui']," line) and they seems to work fine here :?:

Once you have installed PySide with pip3 where you use PyInstaller, it should work fine. The generate self-extracting executable should run also where PySide is not installed.

Note: I don't "import PySide", I do "import PySide.QtCore" and "PySide.QtGui" :?:

Re: PyLuxCoreTools GUI

Posted: Sat Mar 17, 2018 7:49 am
by B.Y.O.B.
Dade wrote: Sat Mar 17, 2018 1:08 am

Code: Select all

make -j 12 pyluxcoretools ; python3 samples/pyluxcoretool/pyluxcoretool.py netnodeui
When I run this, the second command crashes with SIGSEV.

How do I compile pyluxcore in debug mode?
Dade wrote: Sat Mar 17, 2018 1:08 am Note: I don't "import PySide", I do "import PySide.QtCore" and "PySide.QtGui"
This also works in a Python3 interpreter.

Re: PyLuxCoreTools GUI

Posted: Sat Mar 17, 2018 8:11 am
by B.Y.O.B.
I tried to get a debug build with

Code: Select all

cmake -DCMAKE_BUILD_TYPE=Debug .
make -j8
And gdb says that it finds debugging symbols in the binaries/libs, however when I run them with valgrind I still only get hex adresses instead of line numbers and function names :?:

This is the output of valgrind python3 samples/pyluxcoretool/pyluxcoretool.py netnodeui

Code: Select all

==12586== Process terminating with default action of signal 11 (SIGSEGV)
==12586==  Bad permissions for mapped region at address 0x216296
==12586==    at 0x216296: ???
==12586==    by 0x81200E7: std::future_category() (in /home/simon/Projekte/luxcore_build/LinuxCompile/LuxCore/lib/pyluxcore.so)
==12586==    by 0x9C22718: ??? (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.19)
==12586==    by 0x40101D9: call_init.part.0 (dl-init.c:78)
==12586==    by 0x40102C2: call_init (dl-init.c:36)
==12586==    by 0x40102C2: _dl_init (dl-init.c:126)
==12586==    by 0x4014CFF: dl_open_worker (dl-open.c:577)
==12586==    by 0x4010093: _dl_catch_error (dl-error.c:187)
==12586==    by 0x401444A: _dl_open (dl-open.c:661)
==12586==    by 0x541F02A: dlopen_doit (dlopen.c:66)
==12586==    by 0x4010093: _dl_catch_error (dl-error.c:187)
==12586==    by 0x541F62C: _dlerror_run (dlerror.c:163)
==12586==    by 0x541F0C0: dlopen@@GLIBC_2.2.5 (dlopen.c:87)
==12586== 
==12586== HEAP SUMMARY:
==12586==     in use at exit: 3,053,706 bytes in 6,983 blocks
==12586==   total heap usage: 26,385 allocs, 19,402 frees, 16,015,063 bytes allocated

Re: PyLuxCoreTools GUI

Posted: Sat Mar 17, 2018 8:52 am
by Dade
It looks like your PySide installation is corrupted/broken. Does it work aside from "import PySide" ? Try to run on normal python3 interpreter:

Code: Select all

import sys
from PySide.QtCore import *
from PySide.QtGui import *

# Create a Qt application
app = QApplication(sys.argv)
# Create a Label and show it
label = QLabel("Hello World")
label.show()
# Enter Qt application main loop
app.exec_()
sys.exit()
The result:

Code: Select all

david@i7-3930k:~/projects/luxcorerender/LuxCore$ python3
Python 3.4.3 (default, Nov 28 2017, 16:41:13) 
[GCC 4.8.4] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> from PySide.QtCore import *
>>> from PySide.QtGui import *
>>> 
>>> # Create a Qt application
... app = QApplication(sys.argv)
>>> # Create a Label and show it
... label = QLabel("Hello World")
>>> label.show()
>>> # Enter Qt application main loop
... app.exec_()
0
>>> sys.exit()
[2]+  Terminated              python3 samples/pysideluxcoredemo/pysideluxcoredemo.py
david@i7-3930k:~/projects/luxcorerender/LuxCore$ 
If it doesn't work, you can try to remove and re-install PySide with pip3.

P.S. why valgrind and not gdb ?

Re: PyLuxCoreTools GUI

Posted: Sat Mar 17, 2018 8:59 am
by neo2068
Hi! On windows I get an error when I try to install PySide. It seems that it is only supported until python 3.4.

Code: Select all

Collecting PySide
  Using cached PySide-1.2.4.tar.gz
    Complete output from command python setup.py egg_info:
    only these python versions are supported: [(2, 6), (2, 7), (3, 2), (3, 3), (3, 4)]

Re: PyLuxCoreTools GUI

Posted: Sat Mar 17, 2018 9:00 am
by B.Y.O.B.
Dade wrote: Sat Mar 17, 2018 8:52 am Does it work aside from "import PySide" ? Try to run on normal python3 interpreter:
It works:
scrn_2018-03-17_09-57-26.png
Dade wrote: Sat Mar 17, 2018 8:52 am It looks like your PySide installation is corrupted/broken.
Ok I'll try to reinstall. Yesterday night I compiled it with multithreading, maybe that killed it.
(I did it this way: https://stackoverflow.com/a/32598533 with pip3 install --install-option="--jobs=6" PySide)
Dade wrote: Sat Mar 17, 2018 8:52 am P.S. why valgrind and not gdb ?
Because I don't know how to use gdb :oops:

Re: PyLuxCoreTools GUI

Posted: Sat Mar 17, 2018 9:20 am
by Dade
It is strange because your crash seems inside pyluxcore. Does this work (i.e. the command line version) ?

Code: Select all

make -j 12 pyluxcoretools ; python3 samples/pyluxcoretool/pyluxcoretool.py netnode
To run gdb:

Code: Select all

david@i7-3930k:~/projects/luxcorerender/LuxCore$ make -j 12 pyluxcoretools
Built target pyluxcoretools
david@i7-3930k:~/projects/luxcorerender/LuxCore$ gdb python3
GNU gdb (Ubuntu 7.7.1-0ubuntu5~14.04.3) 7.7.1
Copyright (C) 2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from python3...(no debugging symbols found)...done.
(gdb) r samples/pyluxcoretool/pyluxcoretool.py netnodeui
At the crash, you can use the command "bt" to get the stack trace or "list" to list the line where the crash was.