morevnaproject-org / RenderChan

A smart rendering manager
BSD 3-Clause "New" or "Revised" License
55 stars 12 forks source link

opentoonz.py is buggy #95

Open Sam2much96 opened 9 months ago

Sam2much96 commented 9 months ago

The command line in line 51 is buggy. self.conf["binary"] returns a wrong directory path on and this breaks the subprocess call when attempting to render .tnz files on Linux using python 3

morevnaproject commented 8 months ago

Hi! You need to have "tcomposer" binary in your PATH. Otherwise RenderChan won't find it.

Sam2much96 commented 8 months ago

Hi. there are two reasons for this error

  1. self.conf["binary"] dictionary data is somehow manipulated from pointing to the binary file to pointing to the binary file directory. this ends up breaking the subprocess.check_call() command from calling "opentoonz.tcomposer" to calling "usr/bin/snap". Modifiying the subprocess command line from self.conf["binary"] to self.findBinary("tcomposer") rather than calling it in the 'init(self)' method fixes this.
  2. opentoonz tcomposer is buggy on ubuntu 22.04 and results in a segmentation fault error when using an app image to render tnz files, it also throws a dependency missing error "xcb" for qt when using $opentoonz.tcomposer to render .tnz files in the terminal. opentoonz.tcomposer requires libqxcb.so and so the subprocess call need to add qt plugin environment variables to it's call i.e. export QT_PLUGIN_PATH=/snap/opentoonz/147/usr/lib/x86_64-linux-gnu/qt5/plugins . More info on this can be read here

Fix:

opentoonz.py line 51 should be changed to

commandline=[self.findBinary("tcomposer"),'--appimage-exec', 'tcomposer', filename, "-o", os.path.join(img_outputPath, "image."+img_format), "-nthreads",extraParams['nthreads'], "-step", extraParams['step'], "-shrink", extraParams['shrink'], "-multimedia", extraParams['multimedia']]

And tcomposer.txt should point to an appimage of opentoonz-morevna in rebnderchan's directory

Sam2much96 commented 8 months ago

Fix: pointing tcomposer.txt to a compiled app image of opentoonz-morevna-1.4.0.appimage and running the following commands $./OpenToonz-1.4.0-morevna-2020.06.14-linux64-b6177.appimage --appimage-exec tcomposer '/path to tonnz files.tnz' -o '/path to output fileimage.tiff' -nthreads all

successfully compiles. If asked for qt dependencies errors $sudo apt install qt-creator this installs all required qt dependencies for running tcomposer in command line if missing

morevnaproject commented 8 months ago

Thank you for sharing your findings! Can you please post output of those two commands?

which tcomposer
ls -al /usr/bin/snap
Sam2much96 commented 8 months ago

Result:

samuel@samuel-x540na:~$ ls -al /usr/bin/snap -rwxr-xr-x 1 root root 16138392 May 29 2023 /usr/bin/snap samuel@samuel-x540na:~$ which tcomposer samuel@samuel-x540na:~$

I think Snap is buggy generally. Using App Images works better. No Hassles with snap or missing dependencies. I'll make a PR of my implementation of this approach.