Animated "Firework" script animation problem
Dear all,
I have created the following script to generate "fireworks" (term used loosely) as directed my tutor. It is based on skeleton script that I MUST use.
There are spinner to control certain parameters, however for the life of me I can not figure out what is wrong! Please help me!!!
The task was to animate via script, a sphere that went up, where the faces "exploded" and changed direction downwards via a time scale.
(firework goes up, explodes, and debris fall to earth)
I believe what I have written is correct, however no animation is actually generated. Despite my BEST effort and months of hard work.
I am new to coding, and did not sign up for any coding. All I wanted to do was to learn how to model. However my tutor holds the key to my pass.
At this present time I am ready to "rage quit" and am simply going out of my mine. ANY help would be greatly appreciated.
Here is the script I have written thus far...
-- Empty varables to be called in or adjusted by spinners numOfSpheres = 0 --number of exploding spheres sphereRadius = 0 creationBoxSize = 0 -- spawn radius in what box size? objs = #() -- objs created go to empty array! maxHeight = 0 startTime = 0 dropping = false --boolean flag to trigger the falling sphere stage animate on ( for i = 1 to numOfSpheres by 1 do ( at time (startTime + 50.000) ( meshop.bevelFaces objs[i] #{1..objs[i].numFaces} 0.0000001 0 ) at time (startTime + 50.001) ( meshop.bevelFaces objs[i] #{1..objs[i].numFaces} 0.0000001 0 ) at time (startTime + 100) ( meshop.bevelFaces objs[i] #{1..objs[i].numFaces} 100 0 ) at time (startTime) ( objs[i].pos = objs[i].pos ) local height = maxHeight for t = 5 to 100 by 5 do ( height = height - 2 at time (startTime + t) ( objs[i].pos = objs[i].pos + [ 0, 0, height] ) ) ) ) rollout FireWorks "FireWorks" ( -- button ui code starts here label lbl1 "By Luke Fahy" style_sunkenedge:true width:67 height:17 spinner count "FireWorks: " type:#integer range:[1,100,10] -- 1 to a 100: default value of 10: integer = whole number not fraction! spinner size "Size: " type:#float range:[0.1,30,1] spinner sPlane "Spawn Plane: " type:#integer range:[1,200,30] spinner maxHeightSpinner "Max Height: " type:#float range:[1,100,14] spinner startTimeSpinner "Start Time: " type:#float range:[1,100,1] button create "Create Fireworks" on create pressed do -- Event handler code start ( numOfSpheres = count.value sphereRadius = size.value creationBoxSize = sPlane.value maxHeight = maxHeightSpinner.value startTime = startTimeSpinner.value dropping = false --create spheres for i = 1 to numOfSpheres by 1 do ( objs[i] = sphere radius:sphereRadius local r = random 0 255 local g = random 0 255 local b = random 0 255 objs[i] .wirecolor = (color r g b) objs[i] .pos = [random creationBoxSize -creationBoxSize, random creationBoxSize -creationBoxSize, 0] -- random possative and negative x/y values to create spawn box. convertToMesh objs[i] meshOp.explodeAllFaces objs[i] 0 ) ) ) -- button ui code end createDialog FireWorks width:200
Also, any suggestion for my comments and indentation would be appreciated. (formatting seems to have been thrown out of the window upon cut and past, my apologies I'm new to this forum. File is as attachment)
Kind regards,
ShineSmith
:)
Further more, here is the script my tutor gave me to base my work on.
convertToMesh $ meshop.explodeAllFaces $ 0 update $ v = 20 animate on ( at time (sliderTime+50.000) ( meshop.bevelFaces $ #{1..$.numFaces} 0.0000001 0 ) at time (sliderTime+50.001) ( meshop.bevelFaces $ #{1..$.numFaces} 0.0000001 0 ) at time (sliderTime+100) ( meshop.bevelFaces $ #{1..$.numFaces} 100 0 ) at time (sliderTime) ( $.pos = $.pos ) for t = 5 to 100 by 5 do ( v = v - 2 at time (sliderTime+t) ( $.pos = $.pos + [0,0,v] ) ) )
Attachment | Size |
---|---|
explosion.ms | 2.35 KB |
Comments
see this...
see this, just rearranged it ...
kimarotta.com.br
3d Artist