Handy Maxscript for effects...

nickw

Administrator
Staff member
#1
So, you all know that placing hundreds of lights using attachpoints in GMAX is a nightmare right.... ? Not any more...

First, draw boxes everywhere you want the attachpoints to be. Do not rename from the default Box01 Box02 etc. Also, make sure to convert to an editable Mesh.

Now... here is the cool bit... Download the attached script....

That script, when placed in a new MaxScript and evaluated will take every object named "box*" (so box01, box02, box03, etc.), rename it to an incremented attach point name, put in the correct XML blob, with the incremented attach point name, and in this case, give them all the effect of fx_obslight.

Be careful though, you have to use it only once (or redefine your starting number "strAttachNumber = 0"). Because if you have two "attachPoint_RedLight1" in your scene, only one of them will show up.

What you can do is just change "strAttachNumber = 0" to be one greater than the highest attach point number in your scene, and then run it again with another batch of boxes.
 

Attachments

Last edited:

Horst18519

Moderator
Staff member
Resource contributor
#3
This seems to be a very good thing, Nick. :) Although I place all my effects by hand via XML I think this can save a lot of time working with the attach-method. :)
 
#5
ah just read the post, looks interesting! Will use it sometime! Though what is the advantage of using effects over scenery lights for say, taxilights or lining the runway or so? Dunno what would affect FR more, though effects can be dimmed and scenery lights cant, to the best of my knowledge, but tell me if im wrong :eek: !

The tool would definately save time rather than doing them by hand :D !
 
#6
Wait until you see the new tool....

I've done a lot of work on the attach point tool to make it much, much easier to use. The FSX SDK (and subsequent refreshes) will make that available.

Basically just select your model and then it's point and click functionality from there. There will be an SDK refresh coincident with our release that will include some bug fixes and also (hopefully!) include all of the Gmax functionality.

So, you all know that placing hundreds of lights using attachpoints in GMAX is a nightmare right.... ? Not any more...

First, draw boxes everywhere you want the attachpoints to be. Do not rename from the default Box01 Box02 etc. Also, make sure to convert to an editable Mesh.

Now... here is the cool bit... Download the attached script....

That script, when placed in a new MaxScript and evaluated will take every object named "box*" (so box01, box02, box03, etc.), rename it to an incremented attach point name, put in the correct XML blob, with the incremented attach point name, and in this case, give them all the effect of fx_obslight.

Be careful though, you have to use it only once (or redefine your starting number "strAttachNumber = 0"). Because if you have two "attachPoint_RedLight1" in your scene, only one of them will show up.

What you can do is just change "strAttachNumber = 0" to be one greater than the highest attach point number in your scene, and then run it again with another batch of boxes.
 

nickw

Administrator
Staff member
#7
Hey Adrian! Welcome to the forums! Really great to see you here I am sure all will agree!

Cannot wait to see the new tool! Thanks for the update!
 
#8
I've done a lot of work on the attach point tool to make it much, much easier to use. The FSX SDK (and subsequent refreshes) will make that available.

Basically just select your model and then it's point and click functionality from there. There will be an SDK refresh coincident with our release that will include some bug fixes and also (hopefully!) include all of the Gmax functionality.
Awesome!!!!! Great to see you Adrian!

Best,

Owen
 
#10
I have One Very important Question...

somehow this script turned my entire model into a MASS of blinking red lights

nothing left of the model i see in gmax.

HOW do you undo the attachments and return the regular properties of the model.
 

n4gix

Resource contributor
#12
I have One Very important Question...

somehow this script turned my entire model into a MASS of blinking red lights

nothing left of the model i see in gmax.

HOW do you undo the attachments and return the regular properties of the model.
Evidently you have a lot of objects in your scene named "Box01 Box02 etc." The script looks for ANY object in the scene with the root name "Box..." so if you have a building object named "Box..." it will also be converted to a light!!!

You MUST tidy up your scene by giving stuff meaningful names if you want to use this script... :)

Don't Save it and then, Open the saved version of the scene... :rolleyes:
 
Last edited:
#14
is there a possible means to make the script behave like *attachTool script

were it only affects the items [selected]

maybe isolate the specific paragraph from *attachTool script

and paste that into the multiple boxes maxscript file.

do any of you know exactly witch paragraph to copy?

make it more *user friendly :)
 

n4gix

Resource contributor
#15
is there a possible means to make the script behave like *attachTool script
were it only affects the items [selected]
maybe isolate the specific paragraph from *attachTool script
and paste that into the multiple boxes maxscript file.
do any of you know exactly witch paragraph to copy?
make it more *user friendly :)
:eek: :confused: That would defeat the purpose of the script! If you want ot do 'em one at a time, just use the Attach Tool...
 
#16
NOT one-at-a-time.

A>> SELECTED CHOICE <<

as oposed to everything in the screen.

the desighn is counterproductive to itself...

you may not have to rename amymore boxes for lights
BUT
you have to now rename every Single box that is not going to be a light!

either way you rename ALOT of boxes.

BUT if you include in the script the paragraph that enables SELECTIVE attachment. you wont have to rename ANY boxes either way!


Do you see now?
 

n4gix

Resource contributor
#17
Ah so. Now I understand what you're asking for. I suppose someone who's well versed in script writing could figure that out, but that doesn't include me! I can read and parse scripts well enough, but am not familiar enough to create/modify the code myself...

...aside from which I have no incentive to do so. I'll never need to do this.

However, there IS a script that will auto-rename "selected objects" in a scene, and that could be used to rename your "light objects" to something unique, in which case you'd simply need to edit this script to use that "unique name" instead of "Box.." ;)
 

arno

Administrator
Staff member
FSDevConf team
Resource contributor
#20
The only thing Nick did not mention is that you have to click the MAXScript menu in GMax and then select "Run script", after which you can browse for the script file. But those menu names are quite obvious :D.
 
Top