Skip to content

Commit d29a9d1

Browse files
committed
Updated UI, and connected new elements. Did NOT update functionality yet.
1 parent 70b8cdf commit d29a9d1

File tree

2 files changed

+94
-59
lines changed

2 files changed

+94
-59
lines changed

cleanDWG.py

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# ----------------------------
2-
# Clean DWG v1.0.0 Release
3-
# ----------------------------
1+
# -----------------------
2+
# Clean DWG DEV BUILD
3+
# -----------------------
44

55
# Destroys instances of the dialog before recreating it
66
# This has to go first, before modules are reloaded or the ui var is re-declared.
@@ -77,13 +77,16 @@ def __init__(self, ui_file, pymxs, parent=MaxPlus.GetQMaxMainWindow()):
7777

7878
# Titling
7979

80-
self._window_title = 'Clean DWG v1.0.0'
80+
self._window_title = 'Clean DWG - DEV BUILD'
8181
self.setWindowTitle(self._window_title)
8282

8383
# ---------------------------------------------------
8484
# Widget Setup
8585
# ---------------------------------------------------
8686

87+
self._chk_expand = self.findChild(QtW.QCheckBox, 'chk_expand')
88+
self._chk_full_scene = self.findChild(QtW.QCheckBox, 'chk_fullScene')
89+
8790
self._btn_clean = self.findChild(QtW.QPushButton, 'btn_clean')
8891
self._bar_progress = self.findChild(QtW.QProgressBar, 'bar_progress')
8992
self._lbl_status = self.findChild(QtW.QLabel, 'lbl_status')
@@ -123,6 +126,9 @@ def __init__(self, ui_file, pymxs, parent=MaxPlus.GetQMaxMainWindow()):
123126
# Public Methods
124127
# ---------------------------------------------------
125128

129+
# TODO: Set up options checking
130+
# TODO: Add functionality for "Expand Selection" and "Clean Entire Scene" options
131+
126132
def clean(self):
127133
rt = self._pymxs.runtime
128134
selection = []
@@ -143,7 +149,7 @@ def clean(self):
143149
layer_parents.isHidden = True
144150

145151
# 1/4
146-
# Build list of selected objects
152+
# Build list of selected objects, optionally including their entire hierarchy.
147153
self._lbl_status.setText(self._status[1])
148154
selection = rt.getCurrentSelection()
149155

cleandwg.ui

