[Closed] Fracture Script
Hey Guys,
I recently used a Macroscript called MB_Fracture and also used Allan Mckays BirthScript from the tutorial on his site.But on trying to execute the Script it is giving me an error saying that Inalid Argument on “on Init pCont do”…:eek:
I could not find Allan Mckays Fracturing Script anywhere and I believe that the reason my Script is not working is because it has specified a Global Event called “groundGeom” which I figure Allan’s script has specified.Now I dont know what the global event for my Fracture Script(mb_Fracture) is or where I can find it…I really need to crack this guys…So please help.I am copying the Birth Script here for your convenience:-
–MODIFY THIS AT YOUR OWN RISK–
on ChannelUsed pCont do
(
pCont.useposition = true
pCont.useshape = true
)
on Init pCont do
(
global $frag_* = $frag_* as array
)
on Proceed pCont do
(
t1 = pCont.getTimeStart() as float
t2 = pCont.getTimeEnd() as float
if ((t1 <= 0) and (t2 => 0)) then
(
(
pcont.addparticles groundgeom.count
for i in 1 to groundgeom.count do
(
pcont.particleindex = i
pcont.particleshape = groundgeom[i].mesh
pcont.particleposition = groundgeom[i].position
)
)
)
on Release pCont do
(
)
If I undertand what you’re trying to achieve (and I might not be), try the following:
on ChannelsUsed pCont do
(
pCont.useTime = true
pCont.useTM = true
pCont.usePosition = true
pCont.useShape = true
)
on Init pCont do
(
)
on Proceed pCont do
(
MyFragments = $frag* as array --The objects you want to use have to have the name "frag*"
count = MyFragments.count
t1 = pCont.getTimeStart() as float
if (t1 < 0) then
for i in 1 to count do
(
pCont.AddParticle()
pCont.particleIndex = i
pCont.particleShape = MyFragments[i].mesh
pCont.particlePosition = MyFragments[i].pos
pCont.ParticleTM = MyFragments[i].objectTransform
)
)
on Release pCont do
(
)
Hey thanks for the quick reply Man…Unfortunateky the script didn’t work…I am attaching the Max File and the Fracture Script…Hope on seeing the file the situation would be a lot clearer…Thanks a ton…
http://download.yousendit.com/4695D84B4EACED01
Regards,
Subhro
Hey thanks for the quick reply Man…Unfortunately the script didn’t work…I am attaching the Max File and the Fracture Script…Hope on seeing the file the situation would be a lot clearer…Thanks a ton…
http://download.yousendit.com/4695D84B4EACED01
Regards,
Subhro
Firstly : Ungroup your fragments.
Secondly: You’ve copied part of your post here into the birth script!
Take out the lines
Today 11:34 AM
entrancea Hey Guys,
I recently used a Macroscript called MB_Fracture and also used Allan Mckays BirthScript from the tutorial on his site.But on trying to execute the Script it is giving me an error saying that Inalid Argument on "on Init pCont do".....
at the bottom.
Oh and if you wanna use the MB_Fracture Script then run it from MaxScript and then go to Customize User Interface and from there go to the Toolbar tab and then the dropdown menu and from there you’ll see the MB Tools…You can drag it upon your existing toolbar to add a new tab called Fracture…
Cheers,
SUbhro
:bounce: Woops…Yeah I see it…well I did that and ungrouped all the particles but all I am getting is one particle instead of particles generating for each mesh object I have on screen…
Cheers,
Subhro
Allright…Few problems…I can see the fractured pieces now…But
1)Only when I turn Display Geometry on PFlow.
2)When I switch to ticks I see only two or three ticks which seem to be all the pieces at one place.
I hope I sound clear cause I am confused now…On one hand the Geometry display shows that everything is evenly distributed but when I switch to the tick mode it shows that all the pieces are concentrated at one place…And upon applying a deflector and wind I found out that the Tick version is correct and not the Geometry mode…
Thanks,
Subhro
Make sure you have centered all of the pivots on your fragment geometry.
Bobo explains it better than me:
http://www.scriptspot.com/bobo/mxs5/pflow/pflow__Chunks_Basics.htm
Oh Yeah…Way Coool:scream:
It worked out…
Thanks a ton Man:thumbsup:
Take Care,
Regards,
Subhro