In this post, I will talk about a simple script that repairs all the broken NURBS surfaces in a scene.
Xwift is a shelf that contains specialized scripts when I was producing my animated film. I want to write some blogs to document them, in case there’s anyone out there that needs some inspiration.
Everything is developed and tested using Maya 2022.
Swift is not (well, not yet) open-source and therefore I will not share the whole script in my post. However, after reading my posts I believe you can implement your own, given some time and effort.
Okie this one will be a short one. There are often times when the rigger in your production wants to go fancy and use NURBS surfaces instead of NURBS curves for rigs to make things much, much easier to click. In my case, Cody Wilcoxon (Seriously, this guy is a Maya god).
But Maya lags behind. Sometimes, when referenced, all the NURBS surfaces on your fancy rig break. It is nasty.
A Rig with broken NURBS surfaces
First, we need to dig the Maya documentation for rebuilding NURBS surfaces.
Good for you, I did the work already. In case if you are interested, here’s the documentation for rebuildSurfaces.
Let’s write a helper function that help execute the commands.
Now, we need to get a list of all the surfaces.
We can do that by using
cmds.ls(type='nurbsSurface') and feed all of them into the function above.
Bind fix_broken_NURBS() to a button and you are all set.
A Rig with fixed NURBS surfaces
Next time when you see every single NURBS surface on a rig is broken, keep calm and press the button.
Note: For advanced use, you can consider integrate this into your asset manager from your studio when you try to reference a rig into the scene. The animators will be happy!
If you want to quickly say hi just shoot me a message using the contact portal.