ApplyParticleShader

Introduced

1.0

Description

Applies a particle shader to particle cloud objects.

Important: If you are using Softimage version 3.0 or later, use this command with Explosion clouds only.

Particle shaders are special shaders for particle and fluid simulations that give you the control over making particles look the way you want. All particle shaders are texture shaders except for the particle renderer shader, which is a volume shader. As well as these special particle shaders, you can plug many other Softimage shaders into a particle's render tree.

Scripting Syntax

    ApplyParticleShader( [InputObjs], Material, Volume, [Inspect] )

Parameters

Parameter | Type | Description
InputObjs | String | List of cloud objects Default Value: Selected objects
Material | String or a preset object (for example, an object obtained from SIGetPreset) | Particle material shader
Volume | String or a preset object (for example, an object obtained from SIGetPreset) | Particle volume shader
Inspect | Boolean | True to automatically inspect the shader. Default Value: True

Return Value

Returns the shaders.

Examples

VBScript Example

    '
    ' This example creates an explosion cloud, applies a particle shader to it,
    ' and prints out the shader information.
    '
    ' Create an Explosion cloud and convert the return value to the
    ' ParticleCloud object
    set oCloud = CreateExplosion( "Cylinder" )
    set oCloud = oCloud(0)

    ' Remove the default connected Explosion shaders
    DeleteObj oCloud & ".Material.Particle_ExplosionV2"
    DeleteObj oCloud & ".Material.Particle_vol_ExplosionV2"

    ' Connect the new Blob shaders to the Explosion cloud
    set oShaders = ApplyParticleShader( oCloud, "Particle_blob", "Particle_vol_blob" )

    ' Print shader info from the ParticleCloud object
    printShaderInfo oCloud

    ' This is a convenience routine that prints information about the shader
    sub printShaderInfo( in_object )
       ' From the X3DObject object you can get its material
       set oMaterial = in_object.Material

       ' Use the material to return the parameters that are connected and
       ' print out their names
       for each p in oMaterial.Parameters
           if TypeName( p.Source ) <> "Nothing" then
              LogMessage p.ScriptName & " is connected to " & p.Source.Name
           end if
       next
    end sub

    ' Output of the above script:
    'INFO : "surface is connected to Particle_blob"
    'INFO : "volume is connected to Particle_vol_blob"
    'INFO : "shadow is connected to Particle_blob"

See Also

CreateParticleCloud | AddParticleEmitter | AddParticleObstacle | AddParticleForce
Particle |  |  |

Autodesk Softimage v7.5