Tool to export or print out complete Hierarchy & inspectors

Is there any plug-in or tool that allows you to recursively dump a Unity project’s complete Hierarchy (including the fully-expanded inspector views & their sub-item values for each item IN the hierarchy) as XML? Or to dump it all in some coherent manner to a printer?

Why: I’m trying to make sense of Oculus’ example projects, since most of their documentation is limited to semi-random example projects with minimal coherent higher-level documentation. To me, trying to learn by reverse-engineering a large Unity example project feels like the ancient story of having a hundred blind men trying to describe an elephant, because you can only see tiny, disjointed pieces of information at a time in the editor. What I really find myself wanting to do is just recursively print the entire project hierarchy (and all of its fully-expanded inspector values), then tape the pages together like make-believe fanfold paper so I can view them as a coherent linear whole & mark them up with notes, colored lines, highlights, etc.

So… does anything like this exist? Or can anybody point me towards some resources that would help if I wanted to try writing something like this myself (like, documentation about which files to parse to actually obtain the same information Unity itself uses to generate the Hierarchy view and its inspector tabs)? I’d prefer to avoid burning a week on a side trip to write a program to dump Unity project hierarchies to XML, plus the XSL to transform it into something coherently-printable, but if nobody has done it yet, it’s something I’d seriously consider tackling as a project because it would be so useful to me going forward.

In case anybody’s interested, I wrote an editor extension to do exactly what my original posting proposed. It’s available from GitHub in two different projects:

and

The first one consists only of the files needed for the extension that go under Assets/Editor/ in your project. The second one consists of an entire sample Unity project, as well as examples of the XML output generated for it. Complete instructions for adding it to your Unity project as a Git submodule are in the README.md files.

I spent a completely insane amount of time writing it (once I made the decision to post it to GitHub, I felt compelled to implement things I didn’t really care about for my original purpose, and polish it up to a degree that goes way beyond what I actually needed).

Anyway, it’s there if anybody wants to try it. At the moment, it’s set up to output XML in two forms:

terse, which is optimized for human-readability (minimizing excessive whitespace and wasted vertical real estate, rendering complex values as strings, etc). In theory, it’s well-formed XML, but parsing it probably won’t be fun unless you just want to output the complex values AS strings.

verbose, which is optimized for consumption mainly by computers. Many complex types have their values separated out into individual elements, with lots of containers whose only purpose is to group related child elements together.

Although those are the two defaults, they’re really just two different collections of sensible options that can be remixed and combined in fairly arbitrary ways. For example, you can configure it to output complex values (like Vector3) as BOTH text properties AND discrete child element values, use any prefix you like (or none at all), rename or omit container elements, etc.

I hope someone finds it to be at least a little bit useful. I don’t want to make its ongoing maintenance my life’s work, but I’m definitely open to improving it (and incorporating changes made by others). It can be freely forked as well. If enough people genuinely care and ask, I might publish it to the Asset Store.

1 Like