#    This .cshrc file is used for the standard Alias ``demo'' account. Special
#    care has been taken to make it as general and flexible as possible, so it
#    may be used as a template for accounts other than demo without any changes
#    required.

#    No changes to this file should be required, other than to add your 
#    favourite UNIX-aliases (for example: ``alias ls ls -Cf'').

#    The following detects whether this .cshrc is being read by the root
#    account (i.e: su from demo). If so, set a default search path and umask,
#    unsetenv all Alias environment variables (ALIAS_*), and exit, since the
#    ALIAS software should NEVER be run by root!!!

set whoami = `id | cut -c6-11`
if ($whoami == "(root)") then
    set path = (/usr/sbin /usr/bsd /bin /usr/bin /etc /usr/etc /usr/bin/X11)
    umask 002
    unsetenv ALIAS_LOCATION ALIAS_WORKENV ALIAS_PROJECT ALIAS_PIX_SEARCHPATH
    unsetenv ALIAS_RENDER_ENG ALIAS_RENDER_LOCN ALIAS_SP_LOCATION ALIAS_LIB_LOCN
    exit 0
endif

#    Below, several variables are set that are critical to the proper operation
#    of the ALIAS package. The value of ALIAS_LOCATION should not be altered
#    without first consulting Customer Support at Alias.

setenv ALIAS_LOCATION    /usr/alias

#   The environment variable ALIAS_SP_LOCATION specifies the location of the
#   ALIAS StudioPaint software. It is used by the StudioPaint software to
#   locate its encryption file.

setenv ALIAS_SP_LOCATION /usr/StudioPaint

#   The ALIAS_WORKENV variable below should be set to the area in which you do
#   most of your work. It should start with a / (ie /usr/demo, /u/joe/alias, or
#   $HOME/jobs/funstuff). This variable is used by Alias 3D products and
#   Alias StudioPaint.
#
#   If you are using an Alias 3D product (Animator, AutoStudio, Designer,
#   Power Animator, Studio), all of your data files will be stored in
#   $ALIAS_WORKENV/user_data/$ALIAS_PROJECT/{anim,mask, ...}. The variable
#   ALIAS_PROJECT is defined below to the name of the current project. Its
#   initial value is determined by the contents of a .AliasPrefs file (see
#   below).

setenv ALIAS_WORKENV    $HOME

#    Here we set the search path to include all the standard places, including
#    the proper location of the Alias executables.

if ($?prompt) set prompt="`hostname` ${USER}-\!% "
set path=(                       \
          $ALIAS_LOCATION/bin    \
          $ALIAS_SP_LOCATION/bin \
          .                      \
          /usr/new               \
          /usr/ucb               \
          /usr/bsd               \
          /usr/sbin              \
          /usr/bin               \
          /bin                   \
          /usr/bin/X11           \
         )

set history=64
set savehist=64

alias a5        Alias
alias sp        studiopaint
alias g         gclear
alias h         history
alias m         more
alias rmrl      'rm -f /tmp/.v3_run_lock'

#    Here we set several CSH environment variables to match the values
#    found in the .AliasPrefs file, allowing some useful aliases to be
#    defined below. The variables are set only if a Alias 3D product
#    has been installed and get_alias_variable exists at the specified
#    location.

if (-f $ALIAS_LOCATION/bin/get_alias_variable) then
    setenv ALIAS_PROJECT `get_alias_variable ALIAS_DEFAULT_PROJECT`
    if ($status != 0) unsetenv ALIAS_PROJECT

    setenv ALIAS_RENDER_ENG  `get_alias_variable ALIAS_RENDER_ENGINE`
    if ($status != 0) unsetenv ALIAS_RENDER_ENG

    setenv ALIAS_RENDER_LOCN  `get_alias_variable ALIAS_RENDER_LOCATION`
    if ($status != 0) unsetenv ALIAS_RENDER_LOCN

#    The following aliases are very handy for poking around the various projects
#    in ALIAS_WORKENV and [remote] rendering. Three variables must be defined
#    for the aliases to be correctly defined:
#
#        ALIAS_PROJECT         - the current project (i.e.: demo, apple, ...)
#        ALIAS_RENDER_ENG      - the hostname of the ``rendering engine''
#        ALIAS_RENDER_LOCN     - specifies a directory where the rendering will
#                                be performed on ALIAS_RENDER_ENG.
#
#    All of these variables are defined in the file /usr/alias/.AliasPrefs.
#    If the default values are unsuitable for your needs, you may modify
#    them from within the main Alias executable.

#    These aliases are a simple way to switch your current directory to
#    the mask, pix, sdl or wire area within the project of your working
#    area and list the files that are there.

    alias mask 'cd $ALIAS_WORKENV/user_data/$ALIAS_PROJECT/mask; pwd; ls'
    alias pix  'cd $ALIAS_WORKENV/user_data/$ALIAS_PROJECT/pix; pwd; ls'
    alias sdl  'cd $ALIAS_WORKENV/user_data/$ALIAS_PROJECT/sdl; pwd; ls'
    alias wire 'cd $ALIAS_WORKENV/user_data/$ALIAS_PROJECT/wire; pwd; ls'

#    The following aliases render an SDL file, either on the current machine
#    (go sdl/car) or on a remote machine (rgo sdl/car) in the background.

    alias go   'renderit -e :$ALIAS_WORKENV/user_data/$ALIAS_PROJECT \!^ &'
    alias rgo  'renderit -e ${ALIAS_RENDER_ENG}:$ALIAS_RENDER_LOCN -t $ALIAS_WORKENV/user_data/$ALIAS_PROJECT/pix \!^ &'

#    And this alias retrieves a pix file from the rendering engine and
#    places it in the current directory (rget car.pix)

    alias rget 'rcp ${ALIAS_RENDER_ENG}:$ALIAS_RENDER_LOCN/pix/\!^ .'

#    If the .AliasPrefs file defines the location of the 3DCD examples
#    (ALIAS_LIBRARY_LOCATION), set the environment variable
#    ALIAS_PIX_SEARCHPATH. The Alias package will use this variable to search
#    for pix files in the specified locations.
#
#    If you modify this variable, you may exceed the CSH limit for size of an
#    environment variable. Such an error is indicated by the CSH message
#    `Word too long'. If this happens to you, you will have to reduce the
#    number of pathnames in the variable.

    setenv ALIAS_LIB_LOCN  `get_alias_variable ALIAS_LIBRARY_LOCATION`
    if ($status == 0) then
        set APS = "pix mask $ALIAS_LIB_LOCN/pix/{construction_materials,earth_sky_weather,fabrics_papers,patterns_fractals,glass,humans_animals,liquids,metals,plastics_rubbers,stone,woods_plants}"
    
        setenv ALIAS_PIX_SEARCHPATH "`echo $APS`"
    else
            unsetenv ALIAS_LIB_LOCN
    endif
endif

#    "np" allows you to switch to a "New Project" at the csh prompt level.
#    For example, "np UsersGuide" will make the above aliases refer to the
#    "UsersGuide" project instead of the "demo" project.

alias np        'setenv ALIAS_PROJECT \!^'

#    Turn off hardware graphics acceleration as it doesn't work on all
#    machines. This variable is specific to ImageVision and is for
#    StudioPaint.

setenv IL_HW_ACCELERATE 0

#    The umask value determines whether others can read and write files that you
#    create. 022 means that others can read your files but cannot write to them.
#    002 is a good value if you would like others to change files that you have
#    created.

umask 022
exit 0
