Now that animation has wrapped at Reel FX on both Open Season 3 and the three Wile E / Roadrunner shorts, I'm back to updating the animation tools. While I was able to do a little development during production, it's tough making big changes for various reasons. With things flowing a bit slower now, it's nice to finally have the time to tackle some long-overdue to-do items.
One particular programming puzzle piece that I've been half dreading, half eagerly-anticipating is Qt. For those not in the know, Qt is (in the words of its current developer, Nokia) "a cross-platform application and UI framework." With the popular PyQt module that provides an interface to this framework for Python users, its use in the development of tools and interfaces for CG software has grown immensely, just as Python's use has grown in the same field.
The TD team at Reel FX has been steadily pushing farther into Qt development over the past several months, but production demands pretty much kept me from taking a serious look at it until last week. After just a few days of play, though, I'm already a fan/convert/addict. Just as Python is so much more versatile than MEL, Qt's UI tools are WAY more versatile than the UI tools provided by Maya. My mind is reeling with so many ideas of how we can significantly upgrade our animation tools to take advantage of the versatility provided by the Qt toolkit. While I'm far from an expert at it after only a few days, I've managed to conduct several successful tests of greatly enhanced functionality for our character GUI system, and can't wait to overhaul the whole thing and put the new pieces in place.
The only hitch is that getting Maya set up to use the Qt framework takes a bit of work, at least if you're using Maya 2009 (which we still are for some recent projects). While the folks at work have taken care of that already, and we are already using Qt for a greater number of internal Maya tools, we have several tools that are also used by remote animators who are hired to help us with various projects. By relying only upon the toolset within Maya up until now, we've been able to minimize the setup hassle for remote artists. If we suddenly ask folks to also go through the necessary steps to get Maya and Qt talking, we'll likely run into some problems, and that kind of remote support is something that we're just not prepared to handle.
This means that until production switches to using the later versions of Maya that have built-in Qt support, it's going to be difficult to justify spending much time on the tools that are used by both internal and external animators, which is just a tad frustrating. However, there are plenty of internal-only things that can be upgraded, which will give me time to become more familiar with Qt's idiosyncrasies.
On a somewhat-related note, I've taken on yet another side job. This one's more informal, though, but it also involves Python. One of my friends owns a dent-repair business, and he approached me a few weeks ago asking for help with something that will perform a bunch of calculations and track certain information related to the jobs done by him and his team members. Originally he wanted to do everything in a spreadsheet, and in our initial meeting we came up with something that worked fairly well after a couple hours. However, as my friend came up with additional features that he wanted for this system, it quickly became apparent that while it's certainly possible to do the whole thing via spreadsheets, in the long run it would be too much of a headache. I've been wanting to try my hand at standalone development for a while, and this looked like the perfect opportunity. To keep deployment simple, I plan on using Tkinter for the program interface, and will pack the whole thing up using py2exe. While I've only put a few hours into it so far, my experience with Python development at work is helping immensely. I could not imagine tackling something like this in my early Python programming days.
I hope to put out some more posts in the coming days/weeks with some further Python programming thoughts, but only time will tell if it actually happens.
Monday, August 16, 2010
The latest goings-(Pyth)on
Thursday, July 22, 2010
Looney, you say?
Jerry over at Cartoon Brew just posted his thoughts about the new 3D CG short films featuring Wile E. Coyote and Roadrunner, the first of which can be seen in front of Cats and Dogs 2 beginning next week. The article features a few stills plus a 25-second clip from the first short. It's a real cliff-....er.....bridge-hanger. ;)
Tuesday, July 13, 2010
Anniversaries
I don't often think about this, but summer is a celebration of two industry anniversaries for me. One in late June marks my entrance into the Reel FX family, while the other in mid-May marks my entrance into the animation industry. This year the counts are:
6 years at Reel FX
9 years overall
What brought this to mind was the realization that next year will bring the overall count into double digits. I realize that there are plenty of people who have been in the biz far longer than that, but consdidering (all together now) "these tough economic times" (*ahem*), I'm pleased as punch that I've managed to last this long. It's been quite an interesting ride, and I'm sure there are plenty of new thrills and spills (hopefully fewer of the latter than the former) on the road/track ahead.
I'll save the big gushy post for next year. For now, I'll just offer a brief but heartfelt thanks to God for allowing this all to happen, and to all those who I've had the pleasure of meeting along the way for making the journey interesting.
6 years at Reel FX
9 years overall
What brought this to mind was the realization that next year will bring the overall count into double digits. I realize that there are plenty of people who have been in the biz far longer than that, but consdidering (all together now) "these tough economic times" (*ahem*), I'm pleased as punch that I've managed to last this long. It's been quite an interesting ride, and I'm sure there are plenty of new thrills and spills (hopefully fewer of the latter than the former) on the road/track ahead.
I'll save the big gushy post for next year. For now, I'll just offer a brief but heartfelt thanks to God for allowing this all to happen, and to all those who I've had the pleasure of meeting along the way for making the journey interesting.
Thursday, May 20, 2010
Sorry, friends...
The last post had to be temporarily removed due to certain restrictions of which I was unaware. Kinda sad when lots of people know you did something, but you can't say it yourself. What a crazy world.
Thursday, March 04, 2010
FWIW
If you don't know what "FWIW" means, you're probably not alone. At least one of the animators at Reel FX didn't know what it meant until yesterday. I used that acronym (which, BTW, means "For what it's worth") in a reply to a post he'd sent to the animation crew, and he responded with a puzzled look....well, a puzzled-looking email. After I explained it, one of the other guys chimed in with, "OTWTM IWLT" (later translating it into "Oh that's what that means. I was lost, too"). That, in turn, spawned numerous other comedic replies.
The last reply in the thread used selected letters from the original guy's name as a fake acronym, and that was the spark that led me to create the list below. It contains the name of every animator (and one non-animator) at Reel FX, but the names are all printed "long-form", as if the name were actually an acronym for something else. As you can see, I had way too much fun (and probably took more time than I should have) trying to figure out what that "something else" could be for each one. In most cases, I wasn't aiming for anything specific, though a few passages do contain items relating to actual qualities/traits about the associated individual.
While I figured everyone would get a kick out of the list, I wasn't prepared for the replies from the group. Almost immediately, people started replying in the same pseudo-acronym "code", taking their real message and expanding it out to a bunch of nonsense words and phrases. The exchange was so funny (IMO) that I asked for permission from the group to share their replies here as well. You find them below the main list. The scary thing is that some of them actually make sense outside of their fake acronym-ity.
Enjoy!
The last reply in the thread used selected letters from the original guy's name as a fake acronym, and that was the spark that led me to create the list below. It contains the name of every animator (and one non-animator) at Reel FX, but the names are all printed "long-form", as if the name were actually an acronym for something else. As you can see, I had way too much fun (and probably took more time than I should have) trying to figure out what that "something else" could be for each one. In most cases, I wasn't aiming for anything specific, though a few passages do contain items relating to actual qualities/traits about the associated individual.
While I figured everyone would get a kick out of the list, I wasn't prepared for the replies from the group. Almost immediately, people started replying in the same pseudo-acronym "code", taking their real message and expanding it out to a bunch of nonsense words and phrases. The exchange was so funny (IMO) that I asked for permission from the group to share their replies here as well. You find them below the main list. The scary thing is that some of them actually make sense outside of their fake acronym-ity.
Enjoy!
---------------------
David almost veered into dedicated luchadors, inflating Steve's big ego.
Kent enjoys new tomatoes, and leaves fifteen rabbits eating dessert.
Randy accidentally nudged Doug, yet handily applied yams evenly spaced.
Joe oversaw every jump, only hitting Nelson six times over nothing.
Justin upset Steve's tray, inverting nine bottles and royally ruining Ernesto's tea time.
Ray acquired yonder cheese? Huzzah! Always so excellent.
Bryan rode yaks, and nearly exceeded Nelson's greatest ride. Almost, man.
Ken's egrets never hike up long inclines near goats.
Ernesto races Nigerian elk, skillfully taking over better opportunities to teach gerbils English. Really!
Doug ousted underpaid garment labelers after sprinting liberally in Texan ostrich skins
Monica owns no ice cream, although avocados sometimes tempt one nibble.
Ben: excellent ninja, jumping all mountains instantly. No, really! Obviously superior athletic limbs easily scale.
Trevor recovers emeralds, vanquishing outrageous rhinos, yammering ocelots, unbelievably nefarious giraffes.
John obviously has nifty beats, excellent rapping rhymes, yo.
Steve takes elephants Venetian eggplant nuggets in chocolate hollow orbs, like so.
Michael intercepts camouflaged hairpieces, and even liberates hidden oranges lurking languidly amid nectarines during evening rituals.
Tim is mysterious, like a nondescript nugget of nougat
Abraham breaks reclusive armchairs, hammering at manifold armoires. "Give up! I like applied radiology!"
Sean, earnestly anticipating new encounters, recently made effervescent yogurt
Eric rips into chocolate deposits ravenously, overtly bypassing internal lemon essence
Dave avoids vicious emus, vivaciously applying liberal linguistics on next email
Tom overcooks meringue dishes and neatly engineers neckties.
Josh? Oh, snap! He creates awesomely rigged eyes. Yeah!
Nelson elevates limp sombreros over nineteen blazing rings on Wednesday nights.
Kent enjoys new tomatoes, and leaves fifteen rabbits eating dessert.
Randy accidentally nudged Doug, yet handily applied yams evenly spaced.
Joe oversaw every jump, only hitting Nelson six times over nothing.
Justin upset Steve's tray, inverting nine bottles and royally ruining Ernesto's tea time.
Ray acquired yonder cheese? Huzzah! Always so excellent.
Bryan rode yaks, and nearly exceeded Nelson's greatest ride. Almost, man.
Ken's egrets never hike up long inclines near goats.
Ernesto races Nigerian elk, skillfully taking over better opportunities to teach gerbils English. Really!
Doug ousted underpaid garment labelers after sprinting liberally in Texan ostrich skins
Monica owns no ice cream, although avocados sometimes tempt one nibble.
Ben: excellent ninja, jumping all mountains instantly. No, really! Obviously superior athletic limbs easily scale.
Trevor recovers emeralds, vanquishing outrageous rhinos, yammering ocelots, unbelievably nefarious giraffes.
John obviously has nifty beats, excellent rapping rhymes, yo.
Steve takes elephants Venetian eggplant nuggets in chocolate hollow orbs, like so.
Michael intercepts camouflaged hairpieces, and even liberates hidden oranges lurking languidly amid nectarines during evening rituals.
Tim is mysterious, like a nondescript nugget of nougat
Abraham breaks reclusive armchairs, hammering at manifold armoires. "Give up! I like applied radiology!"
Sean, earnestly anticipating new encounters, recently made effervescent yogurt
Eric rips into chocolate deposits ravenously, overtly bypassing internal lemon essence
Dave avoids vicious emus, vivaciously applying liberal linguistics on next email
Tom overcooks meringue dishes and neatly engineers neckties.
Josh? Oh, snap! He creates awesomely rigged eyes. Yeah!
Nelson elevates limp sombreros over nineteen blazing rings on Wednesday nights.
---------------------
Responses
Why are Steve and Nelson listed so frequently?
Pure randomness. If someone's name came to mind at a certain point, and it fit the flow of the text, I used it.Why are Steve and Nelson listed so frequently?
- Kent
- Me
So he understands the underlying problems, knowingly entertaining nobody today
- John
Has anyone had a half a** hamburger accident?
- Joe
Like old Lenny?
- John
Now I can eat
- Joe
Winning eliminates lame losers. People like all your excessive domination!
- David
You offer umbrellas and rain, even jokingly uttering sad thoughts... John empties angry lotus orbs under sweet juice oak humming nests.
- Kent
Is life in Kentuky exciting, capsules ate kewl envelopes
- Ray
pickle grandma rain yelling monkey September ninja brick pee pee whisper happy.
- Joe
Really answering Nelson's doorknock, you see that interesting neighbor Kent's sexiness.
- Kent
On hibiscus nibs, oranges wallow happily after tipsy housewives applied vivid eggplants in domes over next event
- Me
Y’all obviously underestimate all literary levity. How are varied enigmas written, and you’re totally overlooking obvious mastery? Unlike childish happenstance from really elementary efforts, this iteration marks expertise.
- Tim
Tony is missing wonderfully insane nonsensical stuff!
- David
Time I met your old ugly retarded obnoxious codger kid. Jackson unbelieving sucker thought Whitaker had a tight isolated white anger soon. Tenaciously heightening its noodley kind in near grossness.
- Randy
- Joe
Like old Lenny?
- John
Now I can eat
- Joe
Winning eliminates lame losers. People like all your excessive domination!
- David
You offer umbrellas and rain, even jokingly uttering sad thoughts... John empties angry lotus orbs under sweet juice oak humming nests.
- Kent
Is life in Kentuky exciting, capsules ate kewl envelopes
- Ray
pickle grandma rain yelling monkey September ninja brick pee pee whisper happy.
- Joe
Really answering Nelson's doorknock, you see that interesting neighbor Kent's sexiness.
- Kent
On hibiscus nibs, oranges wallow happily after tipsy housewives applied vivid eggplants in domes over next event
- Me
Y’all obviously underestimate all literary levity. How are varied enigmas written, and you’re totally overlooking obvious mastery? Unlike childish happenstance from really elementary efforts, this iteration marks expertise.
- Tim
Tony is missing wonderfully insane nonsensical stuff!
- David
Time I met your old ugly retarded obnoxious codger kid. Jackson unbelieving sucker thought Whitaker had a tight isolated white anger soon. Tenaciously heightening its noodley kind in near grossness.
- Randy
Monday, July 13, 2009
Animate a Face SOLD OUT!
The last copy of my Animate a Face CD set has been sold! I won't get a chance to update my site until later tonight, so if you know someone who's about to place an order, please pass along the news.
Even though the first-run CDs are gone, I still have a set for my own use, and am still keeping an eye out for alternate avenues of distribution. One distribution firm I was considering apparently doesn't have a system in place to sell multi-disc products. I haven't looked at the contents in a while, but there may be a way to compress it down to a single disc. Electronic distribution is an option that some have suggested, and I'd like to explore that if possible. Leads to appropriate distribution solutions are most welcome!
I'm very grateful to everyone who has taken a chance with my little tutorial product, and hope that it's been helpful in your animation efforts.
Even though the first-run CDs are gone, I still have a set for my own use, and am still keeping an eye out for alternate avenues of distribution. One distribution firm I was considering apparently doesn't have a system in place to sell multi-disc products. I haven't looked at the contents in a while, but there may be a way to compress it down to a single disc. Electronic distribution is an option that some have suggested, and I'd like to explore that if possible. Leads to appropriate distribution solutions are most welcome!
I'm very grateful to everyone who has taken a chance with my little tutorial product, and hope that it's been helpful in your animation efforts.
Monday, June 29, 2009
Two Webosaurs vignettes online!
We've been producing a number of short 15-second vignettes for Webosaurs, and the first couple have been released into the wild!
What I love about these pieces (not just these two, but the whole series) is that the animators at Reel FX were given a huge amount of ownership over their work. The team was given the task of creating mini-stories that could tie in with certain parts of the Webosaurs world. The group split into pairs, and each twosome developed a script, boarded and pitched it, directed the voice talent (Justin Harder and myself), animated the shots, and even offered direction on the background designs. It's been a huge collaborative effort, and the end result in each case is something that's part story, part ad, and all fun.
(Edit: word has it the crew here is going to update the clips so the ends don't get truncated by good ol' YouTube. They're a tad short in their current form.)
(Edit edit: fixed links to embedded videos, fixed size)
What I love about these pieces (not just these two, but the whole series) is that the animators at Reel FX were given a huge amount of ownership over their work. The team was given the task of creating mini-stories that could tie in with certain parts of the Webosaurs world. The group split into pairs, and each twosome developed a script, boarded and pitched it, directed the voice talent (Justin Harder and myself), animated the shots, and even offered direction on the background designs. It's been a huge collaborative effort, and the end result in each case is something that's part story, part ad, and all fun.
(Edit: word has it the crew here is going to update the clips so the ends don't get truncated by good ol' YouTube. They're a tad short in their current form.)
(Edit edit: fixed links to embedded videos, fixed size)
Wednesday, May 13, 2009
Kicking off voiceover site
I'm finally kicking off a separate voiceover web site:
www.justinbvocal.com
Just a temp splash page for now, but the blog portion of the site is alive and kicking. Voiceover-related posts from this blog will gradually move over there. Many thanks to Grant Goodwin for help with the logo design.
www.justinbvocal.com
Just a temp splash page for now, but the blog portion of the site is alive and kicking. Voiceover-related posts from this blog will gradually move over there. Many thanks to Grant Goodwin for help with the logo design.
Thursday, April 30, 2009
Short Story: The Cobweb
A little over a month ago, I took a day off to just relax and unwind. Somewhere in the middle of the day, the voiceover bug jumped up and bit me, and before I knew it I was perusing the available projects in the Librivox forum in search of something short to record.
It wasn't long before I located a thread for a collaborative production of Beasts and Super-Beasts. I'd been searching for material to use as practice for narrative voiceover work, and one of the unclaimed short stories in this collection caught my attention. After receiving word from the project coordinator that I could claim the requested story, I dove in. An hour later I uploaded the finished piece, which I present for your listening pleasure:
There are things that I could have done better, but all in all, I'm very happy with how it turned out. I hope you enjoy it!
It wasn't long before I located a thread for a collaborative production of Beasts and Super-Beasts. I'd been searching for material to use as practice for narrative voiceover work, and one of the unclaimed short stories in this collection caught my attention. After receiving word from the project coordinator that I could claim the requested story, I dove in. An hour later I uploaded the finished piece, which I present for your listening pleasure:
There are things that I could have done better, but all in all, I'm very happy with how it turned out. I hope you enjoy it!
Monday, April 06, 2009
Twitter me this...
I've semi-recently become a Twitter semi-junkie. As part of this semi-new-found addiction, I've added a Twitter gadget to the blog sidebar. Happy to hook up with other animators, developers, etc. However, be warned: I do weed my follower list from time to time, blocking users who (for lack of a better phrase) creep me out. If your creep quotient is low, you'll likely stay. :)
Wednesday, April 01, 2009
Totally awesome!
ThinkGeek always comes out with the best products. Especially at this time of year. :)
Sunday, March 29, 2009
Monsters vs. Aliens vs. Apathy
There are a only a handful of animated films that I have intentionally avoided for one reason or another. In some cases, the animation style was just too off-putting. In others, it was the apparent quality of the film as a whole that turned me off.
In the case of Monsters vs. Aliens, however, I simply didn't care. Not about the plot, and not about the characters. While I got a few minor chuckles when I watched the early trailers, nothing in them raised my interest to the point where I felt myself saying, "I have to see this!" In fact, the film was so far off my radar that I frequently found myself saying, "Oh yeah...I forgot that was coming out," when friends would ask about it.
And that's another thing: almost nobody in my animation circle was talking about it. It wasn't a hot topic like many past films had been, so those moments were friends would ask about the film were few and far between. Hence the forgetting.
Anyone else feel the same way? Chime in! Anyone see it? If so, what are your thoughts?
In the case of Monsters vs. Aliens, however, I simply didn't care. Not about the plot, and not about the characters. While I got a few minor chuckles when I watched the early trailers, nothing in them raised my interest to the point where I felt myself saying, "I have to see this!" In fact, the film was so far off my radar that I frequently found myself saying, "Oh yeah...I forgot that was coming out," when friends would ask about it.
And that's another thing: almost nobody in my animation circle was talking about it. It wasn't a hot topic like many past films had been, so those moments were friends would ask about the film were few and far between. Hence the forgetting.
Anyone else feel the same way? Chime in! Anyone see it? If so, what are your thoughts?
Friday, March 27, 2009
tweenMachine 2.03
tweenMachine 2.03 is published. It fixes a problem that has prevented Maya versions in the 200X series from using the special tick color feature. If you run into any issues, drop a note here (still haven't got the contact page on my site updated yet).
Thursday, March 26, 2009
Booleans, ternary operators, and max
I ran into a situation today that initially stumped me. I needed to take a list of unknown size, check each item in the list to see if it could be found in a line of text, and return a single
Originally I'd hacked together a short four or five line function that did the job. However, after coming back to the code for some other updates, I noticed that said function was only being called once, so I began looking for ways to nix that function and do the job more directly. Part of the challenge was that this comparison I needed to do was part of an existing
The first thing I tried to figure out was a way to get a single
Getting the necessary Boolean list to pass to
This process alone solved most of my problem. However, I couldn't always be sure that my list of things to look for would contain anything. The variable containing the list was set by an argument in a function definition, and that argument defaulted to
That got my thoughts going toward ternary operators. For those who don't know, many programming languages offer a condensed one-line shortcut for the standard
into this:
Not long ago I dug around to see if Python supported anything like this, and sure enough it does (as of one of the more recent versions, but I forget which one), although it isn't in the standard documentation from what I could see. At any rate, the above example would look like this using Python's approach to the ternary operator:
With that applied to my
The reason that
It's also possible to generate the Boolean list using the
True or False if any one item in the list matched that check. Oh, and if the list was empty, that had to be addressed appropriately as well. And I wanted to do it in the smallest way possible.Originally I'd hacked together a short four or five line function that did the job. However, after coming back to the code for some other updates, I noticed that said function was only being called once, so I began looking for ways to nix that function and do the job more directly. Part of the challenge was that this comparison I needed to do was part of an existing
if statement, and it had to remain so due to the way the rest of the code worked. In short, the comparison went like this (in pseudo-Python):thisList = ["list", "of", "unknown", "length"]
if not ":" in line and not anythingInThisList in line:
do stuff
else:
do other stuff
The first thing I tried to figure out was a way to get a single
True or False out of a list of various Boolean values. On a whim, I tried to use the built-in max function. I'd used max before in standard numeric comparisons, but never with Booleans. Not surprisingly, it worked quite well.>>> max(True, False)
True
>>> max([False, False, True, False])
True
Getting the necessary Boolean list to pass to
max was a no-brainer thanks to Python's list comprehensions. Here's an example that quickly shows if a given word contains any vowels:>>> vowels = ["a", "e", "i", "o", "u"]
>>> max([v in "sadness" for v in vowels])
True
>>> max([v in "shhhh" for v in vowels])
False
This process alone solved most of my problem. However, I couldn't always be sure that my list of things to look for would contain anything. The variable containing the list was set by an argument in a function definition, and that argument defaulted to
None if no other data came through. That meant that I had to somehow force the output of the max comparison to False if the variable was None, or let it do its thing if not.That got my thoughts going toward ternary operators. For those who don't know, many programming languages offer a condensed one-line shortcut for the standard
if-else comparison, called a ternary operator. In short, it turns this:if statement:
doThis
else:
doThat
into this:
statement ? doThis : doThat
Not long ago I dug around to see if Python supported anything like this, and sure enough it does (as of one of the more recent versions, but I forget which one), although it isn't in the standard documentation from what I could see. At any rate, the above example would look like this using Python's approach to the ternary operator:
doThis if statement else doThat
With that applied to my
max comparison, the end result looked something like this (and I hope this all ends up on a single line in the blog post):# "line" is the line of text
# "y" is either None or a list of items to find in "line"
max([x in line for x in y] if y is not None else [False])
The reason that
False needs to be encapsulated inside a list is because max needs a list of items through which to iterate, even if that list only contains a single item.It's also possible to generate the Boolean list using the
map function and a lambda, and the code isn't that much longer:max(map(lambda x:x in line, y) if y is not None else [False])
Sneak peek at upcoming RFX project
I had the opportunity to work on a cool project at Reel FX last summer. We were awarded a contract to construct a series of sculptures to coincide with the opening of a new light rail station not far from the studio. Part of the prep phase involved posing some 3D models in Maya, with the resulting models to be used as templates for the final sculptures, and I had the honor of creating the needed poses under the watchful eye of Brandon Oldenburg, VP of Creative at Reel FX, who designed the installation.
Work is well underway on construction of the sculptures, although I can't give any more details at this time regarding what they'll be. However, if you happened to pop into Reel FX during the last month or two, you probably would have seen a work-in-progress version of one small portion of one sculpture sitting in our main atrium. If you didn't...I'm so sorry. Other than that, I can only say this: they will be BIG!
For more info, and a sneak peek at some of the smaller components of the installation (not to scale, in case you're wondering), check out the official site for the Deep Ellum Gateway Project. With the opening of the new station slated for September of this year, I imagine more info about the installation will come along any day now.
Work is well underway on construction of the sculptures, although I can't give any more details at this time regarding what they'll be. However, if you happened to pop into Reel FX during the last month or two, you probably would have seen a work-in-progress version of one small portion of one sculpture sitting in our main atrium. If you didn't...I'm so sorry. Other than that, I can only say this: they will be BIG!
For more info, and a sneak peek at some of the smaller components of the installation (not to scale, in case you're wondering), check out the official site for the Deep Ellum Gateway Project. With the opening of the new station slated for September of this year, I imagine more info about the installation will come along any day now.
Friday, March 20, 2009
Yoono
Just discovered a nifty add-on for Firefox: Yoono. It sits in a thin sidebar in the main window, and lets me hook up to pretty much everything: chat, social sites, RSS feeds, etc. I'm even writing and posting this blog entry from it. Pretty slickaroonie, I must say. :)
All right, enough geekin'. For now, anyway. ;)
All right, enough geekin'. For now, anyway. ;)
Wednesday, March 18, 2009
Changing styles, changing times
Imagine if the Merrie Melodies short "One Froggy Evening" were created by today's animation production system. It's very possible that it would turn out very differently, as one blogger speculates via a series of hypothetical notes that might come back from a review session with today's content critics.
What do you think? Do you think that the creation of such a film today is likely to generate that kind of response...that kind of over-analyzation of details that, in the end, really don't matter because it's all fantasy?
At some level, I feel that we are excessively critical with some of the things we create in the name of entertainment. Even in the realm of animation, we don't always allow ourselves to let go and let loose, to just let certain things be nonsensical and come out of left field. Why not?
Think about this: if that film were made as a live-action story (with a CG frog, naturally), matching the appropriate details of the animated version as closely as possible, how would we feel about it? Would we be as willing to accept the presented absurdities and disregard certain glossed-over details like we do with the animated presentation?
I don't know that there are any firm answers, but I've got some thoughts. It's late, though, and I need my beauty sleep (yeah, right....like it's done me much good so far!). More postulating to come later...
What do you think? Do you think that the creation of such a film today is likely to generate that kind of response...that kind of over-analyzation of details that, in the end, really don't matter because it's all fantasy?
At some level, I feel that we are excessively critical with some of the things we create in the name of entertainment. Even in the realm of animation, we don't always allow ourselves to let go and let loose, to just let certain things be nonsensical and come out of left field. Why not?
Think about this: if that film were made as a live-action story (with a CG frog, naturally), matching the appropriate details of the animated version as closely as possible, how would we feel about it? Would we be as willing to accept the presented absurdities and disregard certain glossed-over details like we do with the animated presentation?
I don't know that there are any firm answers, but I've got some thoughts. It's late, though, and I need my beauty sleep (yeah, right....like it's done me much good so far!). More postulating to come later...
Wednesday, February 25, 2009
Maya and Python lambdas, part 3
A thought occurred to me this morning before coming into work. I was still thinking that there had to be some way of further improving my use of lambdas in Maya GUI creation. Then it hit me: assign the data from the loop as a default value for one of the lambda's arguments!
Look, ma...no lambda factory! :) Here's my guess as to why this works when it doesn't work to put the variable "inside" the lambda...
By stuffing a variable into the function/method call inside the lambda function, it appears that the value of the variable isn't retrieved until the lambda function is executed. For a variable defined by a loop, this means that the variable value is the same as it was during the last iteration through the loop.
However, by taking a variable and assigning it as the default for one of the lambda's arguments, the value assigned to that variable is retrieved and stored in the lambda function definition. When called by Maya when the appropriate GUI element is used, the lambda function already has that value, and knows to pass it as the default for the appropriate argument. Because no other data is passed to replace it, it can be used reliably inside the function as part of the real function call we want to make.
The only thing to keep in mind when using this technique is the extra data that Maya passes on its own, which is caught (and promptly ignored) in the example above by the
Clean and simple. Me likey.
import maya.cmds as mc
def showStuff (stuff):
print "You've given me %s!" % stuff
stuffList = ["an apple", "a pear", "a pickle"]
mc.window("Stuff to Give", w=300, h=200)
cl = columnLayout()
for item in stuffList:
mc.button(l=item, c=lambda x, i=item:showStuff(i))
Look, ma...no lambda factory! :) Here's my guess as to why this works when it doesn't work to put the variable "inside" the lambda...
By stuffing a variable into the function/method call inside the lambda function, it appears that the value of the variable isn't retrieved until the lambda function is executed. For a variable defined by a loop, this means that the variable value is the same as it was during the last iteration through the loop.
However, by taking a variable and assigning it as the default for one of the lambda's arguments, the value assigned to that variable is retrieved and stored in the lambda function definition. When called by Maya when the appropriate GUI element is used, the lambda function already has that value, and knows to pass it as the default for the appropriate argument. Because no other data is passed to replace it, it can be used reliably inside the function as part of the real function call we want to make.
The only thing to keep in mind when using this technique is the extra data that Maya passes on its own, which is caught (and promptly ignored) in the example above by the
x argument.Clean and simple. Me likey.
Tuesday, February 24, 2009
More Lambda and GUI fun
Just tripped over an interesting problem with the lambda stuff I shared in the last post. It's just peachy if you're passing a literal value:
However, if you're creating a collection of controls using a loop, it no worky correctly:
In this example, no matter which button you click, it will pass "him".
I tried a number of ways to get around this, and wasn't successful until I revisited the page that flipped the lambda light switch for me. The second example on that page shows how to create a "lambda factory" of sorts. In the context of the loop situation, the factory serves to isolate the creation of the lambda function from the loop. While the factory function was a standalone item in the example on that page, it would be convenient to nest said factory inside the same function/method that contains the loop. Here's a more fleshed-out example:
It's a bit more extra code than I'd hoped for, but it's only needed when using the lambda technique inside a loop, and still allows me to keep the target functions/methods clean by avoiding nesting.
# other code omitted for brevity
mc.button(l="click me", c=lambda x:colorMe("Purple"))
However, if you're creating a collection of controls using a loop, it no worky correctly:
names = ["me", "you", "him"]
for name in names:
mc.button(l=name, c=lambda x:nameMe(name)
In this example, no matter which button you click, it will pass "him".
I tried a number of ways to get around this, and wasn't successful until I revisited the page that flipped the lambda light switch for me. The second example on that page shows how to create a "lambda factory" of sorts. In the context of the loop situation, the factory serves to isolate the creation of the lambda function from the loop. While the factory function was a standalone item in the example on that page, it would be convenient to nest said factory inside the same function/method that contains the loop. Here's a more fleshed-out example:
import maya.cmds as mc
def addButtons (names):
# here's the factory function
def factory (nm):
return lambda x:showName(nm)
# and here's our loop
for name in names:
mc.button(l=name, c=factory(name))
It's a bit more extra code than I'd hoped for, but it's only needed when using the lambda technique inside a loop, and still allows me to keep the target functions/methods clean by avoiding nesting.
Monday, February 23, 2009
Python Lambdas and Maya GUIs
I love epiphanies. :)
For some reason, I haven't been able to figure out "lambda" functions in Python. Granted, I've not put a great deal of time into them. It's just that whenever I would see them in someone else's code, I couldn't immediately figure out what they were doing, so I'd just add another mark next to the "Need to research lambdas" entry in my mental to-do list and move along. To make a long story short, I ran across a page today that flipped the light switch on lambdas. But that's not the epiphany of which I speak. The epiphany hit when I began trying to figure out what (if anything) I could do with those lovely little lambdas in my Python programming at work.
Most of my development work involves the creation of tools with some kind of graphical user interface (GUI). When assigning a command to a Maya GUI element in Python, it expects either a string that contains some Python code to execute, or a pointer to a function or method that will be called. In the vast majority of situations, I'll use the latter option. If I don't need to pass any data to the target function, there's no problem, and Maya gets the function pointer as expected:
However, in most of the GUIs that I create, some control will need to pass specific data to the function that it calls. The problem is that once you include parentheses to pass data to the function, Maya is no longer getting a function pointer. It's getting the value (if any) returned by the called function, or
Up until now, I've been using nested functions to get around this problem. By defining and returning a "dummy" function inside the main function that is called by the GUI element, Maya will get the function pointer it wants, and I can pass in any data that I please:
This process has been working fine, but in the back of my mind, I kept hoping to find a more elegant solution.
Enter my new friend: the lambda!
After some experimentation, I learned two very helpful things about lambdas. The first is that the expression evaluated by a lambda doesn't necessarily have to have any connection to the data it is passed. For example, a "normal" lambda definition might look something like this:
In this case, calling
In this case, no matter what value you pass,
Based on this example alone, I can already begin to use lambdas to simplify my example code above. (It's simpler on the function definition side of things because we get rid of the nesting issue, but some might see the syntax of assigning the desired function call to the GUI element a tad more confusing.)
What happens is that the mystery-data passed by Maya gets assigned to
For some GUI elements, though, the data passed by Maya is actually useful. Take an intSlider, for example:
In this situation, the data passed by Maya when dragging the slider is the slider's value. However, it's passed as a Unicode string, so I just converted it to an integer before passing it to the function. This means I don't have to query the slider, as the data I need has already been passed.
Some GUI operations, like dragging and dropping, pass more than one argument to the target function. No matter...just provide the requisite number of arguments in the lambda definition (i.e.
That's all for now. Happy Python GUI building!
For some reason, I haven't been able to figure out "lambda" functions in Python. Granted, I've not put a great deal of time into them. It's just that whenever I would see them in someone else's code, I couldn't immediately figure out what they were doing, so I'd just add another mark next to the "Need to research lambdas" entry in my mental to-do list and move along. To make a long story short, I ran across a page today that flipped the light switch on lambdas. But that's not the epiphany of which I speak. The epiphany hit when I began trying to figure out what (if anything) I could do with those lovely little lambdas in my Python programming at work.
Most of my development work involves the creation of tools with some kind of graphical user interface (GUI). When assigning a command to a Maya GUI element in Python, it expects either a string that contains some Python code to execute, or a pointer to a function or method that will be called. In the vast majority of situations, I'll use the latter option. If I don't need to pass any data to the target function, there's no problem, and Maya gets the function pointer as expected:
import maya.cmds as mc
def blah(*args):
# "*args" is required because even though the
# command doesn't pass any data, Maya passes
# some anyway. Go figure...
print "You touched me!"
mc.window(w=500, h=500)
mc.columnLayout()
mc.button(l="Touch!", c=blah)
mc.showWindow()
However, in most of the GUIs that I create, some control will need to pass specific data to the function that it calls. The problem is that once you include parentheses to pass data to the function, Maya is no longer getting a function pointer. It's getting the value (if any) returned by the called function, or
None if the function doesn't return anything.Up until now, I've been using nested functions to get around this problem. By defining and returning a "dummy" function inside the main function that is called by the GUI element, Maya will get the function pointer it wants, and I can pass in any data that I please:
import maya.cmds as mc
def blah(value):
def b(*args):
# "*args" is still required because this is the
# function that Maya will ultimately call when
# the button is pushed
print "I was given:", value
return b
mc.window(w=500, h=500)
mc.columnLayout()
mc.button(l="Touch!", c=blah(10))
mc.showWindow()
This process has been working fine, but in the back of my mind, I kept hoping to find a more elegant solution.
Enter my new friend: the lambda!
After some experimentation, I learned two very helpful things about lambdas. The first is that the expression evaluated by a lambda doesn't necessarily have to have any connection to the data it is passed. For example, a "normal" lambda definition might look something like this:
x = lambda y: y * 2
In this case, calling
x(5) will return 10 (the 5 gets passed to y, when is then evaluated through the expression y*2 to yield 10, which is then returned). However, the expression can be changed to return something that has nothing to do with the value passed in through y, like so:x = lambda y: 15
In this case, no matter what value you pass,
15 will always be returned.Based on this example alone, I can already begin to use lambdas to simplify my example code above. (It's simpler on the function definition side of things because we get rid of the nesting issue, but some might see the syntax of assigning the desired function call to the GUI element a tad more confusing.)
import maya.cmds as mc
def blah(value):
print "I was given:", value
mc.window(w=500, h=500)
mc.columnLayout()
mc.button(l="Touch!", c=lambda x:blah(10))
mc.showWindow()
What happens is that the mystery-data passed by Maya gets assigned to
x in the lambda definition, but we don't need to use it. All we need is to call our function with the desired value.For some GUI elements, though, the data passed by Maya is actually useful. Take an intSlider, for example:
import maya.cmds as mc
def blah(value):
print "The slider value is", value
mc.window(w=500, h=500)
mc.columnLayout()
mc.intSlider(dragCommand=lambda x:blah(int(x)))
mc.showWindow()
In this situation, the data passed by Maya when dragging the slider is the slider's value. However, it's passed as a Unicode string, so I just converted it to an integer before passing it to the function. This means I don't have to query the slider, as the data I need has already been passed.
Some GUI operations, like dragging and dropping, pass more than one argument to the target function. No matter...just provide the requisite number of arguments in the lambda definition (i.e.
lambda w,x,y,z: ....) and pass them along to the target function as desired. Or, as in one particular case where I wanted to substitute my own data in place of what the drag operation passed, you can take advantage of the other nifty thing I learned through my experiments: a lambda can accept arbitrary argument lists, just like normal functions.# other GUI code here
mc.button(l="blah, dragCallback=lambda *x:boo(myData))
That's all for now. Happy Python GUI building!
Subscribe to:
Posts (Atom)