My second Maya Node

In this tutorial, you will create a Maya node more complex than in the topic "My first Maya node". You will go over the entire development of the node "SaveMayaFile".
(We advise you to do first the tutorial "My first Maya node").

 

 

To save a scene in Maya, we need to use the command "file()" that requires the saving path of the scene.

Display this plug in the node interface to allow the user to set the saving path of the scene.

Now add the command to the node script.

 

After a first execution, the scene with a locator is saved to the defined path.

However, it can be saved to any folder and thus to the public part of a project. It seems more interesting now to use the system offered by Kurtis, namely that of the working copy and the assets.


We will then change the node "SaveMayaFile", so we can create an asset from the file it saves.

 

In Kurtis, an asset creation is defined by 4 main parameters :

  1. A name
  2. A file path
  3. A publication method
  4. The number of versions to keep

 

An asset is defined in the Kurtis Database by a unique ID.

We already have the file path to create this asset. Next, create the other three parameters :

 

 

Now, integrate these plugs in the node interface.

 

Add these elements in its list.

 

 

Next, create an asset in the node script.

 

After the execution of the graph, the file is saved first in your working copy, securing the job of the user.

 

Currently, the asset cannot be published into the public project. You must retrieve the script data relative to the asset in order to transmit it to a node "Assets Out" .

 

Now, assign the asset to this plug in the script.

To finish, we need to check the most important input of the node.

 

Then write a docstring, a main comment, fill in the different properties, set the color and the icon of the node.