tag:blogger.com,1999:blog-1009952729388017312024-02-19T11:34:00.114-05:00WillieWorkOn the weaslings and workings of wee little me.Anonymoushttp://www.blogger.com/profile/05102473278182318901noreply@blogger.comBlogger90125tag:blogger.com,1999:blog-100995272938801731.post-4894088729899317032013-06-05T16:09:00.001-04:002013-06-05T16:09:22.407-04:00Some free python goodness. . . Some some of the stuff I mentioned in the last video post about using Python. There's some very cool stuff out there to check out if you have the cajones to try to pull them apart a bit. Kudos to all these guys for making awesome stuff, THEN making it available to us all for free (for the most part)!<br />
<br />
<b>Hamish McKenzie</b> - Zoo tools - I've mentioned him a bunch of times. Really great stuff in terms of tools and also on the blog. <a href="http://www.macaronikazoo.com/">http://www.macaronikazoo.com/</a><br />
<b><br /></b>
<b>CG Monks</b> - Awesome toolset! <a href="http://www.cgmonks.com/">http://www.cgmonks.com/</a><br />
<b><br /></b>
<b>Mark Jackson</b> - Red9 Tools - Holy moly! That's some heavy duty scripting stuff he's giving away! <a href="http://red9-consultancy.blogspot.com/">http://red9-consultancy.blogspot.com/</a><br />
<b><br /></b>
<b>Morgan Loomis</b> - <a href="http://morganloomis.com/downloads/">http://morganloomis.com/downloads/</a><br />
<b><br /></b>
<b>Michael Comet</b> - <a href="http://www.comet-cartoons.com/">http://www.comet-cartoons.com/</a><br />
<br />
<b>Brendan Ross</b> - <a href="http://www.supercrumbly.com/latest.php">http://www.supercrumbly.com/latest.php</a>Anonymoushttp://www.blogger.com/profile/05102473278182318901noreply@blogger.com3tag:blogger.com,1999:blog-100995272938801731.post-29177415481851585672013-06-05T16:09:00.000-04:002013-06-05T16:09:04.069-04:00Some Python in Maya basicsI've been working a ton lately, so sorry for the lack of posts. Some day I'll figure out how to do smaller things a little more regularly.<br />
<br />
Annnyyyywayyys . . . On the last job I was on (and in a rigging class I taught recently), I was demo-ing some little scripts I'd written and realized that I'd forgotten how confusing it can be to run python stuff in Maya if you don't have any experience doing it or know why things are done the way they are. In fact, I recall being able to put together a fairly competent script in python (cuz I knew a bunch of MEL already) and actually not knowing how to run it in maya! So I would just copy and paste the whole thing to the script editor each time or make a button out of the <i>whole</i> code. . . until I was like "What the hell am I doing? Figure this out!". Turns out it wasn't too hard, but it can be a bit confusing sometimes, certainly at the beginning and so I made a couple of quick videos walking through a few things you might want to know about how (and occasionally why) you do things in Maya with Python. Absolutely nothing fancy or tricky here, just the basics for those of you who haven't quite wrapped your heads around it.<br />
<br />
Two videos: the first one is the <i>really</i> basic stuff (importing a module and running a function from it) and the second goes into a few other areas that are a bit more advanced (reloading scripts, what those .pyc files are and how they can trip you up sometimes, messing with the python path [sys.path] to load files from other folders, setting up a package in python and so on). <br />
BTW, I've done a dump of some scripts onto the Downloads page above ^, and I'll do a quick video walkthrough of them in short order<br />
<br />
<iframe allowfullscreen="" frameborder="0" height="283" mozallowfullscreen="" src="http://player.vimeo.com/video/67579845" webkitallowfullscreen="" width="500"></iframe> <br />
<a href="http://vimeo.com/67579845">Maya/Python: The basics of using python scripts in Maya (Pt 1)</a> from <a href="http://vimeo.com/zethwillie">zeth willie</a> on <a href="http://vimeo.com/">Vimeo</a>.<br />
<br />
<iframe allowfullscreen="" frameborder="0" height="283" mozallowfullscreen="" src="http://player.vimeo.com/video/67580415" webkitallowfullscreen="" width="500"></iframe> <br />
<a href="http://vimeo.com/67580415">Maya/Python: The basics of using python scripts in Maya (Pt 2)</a> from <a href="http://vimeo.com/zethwillie">zeth willie</a> on <a href="http://vimeo.com/">Vimeo</a>.Anonymoushttp://www.blogger.com/profile/05102473278182318901noreply@blogger.com1tag:blogger.com,1999:blog-100995272938801731.post-5938007310473080792013-06-05T16:08:00.000-04:002013-06-05T16:08:32.273-04:00Some links I like . . . <h3 class="cK" style="background-color: white; border: 0px; font-family: Roboto, arial, sans-serif; font-size: 14px; font-weight: normal; margin: 0px; unicode-bidi: normal;">
<span style="background-color: transparent;">Just some quick things that I thought were cool and worth checking out if you're interested in the kind of stuff I generally post here. . . .</span></h3>
<br />
<b>Marco Giordano</b> has been cranking out some sweet tutorials on Maya using math-y stuff. This one caught my eye: <a href="https://vimeo.com/66262994">https://vimeo.com/66262994</a><br />
Great stuff! He does the pole vector in essentially the same way I do, but he goes the extra mile and orients it. Which is sweet. You should check out some of his others too. I especially liked the one about using a cone to drive pose space correctives: <a href="https://vimeo.com/64958089">https://vimeo.com/64958089</a><br />
<br />
<b>Charles Looker</b> going over some math stuff, which is always cool in the context of 3D: <a href="http://charleslooker.wordpress.com/2013/05/21/maths-101-back-to-basics-matrices/">http://charleslooker.wordpress.com/2013/05/21/maths-101-back-to-basics-matrices/</a><br />
<br />
<b>Danny Williams. </b>His stuff is always nasty. Here's some artwork via Flooby Nooby: <a href="http://floobynooby.blogspot.com/2013/05/the-art-of-danny-williams.html">http://floobynooby.blogspot.com/2013/05/the-art-of-danny-williams.html</a><br />
Here's some modeling stuff. Really? Modeling like that from a 3/4 view? <a href="https://vimeo.com/59582056">https://vimeo.com/59582056</a><br />
His blog: <a href="http://www.pointpusher.com/">http://www.pointpusher.com/</a><br />
<br />
I generally don't aggregate much here (read: churn other people's stuff) mostly cuz I feel like there're enough places around that do it better, more often, etc (like Lester Banks, etc), but once in a while is okay, right?Anonymoushttp://www.blogger.com/profile/05102473278182318901noreply@blogger.com0tag:blogger.com,1999:blog-100995272938801731.post-13118677171871450192013-01-25T15:50:00.000-05:002013-01-25T15:50:16.243-05:00Rigging a shock absorber and so much more . . . "So much more" might really be an overstatement. In fact, it is.<br />
But there actually IS other stuff in there. As I mention in the vid, I was recently rigging a mechanical "tranformer-ish" guy and had some troubles with the model I got and thought it might be worth pointing out some of the way you could avoid the same issues. Things like how to avoid/deal with the skewing from uneven scaling etc. The shock absorber stuff is in there too :)<br />
Here's the vid:<br />
<br />
<iframe allowfullscreen="" frameborder="0" height="284" mozallowfullscreen="" src="http://player.vimeo.com/video/58212768" webkitallowfullscreen="" width="500"></iframe> <br />
<a href="http://vimeo.com/58212768">Maya/rigging: Setting up shock absorber and some notes on mechanical modeling</a> from <a href="http://vimeo.com/zethwillie">zeth willie</a> on <a href="http://vimeo.com/">Vimeo</a>.<br />
<br />
Oh and btw, I'm an idiot because I wrote a bunch of code to zero out the rots and trans, then freeze the transforms, then reapply the rots and trans when, in fact, one line of code will do it (never really looked into the arguments for the "makeIdentity" command before. The "scale" flag will just freeze the scale attrs.):<br />
<pre class="brush:python">cmds.makeIdentity("yourObject", a=True, s=True)</pre>
And of course you could just do it from the menu options for "Freeze Transforms". Geez. . .<br />
But here's the gist of the code to make the single bone stretchy IK (at least it does the annoying parts for you):<br />
<a href="http://catbuks.com/rigScripts/zbw_smallIKStretch.py.zip">zbw_smallIKStretch.py.zip</a><br />
<pre class="brush:python">import zbw_smallIKStretch as sik
sik.smallIKStretch()
</pre>
Anonymoushttp://www.blogger.com/profile/05102473278182318901noreply@blogger.com5tag:blogger.com,1999:blog-100995272938801731.post-83878319039160147412013-01-25T14:38:00.000-05:002013-01-25T14:38:09.386-05:00Python append to path toolHere is a little script that allows you to browse for and select paths to add to your sys.path list for python.<br />
I generally don't keep my python scripts (at least the ones I write myself) in my scripts folder, I keep them in one of a couple "Git" folders that allow me to easily load/sync my scripts over GitHub so I can work on them on various computers (I suppose I could arrange things so that my scripts stay separate from all the other script in my scripts folder and point Git there, but I don't).<br />
This works fine for me, but it's a bit a pain to have to keep pointing Maya there to look for my Python scripts. Up til I wrote this script I just wrote a little bit of python code in Maya to append to my sys.path and just copied that to the shelf. No problem. Unless I'm on another computer at home or at a studio. Still not a big deal, but I still have to put the scripts somewhere and point Maya there, and when I'm at a studio I often have stuff in a few places (desktop, folder on the desktop, etc). And I'm so lazy that I think it's a pain to grab the path name to add it to the "sys.path.append(pathName)" in Maya (especially on a Mac). So I wrote this.<br />
<br />
Basically, it has two parts (the two tabs). <a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgcUVAy0M2ckSZGvwjF1EhX4o0CEThWrKd4qRi62iIFXGYoIY6StNSGgvZS_Pj1M6dgzCKDKELN325IOCL1hgl6YY2JNNraDAcd7KIoyCXLBhCK7QXWi_gfrs0wHM8YXxGdPxSEV-je-8Xn/s1600/tab1.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="93" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgcUVAy0M2ckSZGvwjF1EhX4o0CEThWrKd4qRi62iIFXGYoIY6StNSGgvZS_Pj1M6dgzCKDKELN325IOCL1hgl6YY2JNNraDAcd7KIoyCXLBhCK7QXWi_gfrs0wHM8YXxGdPxSEV-je-8Xn/s200/tab1.png" width="200" /></a>The first part lets you browse for up to three paths and then add em with a click. It dummy checks that a) you've added <i>something</i> and b) what you've added is actually a path that exists.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi4_ya68pJNCB4DSmctsYehlW8-zfBe-aiTSTbpprgrtAKyaHWfhRPALjxhJ0tA_U7QJoPN9cLfG9yxkFhN6612ccqTv2gP5bX_Yn8i6EGbBRmEDZdXafCx81QLRDEotGsma3Lb7-_tFOCS/s1600/tab2.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="88" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi4_ya68pJNCB4DSmctsYehlW8-zfBe-aiTSTbpprgrtAKyaHWfhRPALjxhJ0tA_U7QJoPN9cLfG9yxkFhN6612ccqTv2gP5bX_Yn8i6EGbBRmEDZdXafCx81QLRDEotGsma3Lb7-_tFOCS/s200/tab2.png" width="200" /></a></div>
The second tab is just a quick list of the paths that Maya is currently looking in, it refreshes once you've added new paths or you can manually refresh it if you've added paths elsewhere. Since I didn't want to make this window soooo big that it could catch any potential long path names, if you double click on a path in the "View Paths" tab, it will print that name in the script editor.<br />
<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhckhxze82KMnp03m9ZEGu3_bYoZCcdt9k1V37My0OxEux4A3G41nFZvXMRp2S5z0Vz7Ew8LKJ0FJK90tEBY2RqlqxKCMO9v_YMLqF8oTQqFcnwQcNuNFyMDG9STCN32uu_5bGjms6HHNaD/s1600/saveLoad.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="88" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhckhxze82KMnp03m9ZEGu3_bYoZCcdt9k1V37My0OxEux4A3G41nFZvXMRp2S5z0Vz7Ew8LKJ0FJK90tEBY2RqlqxKCMO9v_YMLqF8oTQqFcnwQcNuNFyMDG9STCN32uu_5bGjms6HHNaD/s200/saveLoad.png" width="200" /></a>There's also the option in the menu bar to save out your entered paths (it will write a "zbw_appendPathSave.txt" file to your user prefs folder). You can then load it later to save some time (it will just overwrite itself if necessary) and it will reload the paths you've browsed for.<br />
<br />
Here's a <a href="http://catbuks.com/rigScripts/zbw_appendPath.py.zip">link</a> to the script or it's in the NEW downloads section above. (note: slowly but surely I'll get the other scripts up there too)<br />
Basically, I just drop this in my scripts folder (it's the only python script I keep there, except for stuff that might point Maya elsewhere) and run it from my shelf. Here's the code to do call the script (obviously python):<br />
<br />
<pre class="brush: python">import zbw_appendPath
zbw_appendPath.appendPath()
</pre>
<br />
Hope it's useful to someone as lazy as me!Anonymoushttp://www.blogger.com/profile/05102473278182318901noreply@blogger.com0tag:blogger.com,1999:blog-100995272938801731.post-27034404398159036142013-01-25T14:35:00.000-05:002013-01-25T14:35:24.191-05:00Shape node scaling tool<div class="" style="clear: both; text-align: left;">
Here's a little thing that I made a while ago as a little hacked-together tool for some job I was working on. Eventually I added little bits until it ended up as this kind of done-ish version. (I know that's a real sales job, isn't it?:)</div>
<div class="" style="clear: both; text-align: left;">
But it actually is pretty useful to me on a regular basis for everyday stuff, especially for scaling controls. The short description is that this grabs all of the components of each selected object (surfaces, curves and polys) and scales them. That is, your objects gets scaled without affecting the scale attributes or the transform node. </div>
<div class="" style="clear: both; text-align: left;">
The setup looks a bit confusing (and maybe it is), but there are a few things you can do. There are two ways to scale things, either drag the slider (which will automatically recenter itself. Kind of weird, but I felt it gave better sensitivity and still allowed me to scale things very large with a few pulls) or type a number and press "scale". When you use the slider, the value that you slid gets entered into the field, so you can repeat it on the same object by clicking the scale button, or use the same value for other objects. </div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj0ppWLh7PaD3mmvfa1kxWTHLtWXVKXQ7du_FxoASrxPMLtBawQRHppHkRtHyczBOLeSLJqczKb1WCeTx5OVKeUh0Eoid_GYMfPd-VZ6sz5spkEQkYVEaku6n9vVNNPsG9hi0c86fItXPXS/s1600/zbw_shapeScale.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="227" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj0ppWLh7PaD3mmvfa1kxWTHLtWXVKXQ7du_FxoASrxPMLtBawQRHppHkRtHyczBOLeSLJqczKb1WCeTx5OVKeUh0Eoid_GYMfPd-VZ6sz5spkEQkYVEaku6n9vVNNPsG9hi0c86fItXPXS/s320/zbw_shapeScale.jpg" width="320" /></a>The stuff on the right is a bit more esoteric. What was happening was that I would scale a bunch of controls and then realize that I forgot to select one control. It was then tricky to repeat the same slider values, etc. So the top field on the right tracks the cumulative value change to the scales. So you can select a bunch of objects, change the values arbitrarily and this will keep track of the changes from where you started. You can then copy down that number and enter it into the text field if you need to grab another object and match it, though this will then change your tracked value. To get around <i>that, </i>you can "reset" the tracked value back to 100% once you select a new object(s). Similarly, if you do a bunch of scaling it can be tough to get back to the original value without hitting undo a bunch of times. So if you've tracked your changes (by starting with a "change" value of 100, via "reset") you can get back to the original state with the "orig" button (it will just figure out what you need to get back to 100% scale and multiply by that). This change will then be reflected in the "scale %" field if you want to apply it to something else (or just know what the number is). </div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Whew. Sounds like a lot for a simple tool, but I feel like maybe the naming, etc isn't super clear. Maybe at some point I'll put a "help" menu in there or something. . . </div>
<div class="separator" style="clear: both; text-align: left;">
Hope it's useful!</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<a href="http://catbuks.com/rigScripts/zbw_shapeScale.py.zip">zbw_shapeScale.py.zip</a> or you can find it on the shiny, new download page (there's now a button to take you there up at the top) . . .<br />
<pre class="brush:python">import zbw_shapeScale
zbw_shapeScale.shapeScale()
</pre>
Anonymoushttp://www.blogger.com/profile/05102473278182318901noreply@blogger.com0tag:blogger.com,1999:blog-100995272938801731.post-38902255927918816652013-01-25T12:43:00.001-05:002013-01-25T12:43:33.529-05:00Some tidbits . . . <ol>
<li>First of all, the blog has a new look! Soooo. . . there's that. </li>
<li>While we're on the topic, I don't really know much about blogs, per se, and I'm not really interested in learning too much about it (or rather I don't have room in my brain for it). Having said that, if there's anything that you might find useful here in terms of blog setup, or that you like elsewhere, let me know, while I'm thinking about it. I've already set up some stuff to show code a bit better and am in the process of setting up a download page to help you find any scripts and such to download more easily/conveniently. But if there's something else out there I'm interested in hearing about it (as long as it's relatively easy for me to implement:) . . .</li>
<li>Secondly, I saw a demo of some pre-alpha stuff that Raf and his team at Anzovin Studios are working on at the NYC-Maya Users Group meeting Wed night. Very cool stuff. Here's a link to their site: <a href="http://www.anzovin.com/products/art1maya.html">http://www.anzovin.com/products/art1maya.html</a></li>
<li>Finally, while we're on the topic, I finally made it to my first Maya User Group meeting. It was fun! Steve Mann did a great job of getting interesting presenters and creating a good atmosphere (there was pizza, beverages, prizes, etc) If you're in NYC, check it out for next time: <a href="http://nymayausersgroup.blogspot.com/">http://nymayausersgroup.blogspot.com/</a></li>
<li>For those doing VFX or photography, there's a new book out by Christian Bloch, The HDRI Handbook 2.0. Heard nothing but rave reviews (by some pretty savvy people). Just ordered mine, even though I don't do a ton of VFX work. Check it out: <span style="background-color: white; color: #1155cc; font-family: inherit;"><a href="http://www.hdrlabs.com/book/index.html" style="background-color: white; color: #1155cc;" target="_blank">http://www.hdrlabs.com/book/<wbr></wbr>index.html</a> </span><span style="background-color: white; font-family: inherit;">and pass it along.</span></li>
</ol>
<br />
<br />Anonymoushttp://www.blogger.com/profile/05102473278182318901noreply@blogger.com0tag:blogger.com,1999:blog-100995272938801731.post-27128921129949673002013-01-16T14:24:00.001-05:002013-01-24T12:07:51.868-05:00Fixin that shoulder geo . . . <br />
Here's a relatively quick video where I go over a technique I pulled from a Bay Raitt modeling time-lapse video like 10 years ago (vid is <a href="http://www.youtube.com/watch?v=ubgvomRTW80" target="_blank">here</a>). Basically, the idea is that to get more natural edge flow in the shoulder area, you just make a slight adjustment to the first extrusion from the torso which gives you a more natural angle to then extrude the rest of the arm. This helps a) make it more likely you'll model your arm at 45 deg angle, which I prefer to a t-pose when possible and b) help dictate the direction the edge flow wants to naturally travel.<br />
As soon as I posted this on Vimeo, a fella named Ike commented (which I totally appreciate, btw) that maybe it sounded like I was bashing the idea that one should ever build a shoulder in the "tube" method, just extruding out of the torso in a straight line, and that, in fact, plenty of people model in this way and that it often works out (he gives some examples of his experience at The Mill and on Planet 51). To be clear, I totally agree with him! There a bunch of reasons why someone would model in a manner other than I'm proposing here. . . I've seen VERY senior and smart people pretty much advocating for a more "tube-like" approach. Some of the reasons they have mentioned (and I'd reprint the threads, but it was on a private message board and I don't feel like asking for permission to reprint all the stuff verbatim) include:<br />
<ul>
<li>more even distribution of the geo makes it much easier to deal with driving the skin via other influences (like muscles layers, fat layers, etc)</li>
<li>more even distribution can make it easier to weight the skin sometimes</li>
<li>more even distribution also makes it easier to retopo if you have to later on.</li>
<li>sometimes the model just WANTS to be that way!</li>
</ul>
(note that often people advocating this work are in bigger shops, or have much more robust methodology for dealing with specific kinds of geo. Not always but often.)<br />
Totally appreciate all of those reasons and wouldn't presume to argue with them. . . A good example is the clothing someone is wearing. . . obviously it doesn't make a ton of sense to model an edgeflow based on musculature when the character is wearing a heavy coat:) Despite the fact that I probably sounded more dogmatic in the vid than I intended to, my main point stands, in that you definitely want to look at reference for the way something is intended to move. For example, if you look at a man's blazer or tailored jacket, try to lay it out flat and put the sleeves in a T-pose. They probably won't do that, because that's not the way your arm naturally wants to move, hence the clothes aren't made that way! So while the edge flow would obviously be different than that of a muscly shoulder, it also wouldn't be a straight extrusion from the torso, either. . .<br />
Also would add:<br />
<ul>
<li>I'm, at least in part, concerned with passing info to my students, many of whom are learning about these things for the first time. The shoulder is a place on their models that frequently goes awry and this concept at least gives em a place to start. . .</li>
<li>I also work mostly freelance on commercial in NYC, often in smaller shops, and I often (maybe 20% of the time?) see geo that is actively harmful to my ability to rig a character:) So I feel like one is less likely to go wrong following edgeflow than one is just ignoring it.</li>
<li>Looking back, I have had plenty of good experiences with different styles of geo. Just wanted to say that too. . . </li>
</ul>
Also <a href="http://wiki.polycount.com/ShoulderTopology?action=show&redirect=Shoulder+Topology" target="_blank">here's a link</a> for some examples of different styles of modeling the shoulder area. ..<br />
Enough about that! here's the vid:<br />
<iframe allowfullscreen="allowfullscreen" frameborder="0" height="284" mozallowfullscreen="mozallowfullscreen" src="http://player.vimeo.com/video/57408254" webkitallowfullscreen="webkitallowfullscreen" width="500"></iframe> <a href="http://vimeo.com/57408254">Maya/Rigging/Modeling: Tip for creating better shoulder edgeflow</a> from <a href="http://vimeo.com/zethwillie">zeth willie</a> on <a href="http://vimeo.com/">Vimeo</a>.Anonymoushttp://www.blogger.com/profile/05102473278182318901noreply@blogger.com2tag:blogger.com,1999:blog-100995272938801731.post-38025891703809610972013-01-12T14:38:00.000-05:002013-01-24T15:05:12.933-05:00Why so many master controls? Been asked this quite a few times when I've shown my classes some rigs. Seems easier to do a quick vid and point people here. (this is another one that's been sitting on my computer for months that I forgot to post)<br />
I usually put my rigs under multiple levels of master controls (both for chars and props) and the main reason is that it seems easier to me to default to doing that, than to have to go back and add more controls when an animator wants to do something <i>crazy</i> like add something to a motion path and still retain some type of control. I mention a few other circumstances where this is useful, but to be honest, it just seems like common sense to me and makes me grumpy.<br />
So get off my lawn.<br />
<br />
<iframe allowfullscreen="allowfullscreen" frameborder="0" height="284" mozallowfullscreen="mozallowfullscreen" src="http://player.vimeo.com/video/57281167" webkitallowfullscreen="webkitallowfullscreen" width="500"></iframe> <a href="http://vimeo.com/57281167">Maya/Rigging: Using multiple Master Controls</a> from <a href="http://vimeo.com/zethwillie">zeth willie</a> on <a href="http://vimeo.com/">Vimeo</a>.Anonymoushttp://www.blogger.com/profile/05102473278182318901noreply@blogger.com5tag:blogger.com,1999:blog-100995272938801731.post-43269397983578966082013-01-11T14:10:00.001-05:002013-01-11T14:10:56.652-05:00The basics of O.O.P. in Maya/PythonI was thinking about calling this post "O.O.P. I did it again!", but then I realized that most people in 3D nowadays are too young to remember who Britanny Spears was (you bastards). . .Made this video (along with a couple of others) a few months ago, but never got around to posting it. Just got really busy and/or forgot.<br />
For those that don't know, OOP refers to Object Oriented Programming.This is just a basic overview of what that is and how you can start thinking about it in Maya using Python. It's something that was a bit confusing to me when I was first learning Python, some of it still is a little bit . . . <br />
I really have no idea whether this video even makes any sense (in terms of it being a useful/illustrative thing to watch).<br />
Here's a description of a particular type of person:<br />
"I work in Maya and know a little about programming, probably MEL and maybe some Python, and also write enough code to care about digging deeper, but definitely not accomplished enough in Python (or any other OO language) to the point when a discussion of classes seems rudimentary."<br />
If that describes you, then you're who I made this for! I certainly hope both of you enjoy it.<br />
<br />
(p.s. I was going to make a venn diagram for that, but I feel like Randall Munroe/xkcd should be the only person in the world allowed to make those anymore. And while we're on the topic, <a href="http://what-if.xkcd.com/">this</a> is my new favorite site. If you're even a little bit of a nerd, you must read them all.)<br />
<br />
Here's the vid:<br />
<iframe allowfullscreen="allowfullscreen" frameborder="0" height="284" mozallowfullscreen="mozallowfullscreen" src="http://player.vimeo.com/video/57226420" webkitallowfullscreen="webkitallowfullscreen" width="500"></iframe> <br />
<a href="http://vimeo.com/57226420">Maya/Python: The basics of using Classes and Obj. Oriented Progamming in Maya/Python</a> from <a href="http://vimeo.com/zethwillie">zeth willie</a> on <a href="http://vimeo.com/">Vimeo</a>.Anonymoushttp://www.blogger.com/profile/05102473278182318901noreply@blogger.com3tag:blogger.com,1999:blog-100995272938801731.post-39856789009635859632013-01-10T17:01:00.000-05:002013-01-10T17:01:40.543-05:00One more FINAL thing about the autoswim fishy . . .Since a few people have asked about the sine function and such involved <a href="http://williework.blogspot.com/2012/05/autoswim-fish-expressions-follow-up.html">here</a> based on <a href="http://williework.blogspot.com/2011/08/creating-auto-swimming-fish-rig-using.html">this</a>, just wanted to point out that Tomasso let me know about a post he did re: some of the mathy madness involved in changing the periodicity of the sine function on the fly. Thanks Tomasso!<br />
And as I suspected, it's way more than I'm willing to deal with . . . <br />
<a href="http://www.tommasosanguigni.it/blog/?p=40">http://www.tommasosanguigni.it/blog/?p=40</a>Anonymoushttp://www.blogger.com/profile/05102473278182318901noreply@blogger.com0tag:blogger.com,1999:blog-100995272938801731.post-18993282291763076952012-10-01T16:37:00.001-04:002012-10-01T16:39:41.172-04:00When should I add textures to a character?Good question! (Actually, a reader, BMDela, asked me this. . . so I'm only partially taking credit)<br />
The question was posed thusly:<br />
"""<br />
So, I've been looking for an answer to this question everywhere, and can't seem to find it.<br />
<br />
At what point do materials/shaders enter the equation?<br />
<br />
Do you put the materials on the master character/props/set, then reference the shaded character into the animation scene?<br />
<br />
What's a good workflow for implementing a shading network?<br />
"""<br />
<br />
The correct answer is . . . wait for it. . . "It depends!"<br />
Lame, I know, but it's the truth. There are ways to do things that are more 'pipeline' correct and ways that are a bit more user friendly. Some projects work better one way, some the other. So let's look at the two basic ways of doing things. . .<br />
<br />
1. Adding shaders to the master files (let's say to the master model files):<br />
Doing this is basically putting your shaders (and their assignment to surfaces) at the front of the pipeline. That is to say, you make your models, uv and texture them completely, then pass them on to rigging, etc. This would seem to be the easiest way to do things and sometimes it is. What are the pros/cons?<br />
PROS: the texture artist only has to apply the shaders once (in theory) no matter how big the show is. Let's say you have a show with 3 characters. The texture artist hits each one and then it doesn't matter whether there are 5 shots or 500, it's the same amount of work for those characters (unless there are changes, which may or may not be a pain in the butt).<br />
CONS: There can definitely be issues with the fact that now all of your shaders are referenced (until you get to the very end of the pipeline). . . but the main problem here is that in heavier scenes you're <i>always</i> pushing around all the textures. When I was animating recently on Skylanders 2, some of the scenes took 3-4 minutes to load, mostly because of the massive amounts of texture files we had to pull over the network. Let's say, as an animation lead touching a lot of shots, I open 20 shots/day. If each shot takes 1 extra minute to load, that's 20 minutes/day. There are 10 leads opening that many shots, so that's 200 min/day to pull textures (that's not counting the 20 other animators who may open 5 shots/day). So over one month, just the animation leads spend ~4000 minutes (or 60+ hours) JUST TO OPEN SHOTS! That's a lot of time/money. And it's not a crazy scenario depending on the shots/network/etc. Might even be conservative . . . <br />
<br />
2. The alternative is to push the texturing until closer to the end of the pipeline (after animation):<br />
To be clear here, I'm not saying "don't create your textures until the end", I'm saying "don't assign your textures to the models until the end". So the texture artists would do the same thing as above, they'd just do it "offline" or in files that don't get pushed through rigging and animation. They would then export those textures into appropriate files that <i>just have the textures</i> in them. Then once things are animated, you can just import those textures and assign them to correct objects. Usually you'd want some textures in the master files, things like eyes and stuff that's involved with the rig, and maybe even apply basic color shaders so people can see what's up, but the heavy stuff stays out until after the animators are done.<br />
PROS: Obviously the point here is that you don't have to push around hundred's of MB's of textures for each shot. Work can go <i>much</i> faster down the pipeline. You also avoid the annoying "doubling" of textures (if I reference 5 of the same plants, I end up with 5 copies of the same shader in my scene). You just import what's necessary. You're also doing the final assignments in context so you're making any fixes while you're actually in the scene.<br />
CONS: Mainly that the work scales linearly. So more shots, more work. You can also get some surprises if you haven't seen the textures in action, and you'll see them with less time to fix them.<br />
<br />
So the reality is that it depends . . . how heavy are your shots likely to be? How many of them are there? Are the textures integral to the animation or can the shots be animated without them? How rigorous is your pipeline? All theses questions will dictate which is the right way to go!<br />
<br />
I've actually been pondering on scripting a system to keep track of what shader is applied to what mesh, etc so the texture artist could save out a file that would reapply the shaders later on down the pipeline automatically. Haven't gotten around to it yet. . . Does anything like this exist? (non-proprietary, obviously)<br />
<br />
Anyways, hope that was helpful, let me know if there are any clever things I've missed!Anonymoushttp://www.blogger.com/profile/05102473278182318901noreply@blogger.com3tag:blogger.com,1999:blog-100995272938801731.post-49920510504026445902012-08-15T16:26:00.002-04:002012-08-15T16:29:06.605-04:00Space Switching and Space MatchingI created a couple of new videos to talk about space switching and space matching. I think they're pretty self-explanatory, just going over the basics of what they are and some ways to set them up. Nothing too crazy, though the space matching one is a fair amount of python scripting (though again, nothing terribly hard if you're already using python).<br />
<br />
But if you're into the more complicated bits, here are some links to info about them:<br />
Charles Looker - <a href="http://charleslooker.wordpress.com/2012/02/25/multi-directional-constraints/">http://charleslooker.wordpress.com/2012/02/25/multi-directional-constraints/</a><br />
Hamish McKenzie - <a href="http://www.macaronikazoo.com/?page_id=413">http://www.macaronikazoo.com/?page_id=413</a> (very illustrative, but be warned, some of his matrix math stuff used his own scripts to deal with the matrices, so it can be a bit confusing if you try to do it without installing his scripts first. But the principles are the same, I just use the API to do the matrix-y bits, which can be hella confusing in it's own right)<br />
TD Matt - <a href="http://td-matt.blogspot.com/2010/12/broken-hierarchy-rig-and-space.html">http://td-matt.blogspot.com/2010/12/broken-hierarchy-rig-and-space.html</a><br />
<br />
Oh yeah, and the vids by Jeremy Ernst are here: <a href="https://vimeo.com/jernst">https://vimeo.com/jernst</a>. Good stuff!<br />
And I'll say it just so you don't have to. . . My god am I long winded! Not sure how explaining space switching could possibly take that long. But what can you do? :) <br />
<br />
<iframe allowfullscreen="allowfullscreen" frameborder="0" height="281" mozallowfullscreen="mozallowfullscreen" src="http://player.vimeo.com/video/47397744" webkitallowfullscreen="webkitallowfullscreen" width="500"></iframe> <a href="http://vimeo.com/47397744">Maya/Rigging: The basics of space switching</a> from <a href="http://vimeo.com/zethwillie">zeth willie</a> on <a href="http://vimeo.com/">Vimeo</a>.<br />
<br />
<iframe allowfullscreen="allowfullscreen" frameborder="0" height="281" mozallowfullscreen="mozallowfullscreen" src="http://player.vimeo.com/video/47595449" webkitallowfullscreen="webkitallowfullscreen" width="500"></iframe> <a href="http://vimeo.com/47595449">Maya/Rigging: Space Matching</a> from <a href="http://vimeo.com/zethwillie">zeth willie</a> on <a href="http://vimeo.com/">Vimeo</a>.Anonymoushttp://www.blogger.com/profile/05102473278182318901noreply@blogger.com9tag:blogger.com,1999:blog-100995272938801731.post-26540040719107932392012-07-13T10:18:00.001-04:002013-01-24T14:53:07.213-05:00Question about tranforms on a frozen object. . .A fella named Jason emailed me at Vimeo with a question about the IK 2 FK snapping video I did (<a href="https://vimeo.com/45110586">here</a>):<br />
<br />
"I'm a student over at rigging dojo and my mentor turned me towrds your ik fk snapping tool that you created. The script works great. But I would ask how do you handle ctrl curves when they have been say zeroed out at (5,5,5) but when I query there position i get back (0,0,0) and when i apply the proper cordinates to the ctrl curve it goes the right amount but because it was zeroed out it isn't right... Any help would be appreciated"<br />
<br />
Thought it was a good question (as I would expect from Rigging Dojo!) and thought it was worth talking about for two reasons: 1) the problem/solution are kind of interesting (if you're into this kinda thing) and 2) it reinforces some stuff I've said in the past, which bears repeating. Namely, you're kinda doing it wrong.<br />
<br />
{slight digression (would make it footnote if knew how). . . When I say "wrong" here I'm using the term loosely. That is, you may have valid reasons for doing whatever you're doing and in your case it may make sense, BUT in most ordinary circumstances, you're probably creating more trouble than you're saving. end of digression}<br />
<br />
So second things first . . . What is "wrong" and why?:<br />
<br />
It has to do with freezing your transforms. And THAT has to do with the Matrix ("whooa . . ."). Each object has a transformation matrix that basically keeps track of where the object is in space, how it's rotated, scaled, etc. I won't make a fool out of you and me by trying to explain it in detail (Hamish Mckenzie has some cool posts on his <a href="http://www.macaronikazoo.com/?p=395">blog</a> about it), cuz I don't know it that well. But what happens, more or less, when you freeze transforms is that you "reset" the objects matrix (or perhaps more accurately, offset the matrix) and tell it that where it is NOW is at 0, 0, 0. In the ordinary course of events, that may work, but when you come in with your cheeky little scripts and try to tell it to go somewhere specific, as you've discovered, there's a problem and Maya doesn't know what you mean (or again, to be more precise, Maya knows exactly what's going on, YOU don't know what you mean, or least I don't). <br />
So that's what I mean when I say you're doing it wrong. Freezing transforms on controls is usually NOT the best way to zero them out. A much better way is to "group orient" them (some people call it "group freezing"). I even did a <a href="http://williework.blogspot.com/2010/02/technical-correctly-orienting-controls.html">post</a> and a video on the process. In short, you create your control at 0,0,0 and immediately group it. Then take the group and move THAT to the correct location + orientation, either with constraints that you then delete or better yet with "xform" and math and scripts and such. But you get two nice benefits: 1) the control stays at 0,0,0 because it's parented under the group that's doing all the moving and 2) because the control's matrix is then inheriting it's information from the group (which DOES have all the correct info with no offsets), both you and Maya are talking about the same world space, etc. and things like "xform" and "move" and stuff should work fine.<br />
<br />
Sooooo. . . what if (as I imagine is the case) you've already done the freezing on your control and don't want to go back. Can you still use the IK2FK python code? The answer is "yes" (though I would recommend fixing the control using group orienting and being done with it. . .). <br />
There are actually a few ways I would imagine. I read somewhere once that Maya stores the freeze transform offset matrix somewhere. I also bet that there's some way to get all smartypants and mathy and solve the problem by busting out some matrix voodoo. But since I can't do that (yet?), I can only offer a solution that will solve the translate problem the same way we did the rest of the script, with a lil elbow grease and vector math. It's not that hard: <br />
Basically, the trick is to find the world space position of the IK control. If you just xform the transform node (the object), it obviously returns a weird value cuz the matrix has been offset. So instead, you need to do something like:<br />
<code>
cmds.xform(ctrlName, q=True, rp=True)</code>
which will instead use something that's not part of the matrix business (rp is for the rotate pivot point). This will give you the world space of the object. When you compare THAT to the actual value you get from "xform" of the control, it gives you how far "off" you are from Maya's interpretation of the location. You now just need to know where to move it to, and since you've got the offset value, you just need to subtract THAT from the location of the FK ctrl to get the number you'd need to move the transform of the IK ctl. So putting those together and assuming everything else in the script is the same, the section where you move the IK wrist would look like this:<br />
<br />
<pre class = "brush:python">
#snap IK ctrl to wrist position<br />
<br />
trueIKraw = cmds.xform(ikWrist, ws=True, q=True, rp=True) #get IK pos in true ws<br />
trueIK = om.MVector(trueIKraw[0], trueIKraw[1],trueIKraw[2]) #make it a vector<br />
frozenIKraw = cmds.xform(ikWrist, q=True, t=True) #get IK pos via matrix<br />
frozenIK = om.MVector(frozenIKraw[0], frozenIKraw[1],frozenIKraw[2]) #make vector<br />
offset = trueIK - frozenIK #get the offset value for the Ik ctrl<br />
correctedFw = fw - offset #this modifies the fk pos to account for the offset<br />
cmds.move(correctedFw.x, correctedFw.y, correctedFw.z, ikWrist, ws=True)
</pre>
<br />
So all we're doing is figuring out the difference between the world space of the ik ctrl (trueIK) and the values the maya is giving us for the frozen transform (frozenIK) and applying that difference to the fk wrist position to get the final destination of the ik ctrl. This should also work when you HAVEN'T frozen the transforms (since the offset would then be 0).<br />
Whew. Hope that makes sense ...Anonymoushttp://www.blogger.com/profile/05102473278182318901noreply@blogger.com3tag:blogger.com,1999:blog-100995272938801731.post-33131415777426885992012-07-12T15:09:00.000-04:002013-10-25T09:37:57.228-04:00Script for creating/editing message attrs . . .I know I mentioned it in the 3rd part of the IK/FK snapping videos, so here it is for those of you who might be inclined to use it, the message mapping script . . .<br />
<br />
If you're not sure what I'm talking about re: message attrs, watch <a href="https://vimeo.com/45110586">this</a> or look it up, sucka.<br />
<br />
Here it is! <a href="http://catbuks.com/rigScripts/zbw_messageMapper.py.zip">zbw_messageMapper</a> or go to the Downloads page above. . .<br />
<br />
There are 2 tabs here:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhcNkm2WHDGkL5c5c1b8MhgzdNXY0qZRut8wydb32q6IdDrmqXncTvCV_pWBkeJtBq_Ujb9VP5uTHKBQ0SvLg3kat3OSHoVRmwFTBdMvWzvouffjt7QOoBImu0c_4i07kyif_zTBR3kSoD6/s1600/messageMapper.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="199" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhcNkm2WHDGkL5c5c1b8MhgzdNXY0qZRut8wydb32q6IdDrmqXncTvCV_pWBkeJtBq_Ujb9VP5uTHKBQ0SvLg3kat3OSHoVRmwFTBdMvWzvouffjt7QOoBImu0c_4i07kyif_zTBR3kSoD6/s320/messageMapper.jpg" width="320" /></a></div>
The first tab is for creating message attributes.<br />
<br />
Select the object you want to add the message attrs to (the "base object") and click the "choose object" button to add it to the text field.<br />
Click "add new attrs" to create a row that will allow you to type in the attr name and select the object the you want to send a message to that attr. You can do multiple attrs at a time, btw. If you want to delete the last row you created, click the red button (this just deletes the UI part, not any attrs). Once you've got what you need entered, then click the green button and the magic will happen. (it's really boring magic). A bit of text will pop up letting you know what you've got has been added and any problems or warnings should show up in your script editor. It will also run down what attr have been connected to what in the script editor.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhTTlhtyshFJOCehQDU27h7mHvlyZ7WU2AA92Q4sOyrEuwk-jSS1kZf61zMEVkX8U9iO2Rb_aO9qhDmtiimFrfyoln4nneRRXVp8EtspA_vBgPfY1CbUFlRQdDPmnI9B_OMl_z-ofNoqxMo/s1600/messageMapper2.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="228" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhTTlhtyshFJOCehQDU27h7mHvlyZ7WU2AA92Q4sOyrEuwk-jSS1kZf61zMEVkX8U9iO2Rb_aO9qhDmtiimFrfyoln4nneRRXVp8EtspA_vBgPfY1CbUFlRQdDPmnI9B_OMl_z-ofNoqxMo/s320/messageMapper2.jpg" width="320" /></a></div>
The second tab is reviewing what message attrs you have on your selected base obj.<br />
<br />
Select your base the same way you did in the last tab and click "list all message attrs". Any attributes of type "message" (however they were created) will be listed below in columns, one for the attr, one for the connected obj, if any, and a delete button.<br />
The delete button is obvious, I hope, but if you right click on either of the other two columns you'll get a little menu giving you the option to change the name of the attr or change the obj connected to that attr. Clicking on either will open up a little window that gives you opportunity to change the respective end of the connection (and obviously reconnect things when done). <br />
<br />
That's about it. I taken care of most of the dummy checking here (i.e. what happens when there are no message attrs or when you leave a field empty, etc), but there may be some situation that spits out an error or something. Be aware that creation side will force connect things, so it will overwrite any attrs that have the same name. It will show this warning in the script editor (though it just does anyways. Ha!). It will also show a little text message in the main window once you've created the messages, which will disappear when you change base objs. I chose not to reset the fields back to empty in case you wanted to do multiple base obj with the same attrs.<br />
<br />
Hope it's useful to someone. And let me know if there are any big problems. I may try to fix them, you never know.<br />
<br />
To run it, put it into your python scripts folder (maya doesn't automatically read all scripts folders for python files) and type:<br />
<div style="-qt-block-indent: 0; -qt-user-state: 0; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-indent: 0px;">
<pre class="brush:python">import zbw_messageMapper
zbw_messageMapper.messageMapper()
</pre>
<br />
You can drag that code to your shelf and run it from a button there.</div>
Anonymoushttp://www.blogger.com/profile/05102473278182318901noreply@blogger.com7tag:blogger.com,1999:blog-100995272938801731.post-33419100184541964562012-07-03T15:35:00.000-04:002013-01-24T14:58:45.667-05:00IK to FK snappingThese videos are about how you might approach and execute IK to FK snapping. (For those that don't know or use different terminology, that's where you run a script and it snaps your IK limb position to your FK limb position). It's something that I had always looked at as a bit of luxury, something to get to if there was time when building a rig (hint: there rarely was time). As I mention in the video, Michael Cawood pointed out to me that it is actually a time saver when you're doing a lot of quick blocking. If you pose your characters in IK mode in blocking, you have a lot less counter animation to do when you change the body rotations, for example. You can pose away in IK, then switch to FK when it comes time to animate (if you need to switch, that is). As I was one of the lead animators on that job with Michael, not a rigger (thank god, there were 50+ characters for that one), I didn't bother to offer up my services:) But I thought it would be a good topic for a video tute, so here it is. . .<br />
There are 3 parts. 1) covers the basic idea and some rudimentary vector math 2) covers the python scipting of those concepts in Maya and 3) introduces "message attributes" which are nifty little attrs that can be really useful to bump up functionality of your rigs/scripts.<br />
<br />
<iframe allowfullscreen="" frameborder="0" height="281" mozallowfullscreen="" src="http://player.vimeo.com/video/45108258" webkitallowfullscreen="" width="500"></iframe> <br />
<a href="http://vimeo.com/45108258">Maya/Rigging: IK to FK snapping, part 1</a> from <a href="http://vimeo.com/zethwillie">zeth willie</a> on <a href="http://vimeo.com/">Vimeo</a>.<br />
<br />
<iframe allowfullscreen="" frameborder="0" height="281" mozallowfullscreen="" src="http://player.vimeo.com/video/45109123" webkitallowfullscreen="" width="500"></iframe> <br />
<a href="http://vimeo.com/45109123">Maya/Rigging: IK to FK snapping, part 2</a> from <a href="http://vimeo.com/zethwillie">zeth willie</a> on <a href="http://vimeo.com/">Vimeo</a>.<br />
<br />
<iframe allowfullscreen="" frameborder="0" height="281" mozallowfullscreen="" src="http://player.vimeo.com/video/45110586" webkitallowfullscreen="" width="500"></iframe> <br />
<a href="http://vimeo.com/45110586">Maya/Rigging: IK to FK snapping, part 3</a> from <a href="http://vimeo.com/zethwillie">zeth willie</a> on <a href="http://vimeo.com/">Vimeo</a>.<br />
<br />
<br />
Oh, yeah. Here is the code for the basic version of the IK/FK script in python (the script using the message attrs will depend on your specific attr names):<br />
<pre class="brush:python">
import maya.cmds as cmds
import maya.OpenMaya as om
#select the joints we need
sel = cmds.ls(sl=True)
#assign selection
fkWrist = sel[0]
fkShldr = sel[1]
fkElbow = sel[2]
ikWrist = sel[3]
ikPv = sel[4]
#get positions from fk
fkwRaw = cmds.xform(fkwrist, ws=True, q=True, t=True)
fkwPos = om.MVector(fkwRaw[0], fkwRaw[1], fkwRaw[2])
fkeRaw = cmds.xform(fkelbow, ws=True, q=True, t=True)
fkePos = om.MVector(fkeRaw[0], fkeRaw[1], fkeRaw[2])
fksRaw = cmds.xform(fkshldr, ws=True, q=True, t=True)
fksPos = om.MVector(fksRaw[0], fksRaw[1], fksRaw[2])
#set position of IK wrist ctrl
cmds.move(fkwPos.x, fkwPos.y, fkwPos.z, ikwrist)
#start figuring out pole vector pos
#find avg (midpoint) of shoulder and wrist
midpoint = (fkwPos + fksPos) / 2
#find pv direction
pvOrigin = fkePos - midpoint
#extend that length
pvRaw = pvOrigin * 2
#position pvRaw at midpoint
pvPos = pvRaw + midpoint
#stick pole vector at pvPos
cmds.move(pvPos.x, pvPos.y, pvPos.z, ikpv)
</pre>
<br />
Once I get the little things hammered out in the zbw_messageMapper script that I showed in the video, I'll post that up too. . . <br />
<br />
EDIT: One more thing! Here's the link to Ryan Trowbridge's site. <a href="http://www.rtrowbridge.com/blog/">http://www.rtrowbridge.com/blog/ </a>Not sure how to access individual posts, but the post from March 09 has the video of the MasterClass on Vector Math in Maya. Good stuff. Also just bought his book on Python for Games and Film. Can't wait to read it!<br />
<br />Anonymoushttp://www.blogger.com/profile/05102473278182318901noreply@blogger.com20tag:blogger.com,1999:blog-100995272938801731.post-10332112132482119772012-06-28T17:13:00.000-04:002012-06-28T17:13:00.380-04:00Follow up on getting work . . .What this guys says:<br />
<a href="http://effectscorner.blogspot.com/2012/06/getting-visual-effects-job.html#.T-zE3nAmZG-">http://effectscorner.blogspot.com/2012/06/getting-visual-effects-job.html#.T-zE3nAmZG-</a><br />
How come he says it and it sounds smart and I say it and it comes out all curse words and aggressive?<br />
. . .<br />
F*&k him.<br />
<br />
BTW, Scott Squires is seriously legit. Great blog too.<br />
<br />
<br />Anonymoushttp://www.blogger.com/profile/05102473278182318901noreply@blogger.com0tag:blogger.com,1999:blog-100995272938801731.post-68710524461568931792012-06-15T13:55:00.001-04:002012-06-15T13:55:06.851-04:00transfer UV's follow up . . .A little while ago Nasheet posted a comment about solving some of the issues people were having with the transferUV script I posted here:<br />
<br />
"""<br />
It worked well for most of the meshes in my scene, but I did get the
same error as teezy5 for a couple of them, and I think I found a
solution. The error was thrown from:<br />
<br />
`getAttr ($targetOrig+".intermediateObject")`;<br />
<br />
The
problem in my case was that there was more than one object named
'$targetOrig' in my scene, and thus the return value of the 'getAttr'
was an int[] containing the intermediateObject values for all matching
objects, instead of just an int. In order to only get the unique
intermediateObject for the selected geometry, 'listRelatives' needs to
return the full dagpath. Basically, I just changed the line: <br />
<br />
<br />
string $targetShapes[] = `listRelatives-s $target`;<br />
<br />
to <br />
<br />
string $targetShapes[] = `listRelatives-s <b><span class="Apple-style-span" style="color: red;">-f</span></b> $target`;<br />
<br />
<br />
And it worked. That's it! Thank you again!<br />
"""<br />
Haven't had a chance to play with it, but sounds right to me. . . <br />
Thanks Nasheet!<br />
<br />
Here's the fixed script: <a href="http://www.catbuks.com/rigScripts/zbw_cleanTransferUV.mel">zbw_cleanTransferUV.mel</a><br />
<br />Anonymoushttp://www.blogger.com/profile/05102473278182318901noreply@blogger.com2tag:blogger.com,1999:blog-100995272938801731.post-46887876641474356532012-05-10T16:32:00.001-04:002012-05-10T16:32:28.949-04:00Autoswim-fish-expressions follow up . . .A couple of months ago I had someone (Patrice Berube) e-mail me a question about some of the behavior in the autoswim fish rig. Been pretty busy with work and all so never got around to posting about the issue . . .<br />
Basically, the problem was when one animated the frequency of the swimming fish (whole or part), over the frames where the animation occurs the sine wave function would freak out, go super fast, super slow, backwards, etc.<br />
Since the rig was made remotely for a studio, I never really got a chance to play with it too much once I made it and no one ever brought up the issue (I actually knew more or less what the animation would be, and animating the frequency never really entered into it. I also suspect that a lot of the animation was done on the FK controls). But once Patrice pointed out what the issue he was having, the problem became more clear.<br />
Essentially, through all of the expressions and such, time was constant (or moving constantly), but changing the frequency as time progressed would give kind of random values as you passed through the progression of frames (essentially, the sin values no longer had any sensible relationship to the values from the previous frame). My first reaction was, "uh oh! This will take some of that crazy math stuff to solve". But as we batted around a couple of emails about, we both kind of arrived at a similar solutions that were a bit more palatable (though I'd still like to know a math-y solution, I can't be bothered at this point).<br />
Here's the problem illustrated:<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhIYFklFjQFWk_e3cupBDo2IRL9r_brnpbdPSxz8gGTGuI1Ikvh8HbHiRNKYeKdap3tSdMqi4tWVsrY6mrvoJ3zqqiuFWtMDWYpzuIBoMZ4JK0wWJcyaK6eMg-DeRQbqAJLf8FWuESy12gD/s1600/sinewave.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="400" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhIYFklFjQFWk_e3cupBDo2IRL9r_brnpbdPSxz8gGTGuI1Ikvh8HbHiRNKYeKdap3tSdMqi4tWVsrY6mrvoJ3zqqiuFWtMDWYpzuIBoMZ4JK0wWJcyaK6eMg-DeRQbqAJLf8FWuESy12gD/s400/sinewave.jpg" width="400" /></a></div>
<br />
<br />
As you can see, the values that are coming out of the sine function (which is the basis for the joint rotation) are fine if you don't animate the freq. Predictable values, each frame (in this case) changing by a value of 1 in oscillating directions.<br />
But when you animate the freq it looks like it should make sense, but the values kind of suck. Starts out fine (delta of 1. Look I'm using mathy terms!), but then the changes become really unpredictable, sometimes almost 2, sometimes about zero. So the animation would look crazy.<br />
As it turns out the solution Patrice and I both realized independently (with Patrice actually implementing it, rather than just thinking about it :) is that rather than getting hard-core on the math, you could simply take the constant time out of the equation and not worry so much about animating the frequency. Instead, if you <i>create an attribute to take the place of time</i> (I thought to call it "time", he thought to call it "swimspeed". His is better) and simply animate that to make your fish swim, it would solve the problem. So in your expressions you'd simply replace "frame" with $swimspeed (which pulls the value of that attr), you could speed up or slow down the sine wave without fussing with the global frequency. A linear curve for "swimspeed" equals some version of normal time and messing with that curve will give you faster or slower time (as far as the fish rig is concerned).<br />
Note that you'd still have problems if you tried to animate the frequency of the individual controls (because those frequencies would be animated relative to the new "swimspeed" attr). But that's less of an issue. You can just set those frequencies to be whatever you'd like, per control and control the rest of the animation globally.<br />
Hope that helps anyone having this issue and big thanks to Patrice for pointing it out and working through the problem!Anonymoushttp://www.blogger.com/profile/05102473278182318901noreply@blogger.com3tag:blogger.com,1999:blog-100995272938801731.post-28610973992361753262012-03-31T00:15:00.000-04:002012-06-12T15:46:28.209-04:00holds and stuffHad a former student (and colleague!) ask me about some of the in/outs of the business side of things, as he was transitioning from full-time to freelance. The basic questions were: what can I do to turn holds into jobs? Are recruiters worth the time? What about Employer of Record places vs. SCorp/LLC for billing and taxes?<br />
Seemed like useful info to put out there generally, so here's (approximately) what I replied:<br />
"""<br />
re: holds . . .<br />
There's probably not much you can do about this. There are loads of reasons shops hold you rather than book. Most of the time they're feeling out people's availability before the client commits to them, so nothing you do would get a booking from them before they're guaranteed work. Some shops are just dicks and really push for a first hold from everyone in town like their hair's on fire. Then they never get back in touch with anyone if the job falls through or they go a different direction. Talked to producers about that from certain shops and they're like "yup. Sorry about that. They made me do it" Sometimes you're the backup, sometimes you're the primary target. You just never know. So my strategy is to not stress it too much and just give holds (if they insist I'll tell them where they are on the ladder, 1st, 2nd etc). The first person to put the money on the table wins. I'll call and offer challenges as a courtesy, but I never try to cherry pick jobs anymore. Too volatile. Pay me and I'm yours:) what a whore. But I'm usually on at least one hold, most of the time on two, occasionally on 3 or 4. That can get a bit hectic, but again I don't stress it too much. Most of the time one comes through and I give the courtesy of letting everyone else know. Communication with the producers and coordinators isn't a bad idea, they're the one's with the lists of names to call when a job comes up!<br />
re: freelancing and improving your odds <br />
The trick is to just work around wherever and whenever you can. I'm on a gig at XXXXX now (one of the shops I've been on hold with for about 50 times but was always booked elsewhere) and I know like 10 people there now from other random gigs or who just got off gigs with friends of mine, etc. So working breeds work. The folks I'm working with now will spread out and assuming I don't f&;^k up too bad, will remember me for a while and put my name in the hat wherever they move to. And I'll do the same. Before you know it, you'll know someone at just about every shop in town.<br />
re: recruiters and reps <br />
Recruiters are absolutely worthwhile. If only to get you INTO the places in the first place. At that point, it's the same as if you got the job yourself. Sometimes recruiters will get you mixed up with weird, painful little one off jobs, but even those pay the bills and you never know whether it'll be worth it or not in the long run, but money's money. It's a nice little backup, since you don't owe them anything while they try to drum up work. They also usually take their cut from the company or are fine pumping up your rate a bit to cover their fee if they can't. So you never really lose there.They can also help track down payments even if they didn't get you the gig (for some small percentage). I'd rather pay $150 or so to collect $5K and not have to be the heavy in some business relationship gone pear-shaped. <br />
Probably also worth getting yourself an scorp or LLC for billing purposes. F^%k those EOR's. I literally just got an LLC (had billed through a rep of mine for years, but it became a tax problem for her) just for the job I'm on now. And it paid for itself in about 1 1/2 weeks of work. XXXX(EOR) wanted 20% out of the first $10K (and 10% thereafter)! 20%! For submitting an invoice and not much else. As I said, f&;*k them. LLC's are easy. Scorps are bit more of pain re: taxes and such, but I know plenty of people who have em. I had my accountant help me but have friends who have done it online also.<br />
That help?<br />
Send me your contact info and reel and I'll pass it on when I can (cuz that's how it works!). <br />
"""<br />
<br />
So there it is. <br />
Some caveats: Obviously names of studios and stuff have been redacted. Always wanted to redact something. . .<br />
I'd also bet that there are some gotchas re: the specific implications of LLC's/S-Corps etc. As I said, I had my accountant do it. Safer and easier and not much more expensive.<br />
Bottom line re: holds, bookings, freelancing in general. . . If you're pretty good at what you do and (much) more importantly a pleasant person to be around, your dance card will fill up eventually. I've been in conversations with producers who will say things like "Nope. We can't hire her, she made some offensive statement around the EP. He hates her" or "Awww. So and so. He's such a good guy. Let's call him in" or "We had this one dude in and he looked like he was on crack. Not doing that again". Seriously. You will spend a LOT of time with the people you work with. Being a diligent worker and a nice person goes like 75% of the way to getting calls back and kickin ass at what you do doesn't hurt. If you are GREAT at what you do AND you're a good person to be around, you will work constantly, at least in any city that has a reasonable amount of work (I'm not making any assertions about my skills or how pleasant I am to be around:) But I can remember the name of every crazy talented, cool co-worker I've worked with over the years. It's not a big list, but I know that all of them work whenever and pretty much wherever they want (not to delve too deep into their inner wishes or anything . . .). I'd recommend (or hire) any of them in a heartbeat. Just saying. Work hard and be nice. It'll be like the shampoo commercial "she told her friend and she told her friend, and so on and so on. . . " Am I dating myself with that reference? <br />
Be honest about what you can and can't do. Get help when you're in the weeds and be honest about how long things will take you. If you having a crappy experience, tough it out (unless it's crazy or abusive) and cross that name off your list of places you'll work in the future. It's really not that hard and if you like variety (and pressure) freelancing can be a fun lifestyle. Sometimes. <br />
Happy hunting!Anonymoushttp://www.blogger.com/profile/05102473278182318901noreply@blogger.com0tag:blogger.com,1999:blog-100995272938801731.post-83907133521974779742012-03-09T13:27:00.000-05:002012-03-09T13:27:38.994-05:00Using Bump and/or Normal Maps for Pose Space "Deformations"That's a mouthful. Basically, this is a kind of addendum to the last post about animated textures. . . Similar, but different.<br />
The idea is that you can add cool little details to your character (or whatever) using bump and/or normal maps. But you may not want these details all the time (think frown lines on a forehead, or muscle striations on a character when he flexes his muscles). So the trick is to hook the texture up like you would a pose space deformation, only being activated when you want it to be, in certain poses. <br />
This is NOT so much about creating bump and normal maps, just about how you'd use them in this scenario.<br />
<iframe allowfullscreen="" frameborder="0" height="300" mozallowfullscreen="" src="http://player.vimeo.com/video/38137743?title=0&byline=0&portrait=0" webkitallowfullscreen="" width="400"></iframe><br />
<a href="http://vimeo.com/38137743">Maya/Rigging: Using "Animated" Bump and Normal Maps</a> from <a href="http://vimeo.com/zethwillie">zeth willie</a> on <a href="http://vimeo.com/">Vimeo</a>.Anonymoushttp://www.blogger.com/profile/05102473278182318901noreply@blogger.com2tag:blogger.com,1999:blog-100995272938801731.post-15303732263132356402012-03-09T13:21:00.001-05:002012-03-10T16:11:40.792-05:00Animating textures on your rigBeen asked a few times lately about using animated textures on a rig and how to control those textures. Like with most things in Maya there are a bunch of ways to do this . . . you could apply different textures to duplicates of geometry and literally swap geo for any given frame of texture you want, but that's a) a pain to set up and b) kinda like shooting a fly with bazooka. Heavier in your scene and more a pain to deal with. Instead, in this vid I'll go over a couple of different ways to use the ".frameExtension" of an image sequence to control what shows up as our texture. I also briefly discuss a more complicated way of doing the same thing using nuke and UV maps, which I covered in another tutorial.<br />
BTW, I talk about using this on a face in the video, but you could obviously use this on any kind of shader connection for any part of an object. Faces are just the most obvious. . .<br />
<iframe allowfullscreen="" frameborder="0" height="300" mozallowfullscreen="" src="http://player.vimeo.com/video/38122472?title=0&byline=0&portrait=0" webkitallowfullscreen="" width="400"></iframe><br />
<a href="http://vimeo.com/38122472">Maya/Rigging: Using Animated Textures</a> from <a href="http://vimeo.com/zethwillie">zeth willie</a> on <a href="http://vimeo.com/">Vimeo</a>.Anonymoushttp://www.blogger.com/profile/05102473278182318901noreply@blogger.com6tag:blogger.com,1999:blog-100995272938801731.post-46272814508529488652012-02-29T23:20:00.004-05:002013-01-24T15:01:58.868-05:00Triple Switch!That's gonna be the title for my new movie. . . Or the managerial move I make that loses my kid the little league championship game. . . Or a utility node in Maya. <br />
The triple switch is such a weird node. . . Not sure I've ever seen anyone use it in production. But in certain circumstances it can be useful and on rare occasions can be very handy indeed.<br />
Basically the idea of the node is that you can create a geometry-specific attribute of a single material. So, fer example, you could put one shader on 100 objects and have, say, the color be different for each object. Still using just one shader, mind you. . . the color is different for each object, but all the other attrs of the shaders behave as normal. Here's the vid about how that works.<br />
<iframe allowfullscreen="" frameborder="0" height="300" mozallowfullscreen="" src="http://player.vimeo.com/video/37695817?title=0&byline=0&portrait=0" webkitallowfullscreen="" width="400"></iframe><br />
<a href="http://vimeo.com/37695817">Maya: Using the Triple Switch utility node</a> from <a href="http://vimeo.com/zethwillie">zeth willie</a> on <a href="http://vimeo.com/">Vimeo</a>.<br />
<br />
<br />
It's kind of hard to imagine getting the most out of this node without some coding, since by definition the node becomes more useful the more stuff (and therefore connections) you have in your scene. . . Here's the code I used to set up the basic random color thingy from the video. To use it, hook the triple switch up to the material, apply the material shader to the objects. Select the TS, then the objects and run the code. Obviously, if you want different results (which you should, probably) then adjust whatever parameters and values you'd like:<br />
<pre class="brush:python">
//triple switch should already be created and connected to shader<br />
//select triple then objects<br />
string $sel[] = `ls -sl`;<br />
int $sizeObj = size($sel);<br />
string $triple = $sel[0];<br />
<br />
for ($i=1; $i<$sizeObj; $i++) {<br />
string $me = $sel[$i];<br />
select -r $me;<br />
<br />
//these are the per object attrs we're adding<br />
addAttr -at "float" -k 1 -ln "redMult";<br />
addAttr -at "float" -k 1 -ln "greenMult";<br />
addAttr -at "float" -k 1 -ln "blueMult";<br />
<br />
//these are the random values for those attrs<br />
float $rRand = `rand .75 1.25`;<br />
float $gRand = `rand .75 1.25`;<br />
float $bRand = `rand .75 1.25`;<br />
<br />
//assign the values to the attrs<br />
setAttr ($me + ".redMult") $rRand;<br />
setAttr ($me + ".greenMult") $gRand;<br />
setAttr ($me + ".blueMult") $bRand;<br />
<br />
//connect the objects to the TS<br />
string $child[] = `listRelatives -c $me`;<br />
string $shape = $child[0];<br />
string $meShape = ($shape + ".instObjGroups[0]");<br />
<br />
connectAttr ($meShape) ($triple+".input["+($i-1)+"].inShape");<br />
<br />
//connect the attrs to the TS at the same index the obj is connected<br />
connectAttr ($me + ".redMult") ($triple+".input["+($i-1)+"].inComp1");<br />
connectAttr ($me + ".greenMult") ($triple+".input["+($i-1)+"].inComp2");<br />
connectAttr ($me + ".blueMult") ($triple+".input["+($i-1)+"].inComp3");<br />
}<br />
<br />
}</pre>
<br />
EDIT: Here's the code I used to create the distance setup. Seems a bit wonky to do things this way, but it more or less works . . . The point here being that since you can use an attr to drive the triple switch, you can control <i>that</i> attr with any of the usual (or unusual means) you control attrs in Maya. For this one you'll need to create a ".tightenFalloff" attr on the measure object first. (BTW, you actually don't need to drive an attr with the distance numbers, you could just plug them into the triple switch directly, but that's a little mysterious for anyone who might use this. The point, again, was simply to illustrate that you don't need colors to drive the triple switch):<br />
<pre class="brush:python">///////////////////////<br />
//color by distance<br />
//////////////////////<br />
{<br />
//triple switch should already be created and connected to shader<br />
//select triple then measure object, then textured objects<br />
string $sel[] = `ls -sl`;<br />
int $sizeObj = size($sel);<br />
string $triple = $sel[0];<br />
string $mObject = $sel[1];<br />
<br />
for ($i=2; $i<$sizeObj; $i++) {<br />
string $me = $sel[$i];<br />
string $meDist = $me + "Distance";<br />
select -r $me;<br />
addAttr -at "float" -min 0 -max 1 -k 1 -ln "distance";<br />
<br />
//create distance node<br />
shadingNode -asUtility distanceBetween -n $meDist;<br />
connectAttr ($me + ".worldMatrix") ($meDist + ".inMatrix1");<br />
connectAttr ($mObject + ".worldMatrix") ($meDist + ".inMatrix2");<br />
connectAttr ($me + ".rotatePivotTranslate") ($meDist + ".point1");<br />
connectAttr ($mObject + ".rotatePivotTranslate") ($meDist + ".point2");<br />
<br />
//connect the distance to a mult node<br />
shadingNode -asUtility multiplyDivide -n ($me+"mult");<br />
connectAttr ($mObject+".tightenFalloff") (($me+"mult")+".input1X"); <br />
connectAttr ($meDist+".distance") (($me+"mult")+".input2X");<br />
<br />
//connect the dist node to the attr on the object<br />
connectAttr (($me+"mult")+".outputX") ($me+".distance");<br />
<br />
string $child[] = `listRelatives -c $me`;<br />
string $shape = $child[0];<br />
string $meShape = ($shape + ".instObjGroups[0]");<br />
<br />
connectAttr ($meShape) ($triple+".input["+($i-2)+"].inShape");<br />
<br />
connectAttr ($me + ".distance") ($triple+".input["+($i-2)+"].inComp1");<br />
connectAttr ($me + ".distance") ($triple+".input["+($i-2)+"].inComp2");<br />
connectAttr ($me + ".distance") ($triple+".input["+($i-2)+"].inComp3");<br />
}<br />
<br />
}</pre>Anonymoushttp://www.blogger.com/profile/05102473278182318901noreply@blogger.com12tag:blogger.com,1999:blog-100995272938801731.post-12636076978851364372012-02-28T23:29:00.000-05:002012-02-28T23:29:29.678-05:00Geo caching for easier animationSome students of mine were doing things that suggested geo-caching to me and I just used this on a job, so I was all like "wooohooo!". And then I made this video.<br />
Basically talks about the general idea of geo-caching and then I show one example of what I used this on recently. General gist of it: Maya, Geometry, Cached.<br />
Slightly less general gist: You'd use this to lighten some of the processing load in your scene, either by allowing you to eliminate heavy rigs or allowing you to use light version of your characters (i.e. just geo) for multiple instances of an animation. Basically baking animation into the geo itself for use later in various ways. So check it:<br />
<br />
<iframe allowfullscreen="" frameborder="0" height="225" mozallowfullscreen="" src="http://player.vimeo.com/video/37620139?title=0&byline=0&portrait=0" webkitallowfullscreen="" width="400"></iframe><br />
<br />
<b>Edit/Addendum - </b>Totally did not get back around to the bit about why the eyes and teeth didn't come along for the ride in the geo cache! Oops. That's Ok. The reading will do you good.<br />
Here's the deal. . . geo won't get written to the cache (at least the default Maya cache) if it doesn't have something driving the shape node itself (like skinning or other deformers). Simply translating or rotating the geo won't cut it since that stuff operates on the transform node and leaves the shape node to rest a bit. Soooo. . . since I usually connect things like eyes and gums/teeth into the rig via some combo of parenting to groups and constraining those groups (it's easy, clean), when I try to include those in the cache, they sit completely still, unaffected by caching party going on around them. So the easiest way around that is to just bind them to a joint, either existing or created just for that purpose. If you do it carefully, you won't even have to weight them (bind them separately from the rest of the geo, just to one selected joint). But they'll then be included in the caching. The other option is to set up some kind of follicle system on your cache-catching rig, the simple one, whereby you'd use follicles or rivets to stick things like the eyes and teeth to the cache-animated geo. A bit wonkier, but whatever gets ya through the night, amiright?Anonymoushttp://www.blogger.com/profile/05102473278182318901noreply@blogger.com7tag:blogger.com,1999:blog-100995272938801731.post-58562003769266705582011-11-08T11:49:00.000-05:002011-11-08T11:49:47.691-05:00Creating non-renderable "implicit" spheres, cones, cubesNot sure how I didn't know about these until recently. The names sound so passive-aggressive. . . <br />
<br />
<code>createNode implicitSphere -n "name";<br />
createNode implicitBox -n "name";<br />
createNode implicitCone -n "name";</code><br />
<br />
Each of these commands basically creates a non-renderable object (sphere, cube, cone) that has a very basic shape node (no components) and a transform node. You can still go into the shape node and change color using the drawing overrides and all. Doubt I'll be using them all the time or anything, but cool to know they are there if ever you should need them. Anonymoushttp://www.blogger.com/profile/05102473278182318901noreply@blogger.com3