PDA

View Full Version : MEL - Simple Light Array Generator


Jason-Kane
09-28-2003, 11:51 PM
I use rectangular light arrays often when doing my Maya default render lighting and was tired of setting up arrays by hand.


http://www.kanecg.com/images/kane_light_array.mel


I wrote this simple little light array generator for myself and thought I would share.

Move the array around by selecting the plane.
Aim the Array by selecting and rotating the arrow.

If you rotate the plane the arrow will follow relative to its last position.

Not error tested. Use at own risk. And do not use duplicate names.

Hope somebody else finds this as useful as I did.




:D

DeathBrain
09-29-2003, 12:56 AM
Thanks for sharing...:)

wgreenlee1
09-29-2003, 01:08 AM
Thank you.
I will have to give this try sometime soon.

Thanks for you efforts!:thumbsup:

zachgrachan
09-29-2003, 02:40 AM
Looks great, but a couple of things...

1 Is there a way to edit the lights, after creation of the grid(all at once)?

2 the aim constrianed cone should have been orient constrained to control the lights by rotation. An aim constraint points the constrained at the constrainer. as is you just have to translate the cone into the area of your model.

3 wondering if it would be much work to set this up to do a dome, have any idea? That would make it useful in a whole rack of other situations...

Thanks for sharing it!

Jason-Kane
09-29-2003, 04:12 AM
Well first this is just the start or the core of what I hope to be a huge all encompassing lighting utility. So thus far the script is about 5% done.

1 Is there a way to edit the lights, after creation of the grid(all at once)?

Mask out mesh selection on the top of the interface and then select the lights. Go to the attribute spread sheet and edit all the Shape Keyable properties all at once on every light by clicking and dragging down a column.

The plans are to create a fully editable array that when you select a handle a menu pops up with parametric settings for that array. Obviously I didn't get that far.



2 the aim constrianed cone should have been orient constrained to control the lights by rotation. An aim constraint points the constrained at the constrainer. as is you just have to translate the cone into the area of your model.

The spots lights are currently aim constrained to a hidden locator. The locator is parented to the cone. The cone is then parented to the plane. I like this because you can rotate the plane and the lights direction will follow. Or you can rotate the cone the the lights orientation will shift. Also this allows for a 3rd parametric setting that I plan on adding which is "Focus" I can move the hidden locator closer to the plane and further away with a slider named focus. This way the lights will go from parellel to concentrated.

The lights are attatched to each CV through pointInfoNode so that I can deform the planes parametrically. For instance a slider that bends the array or a slider that rounds off the edges of the array or perhaps even skews it.

3 wondering if it would be much work to set this up to do a dome, have any idea? That would make it useful in a whole rack of other situations...


In my final version I want you to be able to choose.
That is all in the works.
Rectangle
Circular Disk
Dome spots
3D Mass or 3D ball of points
These masses are a good trick to represent a torch.

I also have plans to allow you to paint on the nurbs rectangles to control the color of the lights. And finally I plan on making a menu to manage save and load preset arrrays. OH! I also want to add labels to the arrays that estimate the render time each one is adding to your scene. Or at least show the total Shadow map res of the array and make it turn redder as it increases.

Oh I also want to make a function that will automatically calculate the bounce vector of the array. So you could place the array on the floor of a room, select the sun source light and then select the plane and then click a button that will automatically and quickly calculate the inverse bounce and aim the lights that direction.

All in the works. Should be done in a few days.
:D

zachgrachan
09-29-2003, 06:13 AM
a few days???? wow... quite a feature list, I hope someday to be capable of doing this type of stuff in a matter of days... Keep it coming, so as I can study it as much as use it. I plan on having a closer look at the code tomorrow during lab.

Jason-Kane
09-29-2003, 07:28 AM
I am having fun with this. If anyone has used it and has any other comments please let me know.

Thanks,

Jason Kane
:beer:

wgreenlee1
10-12-2003, 07:10 PM
I load the script and hit enter,it gives me the interface and I type in a name for it and then I sit there with a dumb look on my face.
Is there any thing else I should do except look dumb?lol
I looked in the script but saw no hints.
Any help?

THX!:thumbsup:

zachgrachan
10-13-2003, 01:34 AM
It used to work, but now there seems to be no createIt proc. I checked and don't seem to have it anymore. Maybe an update gone screwy, Kane?

zachgrachan
10-17-2003, 01:42 AM
realized what it was... The proc createIt needs to be global. The only time it'll work without being global is when copied and pasted into the script editor - as this makes everything global. Any time a button calls a proc it needs to be global.

Hadn't noticed it at first 'cuz I was just pasting into my script editor before I found out about this.

wgreenlee1
10-19-2003, 04:58 AM
Originally posted by zachgrachan
realized what it was... The proc createIt needs to be global. The only time it'll work without being global is when copied and pasted into the script editor - as this makes everything global. Any time a button calls a proc it needs to be global.

Hadn't noticed it at first 'cuz I was just pasting into my script editor before I found out about this.


so what are you saying....lol

Nevermind...I just found out the panel wasnt expanded....to see the create it button....oh man i tell ya....lol

zachgrachan
10-19-2003, 06:01 PM
oh.... well yeah, that could be the problem too! didn't even think of that.... :)

Jason-Kane
10-21-2003, 12:09 AM
yep

I intended on getting in here and letting you know about expanding the panel but I have been really busy with my new job.

Apologies.

LustRazor
04-19-2004, 11:56 PM
This is buttrock!

:buttrock: :buttrock:

Cheers!
:beer: :beer:

CGTalk Moderation
01-14-2006, 06:00 AM
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.