ScriptSpot

Forum topic · Scripts Wanted

Exploded view

By Lareon · 2009-07-21

Description

not sure if this script or a script that can do this exists but i'm thinking of making an exploded view animation

basically i have thousands of objects in my scene in a small area of a product, i want the whole product to explode (not in a chaotic way)

so every object moves away from the centre of the object as if it is completely disassembled into it's components and i want to animate it

i can't think of a way to do it without key framing every single part and there's way too many

anyone got any suggestions?

Cheers

Comments (12)

jinj · 2010-05-10

@Nimaril
please when you post update for the script...
could you advice me by email?
thanks

jinjjj@gmail.com

jinj · 2010-04-28

cool and awesome!!
hope to download update quick!!!
;)))
Do you will post the update here,
or on it's own page?

Nimaril · 2010-04-28

Cool, happy it works Jinj.

I plan to continue to develop the script, as I said before this is my first script and it is a good exercise for me anyway so why not make something useful at the same time.

Here are some feature I plan to add on short and long term.
(not by order of priority)

1. Feedback on the distance in the viewport. (So you don't have to guess or go back and forth between push/pull)
2. Animating/keyframming via the interface.
3. Move only on the axis X, Y or Z or any combination of those. (<- Top priority) And move along an axis defined by the user.
4. Button to link/unlink the objects with the bomb (parent/child).
5. Button to "freez"/"unfreez" the objects.
6. Button to get the objects back into the selection (so you don't have to chase after them)
7. Button to select the bomb.
8. Back to "initial state". (like a super undo) (<- Top priority)
9. Undo - redo support.

10. Fixing the bugs :).

If there are some features you'd like feel free to ask. If I can implement them I'll try.

jinj · 2010-04-28

cool and awesome!!
hope to download update quick!!!
;)))
Do you will post the update here,
or on it's own page?

Nimaril · 2010-04-28

Both I guess,

I'll update here and when the script is reasonably advanced/debugged I'll create its own page.

jinj · 2010-04-28

@Nimaril
oh yes I do all step,
you can't do nothing wrong ;)
I re-try and now selecting more than one obj at the same time work...
undo and redo is not supported but if you select "push" and you are not satisfied from result than just select "pull" or viceversa and it work like undo ;)
this script is a little start.....
the interface is to small.... it would be nice to have an interface with more "ADD SELECTION" button with dedicated offset x,y,z direction.
but any way, the idea of exploded view is to offset obj on x,y,z,xyz
by bringing single/grouped objs on same plane and distance... so to render all component.
well.. any way I appreciate your script...;)) a nice implementation of this one is just to ad the possibility to select only one from x,y,z, axes for offset.
It would be nice if you continue with developing this script.;)))
thank you man

Nimaril · 2010-04-27

Jinj, glad you found the script useful. I'll try to help you out with your problem.

--------------------------------------------

Are you sure you followed these steps:

1. Select the objects you want to repulse or attract.
2. Press the "ADD SELECTION" button.

3. select the object that will act like the "bomb".
4. Press the "ADD BOMB" button. 5. Chose the wanted distance.

6. Press either "Push" or "Pull".

--------------------------------------------

The script should work fine. There are some known issues (like weird behaviour with groups etc) but as I already said it is an alpha version.

IF you still got trouble you can send me the MAX file so I can take a look why it bugs. Needless to say that I will not spread the file.

jinj · 2010-04-27

hi
Nimaril I try the script!!
It's simple and useful but only for one obj at time
I try to explode more than one component at time but no action!!
I try to explode a watch in all it's component but this is an
never ending job :=
I stay tuned for the official release!
thanks

Nimaril · 2010-04-21

Hi Lareon,

here is a little script that should do the trick for you.
It's an alpha version and still has lots of bugs, but it works.
It's also my first script so the code may not be pretty.

Here is how it works:

1. You select the objects that you want to explode. (Click "Add selection")
2. Select the object that will act as "bomb". (Click "Add bomb")

The rest is self explanatory (distance - push - pull).


-- Exploder ver 0.01
-- Ilies Sarrab, march 2010

-- Arrays
-- Array of the objects who will explode
myObjects = #()

-- Array of the ground zero object, should contain only one object
myBomb = #()

rollout myExploder "My Exploder"
	(
		group "Selection" (
			--myObjects _ MO
					
			button _EmptyMO "Empty" align:#left across: 2
			on _EmptyMO pressed do
			(
				myObjects = #()
				myBomb = #()
				-- test -- print myObjects
			)
			
			button _AddMO "Add selection" align:#right
			on _AddMO pressed do
			(
				join myObjects (selection as array)
				initialMyObjects = myObjects
			)
			
			-- myBomb _ MB
			
			button _AddMB "Add bomb" align:#right
			on _AddMB pressed do
			(
				if selection.count == 1 then (
															(myBomb = selection as array)
															(print myBomb)
														)
					else messagebox "Please select one object as bomb."
			)
		)
		
		group "Forces" (
			spinner _Distance "Distance" range:[1,1000,10]
			-- Execution
			
			button _Push "Push" align:#left across: 2
			on _Push pressed do
			(
				for i in myObjects do
				(
					myVector = normalize(i.pos - myBomb[1].pos)
					i.pos = (i.pos + (myVector * _Distance.value))
					--test -- print i.pos
				)
			)
			
			button _Pull "Pull" align:#right
			on _Pull pressed do
			(			
				for i in myObjects do
				(				
					if i.pos == myBomb[1].pos then
					(
						messagebox "One or more objects have the same positions as the bomb."
					)
					else 
					(
						myVector = normalize(i.pos - myBomb[1].pos) -- /2
						if (distance i.pos myBomb[1].pos) > _Distance.value then
							(
								i.pos = (i.pos - (myVector * _Distance.value))
							)
						else i.pos = (myBomb[1].pos + myVector)
					)
					-- test -- print i.pos
				)
			)
		)	

		
		-- Various
		button _Help "Help"
		on _Help pressed do
			(
			messagebox "Autor: Iliès Sarrab\nmarch 2010\nver 0.01"
			)
		
	)

createdialog MyExploder width:200

Attachments

heidy_james · 2010-04-03

Through allotment of your opinions, you could dig up that awareness which you can’t catch from books. I like this way of sharing knowledge.

Graph · 2010-03-13

could you make a screenshot example showing the camera, 20 objects and the center of "explosion"

also, how would you like to control the speed?
mass based on density * BB volume * global velocity ?
or the same speed for all objects?
do you want an exploding motion or linear?

also.. do you want the objects to explode to a point where no more intersections happen or is that of no importance?

if you only need a linear motion you only need 2 keyFrames per obj... wich you could then later edit in the curveEditor so to get a fluid exploding motion with 2 keyframes per onject

jinj · 2010-02-18

I have no idea about, but it's very interesting!!!
;)