I wanted to write this post for a long time now. In my free time I also do 3D stuff like models and various other things. While doing these I came across Autodesk Maya and from a developer's perspective I like it a lot.
It's one remarkable piece of software. Over the years it just kept growing and getting better. Today it has a huge variety of features and amazing support for developing various new components for it.
I will start with the basics. Surprisingly for a program it has it's own dedicated scripting and programming language called Maya Embedded Language or MEL. In reality the entire application is just one interpreter that reads these MEL scripts to generate the user interface. As you have guessed by now, the entire user interface is written in MEL.
It looks a lot like php and it has some special functions called commands which interact with Maya. With these commands we can add new menus or even edit 3D objects inside it.
The partial script bellow is written by me to add a new menu entry with some new functionalities:
And bellow is the menu that it creates:
It even has a built-in editor for these scripts. Additionally if you don't like it you can choose to write these scripts in python too. It even has another editor for python scripts.
Another amazing thing about this software is how it handles the relationship between the data or how it shows and updates the data to the user. In this case the data is formed of complex 3D objects.
Nowadays there is a trend in user interface programming to use some sort of framework that listens for changes in the data and updates the user interface for you. This is exactly the same idea that Maya uses but it takes it to the next level. All the 3D objects and other types that are shown to the user have properties. These properties determine the shape, color and in general how the object looks.
The amazing thing is that we can establish dependencies between these properties. So for example when we change a property on an object, it will notify all the dependent entities that have another property linked to the changed property. These dependent entities can have other properties which can change. This can trigger a cascade of updates. These are actually like dependency properties in Windows Presentation Foundation.
All these dependencies make a graph, a directed acyclic graph which we can even partially visualize in Maya like bellow:
In UI frameworks, especially in javascript ones, we can establish dependencies on two layers, between the user interface and another object. Here we can have multiple layers, as many as we want. So most modern UI frameworks just implement a subset of the principle and functionality mentioned above.
In the end, Maya is built around this base skeleton of objects with dependencies, each of these object type having some specific functionality built inside, triggered when some properties are changed on it.
For all these objects that exist, there is a C++ API to edit them. There are various function sets which can be used in C++ to perform changes on objects. Not every object support a given function set. For example the most basic function set supported by almost every object is the MFnDependencyNode function set. It allows us to get and set properties of the object that it is attached to. Another function set is MFnTransform that can pe applied to objects that have a position in space.
We can even create new relationships and dependencies between various properties of objects from this API.
There are also custom built-in types for strings, files, networking and even threading.
Finally, if you don't want C++, you can use the Maya .Net API and code in C#. You can even create new windows or extend existing ones in Windows Presentation Foundation or Windows Forms.
The software engineers which developed this program integrated seamlessly several huge technologies. The base user interface is actually written in QT and OpenGL. On top of these they managed to integrate Windows Presentation Foundation and Windows Forms. They even added a python interpreter to access and alter data.
Finally the way you interact with it is amazing and makes a good case study for user interface and user interaction. Just defining the behavior of the operation that a user can do to edit some objects inside it requires a lot of work. The use cases and steps they involve must be huge.
Bellow you can see the pie menu near the top, a context menu in which items are displayed radially to make better use of space:
Some of those items in the menu can open up a new radial menu themselves. And so on.
Overall it's an amazing program both for a developer's and a 3D artist's perspectives.
It's one remarkable piece of software. Over the years it just kept growing and getting better. Today it has a huge variety of features and amazing support for developing various new components for it.
I will start with the basics. Surprisingly for a program it has it's own dedicated scripting and programming language called Maya Embedded Language or MEL. In reality the entire application is just one interpreter that reads these MEL scripts to generate the user interface. As you have guessed by now, the entire user interface is written in MEL.
It looks a lot like php and it has some special functions called commands which interact with Maya. With these commands we can add new menus or even edit 3D objects inside it.
The partial script bellow is written by me to add a new menu entry with some new functionalities:
And bellow is the menu that it creates:
It even has a built-in editor for these scripts. Additionally if you don't like it you can choose to write these scripts in python too. It even has another editor for python scripts.
Another amazing thing about this software is how it handles the relationship between the data or how it shows and updates the data to the user. In this case the data is formed of complex 3D objects.
Nowadays there is a trend in user interface programming to use some sort of framework that listens for changes in the data and updates the user interface for you. This is exactly the same idea that Maya uses but it takes it to the next level. All the 3D objects and other types that are shown to the user have properties. These properties determine the shape, color and in general how the object looks.
The amazing thing is that we can establish dependencies between these properties. So for example when we change a property on an object, it will notify all the dependent entities that have another property linked to the changed property. These dependent entities can have other properties which can change. This can trigger a cascade of updates. These are actually like dependency properties in Windows Presentation Foundation.
All these dependencies make a graph, a directed acyclic graph which we can even partially visualize in Maya like bellow:
In UI frameworks, especially in javascript ones, we can establish dependencies on two layers, between the user interface and another object. Here we can have multiple layers, as many as we want. So most modern UI frameworks just implement a subset of the principle and functionality mentioned above.
In the end, Maya is built around this base skeleton of objects with dependencies, each of these object type having some specific functionality built inside, triggered when some properties are changed on it.
For all these objects that exist, there is a C++ API to edit them. There are various function sets which can be used in C++ to perform changes on objects. Not every object support a given function set. For example the most basic function set supported by almost every object is the MFnDependencyNode function set. It allows us to get and set properties of the object that it is attached to. Another function set is MFnTransform that can pe applied to objects that have a position in space.
We can even create new relationships and dependencies between various properties of objects from this API.
There are also custom built-in types for strings, files, networking and even threading.
Finally, if you don't want C++, you can use the Maya .Net API and code in C#. You can even create new windows or extend existing ones in Windows Presentation Foundation or Windows Forms.
The software engineers which developed this program integrated seamlessly several huge technologies. The base user interface is actually written in QT and OpenGL. On top of these they managed to integrate Windows Presentation Foundation and Windows Forms. They even added a python interpreter to access and alter data.
Finally the way you interact with it is amazing and makes a good case study for user interface and user interaction. Just defining the behavior of the operation that a user can do to edit some objects inside it requires a lot of work. The use cases and steps they involve must be huge.
Bellow you can see the pie menu near the top, a context menu in which items are displayed radially to make better use of space:
Some of those items in the menu can open up a new radial menu themselves. And so on.
Overall it's an amazing program both for a developer's and a 3D artist's perspectives.
Comments
Post a Comment