├── .gitattributes ├── .gitignore ├── LICENSE ├── Procfile ├── README.md ├── Sample GH Files ├── ConnectToServer.gh ├── ConnectToServer_Paul.gh ├── ConnectToServer_Paul1.gh ├── ConnectToServer_Paul2.gh ├── GenerateComponentBasedOnType.gh ├── Looking_Into_GH_Doc_Events_01.gh └── RetrieveBasicInfoFromComponent.gh ├── Videos ├── Demo_Videos_01.tscproj ├── GrasshopperLiveAnimationLogo.gif ├── IMG_1599_01.mp4 ├── IMG_1599_02.mp4 ├── IMG_1600.mp4 ├── LOGO-01.png ├── LOGO_A-01.png ├── LOGO_B-01.png ├── LOGO_C-01.png ├── LOGO_D-01.png ├── hack_demo.gif └── hold │ ├── IMG_1599_01A.mp4 │ ├── IMG_1599_02A.mp4 │ └── IMG_1600A.mp4 └── src ├── csharp ├── GrasshopperLive.Core │ ├── GhLiveEventArgs.cs │ ├── GhLiveMessage.cs │ ├── GhLivePoint.cs │ ├── GrasshopperLive.Core.csproj │ ├── GrasshopperLive.cs │ ├── Properties │ │ └── AssemblyInfo.cs │ ├── UpdateType.cs │ └── packages.config ├── GrasshopperLive.Test │ ├── App.config │ ├── GrasshopperLive.Test.csproj │ ├── Program.cs │ └── Properties │ │ └── AssemblyInfo.cs ├── GrasshopperLive.sln └── GrasshopperLive │ ├── GH_CreateSession.cs │ ├── GH_JoinSession.cs │ ├── GrasshopperLive.csproj │ ├── Properties │ └── AssemblyInfo.cs │ ├── app.config │ └── packages.config └── javascript ├── package.json ├── public └── index.html ├── server.js └── temp.txt /.gitattributes: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Set default behavior to automatically normalize line endings. 3 | ############################################################################### 4 | * text=auto 5 | 6 | ############################################################################### 7 | # Set default behavior for command prompt diff. 8 | # 9 | # This is need for earlier builds of msysgit that does not have it on by 10 | # default for csharp files. 11 | # Note: This is only used by command line 12 | ############################################################################### 13 | #*.cs diff=csharp 14 | 15 | ############################################################################### 16 | # Set the merge driver for project and solution files 17 | # 18 | # Merging from the command prompt will add diff markers to the files if there 19 | # are conflicts (Merging from VS is not affected by the settings below, in VS 20 | # the diff markers are never inserted). Diff markers may cause the following 21 | # file extensions to fail to load in VS. An alternative would be to treat 22 | # these files as binary and thus will always conflict and require user 23 | # intervention with every merge. To do so, just uncomment the entries below 24 | ############################################################################### 25 | #*.sln merge=binary 26 | #*.csproj merge=binary 27 | #*.vbproj merge=binary 28 | #*.vcxproj merge=binary 29 | #*.vcproj merge=binary 30 | #*.dbproj merge=binary 31 | #*.fsproj merge=binary 32 | #*.lsproj merge=binary 33 | #*.wixproj merge=binary 34 | #*.modelproj merge=binary 35 | #*.sqlproj merge=binary 36 | #*.wwaproj merge=binary 37 | 38 | ############################################################################### 39 | # behavior for image files 40 | # 41 | # image files are treated as binary by default. 42 | ############################################################################### 43 | #*.jpg binary 44 | #*.png binary 45 | #*.gif binary 46 | 47 | ############################################################################### 48 | # diff behavior for common document formats 49 | # 50 | # Convert binary document formats to text before diffing them. This feature 51 | # is only available from the command line. Turn it on by uncommenting the 52 | # entries below. 53 | ############################################################################### 54 | #*.doc diff=astextplain 55 | #*.DOC diff=astextplain 56 | #*.docx diff=astextplain 57 | #*.DOCX diff=astextplain 58 | #*.dot diff=astextplain 59 | #*.DOT diff=astextplain 60 | #*.pdf diff=astextplain 61 | #*.PDF diff=astextplain 62 | #*.rtf diff=astextplain 63 | #*.RTF diff=astextplain 64 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | ## 4 | ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore 5 | 6 | # Large video files 7 | *.mov 8 | 9 | # User-specific files 10 | *.suo 11 | *.user 12 | *.userosscache 13 | *.sln.docstates 14 | 15 | # User-specific files (MonoDevelop/Xamarin Studio) 16 | *.userprefs 17 | 18 | # Build results 19 | [Dd]ebug/ 20 | [Dd]ebugPublic/ 21 | [Rr]elease/ 22 | [Rr]eleases/ 23 | x64/ 24 | x86/ 25 | bld/ 26 | [Bb]in/ 27 | [Oo]bj/ 28 | [Ll]og/ 29 | 30 | # Visual Studio 2015/2017 cache/options directory 31 | .vs/ 32 | # Uncomment if you have tasks that create the project's static files in wwwroot 33 | #wwwroot/ 34 | 35 | # Visual Studio 2017 auto generated files 36 | Generated\ Files/ 37 | 38 | # MSTest test Results 39 | [Tt]est[Rr]esult*/ 40 | [Bb]uild[Ll]og.* 41 | 42 | # NUNIT 43 | *.VisualState.xml 44 | TestResult.xml 45 | 46 | # Build Results of an ATL Project 47 | [Dd]ebugPS/ 48 | [Rr]eleasePS/ 49 | dlldata.c 50 | 51 | # Benchmark Results 52 | BenchmarkDotNet.Artifacts/ 53 | 54 | # .NET Core 55 | project.lock.json 56 | project.fragment.lock.json 57 | artifacts/ 58 | **/Properties/launchSettings.json 59 | 60 | # StyleCop 61 | StyleCopReport.xml 62 | 63 | # Files built by Visual Studio 64 | *_i.c 65 | *_p.c 66 | *_i.h 67 | *.ilk 68 | *.meta 69 | *.obj 70 | *.iobj 71 | *.pch 72 | *.pdb 73 | *.ipdb 74 | *.pgc 75 | *.pgd 76 | *.rsp 77 | *.sbr 78 | *.tlb 79 | *.tli 80 | *.tlh 81 | *.tmp 82 | *.tmp_proj 83 | *.log 84 | *.vspscc 85 | *.vssscc 86 | .builds 87 | *.pidb 88 | *.svclog 89 | *.scc 90 | 91 | # Chutzpah Test files 92 | _Chutzpah* 93 | 94 | # Visual C++ cache files 95 | ipch/ 96 | *.aps 97 | *.ncb 98 | *.opendb 99 | *.opensdf 100 | *.sdf 101 | *.cachefile 102 | *.VC.db 103 | *.VC.VC.opendb 104 | 105 | # Visual Studio profiler 106 | *.psess 107 | *.vsp 108 | *.vspx 109 | *.sap 110 | 111 | # Visual Studio Trace Files 112 | *.e2e 113 | 114 | # TFS 2012 Local Workspace 115 | $tf/ 116 | 117 | # Guidance Automation Toolkit 118 | *.gpState 119 | 120 | # ReSharper is a .NET coding add-in 121 | _ReSharper*/ 122 | *.[Rr]e[Ss]harper 123 | *.DotSettings.user 124 | 125 | # JustCode is a .NET coding add-in 126 | .JustCode 127 | 128 | # TeamCity is a build add-in 129 | _TeamCity* 130 | 131 | # DotCover is a Code Coverage Tool 132 | *.dotCover 133 | 134 | # AxoCover is a Code Coverage Tool 135 | .axoCover/* 136 | !.axoCover/settings.json 137 | 138 | # Visual Studio code coverage results 139 | *.coverage 140 | *.coveragexml 141 | 142 | # NCrunch 143 | _NCrunch_* 144 | .*crunch*.local.xml 145 | nCrunchTemp_* 146 | 147 | # MightyMoose 148 | *.mm.* 149 | AutoTest.Net/ 150 | 151 | # Web workbench (sass) 152 | .sass-cache/ 153 | 154 | # Installshield output folder 155 | [Ee]xpress/ 156 | 157 | # DocProject is a documentation generator add-in 158 | DocProject/buildhelp/ 159 | DocProject/Help/*.HxT 160 | DocProject/Help/*.HxC 161 | DocProject/Help/*.hhc 162 | DocProject/Help/*.hhk 163 | DocProject/Help/*.hhp 164 | DocProject/Help/Html2 165 | DocProject/Help/html 166 | 167 | # Click-Once directory 168 | publish/ 169 | 170 | # Publish Web Output 171 | *.[Pp]ublish.xml 172 | *.azurePubxml 173 | # Note: Comment the next line if you want to checkin your web deploy settings, 174 | # but database connection strings (with potential passwords) will be unencrypted 175 | *.pubxml 176 | *.publishproj 177 | 178 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 179 | # checkin your Azure Web App publish settings, but sensitive information contained 180 | # in these scripts will be unencrypted 181 | PublishScripts/ 182 | 183 | # NuGet Packages 184 | *.nupkg 185 | # The packages folder can be ignored because of Package Restore 186 | **/[Pp]ackages/* 187 | # except build/, which is used as an MSBuild target. 188 | !**/[Pp]ackages/build/ 189 | # Uncomment if necessary however generally it will be regenerated when needed 190 | #!**/[Pp]ackages/repositories.config 191 | # NuGet v3's project.json files produces more ignorable files 192 | *.nuget.props 193 | *.nuget.targets 194 | 195 | # Microsoft Azure Build Output 196 | csx/ 197 | *.build.csdef 198 | 199 | # Microsoft Azure Emulator 200 | ecf/ 201 | rcf/ 202 | 203 | # Windows Store app package directories and files 204 | AppPackages/ 205 | BundleArtifacts/ 206 | Package.StoreAssociation.xml 207 | _pkginfo.txt 208 | *.appx 209 | 210 | # Visual Studio cache files 211 | # files ending in .cache can be ignored 212 | *.[Cc]ache 213 | # but keep track of directories ending in .cache 214 | !*.[Cc]ache/ 215 | 216 | # Others 217 | ClientBin/ 218 | ~$* 219 | *~ 220 | *.dbmdl 221 | *.dbproj.schemaview 222 | *.jfm 223 | *.pfx 224 | *.publishsettings 225 | orleans.codegen.cs 226 | 227 | # Including strong name files can present a security risk 228 | # (https://github.com/github/gitignore/pull/2483#issue-259490424) 229 | #*.snk 230 | 231 | # Since there are multiple workflows, uncomment next line to ignore bower_components 232 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 233 | #bower_components/ 234 | 235 | # RIA/Silverlight projects 236 | Generated_Code/ 237 | 238 | # Backup & report files from converting an old project file 239 | # to a newer Visual Studio version. Backup files are not needed, 240 | # because we have git ;-) 241 | _UpgradeReport_Files/ 242 | Backup*/ 243 | UpgradeLog*.XML 244 | UpgradeLog*.htm 245 | ServiceFabricBackup/ 246 | *.rptproj.bak 247 | 248 | # SQL Server files 249 | *.mdf 250 | *.ldf 251 | *.ndf 252 | 253 | # Business Intelligence projects 254 | *.rdl.data 255 | *.bim.layout 256 | *.bim_*.settings 257 | *.rptproj.rsuser 258 | 259 | # Microsoft Fakes 260 | FakesAssemblies/ 261 | 262 | # GhostDoc plugin setting file 263 | *.GhostDoc.xml 264 | 265 | # Node.js Tools for Visual Studio 266 | .ntvs_analysis.dat 267 | node_modules/ 268 | 269 | # Visual Studio 6 build log 270 | *.plg 271 | 272 | # Visual Studio 6 workspace options file 273 | *.opt 274 | 275 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.) 276 | *.vbw 277 | 278 | # Visual Studio LightSwitch build output 279 | **/*.HTMLClient/GeneratedArtifacts 280 | **/*.DesktopClient/GeneratedArtifacts 281 | **/*.DesktopClient/ModelManifest.xml 282 | **/*.Server/GeneratedArtifacts 283 | **/*.Server/ModelManifest.xml 284 | _Pvt_Extensions 285 | 286 | # Paket dependency manager 287 | .paket/paket.exe 288 | paket-files/ 289 | 290 | # FAKE - F# Make 291 | .fake/ 292 | 293 | # JetBrains Rider 294 | .idea/ 295 | *.sln.iml 296 | 297 | # CodeRush 298 | .cr/ 299 | 300 | # Python Tools for Visual Studio (PTVS) 301 | __pycache__/ 302 | *.pyc 303 | 304 | # Cake - Uncomment if you are using it 305 | # tools/** 306 | # !tools/packages.config 307 | 308 | # Tabs Studio 309 | *.tss 310 | 311 | # Telerik's JustMock configuration file 312 | *.jmconfig 313 | 314 | # BizTalk build output 315 | *.btp.cs 316 | *.btm.cs 317 | *.odx.cs 318 | *.xsd.cs 319 | 320 | # OpenCover UI analysis results 321 | OpenCover/ 322 | 323 | # Azure Stream Analytics local run output 324 | ASALocalRun/ 325 | 326 | # MSBuild Binary and Structured Log 327 | *.binlog 328 | 329 | # NVidia Nsight GPU debugger configuration file 330 | *.nvuser 331 | 332 | # MFractors (Xamarin productivity tool) working folder 333 | .mfractor/ 334 | src/javascript/package-lock.json 335 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 Thornton Tomasetti, Inc. 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 | -------------------------------------------------------------------------------- /Procfile: -------------------------------------------------------------------------------- 1 | web: node server.js 2 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Grasshopper Live 2 | _Real-time collaborative visual scripting_ 3 | 4 | ![Grasshopper](/Videos/GrasshopperLiveAnimationLogo.gif) 5 | 6 | Inspired by the collaborative nature of web applications like [Google docs](https://www.edu.uwo.ca/ISC2/technology/img/google.gif) and Google sheets, _Grasshopper Live_ is a system to synchronize [Grasshopper](https://www.grasshopper3d.com/) definitions in real-time, allowing multiple users to modify the same file from different environments. As a user, you simply checkout the latest version of your definition and activate _Grasshopper Live_ together with your friends. You are then able to see each others changes to the document in real-time. 7 | 8 | ## Context 9 | _Grasshopper Live_ was developed from scratch under 24 intense hours at the [AEC Hackathon](http://aechackathon.com) January 2019, in Copenhagen, Denmark. Hack team consisted of: 10 | 11 | - [Charlie Portelli](https://github.com/Crashnorun), CORE Studio | Thornton Tomasetti 12 | - [Elcin Ertugrul](https://github.com/eertugrul), CORE Studio | Thornton Tomasetti 13 | - [Emil Poulsen](https://github.com/EmilPoulsen), CORE Studio | Thornton Tomasetti 14 | - [Paul Poinet](https://github.com/PaulPoinet), CITA 15 | 16 | ## Content / Tech stack 17 | The repo consists of mainly two parts: A node application running the server (javscript) and the client application syncing the changes to the GH doc (C#). The tech stack includes: `Grasshopper SDK`, `SocketIoClientDotNet`, `Node.js`, `Express.js`, `Socket.io`. 18 | 19 | ## Roadmap 20 | - General cleanup. Stabalize outcome from hackathon. 21 | - Record versions and allow time-independent checkouts 22 | - Full version control 23 | - Resthopper/compute and viz in browser. 24 | 25 | ## Demo 26 | ![Demo](/Videos/hack_demo.gif) 27 | 28 | _Changes made to the Grasshopper document on the right laptop is reflected (real-time) on the left laptop._ 29 | 30 | ## License 31 | [MIT](/LICENSE) 32 | -------------------------------------------------------------------------------- /Sample GH Files/ConnectToServer.gh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tt-acm/GrasshopperLive/cad64c3a9aa99db8193f5174475ccbf90b0b4467/Sample GH Files/ConnectToServer.gh -------------------------------------------------------------------------------- /Sample GH Files/ConnectToServer_Paul.gh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tt-acm/GrasshopperLive/cad64c3a9aa99db8193f5174475ccbf90b0b4467/Sample GH Files/ConnectToServer_Paul.gh -------------------------------------------------------------------------------- /Sample GH Files/ConnectToServer_Paul1.gh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tt-acm/GrasshopperLive/cad64c3a9aa99db8193f5174475ccbf90b0b4467/Sample GH Files/ConnectToServer_Paul1.gh -------------------------------------------------------------------------------- /Sample GH Files/ConnectToServer_Paul2.gh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tt-acm/GrasshopperLive/cad64c3a9aa99db8193f5174475ccbf90b0b4467/Sample GH Files/ConnectToServer_Paul2.gh -------------------------------------------------------------------------------- /Sample GH Files/GenerateComponentBasedOnType.gh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tt-acm/GrasshopperLive/cad64c3a9aa99db8193f5174475ccbf90b0b4467/Sample GH Files/GenerateComponentBasedOnType.gh -------------------------------------------------------------------------------- /Sample GH Files/Looking_Into_GH_Doc_Events_01.gh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tt-acm/GrasshopperLive/cad64c3a9aa99db8193f5174475ccbf90b0b4467/Sample GH Files/Looking_Into_GH_Doc_Events_01.gh -------------------------------------------------------------------------------- /Sample GH Files/RetrieveBasicInfoFromComponent.gh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tt-acm/GrasshopperLive/cad64c3a9aa99db8193f5174475ccbf90b0b4467/Sample GH Files/RetrieveBasicInfoFromComponent.gh -------------------------------------------------------------------------------- /Videos/Demo_Videos_01.tscproj: -------------------------------------------------------------------------------- 1 | { 2 | "title" : "", 3 | "description" : "", 4 | "author" : "", 5 | "width" : 1920.0, 6 | "height" : 1080.0, 7 | "version" : "2.0", 8 | "editRate" : 30, 9 | "authoringClientName" : { 10 | "name" : "Camtasia", 11 | "platform" : "Windows", 12 | "version" : "18.0" 13 | }, 14 | "sourceBin" : [ 15 | { 16 | "id" : 1, 17 | "src" : "C:\\Users\\cportelli\\Documents\\Personal\\GitHub\\GrasshopperLive\\Videos\\IMG_1599.MOV", 18 | "rect" : [0, 0, 1920, 1080], 19 | "lastMod" : "20190127T165515", 20 | "sourceTracks" : [ 21 | { 22 | "range" : [0, 852299998], 23 | "type" : 0, 24 | "editRate" : 10000000, 25 | "trackRect" : [0, 0, 1920, 1080], 26 | "sampleRate" : "10000000/333581", 27 | "bitDepth" : 24, 28 | "numChannels" : 0, 29 | "metaData" : "" 30 | }, 31 | { 32 | "range" : [0, 852299998], 33 | "type" : 2, 34 | "editRate" : 10000000, 35 | "trackRect" : [0, 0, 0, 0], 36 | "sampleRate" : 44100, 37 | "bitDepth" : 16, 38 | "numChannels" : 1, 39 | "metaData" : "" 40 | } 41 | ] 42 | }, 43 | { 44 | "id" : 2, 45 | "src" : "C:\\Users\\cportelli\\Documents\\Personal\\GitHub\\GrasshopperLive\\Videos\\IMG_1600.MOV", 46 | "rect" : [0, 0, 1920, 1080], 47 | "lastMod" : "20190127T165947", 48 | "sourceTracks" : [ 49 | { 50 | "range" : [0, 224499999], 51 | "type" : 0, 52 | "editRate" : 10000000, 53 | "trackRect" : [0, 0, 1920, 1080], 54 | "sampleRate" : "500000/16679", 55 | "bitDepth" : 24, 56 | "numChannels" : 0, 57 | "metaData" : "" 58 | }, 59 | { 60 | "range" : [0, 224499999], 61 | "type" : 2, 62 | "editRate" : 10000000, 63 | "trackRect" : [0, 0, 0, 0], 64 | "sampleRate" : 44100, 65 | "bitDepth" : 16, 66 | "numChannels" : 1, 67 | "metaData" : "" 68 | } 69 | ] 70 | } 71 | ], 72 | "timeline" : { 73 | "id" : 3, 74 | "sceneTrack" : { 75 | "scenes" : [ 76 | { 77 | "duration" : 24.8, 78 | "title" : "", 79 | "type" : "", 80 | "csml" : { 81 | "tracks" : [ 82 | { 83 | "trackIndex" : 0, 84 | "medias" : [ 85 | { 86 | "id" : 4, 87 | "_type" : "UnifiedMedia", 88 | "video" : 89 | { 90 | "id" : 5, 91 | "_type" : "VMFile", 92 | "src" : 1, 93 | "trackNumber" : 0, 94 | "attributes" : { 95 | "ident" : "IMG_1599" 96 | }, 97 | "effects" : [ 98 | 99 | ], 100 | "start" : 0, 101 | "duration" : 574, 102 | "mediaStart" : 1034, 103 | "mediaDuration" : 574, 104 | "scalar" : 1, 105 | "animationTracks" : { 106 | 107 | } 108 | }, 109 | "audio" : 110 | { 111 | "id" : 6, 112 | "_type" : "AMFile", 113 | "src" : 1, 114 | "trackNumber" : 1, 115 | "attributes" : { 116 | "ident" : "", 117 | "sampleRate" : 44100, 118 | "bitDepth" : 16, 119 | "gain" : 1.0, 120 | "mixToMono" : false 121 | }, 122 | "channelNumber" : "0", 123 | "effects" : [ 124 | 125 | ], 126 | "start" : 0, 127 | "duration" : 574, 128 | "mediaStart" : 1034, 129 | "mediaDuration" : 574, 130 | "scalar" : 1, 131 | "animationTracks" : { 132 | 133 | } 134 | } 135 | , 136 | "start" : 0, 137 | "duration" : 574, 138 | "mediaStart" : 0, 139 | "mediaDuration" : 2556, 140 | "scalar" : 1, 141 | "metadata" : { 142 | "WinSubProjectDisplayName" : "", 143 | "clipSpeedAttribute" : false 144 | } 145 | } 146 | ] 147 | }, 148 | { 149 | "trackIndex" : 1, 150 | "medias" : [ 151 | { 152 | "id" : 7, 153 | "_type" : "UnifiedMedia", 154 | "video" : 155 | { 156 | "id" : 8, 157 | "_type" : "VMFile", 158 | "src" : 1, 159 | "trackNumber" : 0, 160 | "attributes" : { 161 | "ident" : "IMG_1599" 162 | }, 163 | "effects" : [ 164 | 165 | ], 166 | "start" : 0, 167 | "duration" : 744, 168 | "mediaStart" : 1812, 169 | "mediaDuration" : 744, 170 | "scalar" : 1, 171 | "animationTracks" : { 172 | 173 | } 174 | }, 175 | "audio" : 176 | { 177 | "id" : 9, 178 | "_type" : "AMFile", 179 | "src" : 1, 180 | "trackNumber" : 1, 181 | "attributes" : { 182 | "ident" : "", 183 | "sampleRate" : 44100, 184 | "bitDepth" : 16, 185 | "gain" : 1.0, 186 | "mixToMono" : false 187 | }, 188 | "channelNumber" : "0", 189 | "effects" : [ 190 | 191 | ], 192 | "start" : 0, 193 | "duration" : 744, 194 | "mediaStart" : 1812, 195 | "mediaDuration" : 744, 196 | "scalar" : 1, 197 | "animationTracks" : { 198 | 199 | } 200 | } 201 | , 202 | "start" : 0, 203 | "duration" : 744, 204 | "mediaStart" : 0, 205 | "mediaDuration" : 2556, 206 | "scalar" : 1, 207 | "metadata" : { 208 | "WinSubProjectDisplayName" : "", 209 | "clipSpeedAttribute" : false 210 | } 211 | } 212 | ] 213 | }, 214 | { 215 | "trackIndex" : 2, 216 | "medias" : [ 217 | { 218 | "id" : 10, 219 | "_type" : "UnifiedMedia", 220 | "video" : 221 | { 222 | "id" : 11, 223 | "_type" : "VMFile", 224 | "src" : 2, 225 | "trackNumber" : 0, 226 | "attributes" : { 227 | "ident" : "IMG_1600" 228 | }, 229 | "effects" : [ 230 | 231 | ], 232 | "start" : 0, 233 | "duration" : 672, 234 | "mediaStart" : 0, 235 | "mediaDuration" : 672, 236 | "scalar" : 1, 237 | "animationTracks" : { 238 | 239 | } 240 | }, 241 | "audio" : 242 | { 243 | "id" : 12, 244 | "_type" : "AMFile", 245 | "src" : 2, 246 | "trackNumber" : 1, 247 | "attributes" : { 248 | "ident" : "", 249 | "sampleRate" : 44100, 250 | "bitDepth" : 16, 251 | "gain" : 1.0, 252 | "mixToMono" : false 253 | }, 254 | "channelNumber" : "0", 255 | "effects" : [ 256 | 257 | ], 258 | "start" : 0, 259 | "duration" : 672, 260 | "mediaStart" : 0, 261 | "mediaDuration" : 672, 262 | "scalar" : 1, 263 | "animationTracks" : { 264 | 265 | } 266 | } 267 | , 268 | "start" : 0, 269 | "duration" : 672, 270 | "mediaStart" : 0, 271 | "mediaDuration" : 672, 272 | "scalar" : 1, 273 | "metadata" : { 274 | "WinSubProjectDisplayName" : "", 275 | "clipSpeedAttribute" : false 276 | } 277 | } 278 | ] 279 | }, 280 | { 281 | "trackIndex" : 3, 282 | "medias" : [ 283 | ] 284 | } 285 | ] 286 | } 287 | } 288 | ] 289 | }, 290 | "trackAttributes" : [ 291 | { 292 | "ident" : "", 293 | "audioMuted" : true, 294 | "videoHidden" : true, 295 | "metadata" : { 296 | "IsLocked" : "False", 297 | "WinTrackHeight" : "56" 298 | } 299 | }, 300 | { 301 | "ident" : "", 302 | "audioMuted" : true, 303 | "videoHidden" : true, 304 | "metadata" : { 305 | "IsLocked" : "False", 306 | "WinTrackHeight" : "56" 307 | } 308 | }, 309 | { 310 | "ident" : "", 311 | "audioMuted" : false, 312 | "videoHidden" : false, 313 | "metadata" : { 314 | "IsLocked" : "False", 315 | "WinTrackHeight" : "56" 316 | } 317 | }, 318 | { 319 | "ident" : "", 320 | "audioMuted" : false, 321 | "videoHidden" : false, 322 | "metadata" : { 323 | "IsLocked" : "False", 324 | "WinTrackHeight" : "56" 325 | } 326 | } 327 | ], 328 | "captionAttributes" : { 329 | "enabled" : true, 330 | "fontName" : "Arial", 331 | "fontSize" : 64, 332 | "backgroundColor" : [ 0, 0, 0, 191], 333 | "foregroundColor" : [ 255, 255, 255, 255], 334 | "lang" : "en", 335 | "alignment" : 0, 336 | "defaultFontSize" : true, 337 | "opacity" : 0.5, 338 | "backgroundEnabled" : true, 339 | "backgroundOnlyAroundText" : true 340 | }, 341 | "backgroundColor" : [ 0, 0, 0, 255] 342 | }, 343 | "metadata" : { 344 | "AutoSaveFile" : "C:\\Users\\cportelli\\AppData\\Local\\TechSmith\\Camtasia Studio\\18.0\\Auto-Saves\\Untitled Project5bb68661.autosave.tscproj", 345 | "CanvasZoom" : 57, 346 | "Date" : "2019-01-27 05:58:11 AM", 347 | "Fit" : 0, 348 | "IsAutoSave" : "0", 349 | "Language" : "ENU", 350 | "ProfileName" : "MP4 only (up to 720p)", 351 | "ProjectDimensionsChanged" : "1", 352 | "audioNarrationNotes" : "", 353 | "calloutStyle" : "Basic", 354 | "canvasDetached" : "False", 355 | "canvasPositionHeight" : "0", 356 | "canvasPositionLeft" : "0", 357 | "canvasPositionTop" : "0", 358 | "canvasPositionWidth" : "0" 359 | } 360 | } 361 | -------------------------------------------------------------------------------- /Videos/GrasshopperLiveAnimationLogo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tt-acm/GrasshopperLive/cad64c3a9aa99db8193f5174475ccbf90b0b4467/Videos/GrasshopperLiveAnimationLogo.gif -------------------------------------------------------------------------------- /Videos/IMG_1599_01.mp4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tt-acm/GrasshopperLive/cad64c3a9aa99db8193f5174475ccbf90b0b4467/Videos/IMG_1599_01.mp4 -------------------------------------------------------------------------------- /Videos/IMG_1599_02.mp4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tt-acm/GrasshopperLive/cad64c3a9aa99db8193f5174475ccbf90b0b4467/Videos/IMG_1599_02.mp4 -------------------------------------------------------------------------------- /Videos/IMG_1600.mp4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tt-acm/GrasshopperLive/cad64c3a9aa99db8193f5174475ccbf90b0b4467/Videos/IMG_1600.mp4 -------------------------------------------------------------------------------- /Videos/LOGO-01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tt-acm/GrasshopperLive/cad64c3a9aa99db8193f5174475ccbf90b0b4467/Videos/LOGO-01.png -------------------------------------------------------------------------------- /Videos/LOGO_A-01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tt-acm/GrasshopperLive/cad64c3a9aa99db8193f5174475ccbf90b0b4467/Videos/LOGO_A-01.png -------------------------------------------------------------------------------- /Videos/LOGO_B-01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tt-acm/GrasshopperLive/cad64c3a9aa99db8193f5174475ccbf90b0b4467/Videos/LOGO_B-01.png -------------------------------------------------------------------------------- /Videos/LOGO_C-01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tt-acm/GrasshopperLive/cad64c3a9aa99db8193f5174475ccbf90b0b4467/Videos/LOGO_C-01.png -------------------------------------------------------------------------------- /Videos/LOGO_D-01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tt-acm/GrasshopperLive/cad64c3a9aa99db8193f5174475ccbf90b0b4467/Videos/LOGO_D-01.png -------------------------------------------------------------------------------- /Videos/hack_demo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tt-acm/GrasshopperLive/cad64c3a9aa99db8193f5174475ccbf90b0b4467/Videos/hack_demo.gif -------------------------------------------------------------------------------- /Videos/hold/IMG_1599_01A.mp4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tt-acm/GrasshopperLive/cad64c3a9aa99db8193f5174475ccbf90b0b4467/Videos/hold/IMG_1599_01A.mp4 -------------------------------------------------------------------------------- /Videos/hold/IMG_1599_02A.mp4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tt-acm/GrasshopperLive/cad64c3a9aa99db8193f5174475ccbf90b0b4467/Videos/hold/IMG_1599_02A.mp4 -------------------------------------------------------------------------------- /Videos/hold/IMG_1600A.mp4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tt-acm/GrasshopperLive/cad64c3a9aa99db8193f5174475ccbf90b0b4467/Videos/hold/IMG_1600A.mp4 -------------------------------------------------------------------------------- /src/csharp/GrasshopperLive.Core/GhLiveEventArgs.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace GrasshopperLive 8 | { 9 | public class GhLiveEventArgs : EventArgs 10 | { 11 | public GhLiveMessage TheObject { get; set; } 12 | //public 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/csharp/GrasshopperLive.Core/GhLiveMessage.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace GrasshopperLive 8 | { 9 | /// 10 | /// Update message which could be either add, delete or move. 11 | /// 12 | public class GhLiveMessage 13 | { 14 | /// 15 | /// Custom Id defined by us.. 16 | /// 17 | public Guid CustomId { get; set; } 18 | 19 | /// 20 | /// Corresponds to the CLASS (not the instance!) 21 | /// 22 | public string Type { get; set; } 23 | 24 | /// 25 | /// Defines: 1. added location or updated location 26 | /// 27 | public GhLivePoint Point { get; set; } 28 | 29 | /// 30 | /// Type of update.. 31 | /// 32 | public UpdateType UpdateType { get; set; } 33 | 34 | /// 35 | /// Sender Id 36 | /// 37 | public string Sender { get; set; } 38 | 39 | /// 40 | /// Extra message 41 | /// 42 | public string Message { get; set; } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/csharp/GrasshopperLive.Core/GhLivePoint.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace GrasshopperLive 8 | { 9 | public class GhLivePoint 10 | { 11 | public double X { get; set; } 12 | public double Y { get; set; } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/csharp/GrasshopperLive.Core/GrasshopperLive.Core.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {9A65BFE5-B502-418D-B875-D0B58A2E0E59} 8 | Library 9 | Properties 10 | GrasshopperLive.Core 11 | GrasshopperLive.Core 12 | v4.5.2 13 | 512 14 | 15 | 16 | true 17 | full 18 | false 19 | bin\Debug\ 20 | DEBUG;TRACE 21 | prompt 22 | 4 23 | 24 | 25 | pdbonly 26 | true 27 | bin\Release\ 28 | TRACE 29 | prompt 30 | 4 31 | 32 | 33 | 34 | ..\packages\EngineIoClientDotNet.0.9.22\lib\net45\EngineIoClientDotNet.dll 35 | True 36 | 37 | 38 | ..\packages\Newtonsoft.Json.8.0.1\lib\net45\Newtonsoft.Json.dll 39 | True 40 | 41 | 42 | ..\packages\SocketIoClientDotNet.0.9.13\lib\net45\SocketIoClientDotNet.dll 43 | True 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | ..\packages\WebSocket4Net.0.14.1\lib\net45\WebSocket4Net.dll 56 | True 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 78 | -------------------------------------------------------------------------------- /src/csharp/GrasshopperLive.Core/GrasshopperLive.cs: -------------------------------------------------------------------------------- 1 | using Quobject.SocketIoClientDotNet.Client; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace GrasshopperLive 9 | { 10 | /// 11 | /// Class to deal with communication. Send/receive messages 12 | /// 13 | public class GrasshopperLive : IDisposable 14 | { 15 | //public static readonly string ConnectAddress = "http://localhost:3000"; 16 | public static readonly string ConnectAddress = "https://gh-live.herokuapp.com"; 17 | 18 | public event EventHandler DataReceived; 19 | 20 | public string SocketId 21 | { 22 | get 23 | { 24 | return socket.Io().EngineSocket.Id; 25 | } 26 | } 27 | 28 | protected virtual void OnMessageReceived(string message) 29 | { 30 | try 31 | { 32 | GhLiveMessage incomingObj = Newtonsoft.Json.JsonConvert.DeserializeObject(message); 33 | 34 | if (incomingObj.Sender != _id) 35 | { 36 | GhLiveEventArgs e = new GhLiveEventArgs(); 37 | e.TheObject = incomingObj; 38 | var handler = this.DataReceived; 39 | 40 | if (handler != null) 41 | { 42 | handler(this, e); 43 | } 44 | //Console.WriteLine(incomingObj.Message); 45 | } 46 | } 47 | catch (Exception) 48 | { 49 | 50 | //throw; 51 | } 52 | } 53 | 54 | public void SendDeleteUpdateMessage(Guid customId) 55 | { 56 | SendUpdateMessage(string.Empty, customId, null, UpdateType.Delete); 57 | } 58 | 59 | public void SendMoveUpdateMessage(Guid customId, GhLivePoint position) 60 | { 61 | SendUpdateMessage(string.Empty, customId, position, UpdateType.Move); 62 | } 63 | 64 | public void SendAddUpdateMessage(string compType, Guid customId, GhLivePoint position) 65 | { 66 | 67 | SendUpdateMessage(compType, customId, position, UpdateType.Add); 68 | 69 | } 70 | 71 | public void SendUpdateMessage(string compType, Guid customId, GhLivePoint position, UpdateType type) 72 | { 73 | 74 | GhLiveMessage messageObj = new GhLiveMessage(); 75 | messageObj.Type = compType; 76 | messageObj.CustomId = customId; 77 | messageObj.Point = position; 78 | messageObj.UpdateType = type; 79 | messageObj.Sender = _id; 80 | 81 | string stuff = Newtonsoft.Json.JsonConvert.SerializeObject(messageObj); 82 | 83 | socket.Emit("update", stuff); 84 | 85 | } 86 | 87 | public void SendChatMessage(string message) 88 | { 89 | GhLiveMessage messageObj = new GhLiveMessage(); 90 | messageObj.Sender = _id; 91 | messageObj.Message = message; 92 | 93 | string stuff = Newtonsoft.Json.JsonConvert.SerializeObject(messageObj); 94 | 95 | socket.Emit("update", stuff); 96 | } 97 | 98 | Socket socket; 99 | 100 | string _id; 101 | 102 | public bool Connected 103 | { 104 | get; private set; 105 | } 106 | 107 | public void Connect() 108 | { 109 | socket = IO.Socket(ConnectAddress); 110 | this.Connected = true; 111 | 112 | socket.On(Socket.EVENT_CONNECT, () => 113 | { 114 | _id = socket.Io().EngineSocket.Id; 115 | Console.WriteLine("Connected!"); 116 | }); 117 | 118 | //socket.On("chat message", (data) => 119 | //{ 120 | // OnMessageReceived(data.ToString()); 121 | //}); 122 | 123 | socket.On("update", (data) => 124 | { 125 | OnMessageReceived(data.ToString()); 126 | }); 127 | 128 | } 129 | 130 | public void Dispose() 131 | { 132 | socket.Disconnect(); 133 | socket = null; 134 | //bye.. 135 | } 136 | } 137 | } 138 | -------------------------------------------------------------------------------- /src/csharp/GrasshopperLive.Core/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("GrasshopperLive.Core")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("GrasshopperLive.Core")] 13 | [assembly: AssemblyCopyright("Copyright © 2019")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("9a65bfe5-b502-418d-b875-d0b58a2e0e59")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /src/csharp/GrasshopperLive.Core/UpdateType.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace GrasshopperLive 8 | { 9 | public enum UpdateType 10 | { 11 | Add = 0, 12 | Move = 1, 13 | Delete = 2 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/csharp/GrasshopperLive.Core/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /src/csharp/GrasshopperLive.Test/App.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /src/csharp/GrasshopperLive.Test/GrasshopperLive.Test.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {EE5F188F-BDCD-4C6F-95EE-4B7C7D8B2103} 8 | Exe 9 | Properties 10 | GrasshopperLive.Test 11 | GrasshopperLive.Test 12 | v4.5.2 13 | 512 14 | true 15 | 16 | 17 | AnyCPU 18 | true 19 | full 20 | false 21 | bin\Debug\ 22 | DEBUG;TRACE 23 | prompt 24 | 4 25 | 26 | 27 | AnyCPU 28 | pdbonly 29 | true 30 | bin\Release\ 31 | TRACE 32 | prompt 33 | 4 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | {9a65bfe5-b502-418d-b875-d0b58a2e0e59} 55 | GrasshopperLive.Core 56 | 57 | 58 | 59 | 66 | -------------------------------------------------------------------------------- /src/csharp/GrasshopperLive.Test/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace GrasshopperLive.Test 8 | { 9 | class Program 10 | { 11 | static void Main(string[] args) 12 | { 13 | GrasshopperLive ghlive = new GrasshopperLive(); 14 | ghlive.DataReceived += Ghlive_DataReceived; 15 | 16 | ghlive.Connect(); 17 | 18 | while (true) 19 | { 20 | string message = Console.ReadLine(); 21 | ghlive.SendChatMessage(message); 22 | } 23 | 24 | 25 | } 26 | 27 | private static void Ghlive_DataReceived(object sender, GhLiveEventArgs e) 28 | { 29 | Console.WriteLine(e.TheObject.Message); 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/csharp/GrasshopperLive.Test/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("GrasshopperLive.Test")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("GrasshopperLive.Test")] 13 | [assembly: AssemblyCopyright("Copyright © 2019")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("ee5f188f-bdcd-4c6f-95ee-4b7c7d8b2103")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /src/csharp/GrasshopperLive.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 14 4 | VisualStudioVersion = 14.0.24720.0 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GrasshopperLive", "GrasshopperLive\GrasshopperLive.csproj", "{4B4B59F0-FD3C-41D6-93A7-3C976252EDC6}" 7 | EndProject 8 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GrasshopperLive.Core", "GrasshopperLive.Core\GrasshopperLive.Core.csproj", "{9A65BFE5-B502-418D-B875-D0B58A2E0E59}" 9 | EndProject 10 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GrasshopperLive.Test", "GrasshopperLive.Test\GrasshopperLive.Test.csproj", "{EE5F188F-BDCD-4C6F-95EE-4B7C7D8B2103}" 11 | EndProject 12 | Global 13 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 14 | Debug|Any CPU = Debug|Any CPU 15 | Release|Any CPU = Release|Any CPU 16 | EndGlobalSection 17 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 18 | {4B4B59F0-FD3C-41D6-93A7-3C976252EDC6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 19 | {4B4B59F0-FD3C-41D6-93A7-3C976252EDC6}.Debug|Any CPU.Build.0 = Debug|Any CPU 20 | {4B4B59F0-FD3C-41D6-93A7-3C976252EDC6}.Release|Any CPU.ActiveCfg = Release|Any CPU 21 | {4B4B59F0-FD3C-41D6-93A7-3C976252EDC6}.Release|Any CPU.Build.0 = Release|Any CPU 22 | {9A65BFE5-B502-418D-B875-D0B58A2E0E59}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 23 | {9A65BFE5-B502-418D-B875-D0B58A2E0E59}.Debug|Any CPU.Build.0 = Debug|Any CPU 24 | {9A65BFE5-B502-418D-B875-D0B58A2E0E59}.Release|Any CPU.ActiveCfg = Release|Any CPU 25 | {9A65BFE5-B502-418D-B875-D0B58A2E0E59}.Release|Any CPU.Build.0 = Release|Any CPU 26 | {EE5F188F-BDCD-4C6F-95EE-4B7C7D8B2103}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 27 | {EE5F188F-BDCD-4C6F-95EE-4B7C7D8B2103}.Debug|Any CPU.Build.0 = Debug|Any CPU 28 | {EE5F188F-BDCD-4C6F-95EE-4B7C7D8B2103}.Release|Any CPU.ActiveCfg = Release|Any CPU 29 | {EE5F188F-BDCD-4C6F-95EE-4B7C7D8B2103}.Release|Any CPU.Build.0 = Release|Any CPU 30 | EndGlobalSection 31 | GlobalSection(SolutionProperties) = preSolution 32 | HideSolutionNode = FALSE 33 | EndGlobalSection 34 | EndGlobal 35 | -------------------------------------------------------------------------------- /src/csharp/GrasshopperLive/GH_CreateSession.cs: -------------------------------------------------------------------------------- 1 | using Grasshopper.Kernel; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace GrasshopperLive { 9 | public class GH_CreateSession : GH_Component { 10 | public GH_CreateSession() : base("Create Session", "CreateSession", "Create " + 11 | "a new GrasshopperLive session.", "Live", "Live") { 12 | 13 | } 14 | 15 | public override Guid ComponentGuid { 16 | get { 17 | return new Guid("4F96C8EB-4862-454A-A3F8-33ACED66F37D"); 18 | } 19 | } 20 | 21 | protected override void RegisterInputParams(GH_InputParamManager pManager) { 22 | pManager.AddBooleanParameter("Activate", "A", "True = Create session", GH_ParamAccess.item); 23 | } 24 | 25 | protected override void RegisterOutputParams(GH_OutputParamManager pManager) { 26 | pManager.AddTextParameter("Session ID", "sID", "Session ID", GH_ParamAccess.item); 27 | } 28 | 29 | protected override void SolveInstance(IGH_DataAccess DA) { 30 | bool activate = false; 31 | string sessionID = string.Empty; 32 | 33 | if(!DA.GetData(0,ref activate)) 34 | ExpireSolution(false); 35 | 36 | if (activate == false) 37 | ExpireSolution(false); 38 | 39 | // execute create session code here 40 | 41 | 42 | DA.SetData(0, sessionID); 43 | } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /src/csharp/GrasshopperLive/GH_JoinSession.cs: -------------------------------------------------------------------------------- 1 | using Grasshopper.Kernel; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace GrasshopperLive 9 | { 10 | public class GH_JoinSession : GH_Component 11 | { 12 | //private static GrasshopperLive ghLive; 13 | //internal static GH_JoinSession Application; 14 | 15 | 16 | public GH_JoinSession() : base("Join Session", "JoinSession", "Join " + 17 | "an existing GrasshopperLive session.", "Live", "Live") 18 | { 19 | //Application = this; 20 | //if (ghLive == null) { 21 | // ghLive = new GrasshopperLive(); 22 | // ghLive.DataReceived += GhLive_DataReceived; 23 | //} 24 | } 25 | 26 | private void GhLive_DataReceived(object sender, GhLiveEventArgs e) 27 | { 28 | 29 | _messageLog.Add(e.TheObject.Message); 30 | //Grasshopper.Instances.DocumentEditor. //BeginInvoke(new Action(() => { GH_JoinSession.Application.ExpireSolution(true); })); 31 | //GH_JoinSession.Application.ExpireSolution(true); 32 | } 33 | 34 | public override Guid ComponentGuid 35 | { 36 | get 37 | { 38 | return new Guid("F1B0B8D3-1F30-4BC2-9108-9115977B9558"); 39 | } 40 | } 41 | 42 | protected override void RegisterInputParams(GH_InputParamManager pManager) 43 | { 44 | //TODO: 45 | //pManager.AddTextParameter("Session ID", "sID", "Session ID", GH_ParamAccess.item, ""); 46 | //pManager.AddTextParameter("Message", "M", "Message", GH_ParamAccess.item, ""); 47 | 48 | } 49 | 50 | protected override void RegisterOutputParams(GH_OutputParamManager pManager) 51 | { 52 | //pManager.AddTextParameter("Log", "Log", "Log", GH_ParamAccess.list); 53 | //pManager.AddTextParameter("Connection", "C", "True = Connection established | False = No Connection", GH_ParamAccess.item); 54 | } 55 | 56 | List _messageLog = new List(); 57 | 58 | public void SetupConnection() 59 | { 60 | GrasshopperLive ghLive = new GrasshopperLive(); 61 | //ghLive.DataReceived += GhLive_DataReceived; 62 | ghLive.Connect(); 63 | once = true; 64 | } 65 | 66 | bool once = false; 67 | protected override void SolveInstance(IGH_DataAccess DA) 68 | { 69 | if (!once) 70 | { 71 | Task.Run(() => 72 | { 73 | SetupConnection(); 74 | }); 75 | } 76 | 77 | /* 78 | string sesssionID = string.Empty; 79 | string message = string.Empty; 80 | 81 | if (!DA.GetData(0, ref sesssionID)) { 82 | message = "Could not read session ID"; 83 | DA.SetData(0, message); 84 | ExpireSolution(false); 85 | } 86 | 87 | // execute connection code 88 | */ 89 | //DA.SetDataList(0, _messageLog); 90 | //this.Locked = true; 91 | } 92 | 93 | } 94 | } 95 | -------------------------------------------------------------------------------- /src/csharp/GrasshopperLive/GrasshopperLive.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {4B4B59F0-FD3C-41D6-93A7-3C976252EDC6} 8 | Library 9 | Properties 10 | GrasshopperLive 11 | GrasshopperLive 12 | v4.5.2 13 | 512 14 | 15 | 16 | 17 | 18 | true 19 | full 20 | false 21 | bin\Debug\ 22 | DEBUG;TRACE 23 | prompt 24 | 4 25 | 26 | 27 | pdbonly 28 | true 29 | bin\Release\ 30 | TRACE 31 | prompt 32 | 4 33 | 34 | 35 | 36 | ..\packages\EngineIoClientDotNet.0.9.22\lib\net45\EngineIoClientDotNet.dll 37 | True 38 | 39 | 40 | ..\packages\RhinoCommon.6.11.18348.17061\lib\net45\Eto.dll 41 | True 42 | 43 | 44 | ..\packages\Grasshopper.6.11.18348.17061\lib\net45\GH_IO.dll 45 | True 46 | 47 | 48 | ..\..\..\..\..\..\..\..\..\Program Files\Rhino 6\Plug-ins\Grasshopper\GH_Util.dll 49 | False 50 | 51 | 52 | ..\packages\Grasshopper.6.11.18348.17061\lib\net45\Grasshopper.dll 53 | True 54 | 55 | 56 | ..\packages\Newtonsoft.Json.8.0.1\lib\net45\Newtonsoft.Json.dll 57 | True 58 | 59 | 60 | ..\packages\RhinoCommon.6.11.18348.17061\lib\net45\Rhino.UI.dll 61 | True 62 | 63 | 64 | ..\packages\RhinoCommon.6.11.18348.17061\lib\net45\RhinoCommon.dll 65 | True 66 | 67 | 68 | ..\packages\SocketIO4Net.Client.0.6.26\lib\net40\SocketIOClient.dll 69 | True 70 | 71 | 72 | ..\packages\SocketIoClientDotNet.0.9.13\lib\net45\SocketIoClientDotNet.dll 73 | True 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | ..\packages\SocketIO4Net.Client.0.6.26\lib\net40\WebSocket4Net.dll 86 | True 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | Designer 98 | 99 | 100 | 101 | 102 | {9a65bfe5-b502-418d-b875-d0b58a2e0e59} 103 | GrasshopperLive.Core 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | move $(TargetPath) $(TargetDir)$(TargetName).gha 113 | if $(ConfigurationName) == Debug ( 114 | 115 | IF NOT EXIST %25AppData%25\Grasshopper\Libraries\Live ( 116 | MKDIR "%25AppData%25\Grasshopper\Libraries\Live" 117 | ) 118 | 119 | copy $(TargetDir)*.* %25AppData%25\Grasshopper\Libraries\Live 120 | ) 121 | 122 | 123 | 124 | 125 | This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. 126 | 127 | 128 | 129 | 130 | 131 | 138 | -------------------------------------------------------------------------------- /src/csharp/GrasshopperLive/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("GrasshopperLive")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("GrasshopperLive")] 13 | [assembly: AssemblyCopyright("Copyright © 2019")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("4b4b59f0-fd3c-41d6-93a7-3c976252edc6")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /src/csharp/GrasshopperLive/app.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /src/csharp/GrasshopperLive/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /src/javascript/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "grasshopper_live", 3 | "version": "0.0.1", 4 | "description": "Collaborative parametric modelling in Grashhopper", 5 | "main": "server.js", 6 | "start": "node server.js", 7 | "dependencies": { 8 | "express": "^4.15.2", 9 | "socket.io": "^2.2.0" 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/javascript/public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Socket.IO chat 5 | 15 | 16 | 17 |
    18 |
    19 | 20 |
    21 | 22 | 23 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /src/javascript/server.js: -------------------------------------------------------------------------------- 1 | var app = require('express')(); 2 | var http = require('http').Server(app); 3 | var io = require('socket.io')(http); 4 | 5 | const port= process.env.PORT || 3000; 6 | 7 | app.get('/', function(req, res) { 8 | res.sendFile(__dirname + '/public/index.html'); 9 | }); 10 | 11 | io.on('connection', function(socket) { 12 | console.log('a user connected'); 13 | io.emit('chat message', 'new user connected ' + socket.id); 14 | 15 | socket.on('disconnect', function() { 16 | console.log('user disconnected'); 17 | io.emit('chat message', 'the user disconnected ' + socket.id); 18 | }); 19 | 20 | socket.on('chat message', function(msg) { 21 | // this send to everyone 22 | io.emit('chat message', msg); 23 | console.log('message: ' + msg); 24 | }); 25 | 26 | socket.on('update', function(data) { 27 | // this send to everyone 28 | io.emit('update', data); 29 | console.log('update: ' + data); 30 | }); 31 | 32 | }); 33 | 34 | http.listen(port, function() { 35 | console.log(`Server running at port `+ port); 36 | }); 37 | -------------------------------------------------------------------------------- /src/javascript/temp.txt: -------------------------------------------------------------------------------- 1 | js code to be put in this folder --------------------------------------------------------------------------------