├── images ├── Demo.png └── HYPE.png ├── hypetemplates └── CasparCG_Template_Master_v01.hypetemplate.zip ├── LICENSE ├── README.md └── utils └── CasparExportScript.hype-export.py /images/Demo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/5opr4ni/casparcg_template_hype/HEAD/images/Demo.png -------------------------------------------------------------------------------- /images/HYPE.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/5opr4ni/casparcg_template_hype/HEAD/images/HYPE.png -------------------------------------------------------------------------------- /hypetemplates/CasparCG_Template_Master_v01.hypetemplate.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/5opr4ni/casparcg_template_hype/HEAD/hypetemplates/CasparCG_Template_Master_v01.hypetemplate.zip -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 Olle Soprani 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # CasparCG 2.3 LTS Templates in HYPE 2 | Repo for getting started doing CasparCG HTML template graphics with Tumult HYPE. 3 | 4 | ![Done in HYPE](https://github.com/5opr4ni/casparcg_template_hype/blob/master/images/Demo.png?raw=true "Demo Image") 5 | 6 | Watch the Video on how to use this on YouTube. 7 | [Video on YouTube](https://youtu.be/o98tgWf-vc8) 8 | 9 | Now when the CasparCG 2.3 LTS is near release you want an easy way of doing Templates, don't you. 10 | 11 | 1. Get Tumult HYPE Pro (Sorry!) Not free software. But if someone wants to try to reconstruct the project for the simpler version you are welcome. This is sadly just a MacOS software. There is a software named Saola that exists on both Windows and Mac which I have but it is not even close in what you can do and how easy it makes it. 12 | 2. Download Repo 13 | 3. Unzip `CasparCG_Template_Master.hypetemplate.zip` 14 | 4. Double-click `CasparCG_Template_Master.hypetemplate` 15 | 5. Do your stuff 16 | 6. Export as folder 17 | 7. Move the folder to the template directory on your CasparCG 2.3 18 | 8. Enjoy! 19 | 20 | In the `utils` folder there is an Exportscript you add to Hype to make it easier and a more customized export for CasparCG. 21 | You can read about how you install and use them here. 22 | [Help Document](https://tumult.com/hype/documentation/#export-scripts) 23 | 24 | Please help me extend this repo with more fun things. 25 | /olle 26 | 27 | 28 | -------------------------------------------------------------------------------- /utils/CasparExportScript.hype-export.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | # HypeExportPlayground.hype-export.py 4 | # Sample on implementing patches 5 | # 6 | # MIT License 7 | # Copyright (c) 2020 Max Ziebell 8 | # 9 | 10 | import argparse 11 | import json 12 | import sys 13 | import os 14 | 15 | 16 | def main(): 17 | parser = argparse.ArgumentParser() 18 | parser.add_argument('--hype_version') 19 | parser.add_argument('--hype_build') 20 | 21 | parser.add_argument('--get_options', action='store_true') 22 | 23 | parser.add_argument('--modify_staging_path') 24 | parser.add_argument('--destination_path') 25 | parser.add_argument('--export_info_json_path') 26 | 27 | args, unknown = parser.parse_known_args() 28 | 29 | if args.get_options: 30 | def export_options(): 31 | 32 | return { 33 | "exportShouldInlineHypeJS": False, 34 | "exportShouldInlineDocumentLoader": False, 35 | "exportShouldSaveHTMLFile": True, 36 | "exportShouldNameAsIndexDotHTML": False, 37 | # "indexTitle" : "", 38 | "exportShouldBustBrowserCaching": False, 39 | "exportShouldIncludeTextContents": False, 40 | "exportShouldIncludePIE": False, 41 | "exportSupportInternetExplorer6789": False, 42 | "exportShouldSaveRestorableDocument": False, 43 | } 44 | 45 | def save_options(): 46 | return { 47 | "allows_export": True, 48 | "allows_preview": True, 49 | } 50 | 51 | options = { 52 | "export_options": export_options(), 53 | "save_options": save_options(), 54 | "min_hype_build_version": "596", 55 | } 56 | 57 | exit_with_result(options) 58 | 59 | elif args.modify_staging_path != None: 60 | import os 61 | import string 62 | import fnmatch 63 | import re 64 | 65 | export_info_file = open(args.export_info_json_path) 66 | export_info = json.loads(export_info_file.read()) 67 | export_info_file.close() 68 | 69 | # common file globs 70 | glob_hype_runtime_minified = 'HYPE-'+args.hype_build+'*.min.js' 71 | 72 | # common hooks 73 | hook_api = '.API={' 74 | hook_props = 'top:{HYP_r' 75 | 76 | # patch helper 77 | def read_content(filepath): 78 | with open(filepath) as f: 79 | return f.read() 80 | 81 | def save_content(filepath, content): 82 | with open(filepath, "w") as f: 83 | f.write(content) 84 | 85 | def patch_pre_hook(hook, insert, filePattern): 86 | patch(hook, hook+insert, filePattern) 87 | 88 | def patch_post_hook(hook, insert, filePattern): 89 | patch(hook, insert+hook, filePattern) 90 | 91 | def patch(find, replace, filePattern): 92 | for path, dirs, files in os.walk(os.path.abspath(args.modify_staging_path)): 93 | for filename in fnmatch.filter(files, filePattern): 94 | filepath = os.path.join(path, filename) 95 | s = read_content(filepath) 96 | s = s.replace(find, replace) 97 | save_content(filepath, s) 98 | 99 | def read_runtime_content(): 100 | for path, dirs, files in os.walk(os.path.abspath(args.modify_staging_path)): 101 | for filename in fnmatch.filter(files, glob_hype_runtime_minified): 102 | return read_content(os.path.join(path, filename)) 103 | 104 | runtime = read_runtime_content() 105 | 106 | # ADD PATCHES BELOW HERE 107 | 108 | import shutil 109 | shutil.rmtree(args.destination_path, ignore_errors=True) 110 | shutil.move(args.modify_staging_path, args.destination_path) 111 | 112 | exit_with_result(True) 113 | 114 | # UTILITIES 115 | 116 | # communicate info back to Hype 117 | 118 | 119 | def exit_with_result(result): 120 | import sys 121 | print "====================" 122 | print json.dumps({"result": result}) 123 | sys.exit(0) 124 | 125 | 126 | if __name__ == "__main__": 127 | main() 128 | --------------------------------------------------------------------------------