Slim
Parameter Block Quick Reference


return to main index



Introduction


This reference provides examples of a variety of parameter/collection block statements.

parameter: float-slider

parameter float freq {
    label "Freq"
    description "Set a frequency value."
    subtype slider
    range {0 10}
    # or provide a step size  
    # range {0 1 .1}
    default 0.5
    }



parameter: float switch

parameter float freq {
    label "Freq"
    description "Set a frequency value."
    subtype switch
    range {0 10}
    default 0
    }




parameter: float selector

parameter float freq {
    label "Freq"
    description "Set a frequency value."
    subtype selector
    range {low 0 med 0.5 high 1}
    default 0.5
    }



parameter: color

parameter color color_1 {
    label "Color 1"
    description "Choose a color for the top."
    default {1 1 0}
    detail varying
    }



parameter: string mapping

parameter string texname {
    label "Map Name"
    description "Choose an image file for mapping."
    provider variable
    subtype texture
    # subtypes's can be:
    # environment, shadow, reflection
    default ""
}



parameter: string filter

parameter string filter {
    label "Texture Filter"
    description {
        This is an example of splitting a
        description  over several lines of text.
        Don't use quotations. The text must begin
        and end with curly brackets.
        }
    subtype selector
    range { 
        box box 
        gaussian gaussian
        disk disk
        radial-bspline radial-bspline
        }
    default gaussian
}



parameter: string coordinate 1

parameter string coord_sys {
    label "Coordinate System"
    description {
        Use either world, object, camera, current
        or the name of a coordinate system that has
        been added to the Maya scene.
        }
    default world
    }



parameter: string coordinate 2

parameter string coordsys {
    label "Coordinate System"
    provider variable
    subtype selector
    description { 
        Choose a coordinate system from these
        fixed options.
        }
    range {
        camera camera
        world world
        object object
        shader shader
        }
    default object
    }



parameter: point 1

parameter point pnt1 {
    label "Point One"
    description "Some info about this variable."
    detail mustvary
    default {0 0 0}
    }



parameter: point 2

parameter point pnt2 {
    label "Point Two"
    description "Some info about this variable."
    detail varying
    default {0 0 0}
    }



parameter: vector

parameter vector vec1 {
    label "Light Direction"
    description {
        Default direction is vertically down the
        y axis.
        }
    detail mustvary
    default {0 -1 0}
    }



collection: array of points

collection point(3) pnt {
    label "PointLabel"
    description "No description."
    drawmode all
    state open
    parameter point pnt0 {
        default {0 0 0}
        detail varying
        }
    parameter point pnt1 {
        default {0 0 0}
        detail varying
        }
    parameter point pnt2 {
        default {0 0 0}
        detail varying
        }
    }



inline: simple

parameter color c1 {
    label "Color Noise"
    description "No description."
    detail mustvary "pixar,CNoise" inline
    }



  Notice the default value of 1.0 for the noise frequency.


inline: advanced

parameter color c1 {
   label "Color Noise"
   description "Example of setting an inline connection param value."
   detail mustvary "pixar,CNoise" inline
   msghandler {
       CreateConnection {
           set thisParam %obj
           set thisNode [$thisParam GetAppearance]
           set connectedNode [$thisParam GetConnectedFunction]
           set freqParam [$connectedNode GetProperties -name frequency]
           $freqParam SetValue 8
           $thisNode UpdateEditor
          }
      }
  }



  Notice the default value has been changed to 8.0.


parameter controlling another parameter

parameter color col_var {
    label "Color 1"
    description "Colors set using a menu."
    default {1 0 0}
    provider variable
    }
parameter float float_var {
    label "Color Control"
    description "No description."
    subtype selector
    range {red 0 yellow 1 purple 2}
    default 0
    provider variable
    msghandler {
       SetValue {
           set thisParam %obj
           set thisValue [$thisParam GetValue]
           set thisNode [$thisParam GetAppearance]
           set colorParam [$thisNode GetProperties -name col_var]
            if { $thisValue == 0 } {
           $colorParam SetValue {1 0 0}
            } elseif { $thisValue == 1 } {
           $colorParam SetValue {1 1 0}
            } else {
                $colorParam SetValue {1 0 1}
                }
           $thisNode PreviewRender
           $thisNode UpdateEditor
           }
      }
    }



© 2002- Malcolm Kesson. All rights reserved.