-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmainwindow.ui
2793 lines (2793 loc) · 131 KB
/
mainwindow.ui
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>MainWindow</class>
<widget class="QMainWindow" name="MainWindow">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>880</width>
<height>632</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>880</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>16777215</height>
</size>
</property>
<property name="windowTitle">
<string>Clean Models:EE QT</string>
</property>
<property name="toolButtonStyle">
<enum>Qt::ToolButtonIconOnly</enum>
</property>
<widget class="QWidget" name="centralWidget">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<layout class="QVBoxLayout" name="mainVerticalLayout">
<property name="spacing">
<number>6</number>
</property>
<item>
<widget class="QTabWidget" name="mainTabs">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>858</width>
<height>328</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>328</height>
</size>
</property>
<property name="tabPosition">
<enum>QTabWidget::West</enum>
</property>
<property name="tabShape">
<enum>QTabWidget::Rounded</enum>
</property>
<property name="currentIndex">
<number>0</number>
</property>
<widget class="QWidget" name="generalTab">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>858</width>
<height>324</height>
</size>
</property>
<attribute name="title">
<string>General</string>
</attribute>
<attribute name="toolTip">
<string>General settings.</string>
</attribute>
<widget class="QPushButton" name="outdirButton">
<property name="geometry">
<rect>
<x>260</x>
<y>40</y>
<width>41</width>
<height>28</height>
</rect>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset theme="go-down">
<normaloff>.</normaloff>.</iconset>
</property>
</widget>
<widget class="QPushButton" name="indirButton">
<property name="geometry">
<rect>
<x>260</x>
<y>10</y>
<width>41</width>
<height>28</height>
</rect>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset theme="go-up">
<normaloff>.</normaloff>.</iconset>
</property>
</widget>
<widget class="QFrame" name="coreFixesBox">
<property name="geometry">
<rect>
<x>310</x>
<y>10</y>
<width>220</width>
<height>304</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<widget class="QFrame" name="transBitmapKeyFrame">
<property name="geometry">
<rect>
<x>9</x>
<y>250</y>
<width>201</width>
<height>51</height>
</rect>
</property>
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<widget class="QLabel" name="transBitmapKeyLabel">
<property name="geometry">
<rect>
<x>2</x>
<y>-4</y>
<width>181</width>
<height>20</height>
</rect>
</property>
<property name="text">
<string>Transparent Bitmap Key(s)</string>
</property>
</widget>
<widget class="QLineEdit" name="transparentBitmapKeys">
<property name="enabled">
<bool>true</bool>
</property>
<property name="geometry">
<rect>
<x>0</x>
<y>18</y>
<width>201</width>
<height>28</height>
</rect>
</property>
<property name="toolTip">
<string><html><head/><body><p>Separate multiple keys by spaces</p></body></html></string>
</property>
<property name="toolTipDuration">
<number>-1</number>
</property>
<property name="maxLength">
<number>512</number>
</property>
</widget>
</widget>
<widget class="QCheckBox" name="forceWhiteCheck">
<property name="geometry">
<rect>
<x>8</x>
<y>4</y>
<width>208</width>
<height>24</height>
</rect>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>24</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>24</height>
</size>
</property>
<property name="whatsThis">
<string>Sets all ambient and diffuse values to 1 1 1</string>
</property>
<property name="text">
<string>Ambient/Diffuse to 1</string>
</property>
</widget>
<widget class="QCheckBox" name="meshMergeCheck">
<property name="geometry">
<rect>
<x>8</x>
<y>34</y>
<width>208</width>
<height>24</height>
</rect>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>24</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>24</height>
</size>
</property>
<property name="whatsThis">
<string><html><head/><body><p>If enabled, trimesh nodes with the same bitmap will be merged into a single node. It applies to all classes of model but will be skipped if the model has a non NULL supermodel. Meshes must be set to shadow 0 to be merged but if the “shadow none” option is set, that will be applied before merging is attempted. The resulting trimesh node will be parented directly to the Aurora base at position and orientation zero and have the same name as one of the original ones. Mesh repairs, vertex welding and so on are applied after merging, in the normal way. If one mesh has vertexcolors and another has not, the missing vertexcolors will be padded with white (1 1 1).</p><p>The following will <span style=" font-weight:600;">not</span> be merged together:</p><ul style="margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; -qt-list-indent: 1;"><li style=" margin-top:12px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">meshes with incompatible parameters (render, alpha, ambient, diffuse, rotatetexture, ...)</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">meshes with animation keys or animated parents</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">meshes with child nodes</li><li style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">meshes with a scale other than unity or any of whose ancestors has a scale other than unity</li><li style=" margin-top:0px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">in the case of tile models, meshes descending from the 'a' node.</li></ul></body></html></string>
</property>
<property name="text">
<string>MeshMerge by bitmap</string>
</property>
</widget>
<widget class="QCheckBox" name="cullInvisibleCheck">
<property name="geometry">
<rect>
<x>8</x>
<y>64</y>
<width>208</width>
<height>24</height>
</rect>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>24</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>24</height>
</size>
</property>
<property name="whatsThis">
<string><html><head/><body><p>If checked, any mesh node (other than an aabb node) that is set to render 0 and shadow 0 will be converted to a dummy unless the model contains animations.</p></body></html></string>
</property>
<property name="text">
<string>Cull Invisible Meshes</string>
</property>
</widget>
<widget class="QLabel" name="renderTrimeshLabel">
<property name="geometry">
<rect>
<x>8</x>
<y>94</y>
<width>120</width>
<height>24</height>
</rect>
</property>
<property name="minimumSize">
<size>
<width>120</width>
<height>24</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>120</width>
<height>24</height>
</size>
</property>
<property name="text">
<string>Render Trimeshes</string>
</property>
</widget>
<widget class="QComboBox" name="renderTrimeshCombo">
<property name="geometry">
<rect>
<x>132</x>
<y>94</y>
<width>78</width>
<height>25</height>
</rect>
</property>
<property name="minimumSize">
<size>
<width>78</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>78</width>
<height>16777215</height>
</size>
</property>
<item>
<property name="text">
<string>Default</string>
</property>
</item>
<item>
<property name="text">
<string>All</string>
</property>
</item>
<item>
<property name="text">
<string>None</string>
</property>
</item>
</widget>
<widget class="QLabel" name="renderShadows">
<property name="geometry">
<rect>
<x>8</x>
<y>126</y>
<width>120</width>
<height>24</height>
</rect>
</property>
<property name="minimumSize">
<size>
<width>120</width>
<height>24</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>120</width>
<height>24</height>
</size>
</property>
<property name="text">
<string>Shadows</string>
</property>
</widget>
<widget class="QComboBox" name="renderShadowsCombo">
<property name="geometry">
<rect>
<x>132</x>
<y>125</y>
<width>78</width>
<height>26</height>
</rect>
</property>
<property name="minimumSize">
<size>
<width>78</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>78</width>
<height>16777215</height>
</size>
</property>
<item>
<property name="text">
<string>Default</string>
</property>
</item>
<item>
<property name="text">
<string>All</string>
</property>
</item>
<item>
<property name="text">
<string>None</string>
</property>
</item>
</widget>
<widget class="QLabel" name="snapLabel">
<property name="geometry">
<rect>
<x>8</x>
<y>157</y>
<width>120</width>
<height>24</height>
</rect>
</property>
<property name="minimumSize">
<size>
<width>120</width>
<height>24</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>120</width>
<height>24</height>
</size>
</property>
<property name="whatsThis">
<string><html><head/><body><p>If you choose &quot;<span style=" font-weight:600;">Binary</span>&quot;, all mesh vertices and positions will be snapped to exact multiples of 1/128 metres (0.0078125). The ascii value exported will exactly represent the binary one and, whether you import the resulting model into NWN, nwnmdlcomp, Gmax/3dsMax or back into CleanModels 3, the binary value inside that program will exactly correspond to it. So there is no loss of precision.</p><p>If you choose &quot;<span style=" font-weight:600;">Decimal</span>&quot;, vertices and positions will be snapped to multiples of 0.01 metres and exported values will use only as many decimal places as necessary (thus saving characters in the ascii file). This corresponds to the behaviour of NWmax. Although GMax and 3dsMax work in binary floats internally, NWMax doesn't export in binary precision. (Even if you select the &quot;compile exported model&quot; option, it exports the model in ascii first, discarding the precision, and then compiles it from that).</p><p>&quot;<span style=" font-weight:600;">Fine</span>&quot; is like decimal but 10 times smaller, with a snap interval of 1 millimetre (0.001 metres, one tenth of a unit in 3dsMax or GMax) and will be exported with up to 3 decimal places. This is mainly intended for items and character parts where you want the advantage of snapping and welding but the usual 1cm snap is too coarse and would result in model detail being lost.</p><p>Which one is best, really depends on what you are going to do with the exported models. If you are going to load them straight into NWN or run them through nwnmdlcomp, binary precision is best. If you are going to re-import them into Gmax or 3dsMax, you might as well use decimal precision (and save a few bytes of file size) because that is all you will get back out again anyway.</p><p>If you are working on tiles, you should use the same precision across the entire tileset, otherwise you may get geometry mismatches between one tile and its neighbours in an area.</p><p>Snapping is done after orientations are reset and before repivoting. Vertices are held fixed in absolute position while node positions are snapped, then they themselves are snapped. This avoids problems with rounding errors.</p><p>Snapping is not applied to the positions of the parents of animmesh nodes, nor to the parents of nodes which have animated positions or positionkeys.</p></body></html></string>
</property>
<property name="text">
<string>Snap</string>
</property>
</widget>
<widget class="QComboBox" name="snapCombo">
<property name="geometry">
<rect>
<x>132</x>
<y>157</y>
<width>78</width>
<height>25</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>78</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>78</width>
<height>16777215</height>
</size>
</property>
<property name="whatsThis">
<string><html><head/><body><p>If you choose &quot;<span style=" font-weight:600;">Binary</span>&quot;, all mesh vertices and positions will be snapped to exact multiples of 1/128 metres (0.0078125). The ascii value exported will exactly represent the binary one and, whether you import the resulting model into NWN, nwnmdlcomp, Gmax/3dsMax or back into CleanModels 3, the binary value inside that program will exactly correspond to it. So there is no loss of precision.</p><p>If you choose &quot;<span style=" font-weight:600;">Decimal</span>&quot;, vertices and positions will be snapped to multiples of 0.01 metres and exported values will use only as many decimal places as necessary (thus saving characters in the ascii file). This corresponds to the behaviour of NWmax. Although GMax and 3dsMax work in binary floats internally, NWMax doesn't export in binary precision. (Even if you select the &quot;compile exported model&quot; option, it exports the model in ascii first, discarding the precision, and then compiles it from that).</p><p>&quot;<span style=" font-weight:600;">Fine</span>&quot; is like decimal but 10 times smaller, with a snap interval of 1 millimetre (0.001 metres, one tenth of a unit in 3dsMax or GMax) and will be exported with up to 3 decimal places. This is mainly intended for items and character parts where you want the advantage of snapping and welding but the usual 1cm snap is too coarse and would result in model detail being lost.</p><p>Which one is best, really depends on what you are going to do with the exported models. If you are going to load them straight into NWN or run them through nwnmdlcomp, binary precision is best. If you are going to re-import them into Gmax or 3dsMax, you might as well use decimal precision (and save a few bytes of file size) because that is all you will get back out again anyway.</p><p>If you are working on tiles, you should use the same precision across the entire tileset, otherwise you may get geometry mismatches between one tile and its neighbours in an area.</p><p>Snapping is done after orientations are reset and before repivoting. Vertices are held fixed in absolute position while node positions are snapped, then they themselves are snapped. This avoids problems with rounding errors.</p><p>Snapping is not applied to the positions of the parents of animmesh nodes, nor to the parents of nodes which have animated positions or positionkeys.</p></body></html></string>
</property>
<item>
<property name="text">
<string>None</string>
</property>
</item>
<item>
<property name="text">
<string>Binary</string>
</property>
</item>
<item>
<property name="text">
<string>Decimal</string>
</property>
</item>
<item>
<property name="text">
<string>Fine</string>
</property>
</item>
</widget>
<widget class="QLabel" name="snapTVertLabel">
<property name="geometry">
<rect>
<x>8</x>
<y>188</y>
<width>120</width>
<height>24</height>
</rect>
</property>
<property name="minimumSize">
<size>
<width>120</width>
<height>24</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>120</width>
<height>24</height>
</size>
</property>
<property name="text">
<string>Snap tverts</string>
</property>
</widget>
<widget class="QComboBox" name="snapTVertsCombo">
<property name="geometry">
<rect>
<x>132</x>
<y>188</y>
<width>78</width>
<height>25</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>78</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>78</width>
<height>16777215</height>
</size>
</property>
<item>
<property name="text">
<string>No</string>
</property>
</item>
<item>
<property name="text">
<string>256</string>
</property>
</item>
<item>
<property name="text">
<string>512</string>
</property>
</item>
<item>
<property name="text">
<string>1024</string>
</property>
</item>
</widget>
<widget class="QCheckBox" name="placeableWithTransparencyCheck">
<property name="enabled">
<bool>true</bool>
</property>
<property name="geometry">
<rect>
<x>8</x>
<y>219</y>
<width>208</width>
<height>24</height>
</rect>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>24</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>24</height>
</size>
</property>
<property name="whatsThis">
<string><html><head/><body><p>Only applicable to <span style=" font-weight:600;">Character</span> model classification</p><p>If checked, meshes that match the specified bitmap key(s) entered below are re-parented to an '<span style=" font-weight:600;">a'</span> node just as if they were splotches in a tile, unless the model has a non-NULL supermodel. An '<span style=" font-weight:600;">a'</span> node will be created or repaired if necessary.</p></body></html></string>
</property>
<property name="text">
<string>Placeable with transparency</string>
</property>
</widget>
</widget>
<widget class="QFrame" name="pivotFrame">
<property name="geometry">
<rect>
<x>530</x>
<y>10</y>
<width>291</width>
<height>271</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>1</verstretch>
</sizepolicy>
</property>
<property name="whatsThis">
<string><html><head/><body><p>Bad pivots are one of the causes of shadow errors, particularly in tiles. The pivot of a mesh is regarded as &quot;bad&quot; if the mesh has any faces whose outward normals are directed towards the pivot rather than away from it.</p><p>Unless you set the Repivot option to &quot;none&quot; in the GUI or if there is a non-NULL supermodel, the program checks the pivots of all trimesh nodes that are set to shadow 1, except nodes whose position or orientation is changed in an animation. If it finds a bad pivot, it will try to fix it by moving the pivot to a position inside the mesh where it is no longer &quot;bad&quot;. If it succeeds, it will say so in the detailed log. However, this is not always possible. A common example is a door frame or window frame where the sides are facing each other inwards. Wherever you put the pivot, it would be in front of at least one of the sides Often, these situations can be resolved by splitting the mesh into suitable pieces, each of which can be successfully pivoted. There is an option to allow the program to try to do this automatically for you. If you set the Repivot option to &quot;all&quot;, the program will repivot nodes to conform to its own algorithms, even if their existing position is not actually &quot;bad&quot;. This may be useful on a first pass through a raw tileset, for example.The program will first try setting the pivot at the top of the object. If this is unsatisfactory, it will next try the centroid of the centroids of the faces of the object. If that also fails, it will compute the polyhedron within which the pivot must lie and if that polyhedron is convex it will use the centre of its bounding box as a pivot.</p><p>If snap is being used, the new position of the pivot will be snapped if possible. Sometimes, if the pivoting is critical, this is not possible. For example, if the program has calculated that the only possible position for a pivot is between 1.234 and 1.235, snapping it to 1.23 is not going to work. In this case, the pivot will be set to 1.2345 and the vertex co-ordinates, which are expressed relative to the pivot, will be released so that their absolute positions (relative to the rest of the geometry) can remain exact.</p><p>In the case of tile models, the program will look for a pivot within the XY boundaries of the tile. Objects in tiles do not cast shadows if they have a pivot below Z=0 so you may want to tell CM3 to keep pivots on or above the Z=0 plane. The GUI option “Pivots below Z=0” controls this. The third option 'slice' will cause meshes that cross the Z=0 place to be sliced at Z=0, the upper part repivoted and the lower part set to shadow 0.</p><p>Repivoting is not recommended for character models (it is likely to ruin animations) or doors (which do not cast shadows anyway).</p><p>The memory needed to find the bounding polyhedron increases as the third power of the number of faces. </p><p>For trimesh nodes of up to 150 faces, the program will use an exact algorithm that will certainly succeed in fixing the pivot if it is geometrically possible. Beyond 150 faces and up to 400 faces it will use a looser algorithm that is less memory-intensive and will usually succeed (about 99% of the time) but may occasionally fail. Beyond 400 faces it will not even try.</p><p>Occasionally, repositioning a difficult pivot may be achieved by exploiting rounding errors in the calculation of very small distances and the pivot may be placed the &quot;wrong side&quot; of a face by a microscopic distance. If this happens, a warning will be printed in the detailed log file.</p></body></html></string>
</property>
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<widget class="QFrame" name="repivotBox">
<property name="geometry">
<rect>
<x>10</x>
<y>33</y>
<width>276</width>
<height>225</height>
</rect>
</property>
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<widget class="QFrame" name="allowSplittingFrame">
<property name="geometry">
<rect>
<x>12</x>
<y>110</y>
<width>251</width>
<height>106</height>
</rect>
</property>
<property name="whatsThis">
<string><html><head/><body><p>If you turn on the &quot;splitting&quot; option, when the program fails to find a satisfactory pivot position for an object, it will split the object into parts that can each be pivoted separately. It creates new names for the parts by adding suffix numbers to the original node name (having checked that they are not already in use) and it randomises the wirecolors of the new objects. If it fails to repivot one of the parts (which can happen with a really twisted geometry) it will set its wirecolor to red (1 0 0).</p><p>When splitting an object, the program first separates isolated objects that are not connected to each other by common edges. If that isn't enough, it tries splitting objects into distinct smoothing group. Then it tries detaching pieces of floor and anything below them. After that, it looks for pieces that are entirely convex or entirely concave and detaches those. Finally it looks for groups of faces that form plane polygons. When it separates a piece, it checks to see if that piece and the remaining part can be pivoted. If they can, it need go no further. Otherwise, it will try splitting them again in another way.</p><p>There are some options in the GUI to control the splitting process. You can tell it to use smoothing groups, as described above, or to totally ignore them (if you think the models are not well smoothed anyway) or to protect smoothing groups and not allow them to be split further even if the pivot is still bad.</p><p>There is also a spinner to set the minimum size (number of faces) of pieces after splitting. Setting it to 4 is often a good choice but you might need to try different values on problematic models. Usually, it works better for concave pieces to be identified before convex ones. For some geometries, however, it may be better to do it the other way around. The radio button in the GUI lets you to choose which way you want the program to do it. If you find a particular model is problematic and the program seems to generate a large number of pieces which it can't repivot, try changing this option and running the original file through the program again.When splitting shadow meshes (trimesh nodes set to render 0 shadow 1), the option to protect smoothing groups is ignored for that node (because smoothing is meaningless if the node is not rendered) and the minimum piece size of 2 is used, regardless of GUI options. This is so that, if a node is so convoluted that it cannot be pivoted without breaking smoothing, you can try creating a shadow mesh for it that can certainly be repivoted.</p><p>If a trimesh node cannot be successfully repivoted, even with splitting, you can opt to move it to the top, middle or bottom of the object or to leave it where it is. 'Top' means the centroid of the top-most vertices; 'Middle' means the centroid of those vertices that lie at or above Z=0 and 'Bottom' means the centroid of the bottom-most vertices. One of these choices will quite often, but not always, resolve remaining shadow errors but a warning is still printed in the log because visual inspection of the shadows on the model will still be needed.</p></body></html></string>
</property>
<property name="frameShape">
<enum>QFrame::WinPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Sunken</enum>
</property>
<widget class="QWidget" name="layoutWidget_D">
<property name="geometry">
<rect>
<x>10</x>
<y>40</y>
<width>231</width>
<height>30</height>
</rect>
</property>
<layout class="QHBoxLayout" name="smoothingGroupsLayout">
<item>
<widget class="QLabel" name="smoothingGroupsLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Smoothing Groups</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="smoothingGroupsCombo">
<item>
<property name="text">
<string>Use</string>
</property>
</item>
<item>
<property name="text">
<string>Ignore</string>
</property>
</item>
<item>
<property name="text">
<string>Protect</string>
</property>
</item>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="layoutWidget_E">
<property name="geometry">
<rect>
<x>10</x>
<y>10</y>
<width>232</width>
<height>31</height>
</rect>
</property>
<layout class="QHBoxLayout" name="subObjectsMinFacesLayout">
<property name="sizeConstraint">
<enum>QLayout::SetMinimumSize</enum>
</property>
<item>
<widget class="QLabel" name="subObjectMinFacesLabel">
<property name="text">
<string>Sub-Object Minimum Faces</string>
</property>
</widget>
</item>
<item>
<widget class="QSpinBox" name="subObjectSpin">
<property name="minimum">
<number>2</number>
</property>
<property name="maximum">
<number>8</number>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="layoutWidget_F">
<property name="geometry">
<rect>
<x>10</x>
<y>70</y>
<width>231</width>
<height>30</height>
</rect>
</property>
<layout class="QHBoxLayout" name="splitFirstLayout">
<property name="sizeConstraint">
<enum>QLayout::SetMinimumSize</enum>
</property>
<item>
<widget class="QLabel" name="splitFirstLabel">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Split First</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="splitFirstCombo">
<item>
<property name="text">
<string>Convex</string>
</property>
</item>
<item>
<property name="text">
<string>Concave</string>
</property>
</item>
</widget>
</item>
</layout>
</widget>
</widget>
<widget class="QWidget" name="layoutWidget2">
<property name="geometry">
<rect>
<x>13</x>
<y>10</y>
<width>251</width>
<height>96</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout_5">
<item row="0" column="0">
<widget class="QLabel" name="pivotsBelowZeroZLabel">
<property name="text">
<string>Pivots Below Z=0</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QComboBox" name="pivotsBelowZeroZCombo">
<item>
<property name="text">
<string>Disallow</string>
</property>
</item>
<item>
<property name="text">
<string>Allow</string>
</property>
</item>
<item>
<property name="text">
<string>Slice</string>
</property>
</item>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="moveBadPivotsLabel">
<property name="text">
<string>Move Bad Pivots</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QComboBox" name="moveBadPivotsCombo">
<item>
<property name="text">
<string>No</string>
</property>
</item>
<item>
<property name="text">
<string>Top</string>
</property>
</item>
<item>
<property name="text">
<string>Middle</string>
</property>
</item>
<item>
<property name="text">
<string>Bottom</string>
</property>
</item>
</widget>
</item>
<item row="2" column="0">
<widget class="QCheckBox" name="allowSplittingCheck">
<property name="minimumSize">
<size>
<width>140</width>
<height>0</height>
</size>
</property>
<property name="whatsThis">
<string><html><head/><body><p>If you turn on the &quot;splitting&quot; option, when the program fails to find a satisfactory pivot position for an object, it will split the object into parts that can each be pivoted separately. It creates new names for the parts by adding suffix numbers to the original node name (having checked that they are not already in use) and it randomises the wirecolors of the new objects. If it fails to repivot one of the parts (which can happen with a really twisted geometry) it will set its wirecolor to red (1 0 0).</p><p>When splitting an object, the program first separates isolated objects that are not connected to each other by common edges. If that isn't enough, it tries splitting objects into distinct smoothing group. Then it tries detaching pieces of floor and anything below them. After that, it looks for pieces that are entirely convex or entirely concave and detaches those. Finally it looks for groups of faces that form plane polygons. When it separates a piece, it checks to see if that piece and the remaining part can be pivoted. If they can, it need go no further. Otherwise, it will try splitting them again in another way.</p><p>There are some options in the GUI to control the splitting process. You can tell it to use smoothing groups, as described above, or to totally ignore them (if you think the models are not well smoothed anyway) or to protect smoothing groups and not allow them to be split further even if the pivot is still bad.</p><p>There is also a spinner to set the minimum size (number of faces) of pieces after splitting. Setting it to 4 is often a good choice but you might need to try different values on problematic models. Usually, it works better for concave pieces to be identified before convex ones. For some geometries, however, it may be better to do it the other way around. The radio button in the GUI lets you to choose which way you want the program to do it. If you find a particular model is problematic and the program seems to generate a large number of pieces which it can't repivot, try changing this option and running the original file through the program again.When splitting shadow meshes (trimesh nodes set to render 0 shadow 1), the option to protect smoothing groups is ignored for that node (because smoothing is meaningless if the node is not rendered) and the minimum piece size of 2 is used, regardless of GUI options. This is so that, if a node is so convoluted that it cannot be pivoted without breaking smoothing, you can try creating a shadow mesh for it that can certainly be repivoted.</p><p>If a trimesh node cannot be successfully repivoted, even with splitting, you can opt to move it to the top, middle or bottom of the object or to leave it where it is. 'Top' means the centroid of the top-most vertices; 'Middle' means the centroid of those vertices that lie at or above Z=0 and 'Bottom' means the centroid of the bottom-most vertices. One of these choices will quite often, but not always, resolve remaining shadow errors but a warning is still printed in the log because visual inspection of the shadows on the model will still be needed.</p></body></html></string>
</property>
<property name="text">
<string>Allow Splitting</string>
</property>
</widget>
</item>
</layout>
</widget>
</widget>
<widget class="QLabel" name="repivotLabel">
<property name="geometry">
<rect>
<x>13</x>
<y>4</y>
<width>51</width>
<height>20</height>
</rect>
</property>
<property name="text">
<string>Repivot</string>
</property>
</widget>
<widget class="QComboBox" name="repivotCombo">
<property name="geometry">
<rect>
<x>68</x>
<y>0</y>
<width>111</width>
<height>28</height>
</rect>
</property>
<item>
<property name="text">
<string>If needed</string>
</property>
</item>
<item>
<property name="text">
<string>All</string>
</property>
</item>
<item>
<property name="text">
<string>None</string>
</property>
</item>
</widget>
</widget>
<widget class="QLineEdit" name="inDirectory">
<property name="geometry">
<rect>
<x>50</x>
<y>10</y>
<width>211</width>
<height>28</height>
</rect>
</property>
<property name="toolTip">
<string>You can type addresses relative to the CM3 install directory using "." and ".."</string>
</property>
<property name="statusTip">
<string/>
</property>
<property name="maxLength">
<number>512</number>
</property>
</widget>
<widget class="QLineEdit" name="outDirectory">
<property name="geometry">
<rect>
<x>50</x>
<y>40</y>
<width>211</width>
<height>28</height>
</rect>
</property>
<property name="toolTip">
<string>You can type addresses relative to the CM3 install directory using "." and ".."</string>
</property>
<property name="statusTip">
<string/>
</property>
<property name="maxLength">
<number>512</number>
</property>
</widget>
<widget class="QLineEdit" name="filePattern">
<property name="geometry">
<rect>
<x>90</x>
<y>70</y>
<width>211</width>
<height>28</height>
</rect>
</property>
<property name="toolTip">
<string><html><head/><body><p>Changing the filename pattern allows you to focus on just a few models at a time it you want to. Use Unix-style patterns, for example, <span style=" font-weight:600;">a_*[bf]a_*.mdl</span> to pick out certain animation supermodels or <span style=" font-weight:600;">tcxy?_[a-d]*.mdl</span> to pick out just the a,b,c and d series tiles of the tcxy tileset.</p></body></html></string>
</property>
<property name="maxLength">
<number>32</number>
</property>
</widget>
<widget class="QFrame" name="classSnapBox">
<property name="geometry">
<rect>
<x>10</x>
<y>160</y>
<width>291</width>
<height>41</height>
</rect>
</property>
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<widget class="QWidget" name="layoutWidget_I">
<property name="geometry">
<rect>
<x>0</x>
<y>3</y>
<width>291</width>
<height>31</height>
</rect>
</property>
<layout class="QHBoxLayout" name="modelClassLayout">
<property name="sizeConstraint">
<enum>QLayout::SetMinimumSize</enum>
</property>
<item>
<widget class="QLabel" name="modelClassLabel">
<property name="whatsThis">
<string><html><head/><body><p>Allows you to override the classification of models. It should normally be left on &quot;<span style=" font-weight:600;">Automatic</span>&quot; and the program will assume that the classification parameter in each input model is true and correct and process it and output it accordingly. However, if you know that all of the models are supposed to be of a single type and suspect that some may have the wrong classification, you can set the drop down to one of the specific options to force all the models to be processed and output as if they were of that particular type. There is no distinct classification for placeables because in NWN, placeables are classed as '<span style=" font-weight:600;">Characters'</span>. Note that, if the classification is set to anything other than '<span style=" font-weight:600;">Tile</span>' or '<span style=" font-weight:600;">Automatic</span>', the program will not attempt to load edge tile 2da's.</p></body></html></string>
</property>
<property name="text">
<string>Model Classification</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="modelClassCombo">
<property name="whatsThis">
<string><html><head/><body><p>Allows you to override the classification of models. It should normally be left on &quot;<span style=" font-weight:600;">Automatic</span>&quot; and the program will assume that the classification parameter in each input model is true and correct and process it and output it accordingly. However, if you know that all of the models are supposed to be of a single type and suspect that some may have the wrong classification, you can set the drop down to one of the specific options to force all the models to be processed and output as if they were of that particular type. There is no distinct classification for placeables because in NWN, placeables are classed as '<span style=" font-weight:600;">Characters'</span>. Note that, if the classification is set to anything other than '<span style=" font-weight:600;">Tile</span>' or '<span style=" font-weight:600;">Automatic</span>', the program will not attempt to load edge tile 2da's.</p></body></html></string>
</property>
<property name="editable">
<bool>false</bool>
</property>
<property name="currentText">
<string>Automatic</string>
</property>
<item>
<property name="text">
<string>Automatic</string>
</property>