ScriptSpot

Script

Create Animation Bounding Box

By allanmckay · 2009-10-13

Version
3dsmax 2009
Date updated
2009-09-13
Votes
15
Download
Download
Description

Script I built to work with Fume FX, but can probably be used for many other things.
The idea is that I wanted to roughly work out the entire dimensions of a characters animation, so a bounding box - of the entire animation.
Lets say I have a character running, and jumping, and falling over - and I want him to be on fire, this tool will track all of the dimensions of the character for the entire animation duration and build a bounding box representing the exact area he's covered.
This way I can create a fairly accurate Fume FX container that isn't wasting space.

However could possible be useful for animators, and various other uses.

Tags: fx, bounding box, dimensions, Fume FX, FFX, fluids, mckay, allan, fire

Comments (1)

Anubis · 2009-10-13

Hi, Allan. I think you know so the final box is bigger than bounding box with 2.5 in all 3 dimensions, maybe this is what you want, but rather I want to say that its quite complicated code and it runs slowly. Here's a quick idea of me:

rollout myGUI "Anim Box"
(
	pickbutton chooseOBJ "Choose Anim OBJ" width:140
	checkbox keepDum "Keep Helpers" checked:off
	on chooseOBJ picked obj do
	(
		if obj != undefined do
		(
			bb = nodeLocalBoundingBox obj
			for t = animationrange.start to animationrange.end do
			(
				at time t dummy boxsize:(bb[2]-bb[1]) pos:obj.center prefix:"_tmp"
			)
			select $_tmp* ; tbb = $.max-$.min ; tc = $.center
			b = box name:"AnimFFX_box" \
			width:tbb[1] length:tbb[2] height:tbb[3] xray:on isSelected:on
			CenterPivot b ; b.pos = tc
			if not keepDum.checked do delete $_tmp* -- del. helpers
		)
	)
)
createDialog myGUI
Attachments