martedì 22 luglio 2014

openMaya: closestPointsOnMeshes

Hello everyone! news! I share a node of maya that i made recently. This node helped me to make a system that inspire the node "closestPointOnMesh". This node can calculate the closest points between two meshes. The node takes two meshes and a maximum constant of iteration, returns the outputs: two points closer to the mesh used. Greater is the constant maximum iteration greater the accuracy, but heavier the calculation. Hope the video explains better! Soon the code.

domenica 23 marzo 2014

pymel: FK Chain from Joints Hierarchy


This is a procedure written in Pymel.
It helps to create a system FK selecting the root joint. All controls are aligned along the X axis of the joints.

The process uses a recursive algorithm. The function hierarchy(), in fact, calls itself and can give information about the joint hierarchy.
It works on any type of joint hierarchy.

import pymel.core as pm

def hierarchy( root, parent ):
    for joint in root:
        child = joint.getChildren( type = "joint" )
        if child != []:
            anchor, ctrl = createCircleOnJoint( joint )
            pm.parentConstraint( ctrl, joint, mo = 1 )
            if parent != "":
                pm.parentConstraint( parent, anchor, mo = 1 )
            hierarchy( child, ctrl )
def createCircleOnJoint( joint ):
    circle = nr = (1,0,0) )[0]
    offset = circle, n = "GRP_offset_%s"%circle )
    anchor = offset, n = "GRP_anchor_%s"%circle )
    constraint = pm.parentConstraint( joint, anchor, mo = 0 )
    pm.delete( constraint )
    return anchor, circle
def makeFK():      
    joints = selection = 1, type = "joint" )
    hierarchy( joints, "" )
# RUN makeFK() on selected Joint

martedì 19 novembre 2013

pymel: Rename deformer set

This script allows you to rename the names of the deformer set in relationship editor. The set takes the name of the node deformation linked. In this way, the list is more readable and clean. Bye!
def renameDeformerSet():
    nodes = type = ( "blendShape", "cluster", "wrap", "ffd", "softMod", "nonLinear", "sculpt", "wire", "jiggle" ) )
    for node in nodes:
        set = node.outputs( type = "objectSet")[0]
        set.rename( node.type() + "_" + )

domenica 17 novembre 2013

pymel: ecBlendshape

After all this time I'm back with a little work. Hi!

This script comes in handy when we work with the blendshapes. Sometimes it can happen that we no longer have the shape but only the blendshape node ( it happens when the save file must be small ).

With the extract function, you can extract all the shapes with their in-between shapes. The script will automatically put inside in a group and the names of the shapes will be the same attribute name they have in the blendshape node. The names of the inbetween shapes will be, for example, jawOpen_inb25, jawOpen_inb50, jawOpen_inb85 ( value 0.25, 0.50, 0.85 ).  

With the button "Connect", we can reconnect the blendshapes to the old base mesh. We may add, modify or correct the mesh inside the group.

thanks to Leonardo Viti modeler

martedì 27 agosto 2013

Maya: thunderNode v1.1 (download link)

Updates v1.1
Added and fixed some controls.

Distance: The lightning appears if the two locators are at a minimum distance to the entered value. The thunder always appears if the value is to 0.0.

Seed: Animating this value will generate different lightning.

Offset: Another movement direction of points.

Download link for Maya 2013.

Run thunderNodeCmd in script editor (mel).

Windows 7 (.mll):

Osx (.bundle):

Let me know if it works!

martedì 13 agosto 2013

Maya: thunderNode v1.0

Hi! this is a preview of my new job, its a beta yet. It is an algorithm that can generate a lightning in Maya. The calculation is not completely random but controlled by specific parameters. I show you a 
small graphic that figure out how parameters works.

Soon mll to download.


venerdì 9 agosto 2013

Maya: Oriented Matrix

Hi guys! This is my first post!

Here I show you a simple node that uses an algorithm to calculate the transformation matrix aligned to two locator. The node has a couple inputs data: the locators position, and one output data: the matrix that can be applied to any transform node. In this example, i connected a node in maya decomposeMatrix to verify that the calculation in the node was right.