-
Notifications
You must be signed in to change notification settings - Fork 0
/
ManiaPlanet Tool V0.1 - 2013.ms
792 lines (667 loc) · 26 KB
/
ManiaPlanet Tool V0.1 - 2013.ms
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
-----------------------------------------------------------------------------------------------start change render engine part 1
if (( JustSPeeding != undefined) and ( JustSPeeding.isdisplayed)) do
(destroyDialog JustSPeeding_rollout ) -- test if dialog exist
fn checkRender nSearch = -- function check if render installed
(
theRenderer = for obj in RendererClass.classes where \
(matchPattern (obj as string) pattern:nSearch) -- check if the name in nSearch variable exist
collect obj
if theRenderer.count ==1
then renderers.current = theRenderer[1]()
else
(messageBox "render not installed")
)
------------------------------------------------------------------------------------------------end change render engine part 1
macroScript TM2ManiaPark
category:"ManiaPark"
tooltip:"TM2 Script"
buttontext:"TM2"
(
rollout ManiaPark "ManiaPlanet Tool"
(
button UVW "Unwrap UVW" toolTip:"Open Uvw Editor" pos:[2,5]
spinner sp1 "Copy from" range:[1,99,1] type:#integer scale:1 fieldwidth:28 align:#left
spinner sp2 "Copy To " range:[1,99,2] type:#integer scale:1 fieldwidth:28 align:#right offset:[-40,-22]
checkbox ignoreChannelInfo_osd "don't use Channel Info" checked:false pos:[2,50]
checkbox usePrevUVW_osd "use previous unwrap" checked:false pos:[130,50]
button CopyUVWChannel "Copy UVW channels" tooltip:"Copy UVW from chanel x to chanel x" pos:[2,70]
button openchannelinfo "Open Channel Info" pos:[120,70] toolTip:"Open Chanel Editor for renaming map:1 to Material and map:2 to Lightmap "
button S10 "Scale uvw 1/2" toolTip:"Scale the selected faces by 1/2 in uvw space" pos:[2,95]
button Relaxuvw "relax uvw" tooltip:"Relax UVW Selection" pos:[90,95]
button Iron "Iron" tooltip:"Relax UVW Selection to 1 shell" pos:[160,95]
button stitch "stitch" tooltip:"Stitch the UVW"pos:[200,95]
Label lbl "<<Select Vertex For PivotPosistion>>" pos:[2,125]
button Change "CHANGE" pos:[185,120] toolTip:"Select a vertex in polymode where you want to place the pivot from that object on"
button ProjShad "ProjShad" pos:[2,145] toolTip:"Create your ProjShad plane and correct pivot"
button MaxBox "Maxbox" pos:[65,145] toolTip:"Create maxbox to see if your model is fitting in it"
button lights "Car Lights" pos:[95,170]toolTip:"create your carLight with correct pivot"
button LightFProj "Light ProjShad" pos:[2,170] toolTip:"Create your LightProjShad plane and correct pivot"
button butScanline "Scanline" pos:[2,195]
button butMR "Mental Ray" pos:[60,195]
button butVray "Vray" pos:[135,195]
button butFree "iray" pos:[180,195]
progressBar pBar value:0 color:blue
label lbl1 "Script Made by JustSpeeding" pos:[2,235]
label lbl2 "Free use For TM Carpark/ManiPark Modelers" pos:[2,250]
------------------------------------------------------------------------------
------------------------------------------------------------------start open uvw
on UVW pressed do
(
macros.run "Modifiers" "Unwrap_UVW"
)
--------------------------------------------------------end open uvw
-------------------------------------------------------- start open Channel info
on openchannelinfo pressed do
(--UV Channel Listener
ChannelInfo.dialog();
)
--------------------------------------------------------end open channel info
-----------------------------------------------------start copy map channel
fn isGeometry obj = ( if ( isKindOf obj geometryClass and classof obj != TargetObject ) then true else false )
fn filterGeometry sel = (for obj in sel where isGeometry obj collect obj)
fn setUnwrapContext obj objUnwrapMod =
(
if modPanel.getCurrentObject()==undefined do max modify mode
if selection.count!=1 do select obj
if selection[1]!=obj do select obj
if modPanel.getCurrentObject()!=objUnwrapMod do modPanel.setCurrentObject objUnwrapMod
)
fn isEditable obj =
(
local classOfObj=classOf obj
case classOfObj of
(
Editable_Poly: true
PolyMeshObject: true
Editable_mesh: true
default: false
)
)
fn getThisOp obj =
(
local classOfObj=classOf obj
local thisOp
case classOfObj of
(
Editable_Poly: thisOp=polyOp
PolyMeshObject: thisOp=polyOp
Editable_mesh: thisOp=meshOp
default: ( addModifier obj (Edit_Mesh ()) ; thisOp=meshOp )
)
thisOp
)
fn copyMapChannel objUnwrapMod fromChannel toChannel =
(
local objUnwrap1=objUnwrapMod.unwrap
local objUnwrap2=objUnwrapMod.unwrap2
local thisElementMode=objUnwrap2.getTVElementMode()
local thisSubObjectMode=objUnwrap2.getTVSubObjectMode()
objUnwrap2.setTVElementMode false
objUnwrap2.setTVSubObjectMode 3
local thisFaces=objUnwrap2.getSelectedFaces()
objUnwrap1.setMapChannel fromChannel
modPanel.setCurrentObject objUnwrapMod -- update
local theFaces=#{1..objUnwrap1.numberPolygons()}
objUnwrap2.selectFaces theFaces
objUnwrap2.copy()
objUnwrap1.setMapChannel toChannel
modPanel.setCurrentObject objUnwrapMod -- update
objUnwrap2.selectFaces theFaces
objUnwrap2.paste false
objUnwrap2.selectFaces thisFaces
objUnwrap2.setTVElementMode thisElementMode
objUnwrap2.setTVSubObjectMode thisSubObjectMode
)
fn copyMapChannel2 obj fromChannel toChannel =
(
local thisOp=getThisOp obj
local currentNumMaps=(thisOp.getNumMaps obj)-1
if currentNumMaps<1 do thisOp.setNumMaps obj toChannel+1 keep:true
local currentMapSupport1=thisOp.getMapSupport obj fromChannel
if currentMapSupport1==false do thisOp.defaultMapFaces obj fromChannel
local currentMapSupport2=thisOp.getMapSupport obj toChannel
if currentMapSupport2==false do thisOp.defaultMapFaces obj toChannel
channelInfo.CopyChannel obj 3 fromChannel
channelInfo.PasteChannel obj 3 toChannel
)
fn addUnwrapIfNecessary obj channel reuse =
(
if ( reuse and (classof obj.modifiers[1]==Unwrap_UVW) )
then (
currentChannel=obj.modifiers[1].unwrap.getMapChannel()
case currentChannel of
(
0: currentChannel=1
1: currentChannel=0
)
if channel==currentChannel
then obj.modifiers[1]
else (
objUnwrapMod=Unwrap_UVW()
addModifier obj objUnwrapMod
objUnwrapMod.unwrap.setMapChannel channel
objUnwrapMod
)
)
else (
objUnwrapMod=Unwrap_UVW()
addModifier obj objUnwrapMod
objUnwrapMod.unwrap.setMapChannel channel
objUnwrapMod
)
)--fn
on copyMapChannelRollout open do
(
local vn=maxVersion()
if vn[1]<6000 do ( ignoreChannelInfo_osd.checked=true ; ignoreChannelInfo_osd.enabled=false )
)
on CopyUVWChannel pressed do
(
sel=selection as array
sel=filterGeometry sel
if sel.count>0
then (
local vn=maxVersion()
startTime=timeStamp()
undo off (
for i=1 to sel.count do (
obj=sel[i]
select obj
local newMode=false
if vn[1]>=6000 do newMode=true
if ignoreChannelInfo_osd.checked do newMode=false
if not isEditable obj do newMode=false
if newMode do ( copyMapChannel2 obj sp1.value sp2.value )
objUnwrapMod=addUnwrapIfNecessary obj sp2.value usePrevUVW_osd.checked
objUnwrapMod.name="Unwrap UVW ch"+(sp2.value as string)
setUnwrapContext obj objUnwrapMod
if not newMode do ( copyMapChannel objUnwrapMod sp1.value sp2.value )
pBar.value=((i as float/sel.count as float)*100.0)as integer
)
)--undo off
endTime=timeStamp()
format "copyMapChannel: Processing took % seconds\n" ((endTime-startTime) / 1000.0)
pBar.value=0
select sel
max views redraw
)
else messageBox("select at least one object")
)--on
-----------------------------------------------------end copy map channel
--------------------------------------------------------start Scale50% uvw
on S10 pressed do
(
selectionSets["tempSel"] = selection
sel = selection
obj = #()
for i in sel do
(
append obj i
)
for i = 1 to obj.count do
(
select obj[i]
obj[i].modifiers[#unwrap_uvw].unwrap.edit ()
obj[i].modifiers[#unwrap_uvw].setTVSubObjectMode 3
face = obj[i].modifiers[#unwrap_uvw].getSelectedFaces
obj[i].modifiers[#unwrap_uvw].unwrap2.ScaleSelectedCenter 0.5 0
clearSelection()
select selectionSets["tempSel"]
for i in sel do
(
i.modifiers[#unwrap_uvw].unwrap.edit ()
i.modifiers[#unwrap_uvw].setTVSubObjectMode 3
)
)
)
--------------------------------------------------------end Scale50% uvw
--------------------------------------------------------start relex uvw
on Relaxuvw pressed do
(
if classof (modPanel.getCurrentObject()) == Unwrap_UVW then(
undo on(
local uv = modPanel.getCurrentObject();
local gRi = uv.unwrap3.getRelaxIteration();
local gRa = uv.unwrap3.getRelaxAmount();
case uv.gettvsubobjectmode() of(
1: (
uv.unwrap3.setRelaxIteration 200;--deafult 100
uv.unwrap3.setRelaxAmount 1;--default 0.1
uv.unwrap3.relax2();
)
2: (
--edge selection
uv.relaxByEdgeAngle 1000 0 1 false;
)
3: (
uv.unwrap5.relaxByFaceAngle 1000 0 1 false;
)
)
--restore previous settings
uv.unwrap3.setRelaxIteration gRi;
uv.unwrap3.setRelaxAmount gRa;
)
)
)
--------------------------------------------------------end relex uvw
--------------------------------------------------------Start iron uvw
on Iron pressed do
(
function flattenSelForNode obj uv=(
local numFacesSelected;-- = ( uv.unwrap.getSelectedPolygons() ).numberSet;
if ((maxVersion())[1] >= 10000 )then(--max2008+ version
numFacesSelected = (uv.unwrap6.getSelectedFacesByNode obj).numberSet;
)else(
numFacesSelected = ( uv.unwrap.getSelectedPolygons() ).numberSet;
)
--print("facenum "+numFacesSelected as string);
if (numFacesSelected > 0)then(
local var_a = uv.unwrap3.getRelaxIteration();
uv.unwrap5.quickPlanarMap();--quick flatten
uv.unwrap3.setRelaxIteration 1000;
uv.unwrap3.relax2();
---restore previous settings
uv.unwrap3.setRelaxIteration var_a;
)
)
if (selection.count > 0)then(--at least an object selected
local uv = modPanel.getCurrentObject();
if( classof(uv) == Unwrap_UVW)then(
undo on(
if ((maxVersion())[1] >= 10000 )then(
for sel in selection do(
flattenSelForNode sel uv;
)
)else(
flattenSelForNode selection[1] uv;--only do this with the first object in the selection
)
)
)
)
)
--------------------------------------------------------end Iron uvw
--------------------------------------------------------Start stitch uvw
on stitch pressed do
(
clearListener();
undo on(
if (selection.count > 0)then(--at least an object selected
local obj = selection[1];
--if (classOf obj.baseObject == Editable_Poly) then (--only if this 1st object is a poly at its base
if (superclassof obj == GeometryClass)then(
if (obj.modifiers[ #unwrap_uvw ] != undefined) then(
local uv = obj.modifiers[ #unwrap_uvw ];
if (selectOnly== true)then(
case uv.gettvsubobjectmode() of(--convert selection
1: (
uv.verttoedgeselect()
)
3: (
uv.facetoedgeselect()
)
)
sel_org = uv.getselectededges();
sel = (uv.getselectededges()) as array;
if sel.count > 0 do(
--isolate to just border edges
local found = false;
for e=1 to sel.count do(
uv.unwrap2.selectEdges #{sel[e]};
uv.unwrap2.openEdgeSelect();
local edges_sel = (uv.getselectededges()).numberset;
if (edges_sel > 1)then(
print("done: !!\t"+edges_sel as string+".."+(uv.getselectededges()) as string);
--uv.unwrap2.selectEdges ((uv.getselectededges()) - #{sel[e]});
found = true;
exit;
)
)
if (found == true)then(
print("yes I can continue...");
--uv.unwrap2.selectEdges #{1.. uv.}
sel_border = uv.getselectededges();
--select all
uv.selectFaces #{1.. uv.numberPolygons()};
uv.facetoedgeselect();
sel_all = uv.getselectededges();
uv.unwrap2.selectEdges (sel_org-(sel_all-sel_border));--now contract all edges that are not part of the border
uv.unwrap2.setTVSubObjectMode 2;
uv.selectFaces #{};
)
)
)else(
uv.unwrap2.stitchVertsNoParams();
)
)else(
print("no UV editor present...");
)
)
)
)
)
--------------------------------------------------------end stitch uvw
--------------------------------------------------------start Change pivot
on change pressed do
(
if subobjectLevel == 0 then
(
messageBox "Please select the vertex and then hit CHANGE"
)else
(
NoOfObj = getCurrentSelection()
for i = 1 to NoOfObj.count do
(
SelVert = NoOfObj[i].selectedVerts
SelVertBitArr = SelVert as BitArray
SelVertArr = SelVertBitArr as array
VertPos = polyOp.getVert NoOfObj[i] SelVertArr[1]
NoOfObj[i].pivot = VertPos
)
subobjectLevel = 0
)
)
--------------------------------------------------------end Change pivot
------------------------------------------------------------------------------------------------start projshad
on ProjShad pressed do
if $projshad != undefined
then
(messageBox "ProjShad already created!")
else
(p = Plane lengthsegs:1 widthsegs:1 Pos:[0,0,-0.03] Length:6 Width:4 wirecolor:white name:"ProjShad"
fn DumpXForms obj =
( -- output node transform properties
format "%:\t%\n" "transform" obj.transform
format "%:\t%\n" "position " obj.pos
format "%:\t%\n" "rotation " obj.rotation
-- output node's pivot point location
format "%:\t%\n" "pivot " obj.pivot
-- output object offsets
format "%:\t%\n" "objectoffsetpos " obj.objectoffsetpos
format "%:\t%\n" "objectoffsetrot " obj.objectoffsetrot
format "%:\t%\n" "objectoffsetscale" obj.objectoffsetscale
-- output object transform
format "%:\t%\n" "objecttransform " obj.objecttransform
-- output vertex position in local and world coordinates
format "%:\t%\n" "vert 1 (local) " (in coordsys local getvert obj 1)
format "%:\t%\n" "vert 1 (world1) " (in coordsys world getvert obj 1)
-- calculate and output vertex position in world coordinates
local v_pos=(in coordsys local getvert obj 1)* obj.objecttransform
format "%:\t%\n" "vert 1 (world2) " v_pos
)
-- define function for rotating only the pivot point
fn RotatePivotOnly obj rotation= ( local rotValInv=inverse (rotation as quat)
animate off in coordsys local obj.rotation*=RotValInv
obj.objectoffsetrot*=RotValInv
obj.objectoffsetpos*=RotValInv
)
p.pivot=[0,0,0]
RotatePivotOnly p (Eulerangles 90 0 0)
)
------------------------------------------------------------------------------------------------end projshad
------------------------------------------------------------------------------------------------start maxbox
on MaxBox pressed do
if $MaxBox != undefined
then
(messageBox "MaxBox already created!")
else
(Box lengthsegs:1 widthsegs:1 heightsegs:1 length:6 width:3 height:2.7 pos:[0,0,-0.2] wirecolor:red name:"MaxBox"
)
------------------------------------------------------------------------------------------------end maxbox
------------------------------------------------------------------------------------------------start Lightprojshad
on LightFProj pressed do
if $LightFProj != undefined
then
(messageBox "LightFProj already created!")
else
(lp = Plane lengthsegs:1 widthsegs:1 length:0.1 width:0.1 pos:[0,-2.2,0.58] wirecolor:yellow name:"LightFProj"
rot_lp = eulerangles 90 0 0
rotate lp rot_lp
fn DumpXForms obj =
(
format "%:\t%\n" "transform" obj.transform
format "%:\t%\n" "position " obj.pos
format "%:\t%\n" "rotation " obj.rotation
format "%:\t%\n" "pivot " obj.pivot
format "%:\t%\n" "objectoffsetpos " obj.objectoffsetpos
format "%:\t%\n" "objectoffsetrot " obj.objectoffsetrot
format "%:\t%\n" "objectoffsetscale" obj.objectoffsetscale
format "%:\t%\n" "objecttransform " obj.objecttransform
format "%:\t%\n" "vert 1 (local) " (in coordsys local getvert obj 1)
format "%:\t%\n" "vert 1 (world1) " (in coordsys world getvert obj 1)
local v_pos=(in coordsys local getvert obj 1)* obj.objecttransform
format "%:\t%\n" "vert 1 (world2) " v_pos
)
fn RotatePivotOnly obj rotation= ( local rotValInv=inverse (rotation as quat)
animate off in coordsys local obj.rotation*=RotValInv
obj.objectoffsetrot*=RotValInv
obj.objectoffsetpos*=RotValInv
)
RotatePivotOnly lp (Eulerangles -90 0 0)
)
------------------------------------------------------------------------------------------------end Lightprojshad
------------------------------------------------------------------------------------------------start Lights
on lights pressed do
if $LightRR != undefined
then
(messageBox "Lights already created!")
else
(rr = Plane lengthsegs:1 widthsegs:1 length:0.1 width:0.1 pos:[-0.7,2.14,0.8] wirecolor:yellow name:"LightRR"
rot_rr = eulerangles -90 0 0
rotate rr rot_rr
fn DumpXForms obj =
(
format "%:\t%\n" "transform" obj.transform
format "%:\t%\n" "position " obj.pos
format "%:\t%\n" "rotation " obj.rotation
format "%:\t%\n" "pivot " obj.pivot
format "%:\t%\n" "objectoffsetpos " obj.objectoffsetpos
format "%:\t%\n" "objectoffsetrot " obj.objectoffsetrot
format "%:\t%\n" "objectoffsetscale" obj.objectoffsetscale
format "%:\t%\n" "objecttransform " obj.objecttransform
format "%:\t%\n" "vert 1 (local) " (in coordsys local getvert obj 1)
format "%:\t%\n" "vert 1 (world1) " (in coordsys world getvert obj 1)
local v_pos=(in coordsys local getvert obj 1)* obj.objecttransform
format "%:\t%\n" "vert 1 (world2) " v_pos
)
fn RotatePivotOnly obj rotation= ( local rotValInv=inverse (rotation as quat)
animate off in coordsys local obj.rotation*=RotValInv
obj.objectoffsetrot*=RotValInv
obj.objectoffsetpos*=RotValInv
)
RotatePivotOnly rr (Eulerangles -90 0 0)
rl = Plane lengthsegs:1 widthsegs:1 length:0.1 width:0.1 pos:[0.7,2.14,0.8] wirecolor:yellow name:"LightRL"
rot_rl = eulerangles -90 0 0
rotate rl rot_rl
fn DumpXForms obj =
(
format "%:\t%\n" "transform" obj.transform
format "%:\t%\n" "position " obj.pos
format "%:\t%\n" "rotation " obj.rotation
format "%:\t%\n" "pivot " obj.pivot
format "%:\t%\n" "objectoffsetpos " obj.objectoffsetpos
format "%:\t%\n" "objectoffsetrot " obj.objectoffsetrot
format "%:\t%\n" "objectoffsetscale" obj.objectoffsetscale
format "%:\t%\n" "objecttransform " obj.objecttransform
format "%:\t%\n" "vert 1 (local) " (in coordsys local getvert obj 1)
format "%:\t%\n" "vert 1 (world1) " (in coordsys world getvert obj 1)
local v_pos=(in coordsys local getvert obj 1)* obj.objecttransform
format "%:\t%\n" "vert 1 (world2) " v_pos
)
fn RotatePivotOnly obj rotation= ( local rotValInv=inverse (rotation as quat)
animate off in coordsys local obj.rotation*=RotValInv
obj.objectoffsetrot*=RotValInv
obj.objectoffsetpos*=RotValInv
)
RotatePivotOnly rl (Eulerangles -90 0 0)
fr1 = Plane lengthsegs:1 widthsegs:1 length:0.1 width:0.1 pos:[-0.78,-1.95,0.58] wirecolor:yellow name:"LightFR1"
rot_fr1 = eulerangles 90 0 0
rotate fr1 rot_fr1
fn DumpXForms obj =
(
format "%:\t%\n" "transform" obj.transform
format "%:\t%\n" "position " obj.pos
format "%:\t%\n" "rotation " obj.rotation
format "%:\t%\n" "pivot " obj.pivot
format "%:\t%\n" "objectoffsetpos " obj.objectoffsetpos
format "%:\t%\n" "objectoffsetrot " obj.objectoffsetrot
format "%:\t%\n" "objectoffsetscale" obj.objectoffsetscale
format "%:\t%\n" "objecttransform " obj.objecttransform
format "%:\t%\n" "vert 1 (local) " (in coordsys local getvert obj 1)
format "%:\t%\n" "vert 1 (world1) " (in coordsys world getvert obj 1)
local v_pos=(in coordsys local getvert obj 1)* obj.objecttransform
format "%:\t%\n" "vert 1 (world2) " v_pos
)
fn RotatePivotOnly obj rotation= ( local rotValInv=inverse (rotation as quat)
animate off in coordsys local obj.rotation*=RotValInv
obj.objectoffsetrot*=RotValInv
obj.objectoffsetpos*=RotValInv
)
RotatePivotOnly fr1 (Eulerangles -90 0 0)
fr2 = Plane lengthsegs:1 widthsegs:1 length:0.1 width:0.1 pos:[-0.68,-1.95,0.516] wirecolor:yellow name:"LightFR2"
rot_fr2 = eulerangles 90 0 0
rotate fr2 rot_fr2
fn DumpXForms obj =
(
format "%:\t%\n" "transform" obj.transform
format "%:\t%\n" "position " obj.pos
format "%:\t%\n" "rotation " obj.rotation
format "%:\t%\n" "pivot " obj.pivot
format "%:\t%\n" "objectoffsetpos " obj.objectoffsetpos
format "%:\t%\n" "objectoffsetrot " obj.objectoffsetrot
format "%:\t%\n" "objectoffsetscale" obj.objectoffsetscale
format "%:\t%\n" "objecttransform " obj.objecttransform
format "%:\t%\n" "vert 1 (local) " (in coordsys local getvert obj 1)
format "%:\t%\n" "vert 1 (world1) " (in coordsys world getvert obj 1)
local v_pos=(in coordsys local getvert obj 1)* obj.objecttransform
format "%:\t%\n" "vert 1 (world2) " v_pos
)
fn RotatePivotOnly obj rotation= ( local rotValInv=inverse (rotation as quat)
animate off in coordsys local obj.rotation*=RotValInv
obj.objectoffsetrot*=RotValInv
obj.objectoffsetpos*=RotValInv
)
RotatePivotOnly fr2 (Eulerangles -90 0 0)
fr3 = Plane lengthsegs:1 widthsegs:1 length:0.1 width:0.1 pos:[-0.57,-1.95,0.452] wirecolor:yellow name:"LightFR3"
rot_fr3 = eulerangles 90 0 0
rotate fr3 rot_fr3
fn DumpXForms obj =
(
format "%:\t%\n" "transform" obj.transform
format "%:\t%\n" "position " obj.pos
format "%:\t%\n" "rotation " obj.rotation
format "%:\t%\n" "pivot " obj.pivot
format "%:\t%\n" "objectoffsetpos " obj.objectoffsetpos
format "%:\t%\n" "objectoffsetrot " obj.objectoffsetrot
format "%:\t%\n" "objectoffsetscale" obj.objectoffsetscale
format "%:\t%\n" "objecttransform " obj.objecttransform
format "%:\t%\n" "vert 1 (local) " (in coordsys local getvert obj 1)
format "%:\t%\n" "vert 1 (world1) " (in coordsys world getvert obj 1)
local v_pos=(in coordsys local getvert obj 1)* obj.objecttransform
format "%:\t%\n" "vert 1 (world2) " v_pos
)
fn RotatePivotOnly obj rotation= ( local rotValInv=inverse (rotation as quat)
animate off in coordsys local obj.rotation*=RotValInv
obj.objectoffsetrot*=RotValInv
obj.objectoffsetpos*=RotValInv
)
RotatePivotOnly fr3 (Eulerangles -90 0 0)
fl1 = Plane lengthsegs:1 widthsegs:1 length:0.1 width:0.1 pos:[0.78,-1.95,0.58] wirecolor:yellow name:"LightFL1"
rot_fl1 = eulerangles 90 0 0
rotate fl1 rot_fl1
fn DumpXForms obj =
(
format "%:\t%\n" "transform" obj.transform
format "%:\t%\n" "position " obj.pos
format "%:\t%\n" "rotation " obj.rotation
format "%:\t%\n" "pivot " obj.pivot
format "%:\t%\n" "objectoffsetpos " obj.objectoffsetpos
format "%:\t%\n" "objectoffsetrot " obj.objectoffsetrot
format "%:\t%\n" "objectoffsetscale" obj.objectoffsetscale
format "%:\t%\n" "objecttransform " obj.objecttransform
format "%:\t%\n" "vert 1 (local) " (in coordsys local getvert obj 1)
format "%:\t%\n" "vert 1 (world1) " (in coordsys world getvert obj 1)
local v_pos=(in coordsys local getvert obj 1)* obj.objecttransform
format "%:\t%\n" "vert 1 (world2) " v_pos
)
fn RotatePivotOnly obj rotation= ( local rotValInv=inverse (rotation as quat)
animate off in coordsys local obj.rotation*=RotValInv
obj.objectoffsetrot*=RotValInv
obj.objectoffsetpos*=RotValInv
)
RotatePivotOnly fl1 (Eulerangles -90 0 0)
fl2 = Plane lengthsegs:1 widthsegs:1 length:0.1 width:0.1 pos:[0.68,-1.95,0.516] wirecolor:yellow name:"LightFL2"
rot_fl2 = eulerangles 90 0 0
rotate fl2 rot_fl2
fn DumpXForms obj =
(
format "%:\t%\n" "transform" obj.transform
format "%:\t%\n" "position " obj.pos
format "%:\t%\n" "rotation " obj.rotation
format "%:\t%\n" "pivot " obj.pivot
format "%:\t%\n" "objectoffsetpos " obj.objectoffsetpos
format "%:\t%\n" "objectoffsetrot " obj.objectoffsetrot
format "%:\t%\n" "objectoffsetscale" obj.objectoffsetscale
format "%:\t%\n" "objecttransform " obj.objecttransform
format "%:\t%\n" "vert 1 (local) " (in coordsys local getvert obj 1)
format "%:\t%\n" "vert 1 (world1) " (in coordsys world getvert obj 1)
local v_pos=(in coordsys local getvert obj 1)* obj.objecttransform
format "%:\t%\n" "vert 1 (world2) " v_pos
)
fn RotatePivotOnly obj rotation= ( local rotValInv=inverse (rotation as quat)
animate off in coordsys local obj.rotation*=RotValInv
obj.objectoffsetrot*=RotValInv
obj.objectoffsetpos*=RotValInv
)
RotatePivotOnly fl2 (Eulerangles -90 0 0)
fl3 = Plane lengthsegs:1 widthsegs:1 length:0.1 width:0.1 pos:[0.57,-1.95,0.452] wirecolor:yellow name:"LightFL3"
rot_fl3 = eulerangles 90 0 0
rotate fl3 rot_fl3
fn DumpXForms obj =
(
format "%:\t%\n" "transform" obj.transform
format "%:\t%\n" "position " obj.pos
format "%:\t%\n" "rotation " obj.rotation
format "%:\t%\n" "pivot " obj.pivot
format "%:\t%\n" "objectoffsetpos " obj.objectoffsetpos
format "%:\t%\n" "objectoffsetrot " obj.objectoffsetrot
format "%:\t%\n" "objectoffsetscale" obj.objectoffsetscale
format "%:\t%\n" "objecttransform " obj.objecttransform
format "%:\t%\n" "vert 1 (local) " (in coordsys local getvert obj 1)
format "%:\t%\n" "vert 1 (world1) " (in coordsys world getvert obj 1)
local v_pos=(in coordsys local getvert obj 1)* obj.objecttransform
format "%:\t%\n" "vert 1 (world2) " v_pos
)
fn RotatePivotOnly obj rotation= ( local rotValInv=inverse (rotation as quat)
animate off in coordsys local obj.rotation*=RotValInv
obj.objectoffsetrot*=RotValInv
obj.objectoffsetpos*=RotValInv
)
RotatePivotOnly fl3 (Eulerangles -90 0 0)
)
------------------------------------------------------------------------------------------------end Lights
------------------------------------------------------------------------------------------------start change render engine part 2
on butScanline pressed do
(
varScan = "*Scanline*"
checkRender varScan
)
on butMR pressed do
(
varMR = "*mental_ray*"
checkRender varMR
)
on butVray pressed do
(
varVray = "V_Ray_Adv*"
checkRender varVray
)
on butFree pressed do
(
varIR = "*iray*"
checkRender varIR
)
------------------------------------------------------------------------------------------------endchange render engine part 2
)
--end rollout
createDialog ManiaPark 250 270---
)