Skip to content
No description, website, or topics provided.
C# Python Batchfile
Branch: master
Clone or download

Latest commit

oderby Add links for installing graphviz
Installing graphviz library was gnarly - here's the set of links I found useful to get set up and running.
Latest commit 548fa53 Sep 28, 2015

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
DynamoToCG update to look for annotations list Sep 27, 2015
Presentation all the stuff Sep 27, 2015
VVD-GH-To-CG all the stuff Sep 27, 2015
examples all the stuff Sep 27, 2015
.gitignore Make Andrew happy (it takes compromises!) Sep 27, 2015
CommonGraphDiffer.dll updated examples, adjustments to conform to spec Sep 27, 2015
CommonGraphDiffer.py grapher now uses node names Sep 27, 2015
CommonGraphFormat.txt fix up applier Sep 27, 2015
DiffSetFormat.txt Plumb node location through. Sep 27, 2015
Geometry_Surfaces_V1.dyn all the stuff Sep 27, 2015
Geometry_Surfaces_V1.dyndiffview.dyn all the stuff Sep 27, 2015
Geometry_Surfaces_V2.dyn all the stuff Sep 27, 2015
LICENSE Initial commit Sep 26, 2015
README.md Add links for installing graphviz Sep 28, 2015
RayToolDiff.dsx all the stuff Sep 27, 2015
X-ThenArray.dsx all the stuff Sep 27, 2015
applier.py fix up applier Sep 27, 2015
applydiffdy.cmd fix applydiffdy command Sep 27, 2015
applydiffgh.cmd update/add new commmands Sep 27, 2015
createCircleThenCreateTwistyetc.ghx all the stuff Sep 27, 2015
demo.py fix up python library - pull out demo main function. Sep 27, 2015
diffgraph.py slight changes Sep 27, 2015
diffgraphdy.cmd add sample dynamo files and batch scripts for diff and vizdiff Sep 27, 2015
diffgraphgh.cmd add sample dynamo files and batch scripts for diff and vizdiff Sep 27, 2015
flowerpower - Copy - Copy - Copy.dsx switch to interpreting from inspect instead of ignore (hacky hack) Sep 27, 2015
flowerpower - Copy - Copy.dsx switch to interpreting from inspect instead of ignore (hacky hack) Sep 27, 2015
flowerpower - Copy.dsx switch to interpreting from inspect instead of ignore (hacky hack) Sep 27, 2015
flowerpower.dsx switch to interpreting from inspect instead of ignore (hacky hack) Sep 27, 2015
flowerpower2.dsx switch to interpreting from inspect instead of ignore (hacky hack) Sep 27, 2015
foo.dsx added CGtoGH project Sep 27, 2015
foo2.dsx added CGtoGH project Sep 27, 2015
grapher.py graphviz styles Sep 27, 2015
growthieDiff.dsx all the stuff Sep 27, 2015
rayDiff2.dsx all the stuff Sep 27, 2015
surfacesDyn.dsx all the stuff Sep 27, 2015
towerdiff.dsx all the stuff Sep 27, 2015
towerflowertwist.ghx all the stuff Sep 27, 2015
versionCircle.cgx versionCircle example Sep 27, 2015
vizdiff_2ghx.cmd adding vizdiff_2ghx Sep 27, 2015
vizdiffdy.cmd update/add new commmands Sep 27, 2015
vizdiffgh.cmd seperated out vizdiff into two different batch files Sep 27, 2015

README.md

VVD

Leveraging version control software for graph-based languages & tools, such as Grasshopper and Dynamo, has been an elusive topic for far too long. Although there has always been significant interest, it has been a daunting problem to solve. Due to opaque binary file formats and messy XML documents, traditional VCS is of only marginal utility, and not worth the learning curve.

We believe one of the biggest roadblocks to the adoption of VCS overall, and by the AEC industry in particular, is the lack of a useful, simple UI for visualizing and exploring differences between two files. The ability to see the changes made to a graph, layed out with the original graph, is essential to properly understanding how the definition has changed and evolved as collaborators worked on it. We hope by exploring these issues, we can spur collaboration in the industry and beyond.

