Maya to Blender Conversion script

Hi all,

So this is a script I have been chipping away at for about a year and it has become indispensible in my workflow.
Basically it is a bunch of functions from the maya.cmds module converted to work in Blender, with the exception being that it returns/accepts Blender objects instead of Maya strings (it takes strings too)

Although it works for all my cases so far, there is bound to be some bugs, please submit bugs on the github page otherwise I will forget. And no I am probably not open to feature requests as I barely have time to work on my own stuff let alone someone elses.

I’m now at a point I can easily take most maya scripts from creativeCrash and easily convert them to run in Blender so I’m going to call this one done and release it into the wild.
I’ve learnt a lot about blender’s api doing this, mostly it’s made me despise the Blender api, but hey, learning is learning…

Some stats:
4347 lines
1005 lines of docstring
63 functions
33 sub functions
6 classes

The code:

Enjoy, and I am about to leave for a few weeks on holiday (At last) so my apologies if I do not reply in a timely manner.

Cool! Can’t wait to see some useful scripts working in blender :slight_smile:

That is the best thing I’ve seen all week. Can’t wait to try it out!

Can something like this be converted ?? :eek:
http://www.braverabbit.de/playground/?p=474

@Thanzex
To some extent, My script mostly deals with items at an object level,
I work in animation so for personal projects I just create functions as I need them, hence why there is so many functions geared at finding objects and manipulating keys, however I have already got started on some of these mesh operators, but as I am going away over christmas/new years, I cannot make promises on when it will be done.

Basically all that script is doing is creating a reduced ground mesh, adding a particle system and setting the objects as the particle objects.
Blender is a little better at handling this type of action, I would recommend watching Andrew Price’s tutorial on creating realistic grass (The one with modeled grass blades, not hair grass), That will show you how to set this up which will make it easier to adjust later anyway.

But yes, it is on my list, feel free to add notes to the github page of specific functions you would like.

Good luck on this project. I will mention it in our monthly user meeting newsletter.
Thanks or all the work and the contribution. : )

Can I ask what is needed to install the script?
It gives an error and stops at line 50:
[from core.libs.types import fi, li, asList, parseArgs, isType, asFloat, OrderedDict as od]

You need to check out all the files, if you go to the top of the public repo you can then find that file it is attempting to import
scripts/core/libs/types.py

I’ve downloaded the public-master folder and run the file cmds.py within this folder structure.
I thought it will automatically search for the required module folder. I am not an expert programmer, probably that’s why I fail to do anything further :slight_smile:

I will appreciate a simple instruction what to be done to run the script successfully.

As a second question: I was trying to see if this Maya script will be converted successfully in Blender:
https://vimeo.com/111981446 (there is a link to the download page). Is that possible?

Thanks for your patience!

You need it to be on your python path.
See where it is running “from core.libs.types import …”
This means that “core/” needs to be on the python path
So whereever you saved that “scripts” folder to, add that to the python path.
Or if all else fails, copy the functions form types.py into the top of cmds.py and remove that import line.

Oh and about that script, that is maxscript, for 3dsmax, not maya.
It shouldn’t be difficult to write something similar to that using this though

This looks VERY interesting! I’m a little confused as to what it’s doing though. When installed, does it allow you to run maya scripts in blender? Or is it some kind of “middleware” allowing a scripter to convert maya scripts into blender ones. Once the maya script is converted, can it run in blender without your tools? I’m just wondering what this does and how it works in practice from a blender-user perspective.
Hope your having a great holiday!
Thanks!

1 Like