How I Went Down a USD Rabbit Hole Only to Fight Windows Instead
Disclaimer: Please research your own system configuratin before applying any changes. This post describes what worked on my setup, and I cannot be held responsible for any issues or damages that occur.
Hi everybody!
Last semester I was a Producer and the CG Production Assistant in StudioX. I’m glad I was able to have that experience in a studio environment while I was in school. It gave me a much deeper understanding of the entire animation and visual effects pipeline. Which will help in many ways, especially with getting into Technical Artist/Director type fields. I prefer the artistic side of things and solving specific problems over managing the projects, artists, and clients though.
With that in mind, I had a client who really wanted to have everything converted from Maya scene files to USD and Arnold shaders to MaterialX. He wants to explore taking the project into other platforms such as Unreal Engine and use the approved assets in AR/VR settings. I totally understand the need. This will save him so much time when expanding later. Since I took scripting for animation and visual effects, I learned how to automate some things using Python. Including a cross platform, cross DCC, slap comp GUI that a CG artist can use to automate creating a slap comp for their CG from Maya to Nuke. So, I was wondering if I could automate this process some way.
This took me down quite the research rabbit hole. First, I needed to understand what steps it took to do this manually before I started coding. Man! There is a lot! I also kept running into the issue of researching the cart before the horse. For example, I was researching the Arnold to MaterialX conversion because I thought that would be the hardest problem to solve. Thinking everything else would flow easily from there. I ran into outdated information on what would convert 1:1 and what would not. Mostly because I wasn’t researching the full USD pipeline yet and did not know additional nodes were available in the LookDevX tool. Well, that tool wasn’t even available to use yet because my project wasn’t set up as USD yet 😅. So, I started researching those steps, came across some videos my old LookDev and Lighting teacher created which had GitHub links, to some scripts that he already found or created to solve this problem. Cool! That project is going into his class next semester anyway. However, it did look like some of it was more copying all this code into your shelf, sort of thing. Then open this tool, then open that tool. I was hoping to create something more like a GUI that would call the scripts it needs and let the artist focus on the task at hand. Something a bit more intuitive. So, as GitHub says, standing on the shoulders of Giants… I will continue to work on turning this into something I would want to use. A GUI that is set up more like a check list, like where do you want to save your conversion file too?
Set button that saves a new file with the USD_Convert appended to the original file name. Then set up the outliner organized for USD with all the Geo: AssetName\Render\Asset – set up a new group under AssetName that says proxy. Ok, everything is organized, now let’s duplicate the geo place it under proxy, (simplify the geo) combine the objects if it is created of a group of objects, reduce the verts (slider), and on and on and on until everything is converted to USD and MaterialX. Although I want to do this, I don’t have to be in a huge hurry to do so. The client is heading to the exact right person for the job. So, I can take my time and make something beautiful.
My friend Lana tells me that I need to take more time to show what I’ve done. That I spend too much time helping other people, and that is hurting my portfolio. She said she knows I’m brilliant but we just gotta get other people to see that too. I don’t know why, when I go back to my previous work, I feel like I’m stepping back and somehow not continuing to move forward. I need to get over that and just show my work.
However, as software changes, and I learn more about what I’m doing… sometimes I run into some technical difficulties. Especially moving things from the school’s remote lab to my personal PC because some stuff we have used is rLAB only. Thank God I have senior portfolio next semester… I can move some stuff back to get some better render passes to add to my work. It will be nice to have some dedicated time just to work on my portfolio.
The class I was most excited about last semester was scripting for animation and visual effects. So, I wanted to start sharing that immediately while it was still fresh in my mind. So, I started a GitHub and made my first repository for my.SlapCompGUI. I had some help from my friend to just get something up there to show recruiters. This was the biggest, best script I made so far… so I wanted to make sure to get it visibility first. This script was a big deal because it worked on PC, the rLAB PC, and my instructor’s Mac without any issues. I even earned a Letter of Recommendation out of it. However, after watching some of the getting started videos… I realize I could have done somethings differently. Still there is something to show and you can review my script and use it if you want.
Again, I watched some GitHub for beginner videos… I now realize why my instructor said it is better to create a Python folder for all your scripts. For example: C:\Python\Maya or Nuke or Houdini etc. Then change your environment variables to read from that file location. Instead of C:\user\documents\maya\version\scripts. It looks like this would make it a lot easier to sync my work done in Visual Studio Code and Commit the changes to GitHub all while having a history of those changes so that if something breaks… I can revert to what was working easily. Also, this would allow people to fork off or clone my code and add their own fixes/suggestions, making everything way more collaborative.
So, I created my Python\Maya folder and went to change my Maya environment… It didn’t work 😑. So, my AI friend the CoPilot, on smart mode, recommended I check which paths Maya was using for sure. In Maya’s script editor:
So, I created my Python\Maya folder and went to change my Maya environment… It didn’t work 😑. So, my AI friend the CoPilot, on smart mode, recommended I check which paths Maya was using for sure. In Maya’s script editor:
import sys
for p in sys.path:
print(p)
Yup! Maya was using a documents folder in OneDrive! Now OneDrive has it’s uses, but we don’t need everything to go there… Ok Windows 11! My teacher warned us about this causing problems in the future. I’m glad I’m fixing it now before I get too deep in.
Ok, just go to the properties of the documents folder and change it to a different drive, click move, and apply no big deal, right? Well, you would think it would be that easy but, it wasn’t. My Documents folder did not have a location tab to change the properties on. So, I had to go into my shell, Win+R is the shortcut, and type:
shell:Personal
to find where my true documents folder was.
So then I changed the location and clicked move. “This folder doesn’t exist in the directory; would you like me to create it?” Yes. “Do you want to move all the files from the old location to the new location? (recommended)” Yes. “Can’t move the folder because there is a folder in the same location that can’t be redirected. Access is denied.” But there were no documents folder in said location. I checked. Many iterations with the AI later… I figured out OneDrive was just blocking the whole situation because it didn’t want to give up control. So, I renamed the Documents folder on OneDrive, created a Documents folder at the location I wanted it to be in, and had to force the change through the Registry Editor.
How I did that:
Win+R to open the shell.
Type:
regedit
Navigate to:
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders
Find: Personal
Set its value to the location you want it to use.
Close the registry editor.
Restart your computer.
WARNING!!! DO NOT COPY OR MOVE ALL YOUR FOLDERS FROM THE OLD LOCATION TO THE NEW LOCATION!
When you open your programs like Maya they will rebuild in the new location. OneDrive has little hidden files that will hijack your documents folder again if you copy or move whole folders. Then you gotta start this whole process all over again.
You only want to move your settings, preferences, hotkeys, scripts, projects files only! Things you set yourself. Not folders that were built by the program.
Now I am to the point I can set my Maya Environment Variables again. Obviously, I will need to move my script over, before they will work again. But, as I move my scripts, I will be updating GitHub with repos and creating demonstration videos of how the scripts work. This will help me have something to show on my demo reel and help anyone who wants to use them. I just need to reorganize things to work better together first.
This is exactly why I call it “Magical Mayehem”. It starts as pure Mayhem, but if you stick with it long enough, the fix feels almost magical.
Best Wishes,
Christa “Maye” Chandler