Your browser (Internet Explorer 6) is out of date. It has known security flaws and may not display all features of this and other websites. Learn how to update your browser.
X
Post

Scripting in modo: Using the Command History

I’m currently working on a modo script for exporting a “clean” FBX file from modo for use in Unity. By clean, I mean a file that only contains mesh items. When using an FBX in Unity exported from modo, you’ll want to remove the camera, lights, materials and locators as well as constraints. I’ve been working on a Perl script that will remove all of the unnecessary items from your scene before exporting an FBX from modo. The script will also revert the scene back to it’s last saved state for convenience.

I’m by no means a coding expert when it comes to scripts for modo. However, I find the Command History panel in the modo UI to be an invaluable resource when finding information on what commands I’ll have available when writing a script. The Command History not only shows a full list of modo commands, but also their syntax usage, which is very handy.

Click to Enlarge
Click to Enlarge

In my current script, I needed to find a way to deselect mesh items. I wasn’t sure how to do this, so after looking through the Command History, I found that the command “selection.subItem” would do the trick. In the following image, you can see a screen shot of the Command History panel and specifically the “selection.subItem” command.

If you’re thinking about writing a script for modo, the Command History panel is a good place to find all of the commands you’ll use in your script as well as their syntax. I’ll be posting my ExportToUnity script here on the blog as soon as it’s complete.

Post to Twitter

  • Anonymous

    I’ve been using Unity for some time and I always used the OBJ exporter in order to use my Modo geometry inside Unity but a geometry only FBX exporter is a really good idea. I’m also taking my 1st steps in Modo scripting with Python and the Command History is really handy, as you well stated.

  • pbarrelas

    I've been using Unity for some time and I always used the OBJ exporter in order to use my Modo geometry inside Unity but a geometry only FBX exporter is a really good idea. I'm also taking my 1st steps in Modo scripting with Python and the Command History is really handy, as you well stated.

  • wesm

    Thanks Roberto! I'm working on the script and hope to have it ready in a day or two. I'll post it here on the blog! The funny thing is that since I started writing the script, I found one other modo/Unity script that exports FBX. I was almost done when I found this script, so I figured I just finish mine : ) That just shows that's there are others interested in using modo in a Unity pipeline.

  • http://www.dynematica.it/ Roberto

    This is a good news :) , i think is a good idea to create an export to Unity plug in, i have the same problem.
    I wait your plug in, thanx , good look :)