Box + user defiend field + link

Yeah, i dont know much about this to be honest. But my guess is that this is something easy to do. Im not sure if i should add this in general scripting or here.
Anyway, here is a script made by blur.........

....basicly, when the script runs. it adds a box surrounding the object selected.
What i would want it to do is also that it links the new box to the selected object.
And also adds some code in user defined field on both objects. Some help or advice? Anything would do.

AttachmentSize
BBoxMaker.ms1003 bytes

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
real08121985's picture

( undo "BBoxMaker"

(
undo "BBoxMaker" on
	(
	for i in selection do
		(
		l = (i.max.y - i.min.y)
		w = (i.max.x - i.min.x)
		h = (i.max.z - i.min.z)
		c = i.center - [0, 0, (h/2)]		
		the_box = Box lengthsegs:1 widthsegs:1 heightsegs:1 length:l width:w height:h pos:c
		the_box.name = i.name + "_vol"
		-- the 4 new lines, first set parent, then add 3 userproperties:
		the_box.parent = i
		setUserProp i "an_integer_value" 13
		setUserProp i "a_string_value" "BBox means BeatBox"
		setUserProp i "a_boolean_value" true
		)
	)
)

happy maxing ;D

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.