Tuesday, September 1, 2015

Maya script for snapping vertices and aligning normals.

Hey everybody,

I would like to share with you a script for removing a seam between meshes. It closes gaps between meshes and aligns normals to make seam invisible. We use it in "Skyforge" for hiding a seam between the neck and the head of a character.


Wednesday, April 23, 2014

Project "SKYFORGE" Announcement

Hi, All
 Just want to share with you exciting news. The project, that I'm currently working on, recently has been announced. Take a look at the trailer.

 

Monday, December 2, 2013

Voxels part 2. MAYA .NET API and MFnMesh::allIntersections.

In part one we created a simple script, which generates voxels for a selected mesh object using
MFnMesh::allIntersections function. In this part we are going to write a VoxelGenerator node using Maya .NET API. Why node? Because we want to update our voxel on mesh changes. Actually I believe this node can be created using Maya python API, but i did it using C# in order to learn it, and check how usefull it is.

Let's define node attributes. Number and position of voxels depend on a grid density and a base object position in 3D space. So the input attributes should be: input - (short) "density", (kMesh) "inputGeometry", and output - (int) "voxelsNumber".

I use Microsoft Visual Studio 2013 and Autodesk Maya 2014. For easy start download and install Maya C# Wizards for Visual Studio. You can find it in Cyrille Fauvel blog. After the installation create a new maya plugin in the Visual Studio and let's begin!


Tuesday, November 5, 2013

Creating voxels in Maya, or how to work with MFnMesh::allIntersections. Part 1

Hello everyone,
I would like to share with you some interesting stuff.

Let's fill an object with voxels. In order to do it we need to determine if voxel point is inside the mesh. And it's true, if a ray started at this point in any direction, intersects mesh triangles and number of intersections are even.

Wednesday, May 29, 2013

MAYA: Snippet for curve knot vector.

In order to create curve by CVs we need to construct knot vector. It should have numberOfCVs + degree - 1 knot values. This small snippet takes number of CV and degree of the curve, and returns knot vector values as list. Maybe it will be useful for somebody.
def createKnotVectorString(cvNum, degree):
    """
    @param int cvNum: number of CVs in constructing curve.
    @param int degree: degree of constructing curve.
    @return list
    """
    if cvNum <= degree:
        print "warning, number of CVs can't be less than degree + 1"
        return None
    tailsSize = degree
    knotsNum = cvNum + degree - 1
    knotsArray = [0]*knotsNum
    for i in range(0, len(knotsArray)-degree+1):
        knotsArray[i + degree-1] = i
    tailValue = knotsArray[-tailsSize-1] + 1
    for i in range(1,tailsSize):
        knotsArray[-i] = tailValue
    return knotsArray

print  createKnotVectorString(4, 3)

Tuesday, March 19, 2013

Open MAYA API: Working with iterators (part 2)

As a part of tools for work with polygon hairs i created small script to select cap edges of poly stripes. The task was: create script which converts any selection (poly object, poly vertices, poly edges or poly faces) to edges which lie on the caps of poly stripes.


Wednesday, March 13, 2013

Open MAYA API: Working with iterators (part 1)

Iterators are special classes which have methods to  navigate through objects or components.
MItSelectionList- navigate through selected objects
MItDependencyNodes - navigate through all maya nodes. Especially useful to navigate through specific type of maya objects. For example to traverse all cameras, or lights, or meshes.
MItMeshPolygonMItMeshVertexMItMeshEdgeMItMeshFaceVertex to navigate through specific components of the poly object.