forked from blank63/j3dview
-
Notifications
You must be signed in to change notification settings - Fork 1
/
forms.py
77 lines (54 loc) · 3.17 KB
/
forms.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
from PyQt5 import QtCore,QtGui,uic, QtWidgets
import gx
class ViewSettingsForm(QtWidgets.QWidget):
def __init__(self,*args,**kwargs):
super().__init__(*args,**kwargs)
self.ui = uic.loadUi('ui/ViewSettingsForm.ui',self)
def setViewer(self,viewer):
self.z_near.bindProperty(viewer,'z_near',viewer.z_near_changed)
self.z_far.bindProperty(viewer,'z_far',viewer.z_far_changed)
self.fov.bindProperty(viewer,'fov',viewer.fov_changed)
self.movement_speed.bindProperty(viewer,'movement_speed',viewer.movement_speed_changed)
self.rotation_speed.bindProperty(viewer,'rotation_speed',viewer.rotation_speed_changed)
class TextureForm(QtWidgets.QWidget):
def __init__(self,*args,**kwargs):
super().__init__(*args,**kwargs)
self.ui = uic.loadUi('ui/TextureForm.ui',self)
self.wrap_s.setItems([gx.CLAMP,gx.REPEAT,gx.MIRROR])
self.wrap_t.setItems([gx.CLAMP,gx.REPEAT,gx.MIRROR])
self.minification_filter.setItems([gx.NEAR,gx.LINEAR,gx.NEAR_MIP_NEAR,gx.LIN_MIP_NEAR,gx.NEAR_MIP_LIN,gx.LIN_MIP_LIN])
self.magnification_filter.setItems([gx.NEAR,gx.LINEAR])
@QtCore.pyqtSlot(object)
def setTexture(self,texture):
self.name.bindProperty(texture,'name',texture.name_changed)
self.image_format.setText(texture.image_format.name)
self.image_size.setText('{} x {}'.format(texture.width,texture.height))
self.image_levels.setText(str(len(texture.images)))
if texture.palette is not None:
self.palette_format.setText(texture.palette.palette_format.name)
self.palette_size.setText(str(len(texture.palette)))
else:
self.palette_format.setText('-')
self.palette_size.setText('-')
self.wrap_s.bindProperty(texture,'wrap_s',texture.wrap_s_changed)
self.wrap_t.bindProperty(texture,'wrap_t',texture.wrap_t_changed)
self.minification_filter.bindProperty(texture,'minification_filter',texture.minification_filter_changed)
self.magnification_filter.bindProperty(texture,'magnification_filter',texture.magnification_filter_changed)
self.minimum_lod.bindProperty(texture,'minimum_lod',texture.minimum_lod_changed)
self.maximum_lod.bindProperty(texture,'maximum_lod',texture.maximum_lod_changed)
self.lod_bias.bindProperty(texture,'lod_bias',texture.lod_bias_changed)
self.unknown0.bindProperty(texture,'unknown0',texture.unknown0_changed)
self.unknown1.bindProperty(texture,'unknown1',texture.unknown1_changed)
self.unknown2.bindProperty(texture,'unknown2',texture.unknown2_changed)
def setUndoStack(self,undo_stack):
self.name.setUndoStack(undo_stack)
self.wrap_s.setUndoStack(undo_stack)
self.wrap_t.setUndoStack(undo_stack)
self.minification_filter.setUndoStack(undo_stack)
self.magnification_filter.setUndoStack(undo_stack)
self.minimum_lod.setUndoStack(undo_stack)
self.maximum_lod.setUndoStack(undo_stack)
self.lod_bias.setUndoStack(undo_stack)
self.unknown0.setUndoStack(undo_stack)
self.unknown1.setUndoStack(undo_stack)
self.unknown2.setUndoStack(undo_stack)