Notifications
Clear all

[Closed] Distance Script + Auto omni light creation

Because of the errors we have encountered, I have not been able to figure out an easy way to work around the problem. As it seems to not cause any problems except run slightly slower than necessary due to extra creations and deletions, I am inclined to leave it as is. If you add Boa’s code, it will leave you with a good (as far as I can tell) solution to your creation problem.

Sorry I dropped out there. Too many things to think about at once :banghead:.

Let us know how it goes.

Yea ok, I had a few initial problems integrating it into my scene but I have it down now and it seems to work wonderfully well. Thanks alot you two for the help… Might I direct you to another one of my posts? Maybe you can help on that one too?

Here, you might find this post…

EDIT: Ok, it was working for awhile real great but now after rendering the scene a bit or after triggering something in the scene while working on it, max crashes… It has crashed every time without fail except for one time so far…

Hmm…my Max seems to be crashing all the time now for no reason (animating a sphere!!!), and I haven’t had that scene open. You don’t happen to have windows xp, sp2, do you? :argh:

About your other problem, I looked, but it does not look like something I can really help you with. Especially with max crashing… Sorry though. I am still fairly green at max myself.

I got XP, but made sure not to get SP2… Still i don’t know whats up… I’m pretty bummed out about it though.:banghead:

 Boa

Is the scene crashing because of the light creation? You can test this by enabling/disabling the creation script. How many lights are created? You shouldn’t create too much since they are omnis.

For me it is not the script crashing max, as I have not run it today (or even recently). I was animating a sphere in a blank scene in preperation for a test when max just crapped out on me (that was the first time). It makes no sense…I could probably program something to animate a shape better than that :rolleyes:. I can’t speak for Cryptite though.

Yea I think that, for me, its the script thats crapefying max when I run it, but I have a few more tests I’m gonna run to see what it is… On another note, I’m still going to try running the script for things. I have a question though and that is how do I turn on/set the far (or even near for that matter) attentuation on the light that is created? Couldn’t figure out the right syntax for the pflow script…

If the script is what is killing max, are we talking about in this test scene or your own? Because there could be something else interfering if it is your own. Not really sure though.

As for the attenuation, that I can do. In the script operator where it says

x = omnilight name:str multiplier:0.0 pos:
				(pCont.ParticlePosition) rgb:
				(color 255 255 255) excludeList: #($Sphere01, $Target_Proxies)

you can just continue to add properties. If you open the max script reference and do a search for ‘light’, open the first page it brings up (Light Common Properties). Scroll down a bit and find the properties’ names…look like

<light>.nearAttenStart            Float       default: 80.0

what you get out of these is the property names (nearAttenStart), and the type (float). So for adding the properties to the script operator, just append these on with a colon seperating them…like so

x = omnilight name:str multiplier:0.0 pos:
				(pCont.ParticlePosition) rgb:
				(color 255 255 255) excludeList: #($Sphere01, $Target_Proxies) nearAttenStart: 10 nearAttenEnd: 10 useNearAtten: true showNearAtten: true

make sense? Now you can see that all the other properties (like pos) are also set that way.

And fyi, to make the code easier to look at, if you put a line break after the property label but before the value, max treats those as the same line and wraps around for you. Just like ‘rgb:’ where the color is down a line.

Page 5 / 5