Maya – Basic UV unwrapping

Software:
Maya 2018

Steps for basic UV unwrapping:

  1. Select all polygons.
  2. Apply planar UV projection just to get rid of all the current UV seams.
  3. Select the edges that that are intended to be UV seams.
  4. In the UV Editor menu choose Cut/Sew > Cut.
  5. Select all polygons.
  6. In the UV Editor menu choose Modify > Unfold.
  7. In the UV Editor menu choose Modify > Layout.
  8. Scale and rotate the UV layout to fit the UV space.

Related:
Multiple UV layouts

Maya – Using Multiple UV Sets

Software:
Maya 2018

Annotation 2019-12-26 232222

Note:
This post isn’t about “tiled UVs” (“UDIM”), it’s about multiple UV sets (layouts).

Explanation:
Polygon mesh models can have multiple UV sets. this becomes useful when the UV layout that is optimal for a certain texture isn’t efficient for different texture (in the same material).
For example, we might have a model of furniture, or clothing, in which the UV layout that is best for the fabric weave pattern, isn’t the best for dirt and wear & tear, or stickers.
In such cases we can define different UV sets for the model, each suitable for a different texture.

In this example, having a separate UV Set for the logo texture allows placing it without affecting the checker texture that is displayed an all the surfaces:uvsets

To create multiple UV sets:

  1. In the UV editor view, from the UV Sets menu, select UV Set Editor to open the UV Set Editor:
    Annotation 2019-12-26 234412.jpg
  2. In the UV Set Editor, press the New button to create a new UV Set and double click it in the list to rename it:
    Annotation 2019-12-26 234522
  3. Close the UV Sets Editor.
    The UV Editor view  now displays the new UV Set that is empty, and UV creation and editing operations will now affect the new UV Set.
  4. To switch to edit a different UV Set, select it from the list at the bottom of the UV Sets menu:
    Annotation 2019-12-26 235925

 

To link a texture to a specific UV Set:

  1. Make sure the texture is connected to the material set for the model.
  2. Select the model.
  3. Open Windows > Relationship Editors > UV Linking > Texture-Centric:
    Annotation 2019-12-27 000308.jpg
  4. Select the wanted texture from the material texture list on the left and select the wanted UV Set from the models UV Sets list on the right:
    Annotation 2019-12-27 000336

 

Related:
Basic UV Unwrapping

More posts about Maya

 

Getting Maya 3D Paint to work

Software:
Maya 2018

Steps needed for Maya 3D Paint to work:

  1. Set a project folder and save your scene.
    * If your painting into an existing texture you can skip this step.
  2. Make sure your model has UV coordinates.
  3. Make sure your model has a basic Lambert material.
    * If you’re using a different material/shader on your model,
    Temporarily switch to Lambert just for the texture painting operation,
    And connect the original shader with the painted texture map to the surface shader input of the shading group after you’re done painting.
  4. In the Rendering tab toolbar, Double-Click the 3D Paint tool button to activate 3D Paint and also open its tool settings window.
  5. Make sure the object is selected.
  6. In the 3D Paint Settings window, go to the File Textures part,
    Choose a material attribute to paint to.
    * this would usually be Color because we are using Lambert temporarily anyway.
  7. Click Assign/Edit Textures to open the Assign/Edit Textures dialog,
    Choose a resolution and a file format for the new texture,
    And than click Assign/Edit Textures button at the bottom of the Assign/Edit Textures dialog to create the new texture and close the dialog.
    * If you already connected an existing texture file to the Lambert shader’s Color input you can skip this step.
  8. Check Update on stroke and Save texture on stroke.
  9. Set the viewport to Textured display mode.
  10. Set paint brush settings.
  11. Click the 3D Paint tool button to activate it and paint on the model surface.

Untitled-1

Maya – Setting the V-Ray Sun direction according to location, date and time

Software:
Maya 2018 | V-Ray 3.6

To set the VRaySun photometric light source diretion according to the location in the world, the date and the time:

  1. Select the VRaySun parent node – ‘VRayGeoSun1Transform‘ and rotate it so its Z axis points to the architectural plan’s south.
  2. Select the VRaySun node – ‘VRayGeoSun1‘ and in its attributes un-check Manual Position.
    This will make the location / date / time parameters accessible.
  3. Set the GMT zone of you architectural project’s location in the world, the Date and time.
    * haven’t found how to set daylight saving time….

Untitled-1

Related:
V-Ray for Maya Physical Camera
V-Ray for Maya White Balance
Daylight system addon for Blender

Maya Python scripting – Getting an object’s transform matrix relative to another object’s coordinates

Software:
Maya 2018

How to get an object transformation matrix relative to another object’s coordinates:
* The following script requires selecting 2 objects, the function will return the transform matrix of the first object relative to the transform matrix of the second.

from maya.api.OpenMaya import MVector, MMatrix, MPoint
import maya.cmds as cmds

