• Twitter
  • Vimeo
  • Linkedin
  • Flickr
  • Rss
  • Mail

  • About
    • Bio
    • Resume
  • Work
    • Portfolio
    • Moleskine
  • Blog

Tag Archive for: pymel

Technical Notes

September 26, 2011
26 Sep 2011

I recently started documenting technical issues that I encounter or things that I learn during my Maya scripting projects, and decided to share the notes with the public. I hope others will find it useful when troubleshooting. Click here to see the docs.

0 Comments/
Array Likes
/0 Tweets/in Technical

Curve Vectors Tool

September 16, 2011
16 Sep 2011

https://gist.github.com/1223185

This script finds a vector from a curve. I needed it for orienting a follice to the same direction as the curve’s base, which corresponds to the first two cvs. After writing it, I realized that using edit points (ep) or curve points (u) would give a more accurate direction. Good enough for now, but will rewrite it.

UPDATE: Turns out that I could just use the pymel function tangent to accomplish the same thing (i.e. finding the tangent at a given point on a curve). For example, to find the tangent at parameter 0, which is the start of the curve, execute curv.tangent(0)

0 Comments/
Array Likes
/0 Tweets/in Technical

Hair From Particle Paths

September 15, 2011
15 Sep 2011

I got hooked on my last script (see previous post) and decided to extend it by creating a hair system out of the particle paths. I’ll post the script when it’s working more smoothly, but here are a couple screencaps.

0 Comments/
Array Likes
/0 Tweets/in Technical

Curves From Particle Paths

September 3, 2011
03 Sep 2011

Wrote a little script today. It generates cv curves from the path of a particle object or individual particles. Click here to see the code and a demo.

0 Comments/
Array Likes
/0 Tweets/in Technical

Gitting With It

August 26, 2011
26 Aug 2011

Just learned about Github embedding with Gist. To celebrate the excitement, here are small pymel snippets you may find useful!

https://gist.github.com/1172536

0 Comments/
Array Likes
/0 Tweets/in Technical

Selecting Vertices Sharing Two Edges

April 8, 2011
08 Apr 2011

Here’s a Python snippet that selects vertices sharing only two edges (using maya.cmds as mc):

With the mesh object selected,

obj = mc.ls(sl=True)[0]
vertCount = mc.polyEvaluate(obj, v=True)
vertList = ['{0}.vtx[{1}]'.format(obj,vert) for vert in range(vertCount) if len(mc.polyInfo('{0}.vtx[{1}]'.format(obj,vert), ve=1)[0].split(':')[1].split()) == 2]
mc.select(vertList)

The if statement containing the polyInfo command does the filtering by counting the number of edges around the queried vertex. Unfortunately this returns a line of values in a string, so I had to split it a couple times to retrieve the edges count. For example, vertex 302 of ‘polySurface’ is shared by the edges 506, 489, 484, and 485:
 

mc.polyInfo('polySurface.vtx[302]', ve=1)[0]
# Result: u'VERTEX 302: 506 489 484 485 n' #

UPDATE: A vertex sharing two edges is called ‘winged’. Here’s another way to select winged vertices using PyMEL (as pm)…

obj = pm.ls(sl=True)[0]
vertList = [obj.verts[v] for v in range(len(obj.verts)) if len(obj.verts[v].connectedEdges()) == 2]
pm.select(vertList)

0 Comments/
Array Likes
/0 Tweets/in Technical

Tag Cloud

3D animation 3D scan 3D scanner after effects Amazon AWS animals animation augmented reality C++ character animation character design crafts data visualization dynamics Eclipse fur Git Java JavaScript jon brion Kinect lamarck Linux Maya modeling molecular mudbox origami particles photorealistic point cloud Processing programming pymel Python reel science shading stereoscopy thermal camera visual effects wip Xcode

Twitter Feed

Tweets by @Danvas

On Flickr

Reclining man. (Oil, 24x36 canvas)Demise (acrylic on canvas 24 x 18)
Demise concept sketchLife drawing 1-5min
TAP

Contact Info

d@nielvas.co

six zero four, six one six six four four five

Latest Tweets

  • Let the Waste begin. http://t.co/SP9fGFiNFi
  • This character animation tutorial is rather refreshing. http://t.co/v9RQ9xjMZh (via @pjkc) #3D
  • Secret: this is also how I feel when I have the elevator to myself. https://t.co/owRfVcvmR3

Blog Posts

  • Tuneline App February 10, 2014
  • Setting Up a Git Repository in Eclipse August 1, 2013
  • Scripting a Bloom June 1, 2013
  • Setting Up a Bullet Physics Project May 16, 2013

© Copyright - Hey Light | Portfolio of Daniel Vasquez – 3D Artist and Programmer - CSS by Kriesi
  • About
  • Work
  • Blog