As we welcome in the off-seasons, we also welcome to the world the Dynamo Core 2.8 release! This release has a major focus upon rounding out the bulk of the Python 3 work, but also contains some awesome geometry improvements.
A slew of new features to improve and streamline the Python 3 experience, including better messaging, a migration assistant, more in-product help, whitespace characters, the ability to print to the Dynamo console, recognition of any potential missing IronPython2.7 engine native inside the Workspace References extension, a few targeted improvements to Geometry that allow greater control for the graph author on PolyCurves and NurbsCurves, as well as a respectable amount of bug and crash fixes that all make a much more stable and consistent Dynamo.
But what is Dynamo and its flavours?
What is Dynamo Core?
Dynamo Core is a collection of bundled components that consist of the graphical interface, the compute engine, the scripting language DesignScript and the out-of-the-box nodes that are not specific to another program like Revit or Civil 3d.
What is Dynamo for <INSERT HOST HERE>?
What is Dynamo Sandbox?
Dynamo Sandbox is for package developers and other folks working with Dynamo code who want to stay up to date with the latest and greatest stuff coming out. Sandbox is Dynamo’s “Core” functionality distributed in a way that doesn’t interfere with other Dynamo installations and doesn’t require any other applications (except for a few windows components and some optional extras). You can read more about this distinction here.
Awesome, but can you now just tell me what’s new with Dynamo 2.8?
We have been hard at work continuing to improve the CPython3 integration which forms the majority of the new features in Dynamo 2.8! We’ve been making big strides on our projected phases as we update the timeline that first surfaced in the Dynamo Core 2.7 release. The addition of CPython3 into Dynamo modernizes the Python scripting experience and brings you access to a whole new range of popular modern libraries such as NumPy, Pandas, and Keras:
- Epics in Green are included in the Dynamo 2.8 release.
- Epics in Orange are currently being worked on – all at various stages of completion.
- Epics in Blue have not yet been started.
We have continued to improve the Python 3 work on our CPython3 engine by enabling a Default Python engine which allows you to choose which engine the Python Node will use by default. That means that if you select CPython3 here when you place any new Python Node into the Dynamo workspace it will use that engine without you having go set it manually. Good little time saving for all you hard-core Python gurus! The Use System Default toggle is what will be there when you open Dynamo 2.8 for the first time and is set by the host (i.e. Revit, Civil 3D or FormIt)… but if the system default isn’t quite what you are looking for you can choose to set this for yourself.
This work also splits the old IronPython2 engine away from Dynamo Core by putting it on the package manager. This allows us to ship new versions of this package, and future versions of Python outside of the Dynamo development cycle: keep an eye out for DynamoIronPython2.7 on the Package Manager and other engines in future. To safeguard this we built a special case for the Workspace References where the DynamoIronPython2.7 package is innately tracked – so if you are missing it inside your install and your graph contains Python nodes of that variety you will be able to easily install it!
- [ 1 ] User chosen setting for the
Default Python Engine
- [ 2 ]
IronPython2 packageon the Package Manager
There are a number of improvements to the Python experience inside of Dynamo 2.8 including a clean up of the buttons into icons and hover-text based buttons to efficiently use space as we’ve also added a new button to the panel: the Migration Assistant (Big shout-out to the help here from Matterlab.co!).
This assistant helps you navigate the syntax changes from Python 2 to Python 3 code and provides suggestions for you to accept or reject as well as two funky ways to view the code changes; Side-by-side or Combined. We also surface messaging to help you understand what is happening when you use the assistant and automatically create a back-up Python2 file in the backups folder to safeguard against any potential hiccups. We hope you don’t need to use them, but better safe than sorry!
- [ 3 ]
Migration Assistantbutton that helps you migrate your code from Python 2 to Python 3
- [ 4 ] Toggle that switches
view modesin the Migration Assistant; Side-by-side or Combined
- [ 5 ]
Accept buttonthat will accept the proposed code changes and update the Python Node editor
- [ 6 ]
Reject buttonthat will reject the proposed code changes and exit the Migration Assistant
- [ 7 ] Migration Assistant
Disclaimerthat will explain what the assistant is doing. You can choose to see this repeatedly or turn off for future use!
- [ 8 ] A
backup of your graphis saved when using the Migration Assistant on an IronPython2 node. Note: this will only occur once per graph; if it’s already saved you won’t see this option pop-up again.
We have also updated the Documentation Browser window for Learn More about Python 3 Updates by including an explanation that all CPython3 work is not (necessarily) backwards compatible. Given that Python 2 and Python 3 share a lot of common syntax, your CPython3 code
may still function in IronPython2 but there are no guarantees. If you open up a graph that has used CPython3 engines in the Python Node then prior versions of Dynamo will revert back to the IronPython2 version.
We have also added in some text around how you can make changes to your Python nodes for Python 3 – namely playing with the Migration Assistant. The eagle-eyed amongst you may say; “But Sol, what happens with the Python Script from String node?” and the answer is that as that node does not open up the Python editor it will unfortunately not have access to the Migration Assistant. You’ll need to either make manual changes, or copy and past them into the Python Node editor to run the assistant.
Python 3 is a little more needy than Python 2 when it comes to indentation inside of Python code; whereas Python 2 was totally cool with you using either tabs or spaces, Python 3 much prefers spaces! So, we’ve introduced a new feature that allows you to visualize Whitespace Characters inside the Python Node Editor. A long requested feature, this allows you to better debug your code, or someone else’s to get it working inside Dynamo with
tabs represented as chevrons '>>' and
spaces represented as periods '.'
- [ 10 ] Turn on or off Show Whitespace Characters via the Settings menu
- [ 11 ] IronPython2 representation
- [ 12 ] CPython3 representation
Another long asked for feature, the enabling of print() has also been integrated! Now you can include the
print() statement inside of your Python code, in both IronPython2 and CPython3 nodes that will log directly to the Dynamo Console. Awesomeness! It will also mean that Python code brought into Dynamo from elsewhere that contains any
print() will now also be useful. Even more Awesomeness!
A couple of points to note: the name of the node will be prefixed onto the log line, and the logs will not be saved to disc and the execution time of each node follows the standard Dynamo paradigms; what is wired up further up the chained nodes will execute first.
- [ 13 ] A
print() statementinside the IronPython2 engine using a simple string
- [ 14 ] Another
print() statementinside the CPython3 engine using a named variable
- [ 15 ] The printed statement
appearing in the Dynamo Console
And, to round out the CPython3 work this release, we have also continued to improve the parity between IronPython2 and CPython3 by fixing a huge amount of compatibility issues between .NET land (The language in which things such as Revit talk) and the world of pure Python. Suffice it to say that we spent an
immense amount of effort fixing workflows here that can only truly be grasped by looking at the Release Notes!
Moving on from the awesome Python work the Dynamo team has done, we have also made improvements to Dynamo’s PolyCurve Geometry, that allow you to now more easily change a PolyCurve into a NurbsCurve, by improving the
Curve.ToNurbsCurve node and honoring the curves that make up a PolyCurve when using downstream operations such as
PolyCurve.Curves; rather than return the higher-order (i.e. more abstract version) curve, they will now properly return the correct type. Additionally, the
Curve.SweepAsSurface geometry methods are now more robust as they now also support non-tangent continuous curves; you can sweep more complex things now!
A fix has been implemented to a long-standing request to allow you to rename nodes with their Preview State turned off by double-clicking like normal! A long time coming, this lowers the friction needed to build all of those epicly cool graphs that you have in your head! One more small movement towards a better baseline state as we seek to hone the rougher edges of Dynamo. Bring on the polished masterpiece!
In addition to all of the good stuff above, we have fixed numerous bugs that are definitely worth exploring in our release notes but for easy access here are a few of the more salient ones: We’ve fixed a crash state when undoing and redoing deleted nodes quickly, fixed the issue where a group would jump around from the nodes contained inside it, fixed an anti-aliasing regression introduced during our Helix upgrade work in Dynamo 2.7, and fixed an issue with T-Spline geometry where vertices were unexpectedly closed with the
TSplineSurface.PullVertices node to give a bit of consistency to the hardcore Geometry community!
You’ve sold me, so where can I get my hands on Dynamo 2.8?
Dynamo 2.8 will be made available in our host integrations at a future date and can be explored right now through the dynamobuilds.com website or the Github build page – available in the Sandbox version of Dynamo.
If you’re curious, you can also read our ‘Release Notes’
In order to keep a semblance of propriety to this blog post we’ve skipped a few things! For more information on other minor features, bug fixes, and known issues in Dynamo 2.8, go check out our release notes: this particular set is huge, so well worth a read – especially on the bug section!
A big shout-out to everyone who contributed to the release and the entire Dynamo community for continuing to support our work. As always, please let us know if you have any feedback or suggestions!
The Dynamo Team