def get_relative_transform (node,coordinate_space_node):
    node_matrix = MMatrix(cmds.xform(node, q=True, matrix=True, ws=True))
    parent_matrix = MMatrix(cmds.xform(coordinate_space_node, q=True, matrix=True, ws=True))
    return (node_matrix * parent_matrix.inverse())

node_a = (cmds.ls(sl=1,sn=True))[0]
node_b = (cmds.ls(sl=1,sn=True))[1]

print (get_relative_transform(node_a,node_b))

Untitled-1

V-Ray for Maya with XGen

Software:
Maya 2018 | V-Ray 3.6

The technical steps needed to render XGen hair with V-Ray and a VRayHair3Mtl in Maya:

  1. in the Plugin Manager,
    Make sure the xgenvray.py plugin is loaded.
    * Needless to say vrayformaya.mll must be loaded too.
  2. Set a Project Folder and save the scene.
  3. In Render Settings, set the Renderer to V-Ray.
  4. Select an object or mesh elements and create an XGen Description.
    * This can be done by clicking the Create New Description button in the XGen tab or XGen Window.
  5. In the XGen Output Settings set the Operation to Render and the Renderer to V-Ray.
  6. Edit / Design / Groom your hair.
  7. In the XGen window, Choose File > Export Collections or Descriptions,
    And export the hair Collection and Description.
  8. in the XGen window, Choose File > Export Patches for Batch Render,
    To export the hair cache abc (alembic) file.
  9. In the Hypershade, create a VRayHair3Mtl shader.
  10. In the Outliner, select the XGen Description.
  11. In the Hypershade Browser window,
    RMB click the VRayHair3Mtl and choose Assign Material To Selection.
  12. Make sure there is a light source, and render the scene.

 

Related:
V-Ray for Maya and nHair

Untitled-1

Untitled-1.01

Untitled-1.1.1.jpg

Untitled-2

Untitled-3

Untitled-3.1.jpg

Untitled-4

Arnold for Maya refractive caustics

Software:
Maya 2018 | Arnold 5

An account of the drastic measures that need to be taken in order to ‘persuade’ Arnold for Maya to render refractive caustics.

  1. In the refractive object’s shape attributes,
    Under ‘Arnold’, ‘Opaque’ must remain checked.
    * This is unintuitive but when refractive caustics are calculated there is no need for transparent shadows. the caustics pattern is in fact the light refracting through the object.
  2. The refractive object’s aiStandardSurface shader must have it’s Transmission layer active.
    For a colored refractive object, Transmission Weight should be 1.0,
    A color should be selected, and the density of the color should be controlled with the Depth attribute (higher values make the color less dens).
    In the shader’s advance attributes, check ‘Caustics’.
    In the shader’s Specular layer, set the IOR to match your material.
    * The default of 1.52 is the IOR for glass, and water would be IOR 1.33 for example.
  3. For refractive caustics to be rendered, the light source must be an Arnold Mesh Light,
    And in its shape attributes, under Light Attributes ‘Light Visible’ must be checked.
  4. In many cases, in order for the caustics pattern’s intensity to be correct,
    The ‘Indirect Clamp Value’ must be raised in Render Settings > Arnold Renderer, under Clamping.
  5. In some cases the Transmission value under Ray Depth in Render Settings > Arnold Renderer must be increased for the caustics to render properly.
    * Light simulation must be able refract through all the relevant surfaces.
  6. To increase the caustics render quality, the number of Diffuse samples must be raised in Render Settings > Arnold Renderer.
    * This may be unintuitive, but the caustics pattern is actually part of the Diffuse rendering of the surface upon which the caustics are appearing.

That’s it!
Hope you find this useful 🙂

Arnold_Coustics_AArnold_Coustics_BArnold_Coustics_C

Related:
>
Understanding Transparency Render Settings
>
Arnold Translucency
> Arnold Transmission Scattering

 

Maya Python scripting – Getting an Object’s world-space transform matrix

Software:
Maya 2018

How to get an object transformation matrix in world space coordinates:

from maya.api.OpenMaya import MVector, MMatrix, MPoint
import maya.cmds as cmds

def get_world_transform (obj):
 return MMatrix ( cmds.xform( obj, q=True, matrix=True, ws=True ) )

selected_object = (cmds.ls(sl=1,sn=True))[0]

print ( get_world_transform( selected_object ) )

Capture

Basic animation constraints in Maya

Software:
Maya 2018

To setup basic animation constraints in Maya:

  1. Select one or more target objects, and lastly the object to be constrained.
  2. In the Rigging Tab/Toolbar click the wanted constraint.
  3. Optional:
    In the channel box, highlight the constraint and set target objects weights.

Setting up a Point Constraint:

Maya_Point_Constraint

Setting up an Orientation Constraint:

Maya_Orientation_Constraint.gif

Setting up an Aim Constraint:

Maya_Aim_Constraint.gif