Skip to content

Instantly share code, notes, and snippets.

from maya import cmds
from maya import mel
import urllib2
import shutil
import zipfile
import os
from datetime import datetime
@gabosalinas
gabosalinas / Actor.java
Last active November 29, 2017 05:50
videoclub
package videoclub;
import java.util.ArrayList;
class Actor extends Persona{
ArrayList<String> generos = new ArrayList<>(); // generos en los que se desenvuelve mejor como actor.
int nivelActoral = 0; // Calidad/Talento promedio del actor en los generos que trabaja.
public Actor(String nombre, String apellido, int nivel) {
super(nombre, apellido, 0);
this.setNivelActoral(nivel);
@gabosalinas
gabosalinas / vtx2jnt.py
Created September 19, 2017 03:56
vertices to joints
import maya.cmds as cmds
def verts2jnts():
vertS = cmds.filterExpand(sm=31)
cmds.select(clear=1)
jnts=[]
for vert in vertS:
jntCreado = cmds.joint( n = (vert+'JNT') )
convVert = cmds.polyListComponentConversion( vert, toUV=True )
coorU = cmds.polyEditUV( convVert, query=True )[0]
@gabosalinas
gabosalinas / ZOT.py
Created September 19, 2017 03:46
ZTR,OFFSET,TRF
import maya.cmds as cmds
def extraControl(objs=[],nameSuf='ZTR' , nameOffset='OFS', nameTrf='TRF' , nameCNT='CNT' , rad = 14 ) :
for obj in objs:
print obj
if '|' in obj:
obj=obj.split('|')[-1]
if '_' in obj:
newName=obj.split(obj.split('_')[-1:][0])[0]
else:
newName=obj
@gabosalinas
gabosalinas / CopyAtts.py
Created September 19, 2017 03:35
CopyPasteAtts
#Copia atributos para pegarlos despues en otro/s objetos. Selecciona el transform del shape en el que estas interesado.
#It copies attributes for later pasting on other objects. Select the shape's transform you are interested in.
import maya.cmds as mc
s = mc.ls(sl=1)
if s:
sel = s[0]
if mc.nodeType( sel ) == 'transform' :
sel = mc.listRelatives(sel,s=1)[0]
atts=mc.listAttr(sel)
"""
24/8/2017
"""
import maya.cmds as mc
import pymel.core as pm
import string
@gabosalinas
gabosalinas / MoveTo.mel
Created September 19, 2017 03:01
MoveTo
doCreateParentConstraintArgList 1 { "0","0","0","0","0","0","0","1","","1" };
parentConstraint -weight 1;
parentConstraint -remove;