RPManager - Updating XREF Paths for all Passes

The following one-liner MAXScript from Grant Adam has saved a ton of time while working with RPManager in our Arch-Viz pipeline. 

RPManXref.captureAllXrefPassesIfNotAlready true

Simple little line of MAXScript that is incredibly powerful. Let me explain...

RPManager (short for Render Pass Manager) is a plugin for 3ds Max that provides a way to work with lots of different shots - cameras, lights, objects, settings, etc easier. I'll do a detailed writeup about RPM later - for now this post is mostly for those of you who use it already.

One of the things RPManager does is record your XREF definitions but that can be problematic in our workflow. I like to setup my render passes early which means I might not have all the XREF Scenes referenced yet. For instance let's say in our render file I start by referencing 2 XREFs - Building & Site. Then I setup a dozen render / light passes with RPM, do all the frame ranges, resolution, elements, everything. Awesome. Except we keep building scene data and now I need to add XREFs for People, Cars, Environment, etc. Since my passes are already setup I'd have to manually add those 3 XREFs to every pass (24 of em right now considering light/render) which would be slow and error prone. I wanted to do it all in one fell swoop and after explaining my need to Grant Adam (developer of RPM) he sent back this one liner that totally solved my problem. All 24 passes now reference 5 XREFs instead of the original 2. Perfect. I'm sure I'm not alone so I'm sharing here for you now & future googler's...

RPManXref.captureAllXrefPassesIfNotAlready true
"The true forces it to rebuild the data based on the current setup in 3ds max. Walks through all passes and recaptures the xref data. Run this before turning the 'xref control active ' on. Let me know if that does what you want. Note that it doesn't update the xref RPM UI, so change tab to confirm it is updated the way you expect.
cheers,
grant"

Good work Grant and major props for a robust tool like RPM that solves a lot of animation production problems with 3ds Max!