18. juli 2005 - 22:36
Der er
5 kommentarer
Script melder fejl i 3Ds 6!
Hey, hvorfor siger den: -- Unable to convert true or type: integer i dette: NF = NewRolloutFloater "HH max 2,2" 200 280 20 120 global camCreated = false global lightValue = 20 global simpleLightValue = 255 global lightShadowMap = 125 global lightShadowColor = (color 10 10 10) global lightCreated = false global simpleLightCreated = false Rollout createRoll "HH rummet" ( button wallButton "Tilføj vægge" toolTip:"Fire vægge der danner et standard HH rum" width:125 button camButton "Tilføj camera" toolTip:"Et kamera der er sat i HH perspektiv" width:125 group "Belysning" ( button lightPButton "Tilføj lys" toolTip:"Meget simpel belysning" width:125 button light2Button "Tilføj adv. lys" toolTip:"en blødere belysning med skygger" width:125 ) on wallButton pressed do ( bx1 = chamferBox name:"floor01" pos:[0,0,0] length:220 width:220 height:2 fillet:0.1 mapcoords:true color:[0,0,0] \ lengthsegs:1 widthsegs:1 heightsegs:1 filletsegs:2 \ sleep bx2 = chamferBox name:"wall01" pos:[100,0,0] length:220 width:2 height:150 fillet:0.1 mapcoords:true \ lengthsegs:1 widthsegs:1 heightsegs:1 filletsegs:2 \ bx3 = chamferBox name:"wall02" pos:[-100,0,0] length:220 width:2 height:150 fillet:0.1 mapcoords:true \ lengthsegs:1 widthsegs:1 heightsegs:1 filletsegs:2 \ bx4 = chamferBox name:"wall03" pos:[0,100,0] length:2 width:220 height:150 fillet:0.1 mapcoords:true \ lengthsegs:1 widthsegs:1 heightsegs:1 filletsegs:2 \ bx5 = chamferBox name:"wall04" pos:[0,-100,0] length:2 width:220 height:150 fillet:0.1 mapcoords:true \ lengthsegs:1 widthsegs:1 heightsegs:1 filletsegs:2 \ print "HH walls created" ) on camButton pressed do ( renderHeight = 374 renderWidth = 408 acm = freecamera name:"HHcamera01" pos:[0,0,300] print "HH camera created" acm.rotation.x=0.1 max vpt camera max safeframe toggle print "HH camera activated" camCreated = true ) on lightPButton pressed do ( if simpleLightCreated==false do ( omL = omniLight name:"HH omni01" pos:[0,0,100] value:simpleLightValue simpleLightCreated = true ) if lightCreated do ( delete omL01 delete omL02 delete omL03 delete omL04 delete omL05 delete omL06 delete omL07 delete omL08 delete omL09 delete omL10 delete omL11 delete omL12 delete omL13 lightCreated = false ) ) on light2Button pressed do ( if lightCreated==false do ( omL01 = omniLight name:"HH omni01" pos:[75,75,100] castShadows:true mapSize:lightShadowMap value:lightValue shadowColor:lightShadowColor omL02 = omniLight name:"HH omni02" pos:[-75,75,100] castShadows:true mapSize:lightShadowMap value:lightValue shadowColor:lightShadowColor omL03 = omniLight name:"HH omni03" pos:[75,-75,100] castShadows:true mapSize:lightShadowMap value:lightValue shadowColor:lightShadowColor omL04 = omniLight name:"HH omni04" pos:[-75,-75,100] castShadows:true mapSize:lightShadowMap value:lightValue shadowColor:lightShadowColor omL05 = omniLight name:"HH omni05" pos:[33,33,100] castShadows:true mapSize:lightShadowMap value:lightValue shadowColor:lightShadowColor omL06 = omniLight name:"HH omni06" pos:[-33,33,100] castShadows:true mapSize:lightShadowMap value:lightValue shadowColor:lightShadowColor omL07 = omniLight name:"HH omni07" pos:[33,-33,100] castShadows:true mapSize:lightShadowMap value:lightValue shadowColor:lightShadowColor omL08 = omniLight name:"HH omni08" pos:[-33,-33,100] castShadows:true mapSize:lightShadowMap value:lightValue shadowColor:lightShadowColor omL09 = omniLight name:"HH omni09" pos:[75,0,100] castShadows:true mapSize:lightShadowMap value:lightValue shadowColor:lightShadowColor omL10 = omniLight name:"HH omni10" pos:[0,75,100] castShadows:true mapSize:lightShadowMap value:lightValue shadowColor:lightShadowColor omL11 = omniLight name:"HH omni11" pos:[-75,0,100] castShadows:true mapSize:lightShadowMap value:lightValue shadowColor:lightShadowColor omL12 = omniLight name:"HH omni12" pos:[0,-75,100] castShadows:true mapSize:lightShadowMap value:lightValue shadowColor:lightShadowColor omL13 = omniLight name:"HH omni13" pos:[0,0,100] castShadows:true mapSize:lightShadowMap value:lightValue shadowColor:lightShadowColor lightCreated = true ) if simpleLightCreated do ( delete omL simpleLightCreated = false ) ) ) Rollout bonusRoll "Egenskaber" ( slider camSlider "Zoom" range:[250,350,300] type:#float tricks:50 orient:#horizontal slider lightSlider "Lys styrke (kun adv. lys)" range:[10,30,20] type:#float tricks:20 orient:#horizontal button sfButton "Fjern/tilføj ramme" width:125 on sfButton pressed do ( max safeframe toggle ) on camSlider changed val do ( if camCreated do acm.position.z=camSlider.value ) on lightSlider changed val do ( if lightCreated do ( omL01.value = lightSlider.value omL02.value = lightSlider.value omL03.value = lightSlider.value omL04.value = lightSlider.value omL05.value = lightSlider.value omL06.value = lightSlider.value omL07.value = lightSlider.value omL08.value = lightSlider.value omL09.value = lightSlider.value omL10.value = lightSlider.value omL11.value = lightSlider.value omL12.value = lightSlider.value omL13.value = lightSlider.value lightValue = lightSlider.value ) ) ) Rollout jeppeRoll "Om HH max" ( button hm1 "hm1" button hm2 "hm2" edittext numse "her:" text:"hæ hæ" ) rollout params "Rendering" ( Bitmap WPreview Width:138 Height:124 pos:[17, 14] checkbox shad "Shadows" pos:[14, 150] checked:false Spinner StillF "Frame" type:#integer range:[animationRange.start, animationRange.end, 0] pos:[85, 150] fieldwidth:30 Button SFrame "Preview" width:125 button qrButton "Lav billede" tooltip:"Laver et billede i HHs størelse" width:125 on SFrame pressed do ( bm = render frame:StillF.value outputwidth:138 outputheight:124 vfb:off \ shadows:shad.checked\ WPreview.bitmap = bm ) on qrButton pressed do ( renderHeight = 374 renderWidth = 408 max quick render ) ) addRollout createRoll NF rolledUp:false addRollout bonusRoll NF rolledUp:true addRollout params NF rolledUp:true --addRollout jeppeRoll NF rolledUp:true print "test"
Annonceindlæg fra Cognizant
Jeg tror at det er fordi du har skrevet mapcoords:true istedet for mapcoords:1 (sådan er det ihvertfald i Max 7). Her et udsnit fra maxscript dokumentationen om mapcoords: <ChamferBox>.mapCoords Integer default: 1 1- enable mapping coordinates, 0 - disable mapping coordinates. Er det forresten med vilje at du har du en sleep i koden? Den har jeg fjernet. Og der var også en række line-continuation tegn (dvs. \) for enden af de linier som danner dine vægge. Dem har jeg også fjenet. Her mit forslag til en lille omskrivning af en del af din kode (kan se at der stadig er en lille bug med en delete af dine lys .. sig til hvis du ikke kan lokalisere hvad det skyldes så skal jeg tage et kig på det også). Her koden: NF = NewRolloutFloater "HH max 2,2" 200 280 20 120 global camCreated = false global lightValue = 20 global simpleLightValue = 255 global lightShadowMap = 125 global lightShadowColor = (color 10 10 10) global lightCreated = false global simpleLightCreated = false Rollout createRoll "HH rummet" ( button wallButton "Tilføj vægge" toolTip:"Fire vægge der danner et standard HH rum" width:125 button camButton "Tilføj camera" toolTip:"Et kamera der er sat i HH perspektiv" width:125 group "Belysning" ( button lightPButton "Tilføj lys" toolTip:"Meget simpel belysning" width:125 button light2Button "Tilføj adv. lys" toolTip:"en blødere belysning med skygger" width:125 ) on wallButton pressed do ( bx1 = chamferBox name:"floor01" pos:[0,0,0] length:220 width:220 height:2 fillet:0.1 mapcoords:1 \ color:[0,0,0] lengthsegs:1 widthsegs:1 heightsegs:1 filletsegs:2 bx2 = chamferBox name:"wall01" pos:[100,0,0] length:220 width:2 height:150 fillet:0.1 mapcoords:1 \ lengthsegs:1 widthsegs:1 heightsegs:1 filletsegs:2 bx3 = chamferBox name:"wall02" pos:[-100,0,0] length:220 width:2 height:150 fillet:0.1 mapcoords:1 \ lengthsegs:1 widthsegs:1 heightsegs:1 filletsegs:2 bx4 = chamferBox name:"wall03" pos:[0,100,0] length:2 width:220 height:150 fillet:0.1 mapcoords:1 \ lengthsegs:1 widthsegs:1 heightsegs:1 filletsegs:2 bx5 = chamferBox name:"wall04" pos:[0,-100,0] length:2 width:220 height:150 fillet:0.1 mapcoords:1 \ lengthsegs:1 widthsegs:1 heightsegs:1 filletsegs:2 print "HH walls created" ) on camButton pressed do ( renderHeight = 374 renderWidth = 408 acm = freecamera name:"HHcamera01" pos:[0,0,300] print "HH camera created" acm.rotation.x=0.1 max vpt camera max safeframe toggle print "HH camera activated" camCreated = true ) on lightPButton pressed do ( if simpleLightCreated==false do ( omL = omniLight name:"HH omni01" pos:[0,0,100] value:simpleLightValue simpleLightCreated = true ) if lightCreated do ( delete omL01 delete omL02 delete omL03 delete omL04 delete omL05 delete omL06 delete omL07 delete omL08 delete omL09 delete omL10 delete omL11 delete omL12 delete omL13 lightCreated = false ) ) on light2Button pressed do ( if lightCreated==false do ( omL01 = omniLight name:"HH omni01" pos:[75,75,100] castShadows:true mapSize:lightShadowMap value:lightValue shadowColor:lightShadowColor omL02 = omniLight name:"HH omni02" pos:[-75,75,100] castShadows:true mapSize:lightShadowMap value:lightValue shadowColor:lightShadowColor omL03 = omniLight name:"HH omni03" pos:[75,-75,100] castShadows:true mapSize:lightShadowMap value:lightValue shadowColor:lightShadowColor omL04 = omniLight name:"HH omni04" pos:[-75,-75,100] castShadows:true mapSize:lightShadowMap value:lightValue shadowColor:lightShadowColor omL05 = omniLight name:"HH omni05" pos:[33,33,100] castShadows:true mapSize:lightShadowMap value:lightValue shadowColor:lightShadowColor omL06 = omniLight name:"HH omni06" pos:[-33,33,100] castShadows:true mapSize:lightShadowMap value:lightValue shadowColor:lightShadowColor omL07 = omniLight name:"HH omni07" pos:[33,-33,100] castShadows:true mapSize:lightShadowMap value:lightValue shadowColor:lightShadowColor omL08 = omniLight name:"HH omni08" pos:[-33,-33,100] castShadows:true mapSize:lightShadowMap value:lightValue shadowColor:lightShadowColor omL09 = omniLight name:"HH omni09" pos:[75,0,100] castShadows:true mapSize:lightShadowMap value:lightValue shadowColor:lightShadowColor omL10 = omniLight name:"HH omni10" pos:[0,75,100] castShadows:true mapSize:lightShadowMap value:lightValue shadowColor:lightShadowColor omL11 = omniLight name:"HH omni11" pos:[-75,0,100] castShadows:true mapSize:lightShadowMap value:lightValue shadowColor:lightShadowColor omL12 = omniLight name:"HH omni12" pos:[0,-75,100] castShadows:true mapSize:lightShadowMap value:lightValue shadowColor:lightShadowColor omL13 = omniLight name:"HH omni13" pos:[0,0,100] castShadows:true mapSize:lightShadowMap value:lightValue shadowColor:lightShadowColor lightCreated = true ) if simpleLightCreated do ( delete omL simpleLightCreated = false ) ) ) Rollout bonusRoll "Egenskaber" ( slider camSlider "Zoom" range:[250,350,300] type:#float tricks:50 orient:#horizontal slider lightSlider "Lys styrke (kun adv. lys)" range:[10,30,20] type:#float tricks:20 orient:#horizontal button sfButton "Fjern/tilføj ramme" width:125 on sfButton pressed do ( max safeframe toggle ) on camSlider changed val do ( if camCreated do acm.position.z=camSlider.value ) on lightSlider changed val do ( if lightCreated do ( omL01.value = lightSlider.value omL02.value = lightSlider.value omL03.value = lightSlider.value omL04.value = lightSlider.value omL05.value = lightSlider.value omL06.value = lightSlider.value omL07.value = lightSlider.value omL08.value = lightSlider.value omL09.value = lightSlider.value omL10.value = lightSlider.value omL11.value = lightSlider.value omL12.value = lightSlider.value omL13.value = lightSlider.value lightValue = lightSlider.value ) ) ) Rollout jeppeRoll "Om HH max" ( button hm1 "hm1" button hm2 "hm2" edittext numse "her:" text:"hæ hæ" ) rollout params "Rendering" ( Bitmap WPreview Width:138 Height:124 pos:[17, 14] checkbox shad "Shadows" pos:[14, 150] checked:false Spinner StillF "Frame" type:#integer range:[animationRange.start, animationRange.end, 0] pos:[85, 150] fieldwidth:30 Button SFrame "Preview" width:125 button qrButton "Lav billede" tooltip:"Laver et billede i HHs størelse" width:125 on SFrame pressed do ( bm = render frame:StillF.value outputwidth:138 outputheight:124 vfb:off \ shadows:shad.checked\ WPreview.bitmap = bm ) on qrButton pressed do ( renderHeight = 374 renderWidth = 408 max quick render ) ) addRollout createRoll NF rolledUp:false addRollout bonusRoll NF rolledUp:true addRollout params NF rolledUp:true --addRollout jeppeRoll NF rolledUp:true print "test"
PS. Jeg fik ikke set på de andre roolouts, men jeg kan se at det er et par dage siden du postede dette spørgsmål så kan være du allrede har scriptet kørende.
06. august 2005 - 19:15
#3
Kom du lidt længere med dit script?
09. oktober 2005 - 01:34
#4
.. ?
22. oktober 2005 - 01:11
#5
Kom du videre med scriptingen ?
IT-kurser om Microsoft 365, sikkerhed, personlig vækst, udvikling, digital markedsføring, grafisk design, SAP og forretningsanalyse.