<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>MathiesonFacer.com &#187; Tutorials</title>
	<atom:link href="http://www.mathiesonfacer.com/category/tutorials/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.mathiesonfacer.com</link>
	<description>Mathieson Facer - Rigging Technical Director</description>
	<lastBuildDate>Sat, 29 Oct 2011 21:54:03 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Separate blendshapes seamlessly in Maya</title>
		<link>http://www.mathiesonfacer.com/featured/separate-blendshapes-seamlessly-in-maya/</link>
		<comments>http://www.mathiesonfacer.com/featured/separate-blendshapes-seamlessly-in-maya/#comments</comments>
		<pubDate>Sat, 29 Oct 2011 21:54:03 +0000</pubDate>
		<dc:creator>Mat</dc:creator>
				<category><![CDATA[Featured]]></category>
		<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://www.mathiesonfacer.com/?p=1264</guid>
		<description><![CDATA[Last week, I had to come up with a way of separating one blendshape into multiple blendshapes. So basically, imagine we have one blendshape of a full smile and we need to separate it into left and right. If you go to the Edit Deformers menu, there is an option to paint blendshape weights. This [...]]]></description>
			<content:encoded><![CDATA[<p>Last week, I had to come up with a way of separating one blendshape into multiple blendshapes. So basically, imagine we have one blendshape of a full smile and we need to separate it into left and right.</p>
<p>If you go to the Edit Deformers menu, there is an option to paint blendshape weights. This is the tool we will be using, but the tricky part of separating blendshapes like this is the overlap area between the shapes. Since blendshapes are additive, if the overlap area is not done properly, when both blendshapes are enabled you may run into areas where it is morphing more or less than what you intended.</p>
<p><span id="more-1264"></span></p>
<p>So, our issue is essentially that these weights are not normalized. There is a simple solution to this problem: paint the weights using a skin node so that they are normalized, and then transfer the weights over to our blendshape node.</p>
<p>To do this, you will need to have good UVs set up for your mesh. They don&#8217;t have to be perfect, but they definitely cannot have any faces overlapping. When the UVs are good to go, duplicate your mesh. This is the mesh we will add the skin node to.</p>
<p>For our example, we are separating our main blendshape into left and right blendshapes. Create two joints and name them &#8220;left_blendshape&#8221; and &#8220;right_blendshape&#8221;. It doesn&#8217;t matter where you place these joints, as we are not going to be using them to deform the mesh. All we care about is getting the weights. Select these two joints and your skinning mesh and then create a smooth bind skin node. Paint your weights for however you want the shapes to be separated. The weights will be normalized so that all influences combined will add up to 1, which means our blendshapes will also add up to 1.</p>
<p>To transfer the weights over to your blendshape, select your skinned mesh and go to Skin &gt; Edit Smooth Skin &gt; Export Skin Weight Maps. Click on the options box. We want to export the luminance. Increase the map size to something large so get as much data transferred as possible. I use 2048&#215;2048. Choose TIFF as the file format. Export the maps to wherever you want, just as long as you remember where you saved them to.</p>
<p>Now, on your mesh that has the blendshape set up, so to Edit Deformers &gt; Paint Blend Shape Weights Tool. Click on the options box to bring up the tools panel. Select your main blendshape that your are wanting to separate into left and right shapes. Go down to Attribute Maps &gt; Import. Make sure Luminance is chosen for Import value and then click on the Import button. Navigate to the folder where you exported your weight maps to from the skin node. Load the &#8220;left_blendshape&#8221; map and when you set the weight for the main blendshape to 1, it should only enable the blendshape on the left side. Duplicate the mesh, and you now have your blendshape for the left side. Repeat this process to get your right side blendshape as well.</p>
<p>Now that you have both your right and left blendshapes as separate meshes, select them both, select your main, undeformed mesh, and create a new blendshape node. The new blendshape node should now have both your left and right side blendshapes, and if you set both of their weights to 1 in the channel box they should add together perfectly and look exactly like the main blendshape that you started the process with.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mathiesonfacer.com/featured/separate-blendshapes-seamlessly-in-maya/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sticky Lips: How To &amp; Sample File</title>
		<link>http://www.mathiesonfacer.com/featured/sticky-lips-how-to-sample-file/</link>
		<comments>http://www.mathiesonfacer.com/featured/sticky-lips-how-to-sample-file/#comments</comments>
		<pubDate>Sun, 19 Jun 2011 00:53:11 +0000</pubDate>
		<dc:creator>Mat</dc:creator>
				<category><![CDATA[Featured]]></category>
		<category><![CDATA[R&D]]></category>
		<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://www.mathiesonfacer.com/?p=1076</guid>
		<description><![CDATA[It was requested that I release my sticky lips setup so people could try to take the solution further. I haven&#8217;t spent much time on it since posting about it way back, so I figured I might as well. Only thing I ask of anybody that does further develop this is please provide a link [...]]]></description>
			<content:encoded><![CDATA[<p>It was requested that I release my sticky lips setup so people could try to take the solution further. I haven&#8217;t spent much time on it since posting about it way back, so I figured I might as well. Only thing I ask of anybody that does further develop this is please provide a link back to my website and keep me up to date on any improvements you have made :)</p>
<p><a href="http://www.mathiesonfacer.com/wp-content/sampleFiles/stickyLips.zip">Click here to download the sample file</a> (Made in 3ds Max 2010, and is of a Sackboy-looking teapot since I do not want to be distributing the model seen below, which is not mine, around the internets)</p>
<p>A video of the effect in action. Special thanks to Craig Hobbs for use of the model:</p>
<p><object width="546" height="410" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://vimeo.com/moogaloop.swf?clip_id=25393000&amp;server=vimeo.com&amp;show_title=0&amp;show_byline=0&amp;show_portrait=0&amp;color=00adef&amp;fullscreen=1&amp;autoplay=0&amp;loop=0" /><embed width="546" height="410" type="application/x-shockwave-flash" src="http://vimeo.com/moogaloop.swf?clip_id=25393000&amp;server=vimeo.com&amp;show_title=0&amp;show_byline=0&amp;show_portrait=0&amp;color=00adef&amp;fullscreen=1&amp;autoplay=0&amp;loop=0" allowfullscreen="true" allowscriptaccess="always" /></object></p>
<p>For now I am just going to do a general write-up of some things I am doing in the file and why I am doing them. It might sound like a tutorial at parts, but I&#8217;m more just explaining the general process and thoughts behind the setup. This is not intended to actually be a tutorial, and you may still have to figure some things out on your own.<span id="more-1076"></span></p>
<p><span style="text-decoration: underline;"><strong>PLEASE NOTE</strong></span>: This has not yet been tested in a production scenario; it is just some RnD work I have been doing. The solution does work and is simple to set up, but it does get slow with heavier meshes. This should only be used in the final render rig, as being in the animation rig will make the animator&#8217;s life miserable.</p>
<p><span style="text-decoration: underline;"><strong>UPDATE 1:</strong></span> I may already have an improved method, thanks to <a href="http://www.penproductions.ca/" target="_blank">Paul Neale</a>, for doing this that is much better when it comes to speed and also solves the issue of hands and other extremities passing through the volume selected falloff area. I still have to test it.</p>
<p><span style="text-decoration: underline;"><strong>UPDATE 2:</strong></span> The new method is quite improved, nearly doubling the FPS of the previous method. I am not going to share the new method here, as it basically uses the same ideas listed below. There is only a slight difference, but I will leave that up to you to figure out. I don&#8217;t want to give everything away :)</p>
<hr />
<p>There are a few tricks to this set up. The keys are to have a volume select modifier, a spline with a sweep modifier, a duplicated mesh of your character&#8217;s head, and a morpher modifier above your skin modifier. Its thinking outside the box a little bit, and may seem kind of confusing at first, but after doing it once or twice it really is quite simple.</p>
<p>You&#8217;ll want to start setting this up after you have the jaw skinned for your character. Once you have the jaw all skinned and looking pretty, you need to duplicate the skinned mesh. The only alterations you need to make on this duplicated mesh is with the skinning around the mouth. Change the skinning of the lips so that they remain sealed when the jaw opens. This is how your lips will look when they stick. If you want to improve performance, you can remove all bones from the skin modifier except for the head and jaw bone (or whatever bones are actually influencing the lip area on your mesh). Un-hide the node &#8220;hlp_lips_geo&#8221; in the sample scene to see how mine were set up.</p>
<p>On the original mesh, you will notice there is a morpher modifier above the skin modifier. The reason for it being above the skin modifier is that we want the mesh to assume the absolute pose of our sticky lips mesh, so we want it to morph <em>after</em> the skinning has affected it. Having it below the skin modifier just doesn&#8217;t produce the same result. So, add the morpher modifier above the skin modifier, and then pick the duplicate &#8220;sticky lips&#8221; mesh as the target and turn it up to 100.</p>
<p>If you test it out at this point, you&#8217;ll notice the mesh just morphs back to whatever pose the duplicate mesh was in at the time it was picked. This isn&#8217;t what we want. There is a checkbox in the morpher modifier called &#8220;Automatically reload targets&#8221;. This needs to be enabled. This checkbox does exactly what it says and automatically reloads our target mesh. What this means is, since our target mesh is skinned, it will always morph to the current skinned state of the mesh. Once this is enabled, things should look a little better.</p>
<p>Now our lips are sticking, but they&#8217;re never un-sticking. This is where the volume select and a spline with a sweep come into play. Select the edges of the lower or upper lip, where they would be sticking, from one corner of the mouth to the other, and extract the edges as a shape. You can just go and make your own spline shape if you want, I just find this to be easiest and the most accurate method of getting the shape. Once the spline is created, it needs a sweep modifier so it had some thickness to it. This spline is what will be driving our volume select modifier, which is controlling our morpher modifier.</p>
<p>Up next, we need to add the volume select to the main head mesh, under the morpher modifier. Change the settings to what I have set up in the sample file. The main things to change are selection level to vertex, and select by mesh object, picking your spline. Enabling soft selection here is quite important, and you will have to play with the settings further down the road when you are fine tuning the stickiness.</p>
<p>We need the spline to follow the mouth&#8217;s skinning now. We want it to sit in the middle of the lips when opening, so the easiest way to achieve this is to skin wrap it to the duplicate mesh and then convert to skin. I had some errors with Max when leaving the skin wrap on the spline after converting it to skin; I consistently experienced issues with the viewport no longer redrawing, and the odd time Max would crash. The great thing about this method, and using a skin wrap here, is that if you have morph targets set up for your head you can easily extract matching shapes for your spline. You can even write a script to just go and automatically extract all shapes and set up a new morpher on the spline, making all the same connections as on the head&#8217;s morpher.</p>
<p>I have given the animator some manual controls for the stickiness. You can find these controls on the attribute holder on the jaw control object. I rigged the spline using a simple affect region modifier, connecting the side to side motion up to the slider labelled &#8220;Unstick Point&#8221; and then connecting the depth of the affect region (the y-axis of the end point) to the &#8220;Unstick&#8221; spinner. I also connected up the falloff from the affect region to the &#8220;Sticky Range&#8221; slider, pinch from the affect region to the &#8220;Sticky Pinch&#8221; spinner, and the morph target on the main head to the &#8220;Sticky Enabled&#8221; spinner. There may be other settings that would be useful for the animator to have control of, but this is all I&#8217;ve chosen to do in this example. Play around with each to see how it affects the end result. You may also want to play with the soft selection settings on the volume select, or the radius on the sweep modifier.</p>
<p>The reason this solution has speed issues is mostly because of the volume select modifier. It will work best with lower density meshes. Also, since it is generating a selection based on vertices being within a certain range of the spline object, if the character&#8217;s hand belongs to the same mesh and goes within this range, it may cause some issues. Just some things to consider. I am already thinking up ways to get around these issues, but I haven&#8217;t tested any of them yet.</p>
<p>That&#8217;s all for now. I just wanted to get this posted. Hope you&#8217;ve found it helpful! If you do not fully understand something I am explaining above, try examining the Max file to figure out what I did. If it still doesn&#8217;t make sense, feel free to leave your question in the comments below. Positive feedback is always welcome too :)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mathiesonfacer.com/featured/sticky-lips-how-to-sample-file/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Using StretchTM</title>
		<link>http://www.mathiesonfacer.com/featured/using-stretchtm/</link>
		<comments>http://www.mathiesonfacer.com/featured/using-stretchtm/#comments</comments>
		<pubDate>Mon, 29 Mar 2010 01:21:46 +0000</pubDate>
		<dc:creator>Mat</dc:creator>
				<category><![CDATA[Featured]]></category>
		<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://www.mathiesonfacer.com/?p=857</guid>
		<description><![CDATA[StretchTM is a useful property found on nodes, but it is somewhat hidden. It is particularly useful for bones.In this video I cover two uses of the StretchTM matrix. I show how you can set up bones to stretch along with another bone, as well as how to change the wirecolor of a bone based [...]]]></description>
			<content:encoded><![CDATA[<p>StretchTM is a useful property found on nodes, but it is somewhat hidden. It is particularly useful for bones.<br style="padding: 0px; margin: 0px;" /><br style="padding: 0px; margin: 0px;" />In this video I cover two uses of the StretchTM matrix. I show how you can set up bones to stretch along with another bone, as well as how to change the wirecolor of a bone based on how far it has been stretched.</p>
<p><object width="546" height="410"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=10292114&amp;server=vimeo.com&amp;show_title=0&amp;show_byline=0&amp;show_portrait=0&amp;color=00adef&amp;fullscreen=1&amp;autoplay=0&amp;loop=0" /><embed src="http://vimeo.com/moogaloop.swf?clip_id=10292114&amp;server=vimeo.com&amp;show_title=0&amp;show_byline=0&amp;show_portrait=0&amp;color=00adef&amp;fullscreen=1&amp;autoplay=0&amp;loop=0" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="546" height="410"></embed></object></p>
]]></content:encoded>
			<wfw:commentRss>http://www.mathiesonfacer.com/featured/using-stretchtm/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Parameter Wire Copying</title>
		<link>http://www.mathiesonfacer.com/featured/parameter-wire-copying/</link>
		<comments>http://www.mathiesonfacer.com/featured/parameter-wire-copying/#comments</comments>
		<pubDate>Fri, 19 Mar 2010 19:23:34 +0000</pubDate>
		<dc:creator>Mat</dc:creator>
				<category><![CDATA[Featured]]></category>
		<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://www.mathiesonfacer.com/?p=853</guid>
		<description><![CDATA[Max does not allow you to copy/paste parameter wires, as it does with most other controller types. This is still capable, however, through MAXScript.This video shows you how to go about creating an instance (cake walk) and unique copy. When creating a unique copy, it copies the controller but the wire no longer updates along [...]]]></description>
			<content:encoded><![CDATA[<p>Max does not allow you to copy/paste parameter wires, as it does with most other controller types. This is still capable, however, through MAXScript.<br style="padding: 0px; margin: 0px;" /><br style="padding: 0px; margin: 0px;" />This video shows you how to go about creating an instance (cake walk) and unique copy. When creating a unique copy, it copies the controller but the wire no longer updates along with it&#8217;s targeted track. Really, all the copy needs is a kick in the butt to get it to start working again.<br style="padding: 0px; margin: 0px;" /><br style="padding: 0px; margin: 0px;" />This can really help improve workflow, as it allows you to set up instances of wires throughout your rig and easily copy from one track to the next rather than manually connecting each time.</p>
<p><object width="546" height="410"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=10290747&amp;server=vimeo.com&amp;show_title=0&amp;show_byline=0&amp;show_portrait=0&amp;color=00adef&amp;fullscreen=1&amp;autoplay=0&amp;loop=0" /><embed src="http://vimeo.com/moogaloop.swf?clip_id=10290747&amp;server=vimeo.com&amp;show_title=0&amp;show_byline=0&amp;show_portrait=0&amp;color=00adef&amp;fullscreen=1&amp;autoplay=0&amp;loop=0" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="546" height="410"></embed></object></p>
]]></content:encoded>
			<wfw:commentRss>http://www.mathiesonfacer.com/featured/parameter-wire-copying/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>FFD Mirroring</title>
		<link>http://www.mathiesonfacer.com/featured/ffd-mirroring/</link>
		<comments>http://www.mathiesonfacer.com/featured/ffd-mirroring/#comments</comments>
		<pubDate>Thu, 18 Feb 2010 01:32:14 +0000</pubDate>
		<dc:creator>Mat</dc:creator>
				<category><![CDATA[Featured]]></category>
		<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://www.mathiesonfacer.com/?p=736</guid>
		<description><![CDATA[I&#8217;ve always found mirroring FFD Spacewarps to be a real pain. I finally decided to play a bit earlier today to try to find a good way of doing it rather than settling for a negative scale in the x-axis or roughing out a &#8220;mirrored&#8221; version. So, we all know negative scale is a bad [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve always found mirroring FFD Spacewarps to be a real pain. I finally decided to play a bit earlier today to try to find a good way of doing it rather than settling for a negative scale in the x-axis or roughing out a &#8220;mirrored&#8221; version.</p>
<p>So, we all know negative scale is a bad thing; however, mirroring without getting a negative scale is not as straight forward and easy as simply clicking the mirror button in the tool bar.  There are ways of getting around this for things such as morph targets: most straight forward in Max 2010 is using Symmetry Tools in the Graphite Modeling Tools. I&#8217;ve always found it to be extra tedious though when dealing with FFD Spacewarps. They are often warped into very obscure shapes for cartoon-style characters, and unfortunately the Graphite Tools only deal with Editable_Poly classes.  FFD Spacewarps are also a bit of a black hole when it comes to MAXScript, so as far as I know you can&#8217;t just go and write a tool to do it either.</p>
<p><span id="more-736"></span></p>
<p>Anyways, I&#8217;ve put together a little tutorial for how to get the mirrored version of an FFD Spacewarp without a negative scale. It uses a similar method to one that has been floating around for quite a while for mirroring morph targets (not sure where original credit is due, sorry :S), but it just requires a few slight edits for tricking Max to doing it with FFDs.</p>
<p><object width="546" height="410" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://vimeo.com/moogaloop.swf?clip_id=9537276&amp;server=vimeo.com&amp;show_title=0&amp;show_byline=0&amp;show_portrait=0&amp;color=00adef&amp;fullscreen=1&amp;autoplay=0&amp;loop=0" /><embed width="546" height="410" type="application/x-shockwave-flash" src="http://vimeo.com/moogaloop.swf?clip_id=9537276&amp;server=vimeo.com&amp;show_title=0&amp;show_byline=0&amp;show_portrait=0&amp;color=00adef&amp;fullscreen=1&amp;autoplay=0&amp;loop=0" allowfullscreen="true" allowscriptaccess="always" /></object></p>
<p>EDIT: Please read the comment below from Ehsan Kiani. I overlooked the fact that FFDs have internal vertex points, while poly boxes do not. This means that any internal vertices will not be mirrored properly. He has provided a solution to this in the comment below.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mathiesonfacer.com/featured/ffd-mirroring/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Z-Depth &amp; Fog in One</title>
		<link>http://www.mathiesonfacer.com/featured/z-depth-fog-in-one/</link>
		<comments>http://www.mathiesonfacer.com/featured/z-depth-fog-in-one/#comments</comments>
		<pubDate>Fri, 11 Jul 2008 02:34:03 +0000</pubDate>
		<dc:creator>Mat</dc:creator>
				<category><![CDATA[Featured]]></category>
		<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://www.mathiesonfacer.com/wordpress/?p=203</guid>
		<description><![CDATA[This tutorial will show you how to get Z-Depth and fog in compositing out of the same render pass. It will also show you how to tweak your fog without having to go back and re-render from your 3d package. The tutorial is aimed at beginner to intermediate level compositors. The technique for getting Z-Depth [...]]]></description>
			<content:encoded><![CDATA[<p>This tutorial will show you how to get Z-Depth and fog in compositing out of the same render pass. It will also show you how to tweak your fog without having to go back and re-render from your 3d package. The tutorial is aimed at beginner to intermediate level compositors. The technique for getting Z-Depth and fog from the same render pass is not recommended for all situations but is definitely helpful if you have limited resources and cannot afford to render passes for both.</p>
<p>I will be using 3ds Max 2008 and After Effects CS3 for this tutorial although the techniques can be applied to any software packages.</p>
<p><span id="more-203"></span></p>
<p><a href="http://www.mathiesonfacer.com/wp-content/sampleFiles/zdepthFog/zDepthAndFog_start.max">Click here to download the Max file I am using for this tutorial.</a></p>
<p>We&#8217;ll start off by just rendering a beauty pass of our scene.</p>
<p><img class="alignnone" title="zdepthFog01" src="http://www.mathiesonfacer.com/wp-content/images/zdepthFog/zdepthFog01.png" alt="" width="594" height="334" /></p>
<p>Next we will render off our Z-Depth/fog pass. For now we will do this through Max&#8217;s render elements. Open your render scene dialog and go to the &#8220;Render Elements&#8221; tab. Click the &#8220;Add &#8230;&#8221; button and add a Z-Depth render element.</p>
<p><img class="size-full wp-image-637 alignleft" title="zdepthFog02" src="http://www.mathiesonfacer.com/wp-content/images/zdepthFog/zdepthFog02.jpg" alt="zdepthFog02" /></p>
<p>There are a few things you will need to do here in order to get the result we want. For many of the render elements filtering is enabled by default, but for some reason it is not for Z-Depth. Make sure the &#8220;Enable Filtering&#8221; button is checked otherwise we will possibly get rough edges around our geometry&#8217;s edges.</p>
<p>You will also notice at the bottom of the rollout, with our Z-Depth render element selected, two spinners asking for a &#8220;Z-Min&#8221; and &#8220;Z-Max&#8221; value. These values are where our Z-Depth map begins and ends in Z-space, relative to the camera. I find the best method for getting these values is to select the camera we are going to be using and in the modify panel choose to show the camera&#8217;s environment ranges. We then get a perfect visual representation of these ranges and the values to just copy over.</p>
<p>So play around with the environment ranges until you find values that you feel will work well for you and then copy them over to the Z-Min and Z-Max values in the render elements rollout.</p>
<p>Now if we click render, and we render from the proper camera, after the render finishes our Z-Depth pass will pop up. Save the image as PNG with alpha and open up After Effects.</p>
<p><img class="alignnone size-full wp-image-638" title="zdepthFog03" src="http://www.mathiesonfacer.com/wp-content/images/zdepthFog/zdepthFog03.png" alt="zdepthFog03" /></p>
<p>Start a new file, import footage for both our beauty pass and depth pass. When asked how to interperate the depthPass, choose to &#8220;Ignore&#8221; alpha (we&#8217;re just not going to use it in this example). When your footage has been brought in, create a new comp using both pieces of footage.</p>
<p>Put your beautyPass on the layer above your depthPass. Right click on the beautyPass and go to &#8220;Effect/Blur &amp; Sharpen&#8221; and add a Lens Blur. Your scene should now look similar to this.</p>
<p><img class="alignnone size-full wp-image-639" title="zdepthFog04" src="http://www.mathiesonfacer.com/wp-content/images/zdepthFog/zdepthFog04.jpg" alt="zdepthFog04" /></p>
<p>In the top left you will see our Lens Blur effect controls. Click next to &#8220;Depth Map Layer&#8221; where it says &#8220;None&#8221;. You have an option between beautyPass.png and depthPass.png here, choose depthPass. The only thing to note here is that the choices only consist of layers that exist in your current comp, if you removed depthPass.png from your comp you would not be able to choose it.</p>
<p>As soon as you choose depthPass.png you will notice the blurring on your image change as your depthPass is now determining how your image is blurred. This is probably not the result we are looking for though, so the next settings we are going to tweak is the &#8220;Blur Focal Distance&#8221; and &#8220;Iris Radius&#8221;.</p>
<p>The blur focal distance is what determines what area of your image is going to be in focus, not hard to figure out. Without knowing how it works though you will probably just play around with the value and guess at it until you are happy with what your image looks like, but if you know how it is being used by the program you can get pin-point accuracy with your depth blur.</p>
<p>If you ramp the blur focal distance value up as far as it can go you will notice it stops at 255. If you know about color values, each the of the red, green, and blue channels range from 0 to 255 and <img class="alignright" title="zdepthFog05" src="http://www.mathiesonfacer.com/wp-content/images/zdepthFog/zdepthFog05.jpg" alt="" width="399" height="283" />when all 3 are equal to the same number you get a shade of gray. Our Z-Depth pass is a grayscale image ranging from black to white. The blur focal distance is really just telling After Effects what area of your image should be in focus according to the gray value in your depthPass.</p>
<p>Choose an area of your image that you would like to be in focus. Click the eyeball icon to the left of your beautyPass layer in order to hide it and see the depthPass underneith. Move your mouse cursor to hover overtop of the area you chose to be in focus and take note of the &#8220;Info&#8221; window in the top right of your screen. The info window will give you the color value of the pixel your mouse is currently hovering over. All three values for R, G, and B should be the same. Type this value in for your blur focal distance and unhide your beautyPass. Your image should now be focused on the correct spot.</p>
<p>Now adjust the &#8220;Iris Radius&#8221;, no special tricks to this one, to the value you see fit. It is basically just the blur amount. Here is how the image should look now, notice the subtle blur.</p>
<p><img class="alignnone size-full wp-image-641" title="zdepthFog06" src="http://www.mathiesonfacer.com/wp-content/images/zdepthFog/zdepthFog06.jpg" alt="zdepthFog06" /></p>
<p>Now we are going to create our fog. We are going to do a few steps before we begin. Select your beautyPass layer and go to the &#8220;Layer&#8221; menu in the top menu bar and select &#8220;Pre-Compose&#8221;, way down at the bottom. A window will pop up and prompt you. Enter &#8220;beautyWithFog&#8221; as your &#8220;New composition name&#8221;, choose &#8220;Leave all attributes in &#8216;beautyPass&#8217;&#8221;, and check the box for &#8220;Open New Composition&#8221;.</p>
<p>The reason we are creating a new composition for our beautyPass is that when we put the fog overtop of our footage we want our fog to be blurred by the Z-Depth as well. Choosing &#8220;Leave all attributes in &#8216;beautyPass&#8217;&#8221; means that although we are moving our selected layers to a new composition, any existing effects on our selection will remain in this composition and be applied to the new comp that is taking the place of our current selection.</p>
<p style="padding-left: 30px;"><em>EDIT (Attempt at further clarification of the previous paragraph, as requested by André): </em></p>
<p style="padding-left: 30px;"><em>We are creating a new composition for our beautyPass because we want both our beautyPass and fogPass to be affected by the Z-Depth&#8217;s blurring effect. What we do not want is our beautyPass to be blurred by the Z-Depth and the fog to not be blurred. </em></p>
<p style="padding-left: 30px;"><em>By performing a &#8220;Pre-Compose&#8221; on the beautyPass, we are creating a new composition where the beautyPass will now reside. This new composition we are creating will immediately replace our beautyPass in the current composition, and will not change the visual appearance of our current composition.</em></p>
<p style="padding-left: 30px;"><em>Since there were effects applied to the beautyPass, the &#8220;Leave all attributes in beautyPass&#8221; checkbox will give us two options.</em></p>
<p style="padding-left: 30px;"><em>1) Have those effects remain applied to the beautyPass and carry down to the new composition</em><br />
<em>2) Apply those effects to the new composition where the beautyPass will now exist</em></p>
<p style="padding-left: 30px;"><em>By choosing to apply the effects to the newly created composition, rather than remain applied to the beautyPass, we can add more footage to that composition and the effects will automatically affect that footage as well. So, we can add the fog pass on top of the beautyPass, and the fog will receive the same blurring effect the beautyPass was receiving.</em></p>
<p style="padding-left: 30px;"><em>A bit tricky to explain, especially when trying to do so in a limited number of words. Hopefully this helps to explain it further.</em></p>
<p>Now that we have our new comp created and open you will notice the blur is no longer there, that is okay. Go to your project bin and drag the depthPass footage into the current comp, placing it on top of your beautyPass layer. Change the blending mode from &#8220;Normal&#8221; to &#8220;Screen&#8221; (This might be currently hidden. Right click the bar above your footage, go to columns, and make sure &#8220;Modes&#8221; has a checkmark beside it.).</p>
<p><img class="alignnone size-full wp-image-642" title="zdepthFog07" src="http://www.mathiesonfacer.com/wp-content/images/zdepthFog/zdepthFog07.jpg" alt="zdepthFog07" /></p>
<p>You will now notice that the fog is actually at the front of your image, to fix this we will simply add an invert effect to our footage. You can find invert in the channel category of your effects. Your image should now look like this.</p>
<p><img class="alignnone size-full wp-image-643" title="zdepthFog08" src="http://www.mathiesonfacer.com/wp-content/images/zdepthFog/zdepthFog08.jpg" alt="zdepthFog08" /></p>
<p>Now we are going to fine tune our fog to how we want it. Believe it or not, but we have almost all the same control over it in After Effects as we do with Max&#8217;s built in fog render effect, and even a little extra in some areas. All we need for this is a &#8220;Levels&#8221; effect to be added to our depthPass layer, so do that now. You can find levels in the color correction category.</p>
<p><img class="alignnone size-full wp-image-644" title="zdepthFog09" src="http://www.mathiesonfacer.com/wp-content/images/zdepthFog/zdepthFog09.jpg" alt="zdepthFog09" /></p>
<p>The image above is showing control commonalities; 3ds Max on the left, After Effects on the right. If you play with these values in both software packages you will see that they give the exact same results, you even get more control over the exponential falloff by having three control points as opposed to one checkbox.</p>
<p>Other parameters in Max, such as color, environment color map, environment opacity map, and the entire layered fog type, are not as easily accessible in After Effects but are still attainable, you just need to get creative! For example, you can change the color by adding a &#8220;Hue/Saturation&#8221; effect to your depthPass layer and checking the &#8220;Colorize&#8221; option. You can get the same effect as the environment opacity map and layered fog by playing around with masks.</p>
<p>Anyways, tweak your fog settings until you find something you are happy with. I went with values of 32 for Input Black, 255 for Input White, and 0.70 for Gamma, all of which relate to the exponential falloff in Max, and then a value of 18 for Output Black (Near %) and 153 for Output White (Far %).</p>
<p>Go back to your main comp and you will see that we now have fog and Z-Depth from the same pass and they are working in unicen. Here is what your final image should look like.</p>
<p><img class="alignnone size-full wp-image-645" title="zdepthFog10" src="http://www.mathiesonfacer.com/wp-content/images/zdepthFog/zdepthFog10.jpg" alt="zdepthFog10" /></p>
<p>Well! Thats all! I hope you have found this tutorial helpful.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mathiesonfacer.com/featured/z-depth-fog-in-one/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Stretchy Twist Bones</title>
		<link>http://www.mathiesonfacer.com/featured/stretchy-twist-bones/</link>
		<comments>http://www.mathiesonfacer.com/featured/stretchy-twist-bones/#comments</comments>
		<pubDate>Mon, 23 Jun 2008 02:29:59 +0000</pubDate>
		<dc:creator>Mat</dc:creator>
				<category><![CDATA[Featured]]></category>
		<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://www.mathiesonfacer.com/wordpress/?p=199</guid>
		<description><![CDATA[Many character rigs require both stretchy limbs and twist bones in the same appendage. It can be tricky to get these two things working in unicen, and there are many different methods. I am going to show you the technique I have been using as of late. I prefer this method because it is very [...]]]></description>
			<content:encoded><![CDATA[<p>Many character rigs require both stretchy limbs and twist bones in the same appendage. It can be tricky to get these two things working in unicen, and there are many different methods. I am going to show you the technique I have been using as of late. I prefer this method because it is very straight forward, easy to set up and easy to maintain.</p>
<p>This tutorial is being done in 3ds Max 2008 and uses some beginner level MAXScript. <a href="http://www.mathiesonfacer.com/wp-content/sampleFiles/stretchyTwistBones/stretchyTwistBones_start.max">Click here to download the starting max file</a>.</p>
<p><span id="more-199"></span></p>
<p>I suggest first watching Paul Neale&#8217;s <a href="http://www.paulneale.com/tutorials/IKFKarm/IKFKarmSetup.html" target="_blank">IK/FK Arm video tutorial</a> and <a href="http://www.paulneale.com/tutorials/twistBones/twistBones.html" target="_blank">Twist Bones video tutorial</a> before going any further. I will be refering to many things he covers in these videos, I will be starting this tutorial where Paul leaves off at the end of his IK/FK Arm tutorial, and will be using the same technique for twist bones that Paul explains in his Twist Bones tutorial just implementing it in a different way.</p>
<p>The entire idea behind this method is that the twist bones are just going along for the ride with the blend bones, so we can set up our IK/FK blend system and stretch system fully and then just add the twist bones in after. Again, the twist bones are just going along for the ride, we are essentially keeping them completely separated from the actual rig.</p>
<p>Here is how your viewport should look when you open the starting file:</p>
<p><img class="alignnone size-full wp-image-646" title="stretchyTwistBones01" src="http://www.mathiesonfacer.com/wp-content/images/stretchyTwist/stretchyTwistBones01.jpg" alt="stretchyTwistBones01" width="594" height="462" /></p>
<p>We will begin by putting our stretchy limb system in place. The way I like to do this is through the position list that should already exist on your blend bones, if you remembered to freeze their transform. I have a few reasons for doing it this way. The main reason is that if you put the stretchy limb system on the IK bones you need to set up position constraints on the blend system for it to blend to the stretched out position. Having position constraints on the blend system can create issues with the bones separating, the same reason you have to use look-at constraints and point helpers when creating a stretchy bone.</p>
<p>So, go to the nub bone of the blend bones chain, go into your curve editor and add a Position XYZ controller to the available slot and then in the Motion Panel rename it to &#8220;IK Stretch&#8221;. Then go back into the curve editor and add a float script controller to the X Position of IK Stretch. Create three new variables in the script controller, &#8220;sh&#8221;, &#8220;wr&#8221;, and &#8220;dis&#8221;, and then enter the expression &#8220;if ((distance sh wr) &#8211; dis) &gt; 0 then ((distance sh wr) &#8211; dis) / 2 else 0&#8243;. If you would like to understand what is actually happening with this expression and have a more in depth look at stretchy limb systems, you can pick up (I swear hes not paying me for the plugs) <a href="https://www.cg-academy.net/es_catalog/product_info.php?cPath=22_40&amp;products_id=41" target="_blank">Paul Neale&#8217;s Rigging DVDs from CG Academy</a>.</p>
<p><img class="alignnone size-full wp-image-647" title="stretchyTwistBones02" src="http://www.mathiesonfacer.com/wp-content/images/stretchyTwist/stretchyTwistBones02.jpg" alt="stretchyTwistBones02" /></p>
<p>Next we will have to assign values to each of the variables we created here.</p>
<p>Select the first bone in the IK bone system, then select &#8220;sh&#8221; in the variables list in our script controller and click &#8220;Assign Node&#8221;. A window should appear. Put your mouse over &#8220;Objects&#8221;, which should be at the bottom of the list, right click and choose &#8220;Expand Objects&#8221;. Find the object highlighted yellow, which in this case should be ikBone01, select it and press OK.</p>
<p>Select the ikWrist control object, then select &#8220;wr&#8221; in the variables list and follow the same process as explained above.</p>
<p>Lastly we need to figure out what value to assign to our &#8220;dis&#8221; variable. Make sure you are at frame 0 so that the arm is fully extended. Select both the first bone in the IK bone system and the ikWrist control object, open your MAXScript Listener and evaluate the following line of code &#8220;distance $[1] $[2]&#8220;. Copy the returned value, go back into our script controller, select &#8220;dis&#8221; from the variables list and click &#8220;Assign Constant&#8221;. Paste the value we got from the Listener, click Evaluate and then OK.</p>
<p>Back in the script controller&#8217;s main window, click Evaluate and then Close.</p>
<p>You should not get any errors if you followed these steps correctly and find that now if you pull the ikWrist control further than the arm&#8217;s full extension, the blend system will go half the distance.</p>
<p><img class="alignnone size-full wp-image-648" title="stretchyTwistBones03" src="http://www.mathiesonfacer.com/wp-content/images/stretchyTwist/stretchyTwistBones03.jpg" alt="stretchyTwistBones03" /></p>
<p>To get it to go the full distance, select the nub bone of the blend bones chain, the one we added the script controller to, and in the curve editor right click the IK Stretch controller and click copy. Select the forearm blend bone, named blend02, and in the curve editor go to the available slot in the position list, right click and select paste. When prompted as to whether you want this to be a copy or instance, choose instance. You will have to go back to the Motion panel and rename this one to IK Stretch as well. The blend bone system should now go the entire distance when you pull the ikWrist control further than its full extension.</p>
<p>We do have a slight problem here, but one that is easily fixed. Scrub the timeline through the entire animation I have set up on the rig. You&#8217;ll notice that by the end the ikWrist control has been stretched out and our stretchy limb system is working. If you select the ikWrist control and ramp up our IK/FK blend so we go over to FK you&#8217;ll notice that our stretch doesn&#8217;t go away.</p>
<p><img class="alignnone size-full wp-image-649" title="stretchyTwistBones04" src="http://www.mathiesonfacer.com/wp-content/images/stretchyTwist/stretchyTwistBones04.jpg" alt="stretchyTwistBones04" /></p>
<p>To fix this we just need to wire the weights of our stretch system back into the IK/FK value that is on our control objects. You will have to do the following steps for each of the blend bones we added the script controllers to.</p>
<p>Select the bone, right click and select wire parameters. Go to Transform/Positions/Weights and click IK Stretch. Click any control object for the arm, IK or FK, and go to Modified Object/Attribute Holder/Custom_Attributes and click IK/FK. You want to create the wire going right to left with the expression &#8220;(100 &#8211; IK_FK) / 100&#8243;. Click connect and do the same for the next bone. The blend bones should now have the stretch system blend on and off when switching between IK and FK.</p>
<p><img class="alignnone size-full wp-image-650" title="stretchyTwistBones05" src="http://www.mathiesonfacer.com/wp-content/images/stretchyTwist/stretchyTwistBones05.jpg" alt="stretchyTwistBones05" /></p>
<p>Now we can start creating our twist bones. Go to your top view and create two bone chains, each consisting of two bones and a nub.</p>
<p><img class="alignnone size-full wp-image-651" title="stretchyTwistBones06" src="http://www.mathiesonfacer.com/wp-content/images/stretchyTwist/stretchyTwistBones06.jpg" alt="stretchyTwistBones06" /></p>
<p>We are now going to create stretchy bones from these bone chains. This is not the same as what we did above, which was a stretchy limb system. We can easily do this step by using <a href="http://www.jasonlabbe3d.com/pages/scripts.html" target="_blank">Jason Labbe&#8217;s Stretchy Bones Tool</a>. Drag the script into Max&#8217;s viewport then double click the bone at the root of a bone chain to select the entire chain in it&#8217;s hierarchial order. Change the size from 25.0 to 3.0, turn off Box and turn on Cross, then click &#8220;Create Stretchy Bones&#8221;. Do this for both bone chains. Your scene should now look like this:</p>
<p><img class="alignnone size-full wp-image-652" title="stretchyTwistBones07" src="http://www.mathiesonfacer.com/wp-content/images/stretchyTwist/stretchyTwistBones07.jpg" alt="stretchyTwistBones07" /></p>
<p>If you select and move one of the resulting red point helpers that were created you will see that our bones are now constrained to the point helpers and will stretch accordingly. This is great, but not exactly what we are looking for yet. If you watched <a href="http://www.paulneale.com/tutorials/twistBones/twistBones.html" target="_blank">Paul&#8217;s Twist Bones tutorial</a><a href="http://www.paulneale.com/tutorials/twistBones/twistBones.html" target="_blank"></a> you&#8217;ll have noticed that the calculations being done in the parameter wiring rely on the bone hierarchy and rotation being inherited; we no longer have a hierarchy in place with the current stretch bones setup. What we want to do is re-create the hierarchy, but through the point helpers instead of the bones.</p>
<p>Select and link the point helper that controls the nub bone to the point helper that controls the middle bone, and then that point helper to the one that controls the root bone. Do this on both bone chains.</p>
<p><img class="alignnone size-full wp-image-653" title="stretchyTwistBones08" src="http://www.mathiesonfacer.com/wp-content/images/stretchyTwist/stretchyTwistBones08.jpg" alt="stretchyTwistBones08" /></p>
<p>Now we want to get our twist bones to follow along with our blend bones. Hide the ik and fk layers so we only see the blend bones and our twist bones. In Bone Tools, under the Animation menu, we want to turn on the front fin for all of these bones and set the size to 1.0.</p>
<p>Select the point helper that controls the root bone for either of the twist bone hierarchies and align it positionally and orientationally to the pivot of the forearm blend bone. With the point helper still selected, position constrain it to the forearm blend bone and then position constrain it to the nub blend bone. It should now be sitting half way on our forearm blend bone. We want this to be sitting two thirds of the way towards the elbow joint, so in the motion panel select our position constraint and set the weights to 65.5 for blend02 (forearm bone) and 33.5 for blend03 (nub bone). Now do the same thing for the next two point helpers but have the middle point helper constrained two thirds towards blend03 and the the nub point helper constrained 100% to blend03.</p>
<p>Follow the same technique for the other twist bones on the bicep. You&#8217;ll probably notice that it doesn&#8217;t appear as though your bones are lined up properly. Select all of the twist bones and in Bone Tools click &#8220;Reset Stretch&#8221;, it can be found near the bottom of the rollout. After you&#8217;re done it should look like this.</p>
<p><img class="size-full wp-image-682 alignnone" title="stretchyTwistBones09" src="http://www.mathiesonfacer.com/wp-content/images/stretchyTwist/stretchyTwistBones09.jpg" alt="stretchyTwistBones09" /></p>
<p>Now if you unhide the ik and fk layers and play through the animation you will see that the twist bones follow along perfectly with our blend bones. All there is left to do is set up the twisting. I am not going to go through how to set up the twist system, since it is the same as what Paul outlines in his tutorial. All you have to remember is that we re-created our bone hierarchy through the point helpers we used to create our stretchy bones, so anything Paul does to the twist bones you just need to do with the point helpers instead.</p>
<p>Hope you learned something from reading this tutorial. <a href="http://www.mathiesonfacer.com/wp-content/sampleFiles/stretchyTwistBones/stretchyTwistBones_finish.max">Here is the finished Max file</a> incase you ran into some problems along the way and want to see how the final thing looks, and <a href="http://www.mathiesonfacer.com/wp-content/sampleFiles/stretchyTwistBones/stretchyTwistBones_finishWithTwists.max">here is the final with all the twists set up</a>.</p>
<p>Now, with no further adieu, <a href="http://www.paulneale.com/tutorials/twistBones/twistBones.html" target="_blank">Paul&#8217;s Twist Bones video tutorial</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mathiesonfacer.com/featured/stretchy-twist-bones/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

