PDA

View Full Version : nOOb question: adding effects to atmospheric gizmos


Varinderll
04-30-2009, 08:06 AM
Hello all.

Im working on a project which requires large number of boxGizmos of different sizes,
achiving it via max script was not a tough job BUT since, ive created over 50 gizmos, it gets hard for me to add "volume fog" to them one by one. Is there any way around to do this job through max script?

Any help would be appreciated.




--sorry for my bad engish :)

SyncViewS
04-30-2009, 09:52 PM
Hi Varinder and welcome,
here is some sample code to go through the whole process:

(
-- create the Volume Fog Atmospheric Effect
local volFog = Volume_Fog name:"VolFog"

-- create the Box Gizmo
local hBoxGizmo = BoxGizmo length:100 width:100 height:50

-- add the Box Gizmo to Volume Fog Effect
appendGizmo volFog hBoxGizmo

-- add the Atmospheric Effect to "Atmosphere" panel
addAtmospheric volFog
)
In your case, if you already created the gizmos and the VolumeFog in the Atmosphere panel, and it is the only effect in the list, select all the BoxGizmos in the scene and run the following code:

(
-- get the first Atmospheric Effect from the list
local fx = getAtmospheric 1

-- goes through each gizmo and add it to the Effect
for item in selection do
if ((classOf item) == BoxGizmo) then
appendGizmo fx item
)
- Enrico

Varinderll
05-01-2009, 12:54 AM
Worked perfect. thanx alot for the help :)

CGTalk Moderation
05-01-2009, 12:54 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.