#    This .cshrc file is used for the standard Alias|Wavefront user account.
#    Special care has been taken to make it as general and flexible as
#    possible, so it may be used as a template for other accounts 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 a user account). 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 AW_LOCATION
    unsetenv ALIAS_LOCATION ALIAS_WORKENV ALIAS_APP_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 software.
#
#    The environment variable AW_LOCATION specifies the location of a directory
#    which specifies the location of different forms of Alias|Wavefront
#    software (i.e.: Alias Studio, Alias StudioPaint).
#
#    The environment variable ALIAS_LOCATION specifies the location of the
#    following Alias|Wavefront software:
#
#        Animator
#        AutoStudio
#        Designer
#        PowerAnimator
#        Studio
#        Render products
#
#    It is used by the software to locate its support files.
#
#    The environment variable ALIAS_SP_LOCATION specifies the location of the
#    ALIAS StudioPaint software. It is used by the StudioPaint software to
#    locate its support files.
#
#    By default, the values of ALIAS_LOCATION and ALIAS_SP_LOCATION are based
#    on the value of AW_LOCATION.
#
#    If you wish to access another version of the Alias software other than
#    those versions indicated by ALIAS_LOCATION and ALIAS_SP_LOCATION, you
#    will have to change the value of the appropriate environment variable
#    (ALIAS_SP_LOCATION for Alias StudioPaint, ALIAS_LOCATION for the other
#    listed Alias products) in order to access that version of the software.
#
#    If you experience difficultly setting up your environment, contact
#    Alias|Wavefront Assist for assistance.

setenv AW_LOCATION       /usr/aw

setenv ALIAS_LOCATION    $AW_LOCATION/alias

setenv ALIAS_SP_LOCATION $AW_LOCATION/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/$(CURRENT_PROJECT)/{anim,mask, ...}. The variable
#   CURRENT_PROJECT is defined in the .AliasBrowserPrefs file.


setenv ALIAS_WORKENV    $HOME

#    Alias|Wavefront products currently use two formats of output file
#    directory structure. Setting AW_PROD_ENV to "studio" uses the Alias
#    directory format (i.e.: user_data/demo).

setenv AW_PROD_ENV      studio

#    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=(                       \
	  $AW_LOCATION/COM/bin   \
          $ALIAS_LOCATION/bin    \
          $AW_LOCATION/EXP4.3.1/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 a8        Alias
alias sp        studiopaint
alias g         gclear
alias h         history
alias m         more
alias rmrl      'rm -f /tmp/.v7_run_lock'

if ($?MANPATH) then
    setenv MANPATH /usr/share/catman:/usr/man:/usr/aw/COM/man:${MANPATH}
else
    setenv MANPATH /usr/share/catman:/usr/man:/usr/aw/COM/man
endif

if ($?LD_LIBRARY_PATH) then
    setenv LD_LIBRARY_PATH $AW_LOCATION/COM2.0/lib:$AW_LOCATION/COM/lib:$ALIAS_LOCATION/lib:$ALIAS_SP_LOCATION/lib:${LD_LIBRARY_PATH}
else
    setenv LD_LIBRARY_PATH $AW_LOCATION/COM2.0/lib:$AW_LOCATION/COM/lib:$ALIAS_LOCATION/lib:$ALIAS_SP_LOCATION/lib
endif

#    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_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_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/aw/alias/.AliasPrefs.
#    If the default values are unsuitable for your needs, you may modify
#    them from within the main Alias executable.

#    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

#    If you wish to switch to a "New Project" at the csh prompt level.
#    you can overide the CURRENT_PROJECT variable in the .AliasBrowserPrefs 
#    file by setting the ALIAS_APP_PROJECT environment variable.  
#    It is important, however, to realize that this till overide set project
#    changes in Alias as well.

#   setenv ALIAS_APP_PROJECT foo


#    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
