PDA

View Full Version : Help. The fairy lights blink.



ackees
06-02-2003, 09:24 AM
I am trying to create a blinking fairy light effect.
1, got the HV Emitter and wind working, so the particles swirl as I want.
2, Created a point light with a global lens flare
3 Somehow managed to attach the light to the HvParticles – light moves with partical.
4 Here’s the odd bit. When the particle dies the light just sits there, I thought it would dutifully disappear with the particle – you know, come on when the particle comes on and go when the particle dies, but no. Is there a way to achieve this?
5, I get the light blinking by using the graph (the mysterious ‘E’ button – the light dutifully blinks.
But when I duplicate the point light all the fairy lights blink on and off together (naturally as they are cloned). Is there a way to get them all to blink on and off at different times – surely I do not have to adjust each light manually or create hundreds of different light settings?
I searched for the cool button s ‘light blink on and off’ and ‘randomise graph’ but no joy.
Thanks in advance.

ackees
06-04-2003, 05:56 AM
At a guess this appears to be impossible in LW.
I have got the lights to go when the particle goes.
But when I duplicate the light for the other particles they all blink together.
Have I reached the edge of the capability of this function?

nils
06-05-2003, 10:39 AM
Have you tried adding an expression that randomizes the blinking? To do so, select the light in question, Item Properties, Lens Flare Options and click on the "E" next to Flare Intensity which brings up the Graph Editor (you've come thus far yourself, right? Or did you "E"nvelope the the Light Intensity?).

Under the Expressions Tab, select "New", type e.g. "random" as a name and "random(0.0,1.0)" as the Value. Apply it to the graph and see if the result looks good. random() calculates random values between the two values in the parentheses.

Now you can clone the light and have them all flickering individually. I hope you can live with it's rythm because there is not much control over that. I've been fiddling around with the Textured Channel Modifier, but unfortunately, after cloning the light the whole bunch is blinking simultaneously. Maybe some less newbie member of the community can shed some blinking lights upon that: it would be good if the texture's position could be set individually. Manually, that is no problem at all, but can that be automated? Applying the above mentioned random()-expression to the texture's Position Channel is not of much help because the position gets animated over time resulting in the same fast-paced flicker. But what about a random value that is set once and hold during the lifetime of that channel? Do I hear anyone shouting "LScript!"???

Anyway, hope the first part of my verbiage did help!

nils

ackees
06-05-2003, 11:36 AM
Thanks nils i'll give it a go. I was hoping I could get there without scripting, but, I'll try.

toby
06-05-2003, 01:41 PM
there are options for pre and post behaviour when you use "FXLinker" - you can make the linked objects disappear when the particle dies - of course fxlinker doesn't work with lights - maybe luxogons can help -

If you use "noisy channel" for the flicker you can set the "phase" differently for each light - or how about using luminous partigons instead of lights? Set the luminosity to 400 and use a procedural in the same channel

ackees
06-05-2003, 02:15 PM
Thanks again nils, it’s working. I thought the ‘noisy’ modifier was supposed to be a random function, but when I tried it all the lights blinked at the same time, so there is something odd happening with that. Now my problem is that the blinking is too fast so I’ll have to dig into the code to find a slow down. Now, a random function should be one button away with a few sliders for control, it is an indispensable function. Why hide it away in a piece of script several windows deep?
Thanks toby, I did figure out the fading in the end.
There is an oddity with all this, I have to move the original light out of camera view (before cloning) because when a particle dies the light that was attached to it reappears at the original light position, and if there are several you get the summed lights at 0:0.

nils
06-06-2003, 06:31 PM
Hello ackees,

are there any news from the fairyland? I've written a little LScript for you! You can place it anywere on your HD, maybe in your 3rd Party Lscripts Folder?

---
note: you can find the script attached to my next post!!! :rolleyes:
---

Now let's see if it works better! First, you may have to get rid of that "random" expression you may still have attached to your light's flare intensity. In the Graph Editor, go to the FlareIntensity Channel and select the Expressions Tab under the graph display. Select the expression in question (using that green "Expressions..."-button) and "Remove" it.

Now the fun begins: In the "Modifiers" Tab select "Add Modifier ---> Textured Channel". Doubleclick on that Modifier, then on "Texture" and you will find your old friend, the Texture Editor. Select a texture that fits most to your desired blinking pattern. I chose a procedural texture: turbulence. Adjust the Values to your liking, I increased Texture Value to 1.0 and Contrast to 85%, you can see the result in the Graph Editor. The speed (frequency) of the effect is controlled by the texture size (that is the Scale in the Texture Editor, not in the Graph Editor!). To slow the blinking down, just increase the Scale of the X-axis (as that is the axis selected in the Graph Editor).

To randomize the offspring of your "root"light, you can apply my LScript to the Texture's X-Position. Click on the appropriate "E". You'll find the "TextureChannel.TextureLayer.Position.X" loaded into the Graph Editor. Add Modifier "LScript", a doubleclick on that opens a file browser. Open "randomStartPosition.ls", and that's about it!

Give it a try, clone your light and see the result: everything blinks simultaneously! No worries, that's because the LScript only executes once when it is loaded. Save the scene, open it again and everything should be fine.

I hope that this is finally what you were looking for, albeit in a more accessible way! The good thing is that you have full control over rhythm and frequency. You can even draw your own "blinking-rhythms" as a simple grayscale texture. How about sending secret morse messages via your fairy lights? ;)

Have fun!

nils

nils
06-06-2003, 06:38 PM
oops, my attachment didn't show up... sorry!

Danner
06-07-2003, 01:24 AM
you can use a procedural texture to determine the lights values, use a moving texture and select world coordinates, so every light is in a different place of the 3d texture.

ackees
06-07-2003, 04:46 AM
Thanks Danner, I can get the procedural texture technique to work with one light, but when I clone the light they blink together (global pos. is set, texture is Turbulence).
Nils I couldn’t get the file, it downloaded as a .phl file (not sure what that is).
I don’t see why I can’t use the noisy modifer (the controls are OK on that) and then randomise the noisy channel over time, for some unknown reason this doesn’t work. There are oddities when you dig into LW, it’s as though it’s a lot of different programmes linked together and some of the links don’t work or work in an obscure way.

ackees
06-07-2003, 07:13 AM
Actually, the more I think about it the more I think that there must be a way to control the random function over time, that would be very very useful for endless situations. A lot of LW artist use the procedural textures to create random effects but could it be using a hammer to crack a nut? And what if there is a really heavy scene would procedural textures grind to processing down to a crawl?

nils
06-07-2003, 07:48 AM
ackees,

I just tested downloading the file and it works for me, it is not a .phl file (whatever that is), but a .zip one. You cannot unzip it to get the .ls file it contains? In that case, open your favourite text editor (maybe LSed, to be found in your Lightwave/Programs folder). Copy and paste the following little script and save it as "randomStartPosition.ls" (or you can make up a better name!). If you do not use LSed as your editor, make sure it is saved as plain text, not as .rtf or anything!!!

Use it as described above and let me know if it works for you! Sorry that your simple question seems to become more and more complicated...

here is the script (don't copy the dashes!):

--------------------------------
@warnings
@script channel
@version 2.5
@name randomStartPosition


//Nils Grabenhorst, June 06, 2003

//Global Variable
value = random(0.0,1.0);

create: channel
{
setdesc("randomStartPosition");
}

process: ca, frame, time
{
ca.set(value);
}

ackees
06-07-2003, 02:33 PM
The Fairy lights are happy now, thanks again nils your assistance is appreciated.
There are questions for NT though, can someone from NT please explain if there is another way to achieve this without resorting to scripting, also can we have a ‘random modifier’ that works like this (with controls like on the noisy channel), and can also be used for the numerous similar animation situations like this? Why did the noisy channel not work in this case, when I cloned the light did I also clone the randomness of the noisy channel to each light?

nils
06-07-2003, 04:24 PM
Great! Looks good!
:)