33
33
import xml .dom .minidom as xml
34
34
import functools
35
35
36
- from PyQt5 .QtCore import QSize , Qt , QEvent , QObject , QThread , pyqtSlot , pyqtSignal , QMetaObject , Q_ARG , QTimer
37
- from PyQt5 .QtGui import *
38
- from PyQt5 .QtWidgets import *
36
+ from PyQt5 .QtCore import (
37
+ Qt , QObject , pyqtSlot , pyqtSignal , QMetaObject , Q_ARG , QThread , QTimer , QSize ,
38
+ )
39
+ from PyQt5 .QtWidgets import (
40
+ QApplication , QListView , QMessageBox , QColorDialog ,
41
+ QComboBox , QDoubleSpinBox , QLabel , QPushButton , QLineEdit , QPlainTextEdit ,
42
+ )
43
+ from PyQt5 .QtGui import QColor , QImage , QPixmap
39
44
40
45
from classes import info
41
46
from classes .logger import log
44
49
from classes .app import get_app
45
50
from windows .models .blender_model import BlenderModel
46
51
47
- import json
48
-
49
52
50
53
class BlenderListView (QListView ):
51
- """ A TreeView QWidget used on the animated title window """
54
+ """ A ListView QWidget used on the animated title window """
52
55
53
56
def currentChanged (self , selected , deselected ):
54
57
# Get selected item
@@ -74,7 +77,7 @@ def currentChanged(self, selected, deselected):
74
77
self .generateUniqueFolder ()
75
78
76
79
# Loop through params
77
- for param in animation .get ("params" ,[]):
80
+ for param in animation .get ("params" , []):
78
81
log .info ('Using parameter %s: %s' % (param ["name" ], param ["title" ]))
79
82
80
83
# Is Hidden Param?
@@ -588,7 +591,7 @@ def Render(self, frame=None):
588
591
589
592
def __init__ (self , * args ):
590
593
# Invoke parent init
591
- QTreeView .__init__ (self , * args )
594
+ super () .__init__ (* args )
592
595
593
596
# Get a reference to the window object
594
597
self .app = get_app ()
@@ -633,7 +636,6 @@ def __init__(self, *args):
633
636
# Refresh view
634
637
self .refresh_view ()
635
638
636
-
637
639
# Background Worker Thread (for Blender process)
638
640
self .background = QThread (self )
639
641
self .worker = Worker () # no parent!
@@ -722,9 +724,14 @@ def Render(self, blend_file_path, target_script, preview_mode=False):
722
724
723
725
# Check the version of Blender
724
726
import shlex
725
- log .info ("Checking Blender version, command: {}" .format (" " .join ([shlex .quote (x ) for x in command_get_version ])))
727
+ log .info ("Checking Blender version, command: {}" .format (
728
+ " " .join ([shlex .quote (x ) for x in command_get_version ])))
726
729
727
- self .process = subprocess .Popen (command_get_version , stdout = subprocess .PIPE , stderr = subprocess .PIPE , startupinfo = startupinfo , universal_newlines = True )
730
+ self .process = subprocess .Popen (
731
+ command_get_version ,
732
+ stdout = subprocess .PIPE , stderr = subprocess .PIPE ,
733
+ startupinfo = startupinfo , universal_newlines = True ,
734
+ )
728
735
729
736
# Check the version of Blender
730
737
self .version = self .blender_version .findall (self .process .stdout .readline ())
@@ -739,11 +746,16 @@ def Render(self, blend_file_path, target_script, preview_mode=False):
739
746
return
740
747
741
748
# debug info
742
- log .info ("Running Blender, command: {}" .format (" " .join ([shlex .quote (x ) for x in command_render ])))
749
+ log .info ("Running Blender, command: {}" .format (
750
+ " " .join ([shlex .quote (x ) for x in command_render ])))
743
751
log .info ("Blender output:" )
744
752
745
753
# Run real command to render Blender project
746
- self .process = subprocess .Popen (command_render , stdout = subprocess .PIPE , stderr = subprocess .STDOUT , startupinfo = startupinfo , universal_newlines = True )
754
+ self .process = subprocess .Popen (
755
+ command_render ,
756
+ stdout = subprocess .PIPE , stderr = subprocess .STDOUT ,
757
+ startupinfo = startupinfo , universal_newlines = True ,
758
+ )
747
759
748
760
except Exception as ex :
749
761
# Error running command. Most likely the blender executable path in
0 commit comments