MotionBuilder Python Tool “SaveIt”
Here is a script/tool I created for MotionBuilder using Python. This tool will do an incremental save of your scene. Why? Incremental saves are amazingly useful, I thought a tool that automates the process down to one click would be fun.
A big thanks goes out to my college Raphael Lappiere (a kick ass AI Programmer) for helping me with the heavy lifting with Python. He showed me some awesome stuff that was well beyond what I was capable of doing before I start this little tool.
How does SaveIt.py work?
Once you execute the script into your MpotionBuilder scene you will be presented with two buttons – “Save It!” and “Finished“.
“Save It!” will automatically add a suffix to your file name based on the current date and time.
Example: MyAwesomeScene_##03.23.2017_16.30.56.fbx
“MyAwesomeScene” is used only as an example. Your original scene’s name will be there in place of it. If you do not have a scene name then MotionBuilder will prompt you for one.
The first string of numbers (03.23.2017) represent the date at which the scene was saved (March 23 2017).
The second string of numbers (16.30.56) is the time the file was saved at. The time is based off a 24 hour clock so 16.30.56 = 4h:30m:56sec in the pm.
The “Finished” button will save your scene with the suffix removed.
Example: ‘MyAwesomeScene_##03.23.2017_16.30.56.fbx” becomes MyAwesomeScene.fbx
The tool can be downloaded here.
Enjoy.
Nice tool 😉
How to change date to number of version ?
MyAwesomeScene_##_001
MyAwesomeScene_##_002
that should be pretty easy, just do a search for the string “_##_” and replace what ever is after it.
for it to do incremental you could strip the open motionbuilder file’s suffix name into a new variable.
then make sure that variable is in integer and add 1 to it.
this will help you figure out how to strip the suffix of a string:
https://www.quora.com/Whats-the-best-way-to-remove-a-suffix-of-a-string-in-Python