Note : This guide requires the Rhino 9 WIP. This is a work in progress meaning that it is meant for testing and should not be used for project critical production work. The Rhino 9 WIP is available to anyone that owns Rhino 8.
USD files can now be used to encode information for the exchange of BIM information to common workflows. Geometry, Layers, Blocks, UserData and Object Properties will now be transmitted into USD data.
For developers, the RhinoUSD project is open source codebase written in C++ .
Rhino Objects to USD
Here are the changes to USD format and how Rhino objects are encoded into USD. Based on support for USD geometry in general, all geometry objects are exported as mesh objects.
- Additional Export Options on USD - Use this to configure output USD files.
- Included Userdata text on objects - Userdata can be used to add metadata to the prim objects in the USD file.
- Blocks exported - Block Instances are now exported in full. But also options with blocks can be saved.
- Exporting should be scriptable, i.e via aliases, etc
- Exporting should also be possible via Python/c# (see attached)
USD File Options
Here is the new USD Options dialog:
- Default Layer - This is the name for the Root prim of the USD file that all other data fits under.
- Model Name - This is an optional prim. This can be used to make composing multiple USD files easier.
Include User Strings from Rhino into USD
Userdata on objects within Rhino with the Key:Value pairs. This information is saved on the prims as CustomData in the USD. It is meant to be used for all sorts of metadata that can be explored in other USD viewing apps.
Block Export options
Blocks definitions and their instances are now exported with the USD.
Block Handling Options
- Blocks as Separate files - This is the most efficient way to save a USD file. Each Block will create a separate USD file. These files will then reference each other. This can improve the performance of USD viewers.
- Ignore - Ignore
- Embedded - Block definitions are included within the USD file. This makes it easy to move the file around, but is less efficient for viewers.
Scripting Export to USD
USD export can be scripted in RhinoCommon in Python or C# using code similar to this sample:
using System;
using System.IO;
using Rhino;
using Rhino.FileIO;
using Rhino.Collections;
var desktop = Environment.GetFolderPath(Environment.SpecialFolder.Desktop);
var options = new FileWriteOptions()
{
WriteSelectedObjectsOnly = true,
SuppressAllInput = true,
SuppressDialogBoxes = true,
};
// Block Options
// SeparateFiles = 0
// Ignore = 1
// Embedded = 2
var dictionary = new ArchivableDictionary();
dictionary.Set("blocks", 2);
dictionary.Set("root-layer", "RootPrim");
dictionary.Set("model-name", "MyModel");
dictionary.Set("include-user-strings", false);
var doc = RhinoDoc.ActiveDoc;
doc.Export(Path.Combine(desktop, "usd.usdz"), dictionary);