Notifications
Clear all

[Closed] nOOb question: adding effects to atmospheric gizmos

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

2 Replies

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

Worked perfect. thanx alot for the help