Lines changed: 83 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
<rect>
77
<x>0</x>
88
<y>0</y>
9-
<width>260</width>
10-
<height>272</height>
9+
<width>261</width>
10+
<height>326</height>
1111
</rect>
1212
</property>
1313
<property name="sizePolicy">
@@ -25,36 +25,12 @@
2525
</property>
2626
<item>
2727
<widget class="QGroupBox" name="groupBox">
28-
<property name="sizePolicy">
29-
<sizepolicy hsizetype="Preferred" vsizetype="MinimumExpanding">
30-
<horstretch>0</horstretch>
31-
<verstretch>0</verstretch>
32-
</sizepolicy>
33-
</property>
34-
<property name="minimumSize">
35-
<size>
36-
<width>0</width>
37-
<height>0</height>
38-
</size>
39-
</property>
40-
<property name="maximumSize">
41-
<size>
42-
<width>9999</width>
43-
<height>16777215</height>
44-
</size>
45-
</property>
4628
<property name="title">
4729
<string>Instructions</string>
4830
</property>
4931
<property name="alignment">
5032
<set>Qt::AlignCenter</set>
5133
</property>
52-
<property name="flat">
53-
<bool>true</bool>
54-
</property>
55-
<property name="checkable">
56-
<bool>false</bool>
57-
</property>
5834
<layout class="QVBoxLayout" name="verticalLayout_2">
5935
<property name="spacing">
6036
<number>5</number>
@@ -63,7 +39,7 @@
6339
<number>5</number>
6440
</property>
6541
<property name="topMargin">
66-
<number>3</number>
42+
<number>5</number>
6743
</property>
6844
<property name="rightMargin">
6945
<number>5</number>
@@ -73,18 +49,6 @@
7349
</property>
7450
<item>
7551
<widget class="QLabel" name="label">
76-
<property name="sizePolicy">
77-
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
78-
<horstretch>0</horstretch>
79-
<verstretch>0</verstretch>
80-
</sizepolicy>
81-
</property>
82-
<property name="minimumSize">
83-
<size>
84-
<width>0</width>
85-
<height>0</height>
86-
</size>
87-
</property>
8852
<property name="font">
8953
<font>
9054
<weight>75</weight>
@@ -97,6 +61,9 @@
9761
<property name="wordWrap">
9862
<bool>true</bool>
9963
</property>
64+
<property name="textInteractionFlags">
65+
<set>Qt::NoTextInteraction</set>
66+
</property>
10067
</widget>
10168
</item>
10269
<item>
@@ -108,33 +75,45 @@
10875
</item>
10976
<item>
11077
<widget class="QLabel" name="label_2">
78+
<property name="autoFillBackground">
79+
<bool>false</bool>
80+
</property>
81+
<property name="text">
82+
<string>Selected objects will be checked for Block/Style Parent objects. These dummy parents will be removed, and child object transforms will be preserved.</string>
83+
</property>
84+
<property name="wordWrap">
85+
<bool>true</bool>
86+
</property>
87+
<property name="margin">
88+
<number>0</number>
89+
</property>
90+
<property name="indent">
91+
<number>-1</number>
92+
</property>
93+
<property name="textInteractionFlags">
94+
<set>Qt::NoTextInteraction</set>
95+
</property>
96+
</widget>
97+
</item>
98+
<item>
99+
<widget class="QLabel" name="label_3">
111100
<property name="sizePolicy">
112-
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
101+
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
113102
<horstretch>0</horstretch>
114103
<verstretch>0</verstretch>
115104
</sizepolicy>
116105
</property>
117-
<property name="minimumSize">
118-
<size>
119-
<width>0</width>
120-
<height>0</height>
121-
</size>
106+
<property name="layoutDirection">
107+
<enum>Qt::LeftToRight</enum>
122108
</property>
123109
<property name="text">
124-
<string>Objects and their parents will be checked for VIZ Block Parent objects, these dummy parents wil be removed and child object transforms preserved. </string>
110+
<string>Optionally, the selection will be expanded to include all parents and children of selected objects, or everything in the current scene.</string>
125111
</property>
126112
<property name="wordWrap">
127113
<bool>true</bool>
128114
</property>
129115
</widget>
130116
</item>
131-
<item>
132-
<widget class="Line" name="line_2">
133-
<property name="orientation">
134-
<enum>Qt::Horizontal</enum>
135-
</property>
136-
</widget>
137-
</item>
138117
</layout>
139118
</widget>
140119
</item>
@@ -151,6 +130,56 @@
151130
</property>
152131
</spacer>
153132
</item>
133+
<item>
134+
<widget class="QGroupBox" name="groupBox_2">
135+
<property name="layoutDirection">
136+
<enum>Qt::LeftToRight</enum>
137+
</property>
138+
<property name="title">
139+
<string>Options</string>
140+
</property>
141+
<property name="alignment">
142+
<set>Qt::AlignCenter</set>
143+
</property>
144+
<layout class="QFormLayout" name="formLayout">
145+
<property name="horizontalSpacing">
146+
<number>5</number>
147+
</property>
148+
<property name="verticalSpacing">
149+
<number>5</number>
150+
</property>
151+
<property name="leftMargin">
152+
<number>5</number>
153+
</property>
154+
<property name="topMargin">
155+
<number>5</number>
156+
</property>
157+
<property name="rightMargin">
158+
<number>5</number>
159+
</property>
160+
<property name="bottomMargin">
161+
<number>5</number>
162+
</property>
163+
<item row="0" column="0">
164+
<widget class="QCheckBox" name="chk_expand">
165+
<property name="text">
166+
<string>Expand selection?</string>
167+
</property>
168+
</widget>
169+
</item>
170+
<item row="0" column="1">
171+
<widget class="QCheckBox" name="chk_fullScene">
172+
<property name="layoutDirection">
173+
<enum>Qt::LeftToRight</enum>
174+
</property>
175+
<property name="text">
176+
<string>Clean entire scene?</string>
177+
</property>
178+
</widget>
179+
</item>
180+
</layout>
181+
</widget>
182+
</item>
154183
<item>
155184
<widget class="QPushButton" name="btn_clean">
156185
<property name="minimumSize">
@@ -166,7 +195,7 @@
166195
</font>
167196
</property>
168197
<property name="text">
169-
<string>Clean Block Parents</string>
198+
<string>Clean Block/Style Parents</string>
170199
</property>
171200
</widget>
172201
</item>

0 commit comments

Comments
 (0)