/
RoadkillProInit.mel
714 lines (491 loc) · 18 KB
/
RoadkillProInit.mel
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
// Roadkill Professional version v 1.045 R&D
global proc RoadkillProGeometric()
{
int $RKislandScale = 10;
int $RKislandUpright = 1;
int $RKpackAllInOne = 0;
if ( `optionVar -exists rkIslandScale` )
$RKislandScale = `optionVar -q rkIslandScale`;
else
optionVar -intValue rkIslandScale $RKislandScale;
if ( `optionVar -exists rkIslandUpright` )
$RKislandUpright = `optionVar -q rkIslandUpright`;
else
optionVar -intValue rkIslandUpright $RKislandUpright;
if ( `optionVar -exists rkPackAllInOne` )
$RKpackAllInOne = `optionVar -q rkPackAllInOne`;
else
optionVar -intValue rkPackAllInOne $RKpackAllInOne;
string $cmd = "RoadkillPro -function GEOM -s " + $RKislandScale + " -u " + $RKislandUpright + " -i " + $RKpackAllInOne;
evalEcho $cmd;
}
global proc RoadkillProOrganic()
{
int $RKislandScale = 10;
int $RKislandUpright = 1;
int $RKpackAllInOne = 0;
if ( `optionVar -exists rkIslandScale` )
$RKislandScale = `optionVar -q rkIslandScale`;
else
optionVar -intValue rkIslandScale $RKislandScale;
if ( `optionVar -exists rkIslandUpright` )
$RKislandUpright = `optionVar -q rkIslandUpright`;
else
optionVar -intValue rkIslandUpright $RKislandUpright;
if ( `optionVar -exists rkPackAllInOne` )
$RKpackAllInOne = `optionVar -q rkPackAllInOne`;
else
optionVar -intValue rkPackAllInOne $RKpackAllInOne;
string $cmd = "RoadkillPro -function ORGA -s " + $RKislandScale + " -u " + $RKislandUpright + " -i " + $RKpackAllInOne;
evalEcho $cmd;
}
global proc RoadkillProStraighten()
{
int $RKislandScale = 10;
int $RKislandUpright = 1;
int $RKpackAllInOne = 0;
if ( `optionVar -exists rkIslandScale` )
$RKislandScale = `optionVar -q rkIslandScale`;
else
optionVar -intValue rkIslandScale $RKislandScale;
if ( `optionVar -exists rkIslandUpright` )
$RKislandUpright = `optionVar -q rkIslandUpright`;
else
optionVar -intValue rkIslandUpright $RKislandUpright;
if ( `optionVar -exists rkPackAllInOne` )
$RKpackAllInOne = `optionVar -q rkPackAllInOne`;
else
optionVar -intValue rkPackAllInOne $RKpackAllInOne;
string $cmd = "RoadkillPro -function STRA -s " + $RKislandScale + " -u " + $RKislandUpright + " -i " + $RKpackAllInOne;
evalEcho $cmd;
}
global proc RoadkillProSymmetryCut()
{
int $RKislandScale = 10;
int $RKislandUpright = 1;
if ( `optionVar -exists rkIslandScale` )
$RKislandScale = `optionVar -q rkIslandScale`;
else
optionVar -intValue rkIslandScale $RKislandScale;
if ( `optionVar -exists rkIslandUpright` )
$RKislandUpright = `optionVar -q rkIslandUpright`;
else
optionVar -intValue rkIslandUpright $RKislandUpright;
string $cmd = "RoadkillPro -function SYMCUT -s " + $RKislandScale + " -u " + $RKislandUpright;
evalEcho $cmd;
}
global proc RoadkillProScalePack()
{
int $RKislandScale = 10;
int $RKislandUpright = 1;
int $RKpackAllInOne = 0;
if ( `optionVar -exists rkIslandScale` )
$RKislandScale = `optionVar -q rkIslandScale`;
else
optionVar -intValue rkIslandScale $RKislandScale;
if ( `optionVar -exists rkIslandUpright` )
$RKislandUpright = `optionVar -q rkIslandUpright`;
else
optionVar -intValue rkIslandUpright $RKislandUpright;
if ( `optionVar -exists rkPackAllInOne` )
$RKpackAllInOne = `optionVar -q rkPackAllInOne`;
else
optionVar -intValue rkPackAllInOne $RKpackAllInOne;
string $cmd = "RoadkillPro -function SCALEPACK -s " + $RKislandScale + " -u " + $RKislandUpright + " -i " + $RKpackAllInOne;
evalEcho $cmd; // Execute The Command
}
global proc RoadkillProPack()
{
int $RKislandScale = 10;
int $RKislandUpright = 1;
int $RKpackAllInOne = 0;
if ( `optionVar -exists rkIslandScale` )
$RKislandScale = `optionVar -q rkIslandScale`;
else
optionVar -intValue rkIslandScale $RKislandScale;
if ( `optionVar -exists rkIslandUpright` )
$RKislandUpright = `optionVar -q rkIslandUpright`;
else
optionVar -intValue rkIslandUpright $RKislandUpright;
if ( `optionVar -exists rkPackAllInOne` )
$RKpackAllInOne = `optionVar -q rkPackAllInOne`;
else
optionVar -intValue rkPackAllInOne $RKpackAllInOne;
string $cmd = "RoadkillPro -function PACK -s " + $RKislandScale + " -u " + $RKislandUpright + " -i " + $RKpackAllInOne;
evalEcho $cmd; // Execute The Command
}
global proc RoadkillProScaleToSource()
{
int $RKislandScale = 10;
int $RKislandUpright = 1;
if ( `optionVar -exists rkIslandScale` )
$RKislandScale = `optionVar -q rkIslandScale`;
else
optionVar -intValue rkIslandScale $RKislandScale;
if ( `optionVar -exists rkIslandUpright` )
$RKislandUpright = `optionVar -q rkIslandUpright`;
else
optionVar -intValue rkIslandUpright $RKislandUpright;
string $cmd = "RoadkillPro -function S2S -s " + $RKislandScale + " -u " + $RKislandUpright;
evalEcho $cmd;
}
global proc RoadkillProMinimise()
{
int $RKiterations = 50;
int $RKislandUpright = 1;
if ( `optionVar -exists rkMinIterations` )
$RKiterations = `optionVar -q rkMinIterations`;
else
optionVar -intValue rkMinIterations $RKiterations;
if ( `optionVar -exists rkIslandUpright` )
$RKislandUpright = `optionVar -q rkIslandUpright`;
else
optionVar -intValue rkIslandUpright $RKislandUpright;
string $cmd = "RoadkillPro -function MINIMISE -s " + $RKiterations + " -u " + $RKislandUpright;
evalEcho $cmd;
}
global proc RoadkillProMinimiseOptions()
{
if( `window -exists RKMiniWindow` )
{
return;
}
int $RKiterations = 50;
if ( `optionVar -exists rkMinIterations` )
$RKiterations = `optionVar -q rkMinIterations`;
else
optionVar -intValue rkMinIterations $RKiterations;
window -widthHeight 300 110 -rtf 1 -s 0 -title "Roadkill Minimise Stretch Options" RKMiniWindow;
columnLayout ColumnLayout;
columnLayout -adjustableColumn true;
frameLayout -label "Shell Options" -labelAlign "center";
rowColumnLayout -numberOfColumns 3
-columnWidth 1 60
-columnWidth 2 110
-columnWidth 3 30;
text -height 5 -label " ";
text -height 5 -label " ";
text -height 5 -label " ";
text -label " ";
text -label "Minimise Iterations";
intField -width 40 -minValue 1 -maxValue 200 -value $RKiterations -ed 1 RKIterationField;
setParent ..;
setParent ..;
text -height 5 -label " ";
rowLayout -columnAlign3 "center" "center" "center" -numberOfColumns 3;
button -height 30 -width 95 -label "Minimise" -command RKMinimise;
button -height 30 -width 95 -label "Apply" -command RKApplyMinimise;
button -height 30 -width 95 -label "Cancel" -command ("deleteUI -window RKMiniWindow");
showWindow RKMiniWindow;
}
global proc RKMinimise()
{
int $RKiterations;
int $RKislandUpright;
$RKiterations = `intField -q -value RKIterationField`;
optionVar -intValue rkMinIterations $RKiterations;
$RKislandUpright = `optionVar -q rkIslandUpright`;
deleteUI -window RKMiniWindow;
string $cmd = "RoadkillPro -function MINIMISE -s " + $RKiterations + " -u " + $RKislandUpright;
evalEcho $cmd;
}
global proc RKApplyMinimise()
{
int $RKiterations;
int $RKislandUpright;
$RKiterations = `intField -q -value RKIterationField`;
optionVar -intValue rkMinIterations $RKiterations;
$RKislandUpright = `optionVar -q rkIslandUpright`;
string $cmd = "RoadkillPro -function MINIMISE -s " + $RKiterations + " -u " + $RKislandUpright;
evalEcho $cmd; // Execute The Command
}
global proc RoadkillProPackOptions()
{
if( `window -exists RKPackOptionsWindow` )
{
return;
}
int $RKislandScale = 10;
int $RKislandUpright = 2;
int $RKpackAllInOne = 0;
int $RKislandMatch = 0;
int $RKislandEdgeMatch = 0;
int $RKislandSymMatch = 0;
int $RKmaintainUVs = 0;
float $RKislandMatchAnglesTol = 4.0;
float $RKislandMatchEdgeTol = 10.0;
if ( `optionVar -exists rkIslandScale` )
$RKislandScale = `optionVar -q rkIslandScale`;
else
optionVar -intValue rkIslandScale $RKislandScale;
if ( `optionVar -exists rkIslandUpright` )
$RKislandUpright = `optionVar -q rkIslandUpright`;
else
optionVar -intValue rkIslandUpright $RKislandUpright;
if ( `optionVar -exists rkPackAllInOne` )
$RKpackAllInOne = `optionVar -q rkPackAllInOne`;
else
optionVar -intValue rkPackAllInOne $RKpackAllInOne;
if ( `optionVar -exists rkIslandMatch` )
$RKislandMatch = `optionVar -q rkIslandMatch`;
else
optionVar -intValue rkIslandMatch $RKislandMatch;
if ( `optionVar -exists rkIslandEdgeMatch` )
$RKislandEdgeMatch = `optionVar -q rkIslandEdgeMatch`;
else
optionVar -intValue rkIslandEdgeMatch $RKislandEdgeMatch;
if ( `optionVar -exists rkIslandSymMatch` )
$RKislandSymMatch = `optionVar -q rkIslandSymMatch`;
else
optionVar -intValue rkIslandSymMatch $RKislandSymMatch;
if ( `optionVar -exists rkIslandMatchAnglesTol` )
$RKislandMatchAnglesTol = `optionVar -q rkIslandMatchAnglesTol`;
else
optionVar -intValue rkIslandMatchAnglesTol $RKislandMatchAnglesTol;
if ( `optionVar -exists rkMaintainUVs` )
$RKmaintainUVs = `optionVar -q rkMaintainUVs`;
else
optionVar -intValue rkMaintainUVs $RKmaintainUVs;
if ( `optionVar -exists rkIslandMatchEdgeTol` )
$RKislandMatchEdgeTol = `optionVar -q rkIslandMatchEdgeTol`;
else
optionVar -intValue rkIslandMatchEdgeTol $RKislandMatchEdgeTol;
window -widthHeight 300 120 -rtf 1 -s 0 -title "Roadkill UV Pack Options" RKPackOptionsWindow;
columnLayout ColumnLayout;
columnLayout -adjustableColumn true;
frameLayout -label "Shell Options" -labelAlign "center";
columnLayout;
separator -style "none";
radioButtonGrp -nrb 3
-label "Rotate Shells"
-labelArray3 "No Rotation" "Upright" "Longest Edge"
-vertical
-select $RKislandUpright
RKIslandRotationRadio;
separator -style "none";
checkBoxGrp -ncb 1 -label "Pack onto one map" -value1 $RKpackAllInOne RKAllInOneCheckbox;
checkBoxGrp -ncb 1 -label "Maintain UVs" -value1 $RKmaintainUVs RKMaintainUVsCheckbox;
separator -style "none";
intFieldGrp
-nf 1
-label "Shell Border Scale" - extraLabel "%"
-value1 $RKislandScale
RKBorderScaleField;
separator -style "none";
setParent ..;
setParent ..;
frameLayout -label "Shell Match Options" -labelAlign "center";
columnLayout;
separator -style "none";
checkBoxGrp -ncb 1 -label "Match Shells" -value1 $RKislandMatch RKIslandMatchCheckBox;
checkBoxGrp -ncb 1 -label "Match Symmetrical Shells" -value1 $RKislandSymMatch RKIslandMatchSymCheckBox;
checkBoxGrp -ncb 1 -label "Match Edge Lengths" -value1 $RKislandEdgeMatch RKIslandMatchEdgeCheckBox;
separator -style "none";
intFieldGrp
-nf 1
-label "Interior Angle Tolerence" - extraLabel "degrees"
-value1 $RKislandMatchAnglesTol
RKIslandMatchAnglesValue;
intFieldGrp
-nf 1
-label "Edge Length Tolerence" - extraLabel "%"
-value1 $RKislandMatchEdgeTol
RKIslandMatchEdgeValue;
setParent ..;
setParent ..;
text -height 5 -label " ";
rowLayout -columnAlign3 "center" "center" "center" -numberOfColumns 3;
button -height 30 -width 95 -label "Pack" -command RKPack;
button -height 30 -width 95 -label "Apply" -command RKPackApply;
button -height 30 -width 95 -label "Cancel" -command ("deleteUI -window RKPackOptionsWindow");
showWindow RKPackOptionsWindow;
}
global proc RKPack()
{
int $RKislandScale;
int $RKislandUpright;
int $RKpackAllInOne;
int $RKislandMatch;
int $RKislandEdgeMatch;
int $RKislandSymMatch;
int $RKmaintainUVs;
float $RKislandMatchAnglesTol;
float $RKislandMatchEdgeTol;
$RKislandScale = `intFieldGrp -q -value1 RKBorderScaleField`;
//$RKislandUpright = `optionVar -q rkIslandUpright`;
$RKislandUpright = `radioButtonGrp -q -sl RKIslandRotationRadio`;
$RKpackAllInOne = `checkBoxGrp -q -value1 RKAllInOneCheckbox`;
$RKislandMatch = `checkBoxGrp -q -value1 RKIslandMatchCheckBox`;
$RKislandEdgeMatch = `checkBoxGrp -q -value1 RKIslandMatchEdgeCheckBox`;
$RKislandSymMatch = `checkBoxGrp -q -value1 RKIslandMatchSymCheckBox`;
$RKmaintainUVs = `checkBoxGrp -q -value1 RKMaintainUVsCheckbox`;
$RKislandMatchAnglesTol = `intFieldGrp -q -value1 RKIslandMatchAnglesValue`;
$RKislandMatchEdgeTol = `intFieldGrp -q -value1 RKIslandMatchEdgeValue`;
optionVar -intValue rkIslandScale $RKislandScale;
optionVar -intValue rkIslandUpright $RKislandUpright;
optionVar -intValue rkIslandMatch $RKislandMatch;
optionVar -intValue rkIslandEdgeMatch $RKislandEdgeMatch;
optionVar -intValue rkIslandSymMatch $RKislandSymMatch;
optionVar -intValue rkIslandMatchAnglesTol $RKislandMatchAnglesTol;
optionVar -intValue rkIslandMatchEdgeTol $RKislandMatchEdgeTol;
optionVar -intValue rkMaintainUVs $RKmaintainUVs;
deleteUI -window RKPackOptionsWindow;
string $cmd = "RoadkillPro -function PACK -s " + $RKislandScale + " -u " + $RKislandUpright + " -i " + $RKpackAllInOne;
evalEcho $cmd; // Execute The Command
}
global proc RKPackApply()
{
int $RKislandScale;
int $RKislandUpright;
int $RKpackAllInOne;
int $RKislandMatch;
int $RKislandEdgeMatch;
int $RKislandSymMatch;
int $RKmaintainUVs;
float $RKislandMatchAnglesTol;
float $RKislandMatchEdgeTol;
$RKislandScale = `intFieldGrp -q -value1 RKBorderScaleField`;
//$RKislandUpright = `optionVar -q rkIslandUpright`;
$RKislandUpright = `radioButtonGrp -q -sl RKIslandRotationRadio`;
$RKpackAllInOne = `checkBoxGrp -q -value1 RKAllInOneCheckbox`;
$RKislandMatch = `checkBoxGrp -q -value1 RKIslandMatchCheckBox`;
$RKislandEdgeMatch = `checkBoxGrp -q -value1 RKIslandMatchEdgeCheckBox`;
$RKislandSymMatch = `checkBoxGrp -q -value1 RKIslandMatchSymCheckBox`;
$RKmaintainUVs = `checkBoxGrp -q -value1 RKMaintainUVsCheckbox`;
$RKislandMatchAnglesTol = `intFieldGrp -q -value1 RKIslandMatchAnglesValue`;
$RKislandMatchEdgeTol = `intFieldGrp -q -value1 RKIslandMatchEdgeValue`;
optionVar -intValue rkIslandScale $RKislandScale;
optionVar -intValue rkIslandUpright $RKislandUpright;
optionVar -intValue rkIslandMatch $RKislandMatch;
optionVar -intValue rkIslandEdgeMatch $RKislandEdgeMatch;
optionVar -intValue rkIslandSymMatch $RKislandSymMatch;
optionVar -intValue rkIslandMatchAnglesTol $RKislandMatchAnglesTol;
optionVar -intValue rkIslandMatchEdgeTol $RKislandMatchEdgeTol;
optionVar -intValue rkMaintainUVs $RKmaintainUVs;
string $cmd = "RoadkillPro -function PACK -s " + $RKislandScale + " -u " + $RKislandUpright + " -i " + $RKpackAllInOne;
evalEcho $cmd;
}
global proc string AddRoadkillMenuItems()
{
//global string $gPolygonsMenus[];
global int $gRoadkillItemAddTest;
string $parentMenu = RoadkillGetUVMenu();
if ($gRoadkillItemAddTest == 0) // test if the new menu item already exists
{
setParent -menu $parentMenu;
menuItem -divider true;
menuItem -label "Roadkill Geometric"
-annotation ("Unwrap and Pack Geometric Object(s) UVs")
-c "RoadkillProGeometric" m_RoadkillGeometric;
menuItem -label "Roadkill Organic"
-annotation ("Unwrap and Pack Organic Object(s) UVs")
-c "RoadkillProOrganic" m_RoadkillOrganic;
menuItem -label "Roadkill Straighten Grid"
-annotation ("Unwrap and Pack Grid Object(s) UVs")
-c "RoadkillProStraighten" m_RoadkillStraighten;
menuItem -label "Roadkill Minimise Stretch"
-annotation ("Minimise stretch on selected islands(s) UVs")
-c "RoadkillProMinimise" m_RoadkillMinimise;
menuItem -optionBox true
-annotation ("Minimise stretch settings")
-c "RoadkillProMinimiseOptions" m_RoadkillMinimiseOpt;
menuItem -label "Roadkill Scale to Source"
-annotation ("Scale all selected meshes UVs to source mesh")
-c "RoadkillProScaleToSource" m_RoadkillScaleToSource;
menuItem -label "Roadkill Scale and Pack UVs"
-annotation ("Relative scale the UV Islands and pack")
-c "RoadkillProScalePack" m_RoadkillScalePackUVs;
menuItem -label "Roadkill Pack UVs"
-annotation ("Pack all selected to UV window")
-c "RoadkillProPack" m_RoadkillPackUVs;
menuItem -optionBox true
-annotation ("UV Packer settings")
-c "RoadkillProPackOptions" m_RoadkillPackUVsOpt;
menuItem -label "Roadkill Symmetry Cut"
-annotation ("Apply UV cuts symmetrically")
-c "RoadkillProSymmetryCut" m_RoadkillSymCutUVs;
$gRoadkillItemAddTest = 1;
}
return "RemoveRoadkillMenuItems()";
}
global proc RemoveRoadkillMenuItems()
{
global int $gRoadkillItemAddTest;
if ($gRoadkillItemAddTest == 1)
{
deleteUI -mi m_RoadkillGeometric;
deleteUI -mi m_RoadkillOrganic;
deleteUI -mi m_RoadkillStraighten;
deleteUI -mi m_RoadkillMinimise;
deleteUI -mi m_RoadkillMinimiseOpt;
deleteUI -mi m_RoadkillScaleToSource;
deleteUI -mi m_RoadkillScalePackUVs;
deleteUI -mi m_RoadkillPackUVs;
deleteUI -mi m_RoadkillPackUVsOpt;
deleteUI -mi m_RoadkillSymCutUVs;
}
}
// two small helper functions
global proc textureBorderOn()
{
evalDeferred( "polyOptions -db 0; polyOptions -r -dmb 1; polyOptions -sb 4.0" );
}
global proc textureBorderOff()
{
evalDeferred( "polyOptions -db 0; polyOptions -r -dmb 0; polyOptions -sb 1.0" );
}
global proc string RoadkillGetUVMenu()
{
global string $gMainUVMenu;
global string $gPolygonsMenus[];
if($gMainUVMenu == "")
{
return $gPolygonsMenus[7];
}
return $gMainUVMenu;
}
global proc RoadkillProMenu()
{
global string $globRoadkill = "";
global string $gPolygonsMenus[];
string $menu = RoadkillGetUVMenu();
global int $gRoadkillItemAddTest;
$gRoadkillItemAddTest = 0;
addMenuItemSafe($menu, "AddRoadkillMenuItems", "globRoadkill");
}
global proc string RoadkillProGetMayaVersion()
{
string $mayaVersion = `about -version`;
if(startsWith($mayaVersion, "2017"))
{
return "2017";
}
error ("RoadkillPro: Cannot load plug-in - version of Maya not supported: " + $mayaVersion);
error ("Please contact: support@RoadkillPro.com");
return "failed";
}
global proc LoadRoadkillPlugin()
{
string $version = "";
string $mayaVersion = `about -version`;
$version = RoadkillProGetMayaVersion();
if($version == "failed")
{
return;
}
if (`about - is64`)
{
$version += "_x64";
}
string $pluginName = "RoadkillPro" + $version;
int $isLoaded = `pluginInfo -query -loaded -command $pluginName`;
if (!$isLoaded)
{
print "RoadkillPro: Loading Plug-in.\n";
evalDeferred("autoLoadPlugin \"\" " + $pluginName + " " + $pluginName);
}
}
global proc RoadkillProInit()
{
LoadRoadkillPlugin();
}