tag:blogger.com,1999:blog-4405848318944563122024-02-07T12:54:24.357-08:00Mitch Zais3D GeneralistMitch Zaishttp://www.blogger.com/profile/05697606041697200778noreply@blogger.comBlogger5125tag:blogger.com,1999:blog-440584831894456312.post-59649916240831159772011-05-29T00:28:00.000-07:002011-05-29T00:44:17.313-07:00Tutorial: Restricting a Nonlinear deformation to a single axis<span style="color: #cc0000; font-size: x-small;">**<span style="color: #f1c232;">( If you are already familiar with the Nonlinear deformers, you can just scroll down to the "</span><span style="color: #eeeeee;">Let's get started!</span><span style="color: #f1c232;">" part. ) </span></span><br />
<br />
Many times when modeling, you may come across a situation that requires a complex shape to be created that would take quite a long time to do properly by hand, and even still not look very good. One such scenario is a screw, if you were to try and model all the threads by hand, this would take a very long time and still not look very good, most people wouldn't even know where to start. But, with the help of the Twist deformer for example, this task can be done within minutes by merely twisting an object that has every second edge pushed out further, and with enough divisions to support the twisting effect.<br />
<br />
<div style="color: #eeeeee; font-family: Times,"Times New Roman",serif; text-align: right;"><i>If you do not know about the deformers, they are located in Create Deformers>Nonlinear, which is a menu option when the menu is set to Animation. (By default your menu bar is set to Polygons)</i></div><br />
Another scenario is bending pipes. A smooth bend that keeps proper volume can be time consuming to do by hand and still won't be 100% proper. But using the Bend deformer, you can easily bend the pipe smoothly to almost any angle and still retain it's volume in the bend.<br />
<br />
These are only two examples, and there are a few other deformers and many other uses for them, especially when dealing with high poly objects that you need to smoothly change the shape of. <br />
<br />
So lets get on to what this tutorial is about. The Flare deformer. This deformer has two circles at the bottom and top, which it interpolates a curve between, the amount this curve bends being defined by you. When applied to an object or vertices, it will squish or expand those vertices according to that curve. Which is very helpful for creating various cylindrical objects, such as vases, or for creating squash and stretch, as well a plethora of other uses for animation since the parameters can be keyed and the deformation tool can be translated, rotated and scaled to change the location or result of the effect on an object. <br />
<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgwrPM__H7Uo2paRaX2k4Xprx0Ct40nyJEILEwW4ASpcW1tiqJHS63yrjmhRROvXDghLCb8kmyOQQ7LKIhCK2iyekOcfY41uWgCryg6_Lg22DIWKO5HbDH3QClnlngksRXQzLs14-_JN4Q/s1600/wrap_deform_mitchZais_pt00.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="124" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgwrPM__H7Uo2paRaX2k4Xprx0Ct40nyJEILEwW4ASpcW1tiqJHS63yrjmhRROvXDghLCb8kmyOQQ7LKIhCK2iyekOcfY41uWgCryg6_Lg22DIWKO5HbDH3QClnlngksRXQzLs14-_JN4Q/s320/wrap_deform_mitchZais_pt00.png" width="320" /></a></div><div style="text-align: center;"><span style="color: #cccccc; font-size: x-small;">Flare deformer being used the typical way</span></div><br />
Since the Flare deformer works in a cylindrical fashion, it's going to bend your object inward/outward all the way around it.<i> So what can you do if you only want to get that nice smooth curve deformation happening from a single direction?</i> Which is usually the case with objects that aren't cylindrical or when only wanting to deform a small portion of something.<br />
<br />
Well, that's what this tutorial is going to be about.<br />
<br />
<br />
<span style="font-size: x-large;"><i><b><span style="color: #f3f3f3;">Let's get started!</span></b></i></span><br />
<br />
In this tutorial, we will approach the problem of smoothly deforming the lengthwise shape of a pipe. Which obviously would be part of a scenario where you are creating pipework that requires some braces, seals or caps that are custom made to fit certain things, such as a T joint.<br />
<br />
<br />
<div style="font-family: Times,"Times New Roman",serif; text-align: center;"><span style="font-family: Times,"Times New Roman",serif;">Here is a picture that shows what the typical result would be like if you just went ahead and used the Flare deformer,</span> along with the proper result we want, achieved using the method in this tutorial.</div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhajlY8oBLImUunzEdcEM97MAIFSQwlVZEFzAvViIpiSXesopMH_VfgjqcEZNwejsTueQRMz7AFIBdUkKYTeHuBX4hjUjyWEizBcU46-cTnqdhY5WzJ8zIgyj-VCn2WyjMk9iQZbDrVA3Y/s1600/wrap_deform_mitchZais_pt0.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="208" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhajlY8oBLImUunzEdcEM97MAIFSQwlVZEFzAvViIpiSXesopMH_VfgjqcEZNwejsTueQRMz7AFIBdUkKYTeHuBX4hjUjyWEizBcU46-cTnqdhY5WzJ8zIgyj-VCn2WyjMk9iQZbDrVA3Y/s640/wrap_deform_mitchZais_pt0.png" width="640" /></a></div><div style="text-align: center;"><span style="font-family: Times,"Times New Roman",serif;"></span></div><div style="color: #eeeeee; text-align: left;"></div><div style="color: #f3f3f3; text-align: left;"><br />
<i><span style="font-size: large;"><span style="font-family: Times,"Times New Roman",serif;">So now let's create the proper result.</span></span></i></div><div style="text-align: left;"></div><div style="text-align: left;"><span style="font-family: Times,"Times New Roman",serif;"></span><span style="font-size: large;"><b style="color: #eeeeee;">1.</b></span> '<span style="color: #cccccc;">Create>Polygon>Pipe</span>'. Give it a good amount of divisions so it's a fairly smooth pipe, simulating a scenario where moving the points by hand isn't ideal. And give it the amount of thickness you'd like.</div><div style="text-align: left;"><br />
</div><div style="text-align: left;"><span style="font-size: large;"><b style="color: #eeeeee;">2.</b></span> '<span style="color: #cccccc;">Create>Polygon>Plane</span>'. Rotate it 90 degrees so it is aligned lengthwise with your pipe. </div><div style="text-align: left;">Give it a higher amount of height divisions than your pipe has from a front view, and no other divisions. We want it to have it a lot so that our deformation is smooth.<br />
<br />
<span style="font-size: large;"><b style="color: #eeeeee;">3.</b></span> Select the Pipe and then Shift+Select the Plane.</div><div style="text-align: left;">Go to '<span style="color: #cccccc;">Create Deformers > Wrap</span>' on your menu bar (Set the menu to Animation to see the option). </div><div style="text-align: left;">Make sure to set the Wrap options to "Exclusive Bind". </div><div class="separator" style="clear: both; text-align: center;"></div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhvbYmDCO23riF_4dDuoDpexsHXvQ3uuaCMEkUfXdrFy0NZlFamKn5CVcG2QPVRUdM_flSIRGXqxz_xbyaQyfH8rA8Ew34425z-_BJQNSbndBUNwTW5T8i627htnDRm3F7ARyfXICU7SGI/s1600/wrap_deform_mitchZais_pt1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="232" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhvbYmDCO23riF_4dDuoDpexsHXvQ3uuaCMEkUfXdrFy0NZlFamKn5CVcG2QPVRUdM_flSIRGXqxz_xbyaQyfH8rA8Ew34425z-_BJQNSbndBUNwTW5T8i627htnDRm3F7ARyfXICU7SGI/s640/wrap_deform_mitchZais_pt1.png" width="640" /></a></div><div style="text-align: center;"><span style="color: #cccccc; font-size: x-small;"> Basically what 'Wrap' does, is it turns the second object into a lattice for your first object. So whenever you move points on the Plane for example, it will move points on the Pipe. And since we are using a Plane which is a 2D object as our lattice for the Pipe, the deformer will only be able to deform it length-wise and not width-wise since it has no width. This deformation will then be transferred to our Pipe</span></div><div style="text-align: left;"></div><div style="text-align: left;"></div><div style="text-align: left;"><br />
<span style="font-size: large;"><b style="color: #eeeeee;">4.</b></span> Select the side points of the Plane up to the point you want the curve deformation to start. <br />
<div style="color: #cccccc; text-align: center;"><span style="font-size: x-small;"><i>(Or you can select them all like I did here, and just change the start position of the deformer afterwards)</i></span></div></div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgRfUFp-mFNM0wX7AQOQdID_cyyxWEF2f81-hB-jEkvAlkzehvHTa2nhijD31oWDiWPRFKmuikDs3QSB8WxIfQ4xxWNdjqbm29v2TPhgDH8-Ojtt4rVxT16BplqH1i1TMSGGqpNY56Rq3Q/s1600/wrap_deform_mitchZais_pt2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgRfUFp-mFNM0wX7AQOQdID_cyyxWEF2f81-hB-jEkvAlkzehvHTa2nhijD31oWDiWPRFKmuikDs3QSB8WxIfQ4xxWNdjqbm29v2TPhgDH8-Ojtt4rVxT16BplqH1i1TMSGGqpNY56Rq3Q/s1600/wrap_deform_mitchZais_pt2.png" /></a></div><div style="text-align: left;"></div><div style="text-align: left;"><br />
<span style="font-size: large;"><b style="color: #eeeeee;">5.</b></span> With the points selected, go to '<span style="color: #cccccc;">Create Deformers > Nonlinear > Flare</span>'.<br />
Rotate the newly created Flare tool to an appropriate position for the deformation direction we want.</div><div class="separator" style="clear: both; text-align: center;"></div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjrYRH-C-BsSrtgHlO1sLdbZhhTZnhsR8Ib9qef2MV882tLajIPbTRU_eAbCNh56w4SWZYdWhcT-U5U1fS_oNrhvZlW_kepJSvrqJMdQ1jnraWD9qPQxRcG07y5hurLl9TrMVpHI92ur4s/s1600/wrap_deform_mitchZais_pt3.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjrYRH-C-BsSrtgHlO1sLdbZhhTZnhsR8Ib9qef2MV882tLajIPbTRU_eAbCNh56w4SWZYdWhcT-U5U1fS_oNrhvZlW_kepJSvrqJMdQ1jnraWD9qPQxRcG07y5hurLl9TrMVpHI92ur4s/s1600/wrap_deform_mitchZais_pt3.png" /></a></div><div style="text-align: left;"><br />
</div><div style="text-align: left;"><span style="font-size: large;"><b style="color: #eeeeee;">6.</b></span> Now in your Attribute Editor, which should be open on the right side of Maya, play with the values in the "flare" tab to get the deformation you want. </div><div style="text-align: left;"><br />
</div><div style="color: #cccccc; text-align: left;"><span style="font-size: x-small;">*The High & Low 'Bound' defines the distance of the top and bottom deformation circles in relation to the center. So if you lower them, anything outside of them won't be effected by the deformation. And if you raise them, you can create more gradual curves.</span><br />
<span style="font-size: x-small;">*The Start/End Flare values define the X/Z scale of the circles. So you can have an elliptical shape instead of a uniform cylinder.</span><br />
<span style="font-size: x-small;">*And the 'Curve' value of course defines how bent the curve is between the circles.</span></div><div style="color: #cccccc; text-align: left;"></div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgACVnkAh61Cn3JXr6N9NnEo_L5miV7QlVVfovYlx4Kf76_LvtUeXWsQu-pAYOWs4poIn-um47SzLcYMrnSFUez8gS9PHbWAuCs51b9LSiHXJWfsak0M7uezCilSZYb6HDg_15o8AOnlGs/s1600/wrap_deform_mitchZais_pt4.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="300" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgACVnkAh61Cn3JXr6N9NnEo_L5miV7QlVVfovYlx4Kf76_LvtUeXWsQu-pAYOWs4poIn-um47SzLcYMrnSFUez8gS9PHbWAuCs51b9LSiHXJWfsak0M7uezCilSZYb6HDg_15o8AOnlGs/s640/wrap_deform_mitchZais_pt4.png" width="640" /></a></div><br />
<br />
Now we have a custom pipe joint created which has retained it's volume and cylindrical shape. If we are done and know we will not need to make anymore modification to the deformer, we can simply go to '<span style="color: #cccccc;">Edit > Delete by Type > History</span>', which will freeze the vertices into their new position and delete the deformer tool.<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhpS6zyDfWLhbV9QQF2TTBKDWoptq3s__y5bq6ilJ6Jr6jqxHiswGZfdhklW0AHJoe-r6O1lmq1eEcA-kf3wO9gy-611q9akaY7uEXcPxzCSos-xv3JozPzgUBWKDUDU11Cvz4sFEqaZX8/s1600/wrap_deform_mitchZais_pt5.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="169" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhpS6zyDfWLhbV9QQF2TTBKDWoptq3s__y5bq6ilJ6Jr6jqxHiswGZfdhklW0AHJoe-r6O1lmq1eEcA-kf3wO9gy-611q9akaY7uEXcPxzCSos-xv3JozPzgUBWKDUDU11Cvz4sFEqaZX8/s320/wrap_deform_mitchZais_pt5.png" width="320" /></a></div><br />
<br />
This technique can of course be applied to any of the other deformers also, to restrict an effect to one axis. And if you do not delete the history, you can keyframe the Flare values to create an animation of the pipe taking shape.<br />
<br />
<br />
<div style="text-align: center;">____________________________________________________________________________</div><div style="text-align: center;"><span style="color: #cccccc; font-family: Georgia,"Times New Roman",serif;">Thank you for reading my tutorial. I hope you found it helpful in giving you new ideas on how to approach the modeling of various objects, and also for expanding your toolset. This was only one technique I developed for one set of problems. I recommend people to play around with the other deformers, figuring out for yourself different ways you can use them in the modeling and animation process. As they are quite useful.</span></div><div style="text-align: center;"></div>Mitch Zaishttp://www.blogger.com/profile/05697606041697200778noreply@blogger.com0tag:blogger.com,1999:blog-440584831894456312.post-73738643276664655902011-05-23T04:10:00.000-07:002011-05-23T04:25:16.827-07:00Tutorial: Using Maya's hidden "Membrane" node to wrap or deform objectsMaya has many unofficial features that aren't publicly exposed within it, either because they are still in development, havn't had enough beta testing time, turned out to be too buggy, were superseded by better methods, or just havn't been implemented fully due to a case of priorities for the developers. <br />
One of these features is the 'Membrane' dynamic deformer. Not many people know about this deformer, and I only found out about it from a <a href="http://forums.cgsociety.org/showthread.php?f=86&t=976853">post by someone else on CGSociety</a> who discovered it when digging through Maya's API. It's apparently been sitting in Maya for a few years now, oddly not officially announced or GUI integrated even though it seems to be quite useful.<br />
<br />
There are many possibilities this node can be used for, since it has gravity, wind/drag/lift, cloth, internal pressure, rigid body, collision and turbulance dynamics built into it, all based around the nCloth solver in Maya, sort of making it sit inbetween being a deformer and a simulation. Just a little fooling around and some imagination and you can create something interesting with it.<br />
<br />
In this little tutorial, i'll show you one technique with it I came up with for wrapping objects onto other objects. Giving you a powerful tool to aid in modeling interesting shapes and deforming things in ways that would normally take ages by hand, and still not look as good.<br />
<br />
<em><strong><span style="color: #f3f3f3; font-size: large;">Let's Begin!</span></strong></em><br />
For this tutorial, you can just start a new scene with a simple sphere and polygon plane to get an idea of how it works. Make the sphere relatively smooth, around 40x40 divisions. And the polygon plane between 20x20 and 30x30 divisions.. Position the polygon plane on top of the sphere.<br />
<br />
Now select the plane, and open your script editor by hitting the button at the bottom right of Maya.<br />
<br />
<strong><span style="color: #f3f3f3;">Type in:</span></strong><br />
source createMembrane;<br />
createMembrane;<br />
<br />
Then hit the > play/execute button at the top of the window to execute your code.<br />
A membrane node will now have been created for the polygon plane, which you will see a tab for in your Attribute Editor window on the right. <br />
In the future, you will only need to type "createMembrane", as "source createMembrane" only needs to be run once so Maya knows you use it.<br />
<br />
<strong><span style="color: #f3f3f3;">Next:</span></strong><br />
<strong><span style="color: #f3f3f3;">1.</span></strong> Select your Plane and Sphere, go to Window>Hypergraph: Connections. <br />
<br />
<strong><span style="color: #f3f3f3;">2.</span></strong> Find the "pSphereShape" node, middle-click and drag from it to the membrane node, and choose Other in the options that appear.<br />
<br />
<strong><span style="color: #f3f3f3;">3.</span></strong> Now in this new window that will have popped up, find the "worldMesh" output on the left panel, click it, and then click the "collideMesh" input on the right panel, and close the window.<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEieIHeVis8nrEbVE3Dw96gfo0itcKA5wVNvc2lRZuN4fgiwpG_pAhycUNY-Qr3fp_f9Hr1cTIH6I0izdldLmqcnxvOqldikOV9VL9MINuno2spO6CWE-hS3dICpgYA_66rgSfbnw1gUNHE/s1600/membraneNodeMaya-2_MitchZais.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="143" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEieIHeVis8nrEbVE3Dw96gfo0itcKA5wVNvc2lRZuN4fgiwpG_pAhycUNY-Qr3fp_f9Hr1cTIH6I0izdldLmqcnxvOqldikOV9VL9MINuno2spO6CWE-hS3dICpgYA_66rgSfbnw1gUNHE/s320/membraneNodeMaya-2_MitchZais.png" width="320" /></a></div><br />
<strong><span style="color: #f3f3f3;">4.</span></strong> In the veiwport, select your polygon Plane and head to the membrane tab in the attributes window. <br />
<em>To reduce unnecessary computation over-head, we will zero any features were aren't using</em>:<br />
-Set Gravity and Wind options to 0.<br />
-Under the Collision section set Friction to 0.<br />
<br />
<strong><span style="color: #f3f3f3;">5.</span></strong> Under Collision, set Thickness to something like -0.020, Push out to -1, and Push out radius to something like 5 or higher (depends on mesh size, can always adjust this after, it determines the radius in which points are affected by the push-out.)<br />
<br />
<strong><span style="color: #f3f3f3;">6.</span></strong> In Dynamic Properties, resistence levels between 0-2 are pretty good, adjust as needed though for any scenario. Rest Length Scale is also an important one, you'll need to adjust that one as needed to achieve the result you want.<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiY8XzkFBxZgG5AubKbGx8VGdRrv81i6hspyDaGUC-GdrR95IzEwLUkEeh5QWn-4lQ7Qf_tTscDicOGpFjl7p7rfvVmCzwS0tW1j314qGLxe4sUWD7lXs0AD6IYLVaojujtOyFzxW5jyvs/s1600/membraneNodeMaya_MitchZais.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="177" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiY8XzkFBxZgG5AubKbGx8VGdRrv81i6hspyDaGUC-GdrR95IzEwLUkEeh5QWn-4lQ7Qf_tTscDicOGpFjl7p7rfvVmCzwS0tW1j314qGLxe4sUWD7lXs0AD6IYLVaojujtOyFzxW5jyvs/s320/membraneNodeMaya_MitchZais.png" width="320" /></a></div><br />
That should be about all you need to do. If your polygon Plane is already lined up with the Sphere (also rotated for proper angle if it's off to the side) everything should already be looking pretty good. You can select your mesh and move it around on the surface since this is a deformer (if you move it too far, you'll want to rotate it a bit so you don't get a scrunched piece of fabric).<br />
<br />
You can increase substeps as needed for quality control near the bottom in the Quality Settings section, although 3/3 seems to be good enough for most situations, and usually even lower. And the distance you move the pivot from or into the collision mesh effects how stretched the Plane becomes, so just play around with it, it's an interesting tool.<br />
<br />
<br />
<strong><span style="color: #f3f3f3;">Here's a little more complex of a test I did using a face from one of my models:</span></strong><br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjIR5Nd0ANeNF7YY3U0-_6_7P7wlsYPp1StOulH3_MfQz2nxIyimBcSjHrUb9f8q9Okz0W8vLtOwNP_CmBd_jFXk8VMVg_v6hRtnwXFt6RqnOxENZvH-FwoWr-UwKIA2Howy8b2RX37SII/s1600/membraneNodeMaya-3_MitchZais.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="74" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjIR5Nd0ANeNF7YY3U0-_6_7P7wlsYPp1StOulH3_MfQz2nxIyimBcSjHrUb9f8q9Okz0W8vLtOwNP_CmBd_jFXk8VMVg_v6hRtnwXFt6RqnOxENZvH-FwoWr-UwKIA2Howy8b2RX37SII/s320/membraneNodeMaya-3_MitchZais.png" width="320" /></a></div>Since the effect I was going for in this test wasn't about keeping my original shape uniform, I use a positive value in the Push Out, since I want to be pushing the mesh onto my collision object, instead of pulling it outward. In most cases this is the method you will want to use, unless dealing with just a flat polygon plane that you want wrapped onto a convex object.<br />
<br />
Merely delete the history on your deformed mesh to save the shape it is in (which will also delete the membane node on it). Or you can key values in the attribute window by right clicking on a values name and choosing to key it, allowing you to create an animation of the deformation in action to be rendered out.<br />
<br />
This was just a taste of the many possibilities this node brings. I encourage people to play around with it's various other settings also. It is always good to expand ones knowledge, increasing their toolset and ability to create great CG work.<br />
<br />
Somewhat detailed descriptions for each of the Membranes options can be found here:<br />
<a href="http://download.autodesk.com/us/maya/2009help/Nodes/membrane.html">http://download.autodesk.com/us/maya/2009help/Nodes/membrane.html</a>Mitch Zaishttp://www.blogger.com/profile/05697606041697200778noreply@blogger.com13tag:blogger.com,1999:blog-440584831894456312.post-57293236618785404132011-05-08T22:08:00.000-07:002011-05-09T15:11:35.167-07:00multiConstrain_v0.1 - Well that was a good hour and a half spent XDToday I saw a <a href="http://forums.cgsociety.org/showthread.php?f=7&t=978037">post that popped up on CGSociety</a> asking if there is a way to Aim Constraint multiple objects at once to a target<span style="font-size: xx-small;"> (not a group, since that would just make the groups pivot constrained.)</span>. The poster could not find a solution or an available script online, nor could I after searching.<br />
<br />
So, since I've been interested in learning MEL for a while, I decided to take a stab at developing a simple script that would allow Maya to do what he was asking. After a little research into executing MEL commands on each object in a selection individually, and using similar examples, I thought I would have a working code. The code would work for commands like translate or delete, but since aimConstraint requires a target and something to constrain to it, that wasn't working, since it would bring the target object into the selected objects loop and screw it up. Tried so many different configurations until I finally figured out a simple loop structure that worked for it.<br />
<br />
And here's my script :)<br />
<br />
<br />
<blockquote>//Batch Aim Constraint script, by Mitch Zais<br />
//Replace "target" with the name of your target object<br />
//Select all objects you want to aim constrain to the target and execute the script<br />
<br />
$aimTarget = "target";<br />
string $selection[] = `ls -sl -l`;<br />
for ( $each in $selection ) {<br />
aimConstraint $aimTarget $each;<br />
}</blockquote><br />
<br />
I want to keep learning MEL, so I plan on further developing this script now as a way of learning, since as it stands there isn't much to it. I'd like to develop an options window for it and branch it out to other constraints and operations that don't allow multiple objects to be done at once. <br />
<br />
First thing to do is allow you to just select your target object in the viewport, so people don't have to edit the target name at the top of the script. Once I do that, I'll probably upload it to <a href="http://www.creativecrash.com/">CreativeCrash.com</a> to share with people, and continually update it there.<br />
<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgzViyeXH5Jc-Bt5G2y-yC_gWs_J6ksipWsICawX0P7JmjI28_wz9bNDVXEkCTR_f_b2dIb7pBavj6U1_Qw1aWjp2Ce1DdfPr48Vz77DEA-02zWKm7WH88oR-NNS3yjQY4wd__pEADvbUQ/s1600/muiltiAimConstrainv0.1.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgzViyeXH5Jc-Bt5G2y-yC_gWs_J6ksipWsICawX0P7JmjI28_wz9bNDVXEkCTR_f_b2dIb7pBavj6U1_Qw1aWjp2Ce1DdfPr48Vz77DEA-02zWKm7WH88oR-NNS3yjQY4wd__pEADvbUQ/s320/muiltiAimConstrainv0.1.jpg" width="157" /></a></div>Mitch Zaishttp://www.blogger.com/profile/05697606041697200778noreply@blogger.com1tag:blogger.com,1999:blog-440584831894456312.post-3636999132916018362011-03-23T17:56:00.000-07:002011-03-23T17:56:49.574-07:00Work Room WIP 1A work room I am creating for part of my demo reel. Going for a photo-realistic image. This is just what I have so far from about 12 or so hours of work.<br />
<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhPioTQ-CLaFZyW8WSTlSiKMTSnDvXbyhectaDYJ-VQd4itP5ODdMek0K37Y3I4Pg_zMrhBra_IqnYk7rPr8FmOIk8wwzb5pzUhi-kBFGik4oKqhywIIf9gcu1IBEuLymyF91tjdehgWcY/s1600/workRoom-render1-MitchZais.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="360" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhPioTQ-CLaFZyW8WSTlSiKMTSnDvXbyhectaDYJ-VQd4itP5ODdMek0K37Y3I4Pg_zMrhBra_IqnYk7rPr8FmOIk8wwzb5pzUhi-kBFGik4oKqhywIIf9gcu1IBEuLymyF91tjdehgWcY/s640/workRoom-render1-MitchZais.png" width="640" /></a></div>The render took 4 hours with 800 FG quality, 3 point density, 8 refr/refl, 8 shadow, 4 diff bounces and level 3 adaptive sampling. Still, the image quality isn't that good, will have to play with the settings some more.Mitch Zaishttp://www.blogger.com/profile/05697606041697200778noreply@blogger.com0tag:blogger.com,1999:blog-440584831894456312.post-45993815479868381292011-03-02T15:43:00.000-08:002011-03-02T15:43:23.969-08:003DAM300 Marine Rigging Assignment<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgtat1OlSYyQr7yN1G1exTJ0zQ0ipLYVmC6djFRSo8eqCzY3LlosY6SMqKcTsB-onZtup6Qp8wIWa6L9FywxqMUoo7VQfDEtKk0dWDOTplDMvGWOOpt0OJYbcp7lQNIRhrYDaGvf6u38Fo/s1600/marine_model_view-MitchZais.png" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><br />
</a><span style="color: #0b5394; font-size: small;"><span style="font-family: "Trebuchet MS",sans-serif;">My completed rig for the assigned model, built as specified.</span></span></div><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj_SQeo-mf3a7MH0QyPXKpN-glikmY2g0UGOLaYEAzE2eZAimw6fDuVkdLLyrYC6cSxC-fKCY4nzQvSr5DWadB4a8KfOROLZGrBJV66kd0ypYttknkf6139DSpWFbMn8VNFUDfYaXS11dw/s1600/marine_mesh_view-MitchZais.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"></a><br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgtat1OlSYyQr7yN1G1exTJ0zQ0ipLYVmC6djFRSo8eqCzY3LlosY6SMqKcTsB-onZtup6Qp8wIWa6L9FywxqMUoo7VQfDEtKk0dWDOTplDMvGWOOpt0OJYbcp7lQNIRhrYDaGvf6u38Fo/s1600/marine_model_view-MitchZais.png" imageanchor="1" style="clear: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgtat1OlSYyQr7yN1G1exTJ0zQ0ipLYVmC6djFRSo8eqCzY3LlosY6SMqKcTsB-onZtup6Qp8wIWa6L9FywxqMUoo7VQfDEtKk0dWDOTplDMvGWOOpt0OJYbcp7lQNIRhrYDaGvf6u38Fo/s320/marine_model_view-MitchZais.png" width="76" /></a><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj_SQeo-mf3a7MH0QyPXKpN-glikmY2g0UGOLaYEAzE2eZAimw6fDuVkdLLyrYC6cSxC-fKCY4nzQvSr5DWadB4a8KfOROLZGrBJV66kd0ypYttknkf6139DSpWFbMn8VNFUDfYaXS11dw/s1600/marine_mesh_view-MitchZais.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj_SQeo-mf3a7MH0QyPXKpN-glikmY2g0UGOLaYEAzE2eZAimw6fDuVkdLLyrYC6cSxC-fKCY4nzQvSr5DWadB4a8KfOROLZGrBJV66kd0ypYttknkf6139DSpWFbMn8VNFUDfYaXS11dw/s320/marine_mesh_view-MitchZais.jpg" width="201" /></a><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj7KZYUaUcyFOrfpR8yHmMB3XO8HzxLVoeFlg66CPZuuUNrSyXbqFBoptT5mhI113LMiL4uGrv4adlwuyls22J3wNIo9y0XDylCT0Vm1pU4sV5kqgwvNlYWbVHRCOzPOrn5CXc3V1SeFB0/s1600/marine_skel_view-MitchZais.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj7KZYUaUcyFOrfpR8yHmMB3XO8HzxLVoeFlg66CPZuuUNrSyXbqFBoptT5mhI113LMiL4uGrv4adlwuyls22J3wNIo9y0XDylCT0Vm1pU4sV5kqgwvNlYWbVHRCOzPOrn5CXc3V1SeFB0/s320/marine_skel_view-MitchZais.png" width="188" /></a><br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgX9zcErMjWFApGxMhzg7oqqhjNA2Gkbmeyn-vnRmb1m0Y8DOeNwxneDaj5z_fGssv0Hydtm9T1SKO3G9-kzJ0YN4I3POWFmsL6bdcqJJFOnCy0ef2jaHtEht9OCHBmVHxjocONn3x6p0w/s1600/marine_schematic_view-MitchZais.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="247" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgX9zcErMjWFApGxMhzg7oqqhjNA2Gkbmeyn-vnRmb1m0Y8DOeNwxneDaj5z_fGssv0Hydtm9T1SKO3G9-kzJ0YN4I3POWFmsL6bdcqJJFOnCy0ef2jaHtEht9OCHBmVHxjocONn3x6p0w/s400/marine_schematic_view-MitchZais.png" width="400" /></a></div> <br />
<br />
<div class="separator" style="clear: both; text-align: center;"></div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgtat1OlSYyQr7yN1G1exTJ0zQ0ipLYVmC6djFRSo8eqCzY3LlosY6SMqKcTsB-onZtup6Qp8wIWa6L9FywxqMUoo7VQfDEtKk0dWDOTplDMvGWOOpt0OJYbcp7lQNIRhrYDaGvf6u38Fo/s1600/marine_model_view-MitchZais.png" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><br />
</a></div><object width="640" height="390"><param name="movie" value="http://www.youtube.com/v/MukWWUG7Dtc?fs=1&hl=en_US&rel=0&hd=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/MukWWUG7Dtc?fs=1&hl=en_US&rel=0&hd=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="640" height="390"></embed></object>Mitch Zaishttp://www.blogger.com/profile/05697606041697200778noreply@blogger.com0