Soften those distant lights

Soften those distant lights

Download (2kb) -- Put it in the Tool folder in the scripts folder.

I humbly submit my first (usable) little script, made because I was working on something where I wanted a softer shadow than what the distant light casts. It simply clones and rotates the selected distant light a specified number of times, dimming them appropriately as it goes, and puts the new lights in a tidy folder named after the original light's name.

Not too special, but I hope someone finds it useful. Any suggestions or modifications are welcome. Perhaps it could be combined with Todd's sun script? :)

Oh, and Martin, a couple things I learned from making this... I was surprised to find that a script-made DISTANTLIGHT object is not quite the same as a normal light set to distant -- is there any big difference, aside from fewer options? Also, when typing a value in a text field and then clicking right on an action button, sometimes the field reverts to its old value; thought you should know. And lastly, is it right that the addParameterBool documentation has min and max values?... ;)
 

Attachments

  • softshadow.jpg
    softshadow.jpg
    7.2 KB · Views: 748
Last edited:
looks like it goes into the tools folder.

also

capnchunky,
the lights seem to be created at the origin, is this the effect you desired? if not you would want to get the position of the selected light and then set the position of the folder to that. then all your lights will be groped together.

Todd
 
Last edited:
Hi,
Its great to have another script writer. It looks usefull. Would you post a link pointing me to the basics of script writing or tell me how you guys do it. Is it easy?

Thanks a lot,
Greg
 
Eureka!,
in between scripts I am putting together a sort of how to guide for cheetah script writters. all the things I have learned while doing this.

although I am doing this I am better at writting script than english, so it might take a few weeks to write it all down.

Todd
 
in between scripts I am putting together a sort of how to guide for cheetah script writters. all the things I have learned while doing this.

Hi,
That sounds really good. Do you guys use javascript or dose C3D have it's own built in script software. Just so you know I have never written a script for any software and I'm totally new to it:redface:. Sorry if some of my questions are a duh to you pros:wink:.

Thanks for writing the tutorial,
Greg
 
Where should I place this script ( polygon?)
Doh, I was so proud of myself I forgot to say. :tongue: Todd's right, it goes in the "Tool" folder.

Hi,
Its great to have another script writer. It looks usefull. Would you post a link pointing me to the basics of script writing or tell me how you guys do it. Is it easy? ... Do you guys use javascript or dose C3D have it's own built in script software. Just so you know I have never written a script for any software and I'm totally new to it.

Thanks. Any other future scripts I might write will probably be similarly basic time savers, as I lack the creativity and amazing 3D math skills of Todd and tg_jp.

C3D uses Javascript, although Martin has also mentioned integrating Angelscript in the future. In any case, I'm probably not the right person to ask; I wouldn't know how to suggest getting started with scripting. I'm mainly familiar with Javascript through years of struggling with it for the web (and other similar object-oriented languages like Flash) at work, but even relatively simple tools like this take some trial and error for me.

the lights seem to be created at the origin, is this the effect you desired? if not you would want to get the position of the selected light and then set the position of the folder to that. then all your lights will be groped together.
I wasn't worrying too much about that since the position of a distant light doesn't matter in terms of rendering. But good point, I probably ought to, to be polite to the user.

Yikes, and I just now noticed that I managed to upload the wrong version earlier, which omitted locking the GUI during the (relatively) slow light creation process. This new version is much faster, and creates the new lights' folder in the same position as the original one.
 
Last edited:
Hi,
great to see another scripter. The more the better. :smile:


Oh, and Martin, a couple things I learned from making this... I was surprised to find that a script-made DISTANTLIGHT object is not quite the same as a normal light set to distant -- is there any big difference, aside from fewer options?

These are the old light sources. They are just there for backward compatibility. Please use the new light object for your scripts.

Also, when typing a value in a text field and then clicking right on an action button, sometimes the field reverts to its old value; thought you should know.

That happens if you haven't pressed return before you clicked on the Button. Without the RETURN the new value won't be saved.

But a click on a button forced a redraw. So the old value will be redrawn.

And lastly, is it right that the addParameterBool documentation has min and max values?... ;)

OK. That doesn't make to much sense. I probably was to long out of sleep when I wrote this. But I will keep it due to compatibility reasons for the first. A solution for the problem is already under planing.

Bye,
Martin
 
Hi,
one more thing. Please always update your script download in the first thread. So people who want to try your script won't have to search the hole thread to find the download.

Bye,
Martin
 
These are the old light sources. They are just there for backward compatibility. Please use the new light object for your scripts.

Okay, good to know; I just saw DISTANTLIGHT in the helpfile and used that. I'm now using the LIGHT constant (which doesn't seem to be listed?).

Please always update your script download in the first thread. So people who want to try your script won't have to search the hole thread to find the download.

Whoops, very good point; I didn't expect the thread to get this long. :) I've moved the updated download back to the top.
 
Back
Top