VVD ("Vivid") is a set of tools for working with version control software. It consists of 3 different tools, for computing diffs, visualizing them, and applying them to files. These tools are detailed further below, in the Usage section. They are best suited to a collaboration workflow where 2 or more team members are working on the same graph definition asynchronously, and need to merge their respective changes together as they synchronize and finish their respective tasks.

These tools are built using a combination of C# and IronPython, as well as the open Grasshopper and Dynamo C# SDKs, and the great graphviz tools. This tool was intially built at the TT AEC Technology Hackathon 2015, held in New York City.

Installation

To fully utilize VVD, you will need to have the following software installed:

  • Python 2.7 or greater (does not work with Python 3)
  • .Net 4.0 or greater (to compute and apply diffs)
  • graphviz and pygraphviz

Tips for installing graphviz and pygraphviz library on Windwows

http://www.graphviz.org/Download_windows.php http://aka.ms/vcpython27 http://stackoverflow.com/questions/22722730/installing-pygraphviz-on-windows-python-2-7-graphviz-2-36 http://www.lfd.uci.edu/~gohlke/pythonlibs/ Set your PATH to include pointer to graphviz library

Usage

Each tool serves a particular purpose, and we walk through each below, starting with purpose and use case, tool documentation, and several examples.

Compute Differences

Say you want to see what changed between two different versions of a Grasshopper script, or you need to share your changes with a colleague who has an older version of your definition. The first thing you need to do is compute what's changed - the "diff" (differences). There are two tools for this purpose - one for working with Grasshopper files (diffgraphgh.cmd) and one for working with Dynamo files (diffgraphdy.cmd).

diffgraphgh.cmd [old_gh_file] [new_gh_file] [gh_diff_file]

This tool accepts two Grasshopper files (.gh or .ghx) and writes the difference file (a .dsx file, see below for more details) out to the specified diff_file. This diff_file is what you'll use to apply the changes to another file. The diffgraphdy.cmd tool operates in an analogous manner, except for Dynamo.

Visualize Differences

Say your colleage sent you the diff_file of his work since the last time you synced, and you want to see what he's accomplished. There are several options here. We've built diff viewers for GH and Dynamo, which take a base definition file and a diff file, and display the changes from the diff on top of the base file, in the native tools. (Docs coming soon)

We've also built a standalone diff viewer on top of the graphviz library, which takes Dynamo or Grasshopper files and a diff and renders them in a simple graph viewer.

vizdiffdy.cmd [dy_file] [dy_diff_file]

This tool will take a dynamo file and diff file and launch a photo viewer with the resulting png of the differences.

Apply Differences (merging)

You've gotten the differences from your colleague, and inspected the changes. Now you want to apply those changes to your file. We have made 2 tools, one for each Dynamo and Grasshopper, to take a diff and apply them to a definition.

applydiffdy.cmd [base_dy_file] [dy_diff_file] [dst_dy_file]

This tool takes the base Dynamo file and diff file to aply, and the place you want to write the new dynamo file to. It will take the changes in the diff file and try to apply them on top of the base file. The applydiffgh.cmd tool works in a similar manner for Grasshopper files.

There's no need for the base file here to be the same one the diff was calculated on. However, there is also no guarantee a given diff file will apply cleanly to a given definition. In particular, if the two collaborators made a lot of changes in the same region of the graph, it's likely applying the diff will fail. This tool currently will only succeed if all changes applied cleanly - otherwise it won't make any changes and will alert the user to the failure.

Basic architecture

(Coming soon)

Future work

  • Code refactor (this was built at a hackathon, afterall!)
  • Improve cmdline tools to be smarter, easier to use.
    • Convert batch files to python
    • Move towards a single, unified tool
  • Provide an installer to facilitate installing tools and dependencies
  • Expand to other graph-based languages, with open file formats
  • Incorporate diff visualization with patch application logic
  • Interactive merge - review changes before applying a patchset.
  • Diff visualization in the web (git-notes?)
  • 3-way diff/merge - smarter merging behavior
    • Report which areas had issues/problems
  • Expand on the basic standalone diff viewer
You can’t perform that action at this time.