visualize.sh 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. #!/bin/bash
  2. # This is free and unencumbered software released into the public domain.
  3. #
  4. # Anyone is free to copy, modify, publish, use, compile, sell, or
  5. # distribute this software, either in source code form or as a compiled
  6. # binary, for any purpose, commercial or non-commercial, and by any
  7. # means.
  8. #
  9. # In jurisdictions that recognize copyright laws, the author or authors
  10. # of this software dedicate any and all copyright interest in the
  11. # software to the public domain. We make this dedication for the benefit
  12. # of the public at large and to the detriment of our heirs and
  13. # successors. We intend this dedication to be an overt act of
  14. # relinquishment in perpetuity of all present and future rights to this
  15. # software under copyright law.
  16. #
  17. # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  18. # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  19. # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
  20. # IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
  21. # OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
  22. # ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
  23. # OTHER DEALINGS IN THE SOFTWARE.
  24. #
  25. # For more information, please refer to [http://unlicense.org]
  26. if [ "$MCELL_PATH" == "" ]; then
  27. echo "System variable MCELL_PATH is not set, don't know where to find CellBlender"
  28. exit 1
  29. fi
  30. if [ "$1" == "" ]; then
  31. echo "Expecing one argument that is the path to the viz output directory, e.g. viz_data/seed_00001/"
  32. exit 1
  33. fi
  34. if [ "$(uname)" == "Darwin" ]; then
  35. # path on MacOS
  36. # /Applications/Blender-2.93-CellBlender/blender.app/Contents/Resources/2.93/scripts/addons/cellblender/extensions/mcell/
  37. REL_BLENDER_PATH=$MCELL_PATH/../../../../../../../../../
  38. else
  39. REL_BLENDER_PATH=$MCELL_PATH/../../../../../../
  40. fi
  41. # get absolute path to the REL_BLENDER_PATH to deal with links
  42. ABS_BLENDER_PATH=`cd $REL_BLENDER_PATH; pwd`
  43. if [ "$(uname)" == "Darwin" ]; then
  44. VIZ_MCELL_SCRIPT=$ABS_BLENDER_PATH/blender.app/Contents/Resources/2.93/scripts/addons/cellblender/developer_utilities/mol_viz_scripts/viz_mcell_run.py
  45. else
  46. VIZ_MCELL_SCRIPT=$ABS_BLENDER_PATH/2.93/scripts/addons/cellblender/developer_utilities/mol_viz_scripts/viz_mcell_run.py
  47. fi
  48. if [ "$(uname)" == "Darwin" -o "$(uname)" == "Linux" ]; then
  49. $ABS_BLENDER_PATH/my_blender -P $VIZ_MCELL_SCRIPT -- $1
  50. else
  51. # Windows
  52. $ABS_BLENDER_PATH/blender.exe -P $VIZ_MCELL_SCRIPT -- $1
  53. fi