Showing posts with label maya. Show all posts
Showing posts with label maya. Show all posts

Wednesday, September 5, 2018

Get distance between two points

Question was simple. Get the world position of any item in space throughout the entire timeline, then compare each point to get the frame-by-frame traveled distance.

With pymel, first get the item:

import pymel.all as pm
item = pm.selected()[0]

Get the frame range and turn off cycle check:

start_time = pm.playbackOptions(q=1,animationStartTime=1)
end_time = pm.playbackOptions(q=1,animationEndTime=1)
anim_range = range(int(start_time),int(end_time))
pm.cycleCheck(evaluation = 0)

Then, get its worldMatrix at every frame:

item_values = [pm.getAttr(item.worldMatrix,time=t)[-1][:-1] for t in anim_range]

To figure out the difference between frames, I didn't know how to do, so after some searching, this post had the most concise result:

https://stackoverflow.com/questions/1401712/how-can-the-euclidean-distance-be-calculated-with-numpy

And finally, the code needed to get the differences

per_frame_change = []
for i in range(len(item_values)-1):
    per_frame_change.append(numpy.linalg.norm(item_values[i] - item_values[i-1]))


Here's the whole code!

import pymel.all as pm
import numpy
start_time = pm.playbackOptions(q=1,animationStartTime=1)
end_time = pm.playbackOptions(q=1,animationEndTime=1)
anim_range = range(int(start_time),int(end_time))
pm.cycleCheck(evaluation = 0)

item = pm.selected()[0]
item_values = [pm.getAttr(item.worldMatrix,time=t)[-1][:-1] for t in anim_range]

per_frame_change = []
for i in range(len(item_values)-1):
    per_frame_change.append(numpy.linalg.norm(item_values[i] - item_values[i-1]))

Tuesday, November 19, 2013

MatchMoving!!

I've been researching a few techniques to fix my latest render file, so I've resorted to simply re-doing the MatchMoving (the technique to match the camera to a cg environment).  I'm hoping that this helps me with my scene!

This is the tutorial that I found:

I'll upload my findings later :)

Sunday, June 5, 2011

New Reel!

So, ladies and gents, here's my brand new Demo Reel! It's only 2 shots, but I feel they are nice enough to post on my site as finals. Enjoy! :)

Latest Performance Animation Reel from Isai Calderon on Vimeo.

Here's my latest performance animation Reel!

*All rigs provided by Animation Mentor. All animation done by me!

Sunday, April 18, 2010

Class 3 - Session 3 - Amateur Stewie!


Amateur Stewie from Isai Calderon on Vimeo.
Sorry I haven't posted anything lately :( Work has me extremely busy, so Blog maintenance has gone down quite a bit.



Here's my newest video. Amateur Stewie! Blocking-Plus stage!

Wednesday, August 12, 2009

Maya Update: First Animation

So, we started the animation part of the Maya Springboard program. I had fun animating this first animation for, well, AnimationMentor. But first, an update on my last scene. I think it came out ok :) What do you think?





Monday, August 3, 2009

Maya, here we come!

So, I recently began the Maya Springboard Program; a.k.a. massive Maya learning experience. Here's the resulting product of 1 week of work in Maya. First, I made the character (no joints, bones, or anything technical) out of pure geometry, and I think it came out ok for someone that doesn't do a lot of modeling.

Then came the Scene. Here's some screenshots. I'll be adding a few more things to it every day I learn something new.