PDA

View Full Version : dislocate chunked object - bobo script


digiboxoffice
10-15-2008, 07:20 AM
Hi, did anybody tried to control chunked object that generates bobo script?
what I have in mind to create a really complicated shape(car for example) chunk it then dislocate all its parts in space - spin it, rotate it and at some point put all chunks together so that they would form car as it is and then again dislocate, spin and rotate.

I tried allmost every operator to dislocate and then put it back together but once it dislocates it doesn't go back. I also tried to animate original shape. But chunks doen't realy follow that animation. That was quite dissappointing if you imagine what cool effect can be done if the original shape would have Morpher animation on it.

On my scene i put 3 boxes and spline on which bobo chunks move using speed by Icon and path constraint.

So how to dislocate chunks and put them back together?


My regards to great scripting minds as bobo - i wish i knew how to script :)

Wicked
10-15-2008, 12:23 PM
Do you mean something like this? www.wickedstuff.nl/dump/chunks.mov (http://www.wickedstuff.nl/dump/chunks.mov)
(Oh, and.. play it backwards :p )

I used 2 scripts to achieve this:
1- A script to fragment the object -> download (http://www.scriptspot.com/3ds-max/quickfrag)
2- A (birth)script that uses your fragments -> tutorial (http://www.scriptspot.com/bobo/mxs5/pflow/pflow__Chunks_Basics.htm)

Make sure that you center the pivot of each mesh and apply a Reset XForm on each mesh.


Here is my flow:
http://www.wickedstuff.nl/dump/chunk_flow.jpg

Camtrack
10-22-2008, 04:11 PM
Hi, did anybody tried to control chunked object that generates bobo script?
what I have in mind to create a really complicated shape(car for example) chunk it then dislocate all its parts in space - spin it, rotate it and at some point put all chunks together so that they would form car as it is and then again dislocate, spin and rotate.

I tried allmost every operator to dislocate and then put it back together but once it dislocates it doesn't go back. I also tried to animate original shape. But chunks doen't realy follow that animation. That was quite dissappointing if you imagine what cool effect can be done if the original shape would have Morpher animation on it.

On my scene i put 3 boxes and spline on which bobo chunks move using speed by Icon and path constraint.

So how to dislocate chunks and put them back together?


My regards to great scripting minds as bobo - i wish i knew how to script :)

this modification to the birth script works for me after the reset xform ...

( I can send you a scene if you wants to see it working)


on ChannelsUsed pCont do
(
pCont.useAge = true
pCont.useTM = true
pCont.useShape = true
)
on Init pCont do
(
global ChunksArray = $ventana* as array
)
on Proceed pCont do
(
t = pCont.getTimeStart() as float
if t == 0 do
(
NumChunks = ChunksArray.count
for i = 1 to NumChunks do
(
global x1 =ChunksArray[i].Position.x
global y1=ChunksArray[i].Position.y
global z1=ChunksArray[i].Position.z
global caca = ChunksArray[i]
pCont.AddParticle()
pCont.particleIndex = pCont.NumParticles()
pCont.particleAge = 0
pCont.particlePosition = ChunksArray[i].Position

caca.Position.x=0
caca.Position.y=0
caca.Position.z=0
pCont.particleTM = (matrix3[1,0,0][0,1,0][0,0,1][ChunksArray[i].Position.x,ChunksArray[i].Position.y,ChunksArray[i].Position.z])
pCont.particleShape =caca.mesh


caca.Position.x=x1
caca.Position.y=y1
caca.Position.z=z1

pCont.particlePosition = caca.Position


)
)
)
on Release pCont do
(
)

Photropikl
01-27-2009, 01:17 AM
Hi,

This is my first post here. I'm trying to learn PFlow for a project, currently on page 75 of the massive sticky, so I've lot's of ideas about whats possible but lacking the knowledge to stick it all together.

I'm trying to get a fragmented cube (only 10 chunks) to come apart, fly around a little and then reform.

I've managed to get this script to disperse my object but I am totally clueless as to how to get it to reform. I'm assuming that I need to combine a Find Target with a scripted operator that somehow reads

I wonder if anyone could give me some pointers, or even better post an example file :o)

Best,

Charles

Bobo
01-28-2009, 04:15 PM
Hi,

This is my first post here. I'm trying to learn PFlow for a project, currently on page 75 of the massive sticky, so I've lot's of ideas about whats possible but lacking the knowledge to stick it all together.

I'm trying to get a fragmented cube (only 10 chunks) to come apart, fly around a little and then reform.

I've managed to get this script to disperse my object but I am totally clueless as to how to get it to reform. I'm assuming that I need to combine a Find Target with a scripted operator that somehow reads

I wonder if anyone could give me some pointers, or even better post an example file :o)

Best,

Charles

In the birth, store the original positions of the chunks/particles in the particleVector channel (pCont.useVector = true, then in the Proceed handler, pCont.particleVector = pCont.particlePosition).

Later on, when you want to recombine, set the Find Target to use Script Vector channel as the target location. Each particle will contain its "home address", or better, "homing positions", in the particleVector channel and the Find Target will move it to that world coordinate. For this to work, you should have NO mesh selected in the Find Target (otherwise, the vector channel will be interpreted as local coordinates in the mesh's space).

(shameless plug) Go buy my DVDs for more ideas :)

Photropikl
01-28-2009, 05:43 PM
Brilliant, and how perfectly simple.
Thank you so much.

CGTalk Moderation
01-28-2009, 05:43 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.