Boundng Box - custom object script

Leftover
Posts: 56
Joined: Thu Feb 14, 2008 8:58 am

Boundng Box - custom object script

Postby Leftover » Sat Jun 27, 2009 12:30 am

This simple script can be useful for those who use Kray instances done with Null objecs, like placing null proxies for plants.
What does it do: When appled to Null object, script looks for non-null objects with same name as Null. Script gets dimensions of found object and draws bounding box around Null. If object with same name isn't found or any other error occurs, script pops up warning message and displays "No Item" text.

It should make process of placing, rotating, scaling instanced pants or other objects much easier.

dbb.jpg
what does scrip do


dbb2.jpg
in action


Limitations:
1. Proxy object has to be a Null object
2. Source object shoudn't be scaled, scale nulls instead.
(it's not hard to write a code for scaled bounding box, but kray has a bug: instances scale is not equal to source object scale, so i didn't bother)
Would be good to have such option for "Kray instances" script which works with points, but my programming abilities are too weak :)

UPD. For those who can't see difference with "Item Shape" plugin. One more pic.

vs_custom_shape.jpg


UPD2. Script for toggling bounding box added. It can be assigned to shortcut or menu button.
UPD3. Script names changed to more logical ones :) So there are 3 scripts now:
1. KrayProxyNull.ls - custom object scrit - draws bounding box.
2. KrayCreateProxy.ls - Creates proxy null for selected object.
3. KrayProxyToggle.ls - Toggles bounding box on/off for selected null.
Attachments
proxy.zip
(1.41 KiB) Downloaded 542 times
Last edited by Leftover on Mon Jun 29, 2009 11:13 pm, edited 6 times in total.

jure
Posts: 2216
Joined: Thu Jun 02, 2005 6:53 pm

Re: Boundng Box - custom object script

Postby jure » Sat Jun 27, 2009 10:08 am

Wow great! Thank you so much again!

Leftover wrote:(it's not hard to write a code for scaled bounding box, but kray has a bug: instances scale is not equal to source object scale, so i didn't bother)


Are you sure there is a bug? Instances will take up the scale of the original object and apply their own transformation on top.
- Jure

joreldraw
Posts: 144
Joined: Wed Apr 15, 2009 7:36 pm

Re: Boundng Box - custom object script

Postby joreldraw » Sat Jun 27, 2009 11:39 am

what diference whith item shape?
we need to add this manually to all nulls...
Image

Leftover
Posts: 56
Joined: Thu Feb 14, 2008 8:58 am

Re: Boundng Box - custom object script

Postby Leftover » Sat Jun 27, 2009 11:46 am

Thanks.
Are you sure there is a bug?

Yes im sure about a bug. At least on my install :) There are few bugs related to instancing, i will make a post in bug section later
Last edited by Leftover on Sat Jun 27, 2009 6:06 pm, edited 1 time in total.

Leftover
Posts: 56
Joined: Thu Feb 14, 2008 8:58 am

Re: Boundng Box - custom object script

Postby Leftover » Sat Jun 27, 2009 11:53 am

what diference whith item shape?
we need to add this manually to all nulls...


Just try it. For item shape you have manually set box size which has nothing to do with actual cloned object. With this script - you have just apply it and a rest happens automatically. It draws _exact_ size of cloned object with right pivot shift. In other words it is a same as if you really cloned an object and turned bounding box visibility for it.

User avatar
nico
Posts: 624
Joined: Thu Feb 08, 2007 1:21 am
Contact:

Re: Boundng Box - custom object script

Postby nico » Sat Jun 27, 2009 5:05 pm

good work!!! i'm happy to see the instances 8) :shock: :D

joreldraw
Posts: 144
Joined: Wed Apr 15, 2009 7:36 pm

Re: Boundng Box - custom object script

Postby joreldraw » Sun Jun 28, 2009 2:49 pm

nice, thanks for this ;)
Image

adk
Posts: 38
Joined: Thu Jun 01, 2006 3:27 am
Location: Melbourne

Re: Boundng Box - custom object script

Postby adk » Thu Jul 02, 2009 3:01 am

..cheers a bunch for this Leftover.

adk

_mats_
Posts: 249
Joined: Sun Nov 19, 2006 11:53 pm
Location: Seattle, wa

Re: Boundng Box - custom object script

Postby _mats_ » Thu Jul 02, 2009 6:01 pm

Thanks a million leftover !

Will try it now, we all definitely owe you a beer (keg) that is :D

Matt -


Return to “Kray Scripts”

Who is online

Users browsing this forum: No registered users and 1 guest