tag:blogger.com,1999:blog-5360285054998879752024-03-13T21:17:22.222+00:00Yet Another Random TD Blog......original, I know.Lee Dunhamhttp://www.blogger.com/profile/11548341409322230513noreply@blogger.comBlogger102125tag:blogger.com,1999:blog-536028505499887975.post-53723481108657875132020-09-29T03:59:00.001+01:002020-09-29T03:59:10.427+01:00Source on GitHubIts been a while and I doubt I'll keep this up to date. <div><br /></div><div>I've posted the sources for some of my older tools on <a href="https://github.com/ldunham1/maya_utilities/blob/master/ld_soft_cluster.py" target="_blank">GitHub</a>.</div><div><br /></div>Lee Dunhamhttp://www.blogger.com/profile/11548341409322230513noreply@blogger.com0tag:blogger.com,1999:blog-536028505499887975.post-90951824893835016522016-06-12T17:25:00.000+01:002016-06-12T17:25:24.865+01:00Scott Eaton: Portraiture and Facial Anatomy for ArtistsI recently had the pleasure of completing the 3 day <a href="http://www.scott-eaton.com/portraiture-for-artists-workshop" target="_blank">Portraiture and Facial Anatomy course with Scott Eaton</a>, and I cannot recommend it highly enough.<div>
<br /></div>
<div>
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh4LoeXVvdK_OI9qipxNB6eeG-slI7hu07I5yvDXTcyrumr8a-OfyWMnhGwq9UZyD4nFgvEflDN9Ys2FooY22j_bCeaaGRN9gj1oEH2dWGGxVKMCJj1VzCvzfUGm6lgVFqOliep72Cij6w/s1600/20160609_095406.jpg" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" height="360" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh4LoeXVvdK_OI9qipxNB6eeG-slI7hu07I5yvDXTcyrumr8a-OfyWMnhGwq9UZyD4nFgvEflDN9Ys2FooY22j_bCeaaGRN9gj1oEH2dWGGxVKMCJj1VzCvzfUGm6lgVFqOliep72Cij6w/s640/20160609_095406.jpg" style="cursor: move;" width="640" /></a><br /><div>
<br /></div>
<div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
</div>
<div>
<br /></div>
<div>
Scott shared a wealth of knowledge on facial anatomy - how to recognise and understand various landmarks on the face for construction and deformation, variations on the bell curve, the differences between gender, race and species, as well as FACS breakdowns and so much more.</div>
<div>
<br /></div>
<div>
<br /></div>
<div>
Here's an overview of the construction task over the three days.</div>
<div>
<br /></div>
<div>
<br class="Apple-interchange-newline" /><div style="text-align: center;">
Blocking in the <a href="https://en.wikipedia.org/wiki/Temporal_muscle" target="_blank">Temporalis</a>, <a href="https://en.wikipedia.org/wiki/Masseter_muscle" target="_blank">Masseter</a>, <a href="https://en.wikipedia.org/wiki/Medial_pterygoid_muscle" target="_blank">Medial</a> and <a href="https://en.wikipedia.org/wiki/Lateral_pterygoid_muscle" target="_blank">Lateral</a> Pterygoids.</div>
</div>
<div style="text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhDnfUEvuGqFDK4W1JkLFISp9EGZIMUNvineZArYsFcnDQ99bTtmXLQwlaVWtuPANMKj69nLb04Gj80dDsh_c6dhq8rOk8okARSEOGXTu3hhisTHkfmPGAvpPp90F01NGfYubICiaNdRmA/s1600/20160607_171554.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="200" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhDnfUEvuGqFDK4W1JkLFISp9EGZIMUNvineZArYsFcnDQ99bTtmXLQwlaVWtuPANMKj69nLb04Gj80dDsh_c6dhq8rOk8okARSEOGXTu3hhisTHkfmPGAvpPp90F01NGfYubICiaNdRmA/s200/20160607_171554.jpg" width="112" /></a><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj_TnKtGk4DCd40LoB8tVq0zt-kGbdubSm9tZrZRf8BRt_WD4rqWaIfemazfEwqDKv9N2wD_-cmmMS_JwxHs2H4wUhDw5RvxT-zGZNAtC1iMnXtJYSneety71Gn96D2ZWSy3tpqRFcVypQ/s1600/20160607_171601.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="200" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj_TnKtGk4DCd40LoB8tVq0zt-kGbdubSm9tZrZRf8BRt_WD4rqWaIfemazfEwqDKv9N2wD_-cmmMS_JwxHs2H4wUhDw5RvxT-zGZNAtC1iMnXtJYSneety71Gn96D2ZWSy3tpqRFcVypQ/s200/20160607_171601.jpg" width="112" /></a><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgdQP8QN4oUcFxnPsxcJd-Q8PLhNHkp3J9HIq4__UjlRd_RyocfT2vxFqhIDKSD4jnN9610Rqv2-XG990g93pKf0jBXbkE7DCu5S1d5zTXxiBH2Zq2r-fO7jxv4wdTCaR2UZLdd5iz0FL0/s1600/20160607_171546.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="200" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgdQP8QN4oUcFxnPsxcJd-Q8PLhNHkp3J9HIq4__UjlRd_RyocfT2vxFqhIDKSD4jnN9610Rqv2-XG990g93pKf0jBXbkE7DCu5S1d5zTXxiBH2Zq2r-fO7jxv4wdTCaR2UZLdd5iz0FL0/s200/20160607_171546.jpg" width="112" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="" style="clear: both; text-align: center;">
Adding the eyeballs, orbital fat, superior and inferior <a href="https://en.wikipedia.org/wiki/Tarsus_(eyelids)" target="_blank">Tarsus</a>, <a href="https://en.wikipedia.org/wiki/Levator_palpebrae_superioris_muscle" target="_blank">Levator</a> tendon, <a href="https://en.wikipedia.org/wiki/Canthus" target="_blank">Canthus</a> and <a href="https://en.wikipedia.org/wiki/Orbicularis_oculi_muscle" target="_blank">Orbicularis oculi</a>. Also, cleaning up where the Masseter joins the <a href="https://en.wikipedia.org/wiki/Zygomatic_bone" target="_blank">Zygomatic</a> bone.</div>
<div class="" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh3gYVVVOEamHlLO7NPqH9n8cumeXjMgolbyYU0Q79ywFp6f_GTM_UoFotsEZ_sF0Tcz2_CkwtbM5q32ekphaZFTlwOfCuI910I6UtxilD8H1S70Xvy9HPfD3wqpL8ZCYj2f2lqLBLzWBk/s1600/20160608_171738.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="200" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh3gYVVVOEamHlLO7NPqH9n8cumeXjMgolbyYU0Q79ywFp6f_GTM_UoFotsEZ_sF0Tcz2_CkwtbM5q32ekphaZFTlwOfCuI910I6UtxilD8H1S70Xvy9HPfD3wqpL8ZCYj2f2lqLBLzWBk/s200/20160608_171738.jpg" width="112" /></a><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhgkRqzUftMQUjCoJg38VAio0yPgghQmXZr5aRJi6XXntM0jUB4vSLQ_XMr8NPjg4k9cjEJNRZobp02M6DAw0-b-XtwaNIPCpgxVIZF3dyHu8pSgKdVLwti-IT1-qjTFX-xDs1V4ceQ3RQ/s1600/20160608_171743.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="200" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhgkRqzUftMQUjCoJg38VAio0yPgghQmXZr5aRJi6XXntM0jUB4vSLQ_XMr8NPjg4k9cjEJNRZobp02M6DAw0-b-XtwaNIPCpgxVIZF3dyHu8pSgKdVLwti-IT1-qjTFX-xDs1V4ceQ3RQ/s200/20160608_171743.jpg" width="112" /></a><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhNUi8w-yHdH03geUE9YCz86OJdRAFmCRM3hUuxCVLE0YvLu_6rcxnrPT9h6e8fniacxBN-ZXx3Dc4K4Ano_jZzz_vh9U5uP5dIzCSqGJ2YnruXY42KbbDbGMhHgy2NEOjW3-_f65n3yw8/s1600/20160608_171734.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="200" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhNUi8w-yHdH03geUE9YCz86OJdRAFmCRM3hUuxCVLE0YvLu_6rcxnrPT9h6e8fniacxBN-ZXx3Dc4K4Ano_jZzz_vh9U5uP5dIzCSqGJ2YnruXY42KbbDbGMhHgy2NEOjW3-_f65n3yw8/s200/20160608_171734.jpg" width="112" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="" style="clear: both; text-align: center;">
<span style="text-align: start;"><br class="Apple-interchange-newline" />Adding the <a href="https://en.wikipedia.org/wiki/Frontalis_muscle" target="_blank">Frontalis</a>, <a href="https://en.wikipedia.org/wiki/Procerus_muscle" target="_blank">Procerus</a>, </span><a href="https://en.wikipedia.org/wiki/Corrugator_supercilii_muscle" target="_blank">Corrugator supercilii</a> (should have been under the frontalis), <a href="https://en.wikipedia.org/wiki/Orbicularis_oris_muscle" target="_blank">Orbicularis oris</a>, <a href="https://en.wikipedia.org/wiki/Buccinator_muscle" target="_blank">Buccinator</a> and <a href="https://en.wikipedia.org/wiki/Buccal_fat_pad" target="_blank">Buccal</a> fat (far too much!).</div>
<div class="" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhGbjbVQyozArF5pnUxb_SteTRROaRHmzQ4SlrQr-eRzCGKB8SKceRuNAbbMAg9sIxkqdQefoiPCib622XIevDZUXTL9vrjjwcKa6X9nCMjLfdiJughCJs-LgF8JvFT4oJXd0wEfYMZ_E8/s1600/20160609_125331.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="200" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhGbjbVQyozArF5pnUxb_SteTRROaRHmzQ4SlrQr-eRzCGKB8SKceRuNAbbMAg9sIxkqdQefoiPCib622XIevDZUXTL9vrjjwcKa6X9nCMjLfdiJughCJs-LgF8JvFT4oJXd0wEfYMZ_E8/s200/20160609_125331.jpg" width="112" /></a><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhvpVQCeWEt1xhoOtkSfHG_HsSVraifreCX5hybgo5XGJCnGDTS7qK6M7R0Z9TI2tK1o-fp8Bs9FfuKr-DFq0IHpaVD9pttFrXNWywnzG_sUVQDGMuzKM_O90WXnPDi7goMWdHHk5hCB5s/s1600/20160609_125316.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="200" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhvpVQCeWEt1xhoOtkSfHG_HsSVraifreCX5hybgo5XGJCnGDTS7qK6M7R0Z9TI2tK1o-fp8Bs9FfuKr-DFq0IHpaVD9pttFrXNWywnzG_sUVQDGMuzKM_O90WXnPDi7goMWdHHk5hCB5s/s200/20160609_125316.jpg" width="112" /></a><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjNZZkGK0i4pLDoRE8BzNmK5Hz8IHGuw5rZ0-C1zg-hoCgKVituCVIc6WhDDibC8qEhUkbr3VKq-JyhuWCbboXGflYJ3KvlR-erARHXgzLr4W6lzfY3BbEMz2H6WjZErVXYFiXpdsDUsNM/s1600/20160609_125310.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="200" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjNZZkGK0i4pLDoRE8BzNmK5Hz8IHGuw5rZ0-C1zg-hoCgKVituCVIc6WhDDibC8qEhUkbr3VKq-JyhuWCbboXGflYJ3KvlR-erARHXgzLr4W6lzfY3BbEMz2H6WjZErVXYFiXpdsDUsNM/s200/20160609_125310.jpg" width="112" /></a></div>
<div class="" style="clear: both; text-align: center;">
<br /></div>
<div class="" style="clear: both; text-align: center;">
<br class="Apple-interchange-newline" />Adding <a href="https://en.wikipedia.org/wiki/Zygomaticus_major_muscle" target="_blank">Zygomaticus</a> major and minor, <a href="https://en.wikipedia.org/wiki/Depressor_labii_inferioris_muscle" target="_blank">Depressor labii inferioris</a>, <a href="https://en.wikipedia.org/wiki/Depressor_anguli_oris_muscle" target="_blank">Depressor anguli oris</a>, <a href="https://en.wikipedia.org/wiki/Mentalis" target="_blank">Mentalis</a>, <a href="https://en.wikipedia.org/wiki/Levator_labii_superioris" target="_blank">Levator labii superioris</a> and chin fat (for the mentalis).</div>
<div class="" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjVSgtktR_mP7_ROhHqJxWLAFf6iHmqB_f0z1kbwsbhnEi2N-B6SG4bX5gIf4JKqOAnWRpHaXhyDmrpiqa53Mk0u9a3VeiElX2GAoq5gCzHUV4_wch8FQHWWnb8y1rUYgsTKzqWRbODHdc/s1600/20160609_154539.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="200" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjVSgtktR_mP7_ROhHqJxWLAFf6iHmqB_f0z1kbwsbhnEi2N-B6SG4bX5gIf4JKqOAnWRpHaXhyDmrpiqa53Mk0u9a3VeiElX2GAoq5gCzHUV4_wch8FQHWWnb8y1rUYgsTKzqWRbODHdc/s200/20160609_154539.jpg" width="112" /></a><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjl7UKUgxTRP7lp-l1aA481sN15qq3sE_elBKOzT_qOvfTTqXksqhY2qeDJ9omvF1_FKms8cKQg8K1-HTxpRyIHaDowRngYC_bdO-x_X52LtyyfdgPiDYYuweu3tZtyCPHyXhILeWBr94k/s1600/20160609_154533.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="200" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjl7UKUgxTRP7lp-l1aA481sN15qq3sE_elBKOzT_qOvfTTqXksqhY2qeDJ9omvF1_FKms8cKQg8K1-HTxpRyIHaDowRngYC_bdO-x_X52LtyyfdgPiDYYuweu3tZtyCPHyXhILeWBr94k/s200/20160609_154533.jpg" width="112" /></a><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg6gBhoOE0AQLYjtXNv6n2nW1Q6_mAArMlrPPKzBsVcDCNsRTTqHo1J7Kdsuo7myM3lx-W4kdsR4cc53ZYvBzk1x5vtq4iA8UhPgQIfbwc1LuGTIw4FDMclx02qC5Z62ofzLvHhiQ8ZhVs/s1600/20160609_154510.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="200" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg6gBhoOE0AQLYjtXNv6n2nW1Q6_mAArMlrPPKzBsVcDCNsRTTqHo1J7Kdsuo7myM3lx-W4kdsR4cc53ZYvBzk1x5vtq4iA8UhPgQIfbwc1LuGTIw4FDMclx02qC5Z62ofzLvHhiQ8ZhVs/s200/20160609_154510.jpg" width="112" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="" style="clear: both; text-align: center;">
I need to practice noses!</div>
<div class="" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi6n6GaNe27Zvaf7-hVQgwKuWzBbrQxmY9coDRXp8y-Y1ZNgHvAaAkRHm7YR8VTSP-_AzwBoI3qvK5zDLJsZ8A_S3HzftrBIoJA9E1eqkIvyNXEXnGHItJPVOq0HxVNMUd5MENI1VTAS8c/s1600/20160609_175709.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="400" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi6n6GaNe27Zvaf7-hVQgwKuWzBbrQxmY9coDRXp8y-Y1ZNgHvAaAkRHm7YR8VTSP-_AzwBoI3qvK5zDLJsZ8A_S3HzftrBIoJA9E1eqkIvyNXEXnGHItJPVOq0HxVNMUd5MENI1VTAS8c/s400/20160609_175709.jpg" width="225" /></a></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
Here are a few links you may want to bookmark;</div>
<div>
<ul>
<li><a href="http://www.scott-eaton.com/category/bodies-in-motion">scott-eaton.com/category/bodies-in-motion</a></li>
<li><a href="http://www.scott-eaton.com/tutorials">scott-eaton.com/tutorials</a></li>
<li><a href="https://www.bodiesinmotion.photo/">bodiesinmotion.photo</a></li>
<li><a href="https://www.cs.cmu.edu/~face/facs.htm">FACS</a></li>
</ul>
</div>
<div>
<br /></div>
</div>
Lee Dunhamhttp://www.blogger.com/profile/11548341409322230513noreply@blogger.com0tag:blogger.com,1999:blog-536028505499887975.post-55151080989463169462016-06-05T23:23:00.000+01:002016-06-06T09:09:59.148+01:00Python in Maya: Simple node sorting<div>
When applying a worldspace or relative transform to nodes in Maya, you'll often have to account for;</div>
<div>
<ol>
<li>Control behaviour type (IK, Pole Vectors etc)</li>
<li>Control hierarchy</li>
</ol>
</div>
<div>
This is where you will probably need to look at sorting your list of nodes prior to applying the data.<br />
Also, space-switch sorting will want to be run as an additional pass over control type and hierarchy. This dependency check will vary based on the type of space-switch setup the rigs are using.<br />
<div>
<br /></div>
<div>
I've added a simple sort setup with individual and combined priorities.<br />
<i>Edit: Enable</i><i> web view if browsing on mobile</i>.</div>
</div>
<div>
<br /></div>
<script class="brush: python" type="syntaxhighlighter">import pymel.core as pm
# -- The sorting functions allow the user to pass in data they wish to return sorted and,
# -- optionally, matching data the sorting methods should use, eg sort a list by another list.
# -- The final sorting function applies two different sort methods to sort data -
# -- one for attribute value and the other for node hierarchy, and importantly,
# -- in that priority order.
# -- Ideally, any rig constants (controller behaviour type and hierarchy) can and should be
# -- cached (typically onto the rig itself) to avoid the unnecessary computation.
def convert_node_hierarchy(node):
# -- Get the long name of the PyNode
# -- This could be omitted if we can guarantee string longnames.
if isinstance(node, pm.PyNode):
node = pm.longName().count('|')
return node.count('|')
def convert_attribute_value(attribute, priority_list=None):
# -- Get the attribute's value
# -- We could replace this with .getattr under a try/except.
value = attribute.get()
if priority_list:
# -- Use the priority list
if value in priority_list:
# -- Return the index in which the value appears
return priority_list.index(value)
else:
return
else:
# -- Return the attribute's value
return value
def hierarchy(data, sort_data=None):
# -- Get valid sort data
sort_data = sort_data or data
# -- Return original data from a sorted zip of sort data
return [r[0] for r in sorted(zip(data, sort_data),
key=lambda x: convert_node_hierarchy(x[1]))]
def attribute_value(data, sort_data=None, priority_list=None):
# -- Get valid sort data
# -- Attribute sort data would need to be a list of pm.PyAttributes.
# -- We could pass a list of PyNodes and a string attr name instead.
sort_data = sort_data or data
# -- Return original data from a sorted zip of sort data
return [r[0] for r in sorted(zip(data, sort_data),
key=lambda x: convert_attribute_value(x[1]))]
def controls(data,
attribute_sort_data=None,
hierarchy_sort_data=None,
attribute_priority_list=None):
# -- Get valid sort data
attribute_sort_data = attribute_sort_data or data
hierarchy_sort_data = hierarchy_sort_data or data
# -- Return original data from a sorted zip of different sort data
return [r[0] for r in sorted(zip(data,
attribute_sort_data,
hierarchy_sort_data),
key=(lambda x: (convert_attribute_value(x[1],
priority_list=attribute_priority_list),
convert_node_hierarchy(x[2]))))]
</script>
<br />
<div>
I'd love to hear your thoughts and how you approach this task.</div>
Lee Dunhamhttp://www.blogger.com/profile/11548341409322230513noreply@blogger.com1tag:blogger.com,1999:blog-536028505499887975.post-49702726933604459862016-05-26T00:47:00.001+01:002016-05-26T00:47:06.449+01:00Huh... I forgot this thing still existed.<br />
<div class="separator" style="clear: both; text-align: center;">
<iframe width="320" height="266" class="YOUTUBE-iframe-video" data-thumbnail-src="https://i.ytimg.com/vi/IbHKLFMrz8c/0.jpg" src="https://www.youtube.com/embed/IbHKLFMrz8c?feature=player_embedded" frameborder="0" allowfullscreen></iframe></div>
<br />
So, we've finally released Total War: Warhammer.<br />
<br />
What a project! Huge amount of work and fun!<br />
Very proud to have worked on this game, and to work with so many talented developers.<br />
<br />
<br />
Perhaps I'll give this blog another go.<br />
<br />Lee Dunhamhttp://www.blogger.com/profile/11548341409322230513noreply@blogger.com2tag:blogger.com,1999:blog-536028505499887975.post-17120878632483802372013-04-18T20:45:00.000+01:002013-04-18T20:45:11.715+01:00a nice alternative to a quick Rigid Bodies sim: Dynamica PluginIf you're after a quick little rigidbody sim, I'd suggest giving this a try. Simple, quick, fairly consistent and reliable (so far!).<br />
Just make sure you keep organised and clean the scene up straight after baking, crashes do happen...<br />
<br />
Details:<br />
<a href="http://bulletphysics.org/mediawiki-1.5.8/index.php/Maya_Dynamica_Plugin">http://bulletphysics.org/mediawiki-1.5.8/index.php/Maya_Dynamica_Plugin</a><br />
<br />
Downloads:<br />
<a href="https://code.google.com/p/dynamica/downloads/list">https://code.google.com/p/dynamica/downloads/list</a><br />
<br />
Siggraph 2011 vid:<br />
<a href="http://mbakr.squarespace.com/blog/siggraph-2011-destruction-dynamics-for-film-and-game-product.html">http://mbakr.squarespace.com/blog/siggraph-2011-destruction-dynamics-for-film-and-game-product.html</a><br />
<br />
<br />
<br />Lee Dunhamhttp://www.blogger.com/profile/11548341409322230513noreply@blogger.com0tag:blogger.com,1999:blog-536028505499887975.post-12084456551137874362013-02-28T19:00:00.001+00:002013-02-28T19:00:02.478+00:00quick update<iframe allowfullscreen="" frameborder="0" height="315" src="http://www.youtube.com/embed/7fqb3cPPfuM?list=UUugJq15BiB-c1NDYPHiznWQ" width="560"></iframe><br />
<br />
Been mega busy last 6 months, alot of changes, not much time to work on personal stuff, but had a great learning curve so plenty to look into once things slow down.Lee Dunhamhttp://www.blogger.com/profile/11548341409322230513noreply@blogger.com3tag:blogger.com,1999:blog-536028505499887975.post-36149301904833120612012-08-26T14:18:00.002+01:002016-06-06T22:07:20.065+01:00[Maya][Python] Querying soft selectionHandy little script modified from <a href="https://groups.google.com/forum/?fromgroups=#!topic/python_inside_maya/q1JlddKybyM" target="_blank">here</a> to query and select the soft selection influenced components.<br />
<br />
<script class="brush: python" type="syntaxhighlighter">import maya.cmds as mc
import maya.OpenMaya as om
def softSelection():
selection = OpenMaya.MSelectionList()
softSelection = OpenMaya.MRichSelection()
OpenMaya.MGlobal.getRichSelection(softSelection)
softSelection.getSelection(selection)
dagPath = OpenMaya.MDagPath()
component = OpenMaya.MObject()
iter = OpenMaya.MItSelectionList( selection,OpenMaya.MFn.kMeshVertComponent )
elements = []
while not iter.isDone():
iter.getDagPath( dagPath, component )
dagPath.pop()
node = dagPath.fullPathName()
fnComp = OpenMaya.MFnSingleIndexedComponent(component)
for i in range(fnComp.elementCount()):
elements.append('%s.vtx[%i]' % (node, fnComp.element(i)))
iter.next()
return elements
mc.select(softSelection())
mc.softSelect(softSelectEnabled=False)</script>
<br />
This one instead returns the influenced objects. Great for quickly querying the objects within a specific distance of another object.
<br />
<br />
<script class="brush: python" type="syntaxhighlighter">import maya.cmds as mc
import maya.OpenMaya as om
def softSelection():
selection = om.MSelectionList()
softSelection = om.MRichSelection()
om.MGlobal.getRichSelection(softSelection)
softSelection.getSelection(selection)
dagPath = om.MDagPath()
iter = om.MItSelectionList(selection)
elements = []
while not iter.isDone():
iter.getDagPath(dagPath)
dagPath.pop()
elements.append('%s'%dagPath.fullPathName())
iter.next()
return elements
def getObjectsInRadius(radius=20.0):
mc.softSelect(softSelectEnabled=True,softSelectDistance=radius,softSelectFalloff=2)
return softSelection()
print getObjectsInRadius(mc.ls(sl=True)[0])[1:]</script>
Lee Dunhamhttp://www.blogger.com/profile/11548341409322230513noreply@blogger.com0tag:blogger.com,1999:blog-536028505499887975.post-60872459713335426782012-07-02T18:37:00.001+01:002012-07-02T18:38:30.570+01:00ROME II announced<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiXOkhE13t_14mLKISZbmtu5NIoihfWu5aRqyi3Nzf9Cg5luw5rBVuCqN2KsYod81nPVrGSAZQ7bnrEtCSib1mo7jRQxLXFpEV-4ciX4CgGOoOZFs4C2bjg-gAUTp2VjfStn6lVYdv2Z8E/s1600/392911_335546639853876_673488056_n.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="236" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiXOkhE13t_14mLKISZbmtu5NIoihfWu5aRqyi3Nzf9Cg5luw5rBVuCqN2KsYod81nPVrGSAZQ7bnrEtCSib1mo7jRQxLXFpEV-4ciX4CgGOoOZFs4C2bjg-gAUTp2VjfStn6lVYdv2Z8E/s640/392911_335546639853876_673488056_n.jpg" width="640" /></a></div>
<br />
What I'm currently working on here at CA.Lee Dunhamhttp://www.blogger.com/profile/11548341409322230513noreply@blogger.com0tag:blogger.com,1999:blog-536028505499887975.post-65580506405410197132012-05-31T13:11:00.003+01:002012-05-31T13:11:31.111+01:00Update<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjFgR_G0gZiWDTmvwFSSbMMAl_CnEdyuBbhVENTJa9312IVhqZe90STvKEijVQWmJQd7HqvvqW3Srsi1-eJWsKRbgTILOZKfnB2Bbw1LAtBb04Kesdzj27fQvmNTQ5yljuGLNO3a-6lmuA/s1600/The_creative_assembly-logo.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="176" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjFgR_G0gZiWDTmvwFSSbMMAl_CnEdyuBbhVENTJa9312IVhqZe90STvKEijVQWmJQd7HqvvqW3Srsi1-eJWsKRbgTILOZKfnB2Bbw1LAtBb04Kesdzj27fQvmNTQ5yljuGLNO3a-6lmuA/s400/The_creative_assembly-logo.png" width="400" /></a></div>
<br />
<span style="text-align: left;">Thought i'd update, considering it has been a month or two.</span><br />
<span style="text-align: left;">Been pretty busy lately with the moving, new job and 5-hour commute (temporary), so I haven't had much time to work on any of my own stuff, or do... well... anything.</span><br />
<span style="text-align: left;">Once settled i'll probably get back on it.</span>Lee Dunhamhttp://www.blogger.com/profile/11548341409322230513noreply@blogger.com0tag:blogger.com,1999:blog-536028505499887975.post-91627465121339044232012-04-13T17:04:00.001+01:002012-04-13T17:04:09.234+01:00Script: ld_selectMe (v2)Re-wrote my free selection-set creation script, 'ld_selectMe' in python.<br />
Updates include a more dynamic UI, faster set creation and overall, a much better write of the actual selection script, allowing the same functionality but only much, much faster than its mel counterpart.<br />
<br />
You can download the re-write for free <a href="http://www.mediafire.com/?umrjl2lrlq5rdbw" target="_blank">here </a>(mediafire.com)<br />
or creativecrash <a href="http://www.creativecrash.com/maya/downloads/scripts-plugins/animation/c/ld_selectme-selection-sets" target="_blank">here</a>.<br />
<br />
Any comments/suggestions welcome.Lee Dunhamhttp://www.blogger.com/profile/11548341409322230513noreply@blogger.com0tag:blogger.com,1999:blog-536028505499887975.post-92182635724187879592012-04-03T08:10:00.000+01:002012-04-03T08:10:57.223+01:00The Animated SparrowReally lovely animation (modeling and texturing) on the finished Sparrow rig by <a href="https://vimeo.com/24854434" target="_blank">Geraint Wright</a>.<br />
<br />
<iframe allowfullscreen="" frameborder="0" height="348" mozallowfullscreen="" src="http://player.vimeo.com/video/39683916" webkitallowfullscreen="" width="610"></iframe>Lee Dunhamhttp://www.blogger.com/profile/11548341409322230513noreply@blogger.com0tag:blogger.com,1999:blog-536028505499887975.post-77850618273214640152012-03-30T13:20:00.004+01:002012-03-30T13:22:58.516+01:00Python: Writing nested dictionaries to fileBest suggestion I could think of was using cPickle (if available).<br />
<pre class="python" name="code">try:
import cPickle as pickle
except:
import pickle
# nested DICTIONARY
data = { 'one': {'label': 'This is shot 001', 'start': 1, 'end': 10},
'two': {'label': 'This is shot 002', 'start': 11, 'end': 25},
'three': {'label': 'This is shot 003 - Needs Editing', 'start': 26, 'end': 50} }
# write to file with cPickle/pickle (as binary)
def ld_writeDicts(filePath,dict):
f=open(filePath,'w')
newData = pickle.dumps(dict, 1)
f.write(newData)
f.close()
ld_writeDicts('C:/Users/Lee/Desktop/test2.dta',data)
#############
# read file decoding with cPickle/pickle (as binary)
def ld_readDicts(filePath):
f=open(filePath,'r')
data = pickle.load(f)
f.close()
return data
# return dict data to new dict
newDataDict = ld_readDicts('C:/Users/Lee/Desktop/test2.dta')
# test nesting
print newDataDict['one']['label']
</pre>
As you can see its very simple to use and very quick. There are loads of alternatives if you wanted a nicely arranged, readable file, including json:
<br />
<pre class="python" name="code">import json
# nested DICTIONARY
data = { 'one': {'label': 'This is shot 001', 'start': 1, 'end': 10},
'two': {'label': 'This is shot 002', 'start': 11, 'end': 25},
'three': {'label': 'This is shot 003 - Needs Editing', 'start': 26, 'end': 50} }
# write to file with json encoding
def ld_writeDicts(filePath,dict):
f=open(filePath,'w')
newData = json.dumps(dict, sort_keys=True, indent=4)
f.write(newData)
f.close()
ld_writeDicts('C:/Users/Lee/Desktop/test',data)
# read file decoding with json
def ld_readDicts(filePath):
f=open(filePath,'r')
data = json.loads(f.read())
f.close()
return data
# return dict data to new dict
newDataDict = ld_readDicts('C:/Users/Lee/Desktop/test.dta')
# test nesting
print newDataDict['one']['label']
</pre>
<br />
However im all for cPickle.Lee Dunhamhttp://www.blogger.com/profile/11548341409322230513noreply@blogger.com1tag:blogger.com,1999:blog-536028505499887975.post-19533768562687882112012-03-15T20:24:00.000+00:002012-03-15T20:28:13.990+00:00Mel: Invert Selection from a render layerThought I might post up this useful code someone asked for...<br />
<br />
<pre class="python" name="code">// ld_invertSel_rlyr.mel 0.2
//
// Authors: Lee Dunham
// Licence: Creative Commons, Attribution, Share Alike
// About: Inverts selection for visible objects in current render layer.
// Usage:
// ld_invertSel_rlyr ;
global proc ld_invertSel_rlyr(){
string $currentRenderLayer=`editRenderLayerGlobals -q -currentRenderLayer` ;
string $objsRenLayer[]=stringArrayRemoveDuplicates(`editRenderLayerMembers -q $currentRenderLayer`) ;
for($obj in $objsRenLayer)
if(`getAttr ($obj+".v")`==1 && `objectType -isType "transform" $obj`)
select -tgl $obj ;
else
select -d $obj ;
}</pre>
<br />
It'll invert the selection for whatever visible transform objects are in the current render layer. Its not fantastic but it was a 5-minute job.Lee Dunhamhttp://www.blogger.com/profile/11548341409322230513noreply@blogger.com0tag:blogger.com,1999:blog-536028505499887975.post-36734897658442674232012-03-14T17:02:00.001+00:002020-09-29T03:50:06.604+01:00ld_mirrorMe v1.5.0<div>Edit: Source is now available on <a href="https://github.com/ldunham1/maya_utilities/blob/master/ld_mirror_me.py" target="_blank">GitHub</a>.</div><div><br /></div><div><br /></div>I was surprised by the response this tool had, so I'm releasing v1.5.0 to help some people out, it'll be good to hear how you guys use it.<br />
Alongside my <a href="http://ldunham.blogspot.com/2012/03/python-create-cluster-from-soft.html" target="_blank">softCluster</a> script, you'll definitely notice a speed increase in your workflow.<br />
<br />
<span style="font-size: large;">Download it <a href="http://www.mediafire.com/?blmnapbn974dlh8" target="_blank">here</a> </span>(mediafire link).<br />
Download, extract and place script in maya's script directory and use<br />
<pre class="python" name="code">import ld_mirrorMe
ld_mirrorMe.GUI()
</pre>
<br />
<iframe allowfullscreen="" frameborder="0" height="350" mozallowfullscreen="" src="http://player.vimeo.com/video/38444757" webkitallowfullscreen="" width="500"></iframe>
<br />
It's features are shown on this much quicker demo (v1.0.0), supporting multi-mirroring for all modes.<br />
<br />
<span style="color: orange;">Full details:</span><br />
- 3 modes:<br />
1. Curve - mirrors nurbs curves, ideal for mirroring rig controls,<br />
2. Mesh - mirrors geo, ideal for mirroring blendshape targets,<br />
3. Deformer - mirrors only clusters (at present), uses object's pivot for mirroring.<br />
- multi-mirroring on all 3 modes,<br />
- choose mirror axis,<br />
- search and replace,<br />
- alter new objects position (currently either world 0, target, mirror or original - depending on mode),<br />
- world position/rotation based, will work wherever or whatever the targets connected to,<br />
- entry objects names retained, if multiple copies needed (ideal for multi-clustering),<br />
- colourize option for Curves, if given curve is coloured (transform or shape), its mirror can be assigned a different colour,<br />
- quick and simple to use.<br />
<br />
<span style="color: orange;">Updates:</span><br />
09/03/12 - 0.5.0<br />
Initial working version.<br />
10/03/12 - 0.9.5<br />
Tidied UI and reduced/cleaned code.<br />
13/03/12 - 1.0.0<br />
Added colour option for curves.<br />
Removed all pymel (speed issues).<br />
Allowed multi-mirroring.<br />
14/03/12 - 1.5.0<br />
Thanks to <a href="http://www.mattmurrayanimation.com/" target="_blank">Matt Murray</a> for feedback for further improvements.<br />
Added option to mirror world position of mirrored curve.<br />
Added further error-checking for all modes.<br />
Fixed bug causing unwanted locking of attributes.<br />
Added option to disable colouring of mirrored curve.<br />
<br />
Again, any feedback, problems/bugs or ideas lemmie know and I'll do what I can.Lee Dunhamhttp://www.blogger.com/profile/11548341409322230513noreply@blogger.com14tag:blogger.com,1999:blog-536028505499887975.post-25750681675955743312012-03-10T19:12:00.000+00:002012-03-11T17:06:59.385+00:00ld_mirrorMe tool demoJust made a quick demo for one of my 3 main toolsets, (ld_animateMe v2, ld_rigMe v1 and ld_mirrorMe v.9.5) the ld_mirrorMe tool, something I started a while ago but put off.<br />
<br />
<iframe allowfullscreen="" frameborder="0" height="450" mozallowfullscreen="" src="http://player.vimeo.com/video/38280714" webkitallowfullscreen="" width="600"></iframe>
<br />
<br />
This demo primarily shows mirroring on objects from world 0, but everything is calculated from worldspace and works accordingly, it doesn't matter where it is or what its connected/parented to, the mirror will work as expected.<br />
<br />
<span style="color: orange;">Details:</span><br />
3 modes - Curve, Mesh and Cluster (at present),<br />
- Curve - Primarily for mirroring nurbs curves for controllers, Mesh - Primarily for mirroring blendshapes (can mirror multiple targets at the same time), and Cluster - (developing for other deformers), given a deformer and its mesh will mirror the deformer over giving a correctly mirrored pivot and origin based on the objects pivot.<br />
Search and replace feature,<br />
Choose mirror axis,<br />
Choose new objects position,<br />
World based - will work wherever or whatever the targets connected to,<br />
Entries retained, no need to keep adding same object of multiple copies needed,<br />
Simple to use.<br />
<br />
This was initially going to just be a tool for my rigging UI (ld_rigMe), but I prefer having it separate.<br />
<br />
Any ideas/comments welcome.Lee Dunhamhttp://www.blogger.com/profile/11548341409322230513noreply@blogger.com6tag:blogger.com,1999:blog-536028505499887975.post-84043716539325570272012-03-07T16:18:00.001+00:002020-09-29T03:55:24.400+01:00Python: Create Cluster from soft selection<div><span style="font-size: large;">Edit: Source now available on <a href="https://github.com/ldunham1/maya_utilities/blob/master/ld_soft_cluster.py" target="_blank">GitHub</a>.</span></div><span style="font-size: large;"><div><span style="font-size: large;"><br /></span></div>Get the script </span><a href="http://www.mediafire.com/?545fkr217ag549t" style="font-size: x-large;" target="_blank">here</a><span style="font-size: large;">.</span><br />
<span style="font-size: large;">or from creativecrash <a href="http://www.creativecrash.com/maya/downloads/scripts-plugins/character/c/ld_createsoftcluster" target="_blank">here</a>.</span><br />
<iframe allowfullscreen="" frameborder="0" height="313" mozallowfullscreen="" src="http://player.vimeo.com/video/38102335?title=0&byline=0&portrait=0" webkitallowfullscreen="" width="468"></iframe><br />
<br />
All thanks to <a href="http://brian.meljunky.com/" target="_blank">Brian Escribano</a> for his softSelection() code that gathers the id and weights of the current soft selection (basically, all the hard work).<br />
It was simple enough to apply that information to a new cluster.<br />
<br />
Usage:<br />
Extract and place script file into a maya script directory (or python path directory) and run with this<br />
<pre class="python" name="code">import ld_createSoftCluster as sc
sc.ld_createSoftCluster()</pre><br />
and thanks to <a href="http://www.vraphix.com/">Valen Wagner</a> for the icon.<br />
<br />
Update:<br />
07/03/12 - 0.4.0<br />
Alters cluster position to match selection rather than influenced average.Lee Dunhamhttp://www.blogger.com/profile/11548341409322230513noreply@blogger.com10tag:blogger.com,1999:blog-536028505499887975.post-22335147841300562602012-03-04T18:11:00.000+00:002012-03-07T14:26:50.064+00:00Showreel 2011-12Latest work from previous project, <i>Ha Ha Hairies</i>, where I worked for Red Wire Media as the Character TD/Animator.<br />
<br />
<iframe allowfullscreen="" frameborder="0" height="263" mozallowfullscreen="" src="http://player.vimeo.com/video/37901643?title=0&byline=0&portrait=0" webkitallowfullscreen="" width="468"></iframe>
<br />
<br />
<span style="color: orange;">Reel Breakdown:</span><br />
<br />
<span style="color: orange;">Overview:</span><br />
Rigged all shown characters, scripts and GUI's.<br />
<br />
<span style="color: orange;">Sequence 1 (00:00:10):</span><br />
<span style="white-space: pre;">Rigged main character 'Kwiff';</span><br />
<span style="white-space: pre;">- Rig fully scalable and modularly built to provide easy updating of rig if needed.</span><br />
<span style="white-space: pre;">- Simple Nurbs-based selection GUI for easy interaction.</span><br />
<br />
<span style="color: orange;">Sequence 2 (00:00:31):</span><br />
<span style="white-space: pre;">Hybrid IK/FK spine for extreme posing and toony nature of show;</span><br />
<span style="white-space: pre;">- Broken </span><span style="white-space: pre;">hierarchies to separate upper and lower posing and flexibility.</span><br />
<span style="white-space: pre;">- Traditional FK control during rotation, controllable volume preservation during translation.</span><br />
<span style="white-space: pre;">- Position and orient switching for full IK control.</span><br />
<br />
<span style="color: orange;">Sequence 3 (00:00:39):</span><br />
<span style="white-space: pre;">Stretchy, bendy, volume-preserving limbs;</span><br />
<span style="white-space: pre;">- With custom foot-roll, banking and various pivoting attributes.</span><br />
<br />
<span style="color: orange;">Sequence 4 (00:01:18):</span><br />
<span style="white-space: pre;">Various scripts to assist posing and animation;</span><br />
<span style="white-space: pre;">- Ik/Fk blending, with snapping between the two over a single frame or a range of frames.</span><br />
<span style="white-space: pre;">- Fk setup to mirror live rotation.</span><br />
<span style="white-space: pre;">- Script to mirror or flip any part of the rig, including entire poses.</span><br />
<br />
<span style="color: orange;">Sequence 5 (00:01:31):</span><br />
<span style="white-space: pre;">Animator-friendly finger controls;</span><br />
<span style="white-space: pre;">- Setup to allow quick posing of fingers with 2 attributes, as well as individual control over each finger via attributes and individual controllers.</span><br />
<br />
<span style="color: orange;">Sequence 6 (00:01:36):</span><br />
<span style="white-space: pre;">Insert-blink script;</span><br />
<span style="white-space: pre;">- Based on animator designs, for a time-saving script.</span><br />
<span style="color: orange;"><br class="Apple-interchange-newline" /></span><br />
<span style="color: orange;">Sequence 7 (00:01:41):</span><br />
<span style="white-space: pre;">Selection GUI;</span><br />
<span style="white-space: pre;">- Interchangeable between full rig and facial controls.</span><br />
<span style="white-space: pre;">- Varying levels of detail.</span><br />
<br />
<span style="color: orange;">Sequence 8 (00:02:19):</span><br />
<span style="white-space: pre;">Animator friendly facial rig;</span><br />
<span style="white-space: pre;">- Minimal, joystick inspired controls with multiple functions to provide alot of interactivity with minimal effort.</span><br />
<span style="white-space: pre;">- Joint and blendshape based, with interactivity between the controls for quicker, stronger posing.</span><br />
<span style="white-space: pre;">- Tweaking controls for more specific expressions and fine-tuning.</span><br />
<br />
<span style="color: orange;">Sequence 9 (00:02:44):</span><br />
Test facial rig;<br />
- Use of multiple, individually controllable deformers, built into the rig.<br />
- FK beak with tweaking lip controls.<br />
- Various deformers on expressive areas of the face.<br />
- Re-postionable eye sockets.<br />
- Detachable upper/lower head for extreme posing.<br />
<br />
<span style="color: orange;">Sequence 10 (00:03:12):</span><br />
Test facial rig - Deform test;<br />
- All deformers work together, rather than prioritising over each other.<br />
- Complete squash, stretching and deformation over the head rig whilst maintaining any pose, blendshape or joint-based.<br />
- Whilst maintaining that important ability to <i>scale</i>.<br />
<br />Lee Dunhamhttp://www.blogger.com/profile/11548341409322230513noreply@blogger.com4tag:blogger.com,1999:blog-536028505499887975.post-35679231508293323742012-02-23T18:23:00.000+00:002012-03-07T12:26:12.371+00:00Mel: ld_animToCurve - create nurbs curve from moving objects or verts<span style="font-size: large;">Download the script directly, <a href="http://www.mediafire.com/?qfls2joop52qdt5" target="_blank">here</a> </span>(follow link and place it in maya's script directory)<br />
<span style="font-size: large;">or from creativecrash <a href="http://www.creativecrash.com/maya/downloads/scripts-plugins/c/ld_animtocurve" target="_blank">here</a>.</span><br />
<br />
<br />
<iframe allowfullscreen="" frameborder="0" height="263" mozallowfullscreen="" src="http://player.vimeo.com/video/37324514?title=0&byline=0&portrait=0" webkitallowfullscreen="" width="468"></iframe>
<br />
<br />
Creates a nurbs curve for each selected object and/or vert over a series of frames (like a motionTrail, but without the motionTrail bit).<br />
<br />
<b>Works using xforms</b> - so object could be skinned, constrained, driven by expressions etc,<br />
<b>Simple to cleanup</b> - just rebuild the curve,<br />
<b>Simple to use</b> - select the objects and/or verts you want and execute using ld_animToCurve ;<br />
<br />
Useful for quickly putting together complex shapes or tracking a vert's/object's position.<br />
<br />
<br />
<u>Updates:</u><br />
07/03/12: 0.6.0<br />
Fixed issue selecting some verts.<br />
0.7.0<br />
Added poly faces - now requires modified version of owen burgess' 2009 script "getfacecenters.py" (included).<br />
<br />
<br />Lee Dunhamhttp://www.blogger.com/profile/11548341409322230513noreply@blogger.com8tag:blogger.com,1999:blog-536028505499887975.post-54491319849222021142012-02-21T11:35:00.000+00:002012-02-21T11:36:47.856+00:00Mel: Query part of a string, given its index and separator: PART 3Update from <a href="http://ldunham.blogspot.com/2012/02/mel-query-part-of-string-given-its_20.html" target="_blank">PART 2</a>.<br />
Thanks to Viktoras Makauskas for the suggestions and link.<br />
<code>// get an item from a string given the string, separator and index range
// ld_getName "L_test_me_out_bind_jnt" "_" 2 -2 ;
global proc string ld_getName(string $obj,string $separator,int $start,int $end)
{
string $buffer[],$name ;
int $numTokens=`tokenize $obj $separator $buffer` ;
if($start<0)
$start=$numTokens+$start ;
if($end<0)
$end=$numTokens+$end ;
if($start<0 || $start>=$numTokens || $end<0 || $end>=$numTokens || $start>$end)
return "" ;
$name=$buffer[$start] ;
for($n=($start+1);$n<=$end;$n++)
$name+=$separator+$buffer[$n] ;
return $name ;
}</code><br />
Changes include:<br />
1. Separating the indexing to individual ints instead of a string that needs to get split.<br />
2. Using the indexes to specify the token, not the separator.<br />
3. More error checking.<br />
Main difference is 0 -1 will now return the entire string rather than all but the last token (as it does in Python), mainly for functionality due to the removal of the colon. Can still return one item using the same int (ie the last token would be -1 -1).Lee Dunhamhttp://www.blogger.com/profile/11548341409322230513noreply@blogger.com0tag:blogger.com,1999:blog-536028505499887975.post-58672666514843688172012-02-20T14:33:00.000+00:002012-02-20T14:33:10.111+00:00Mel: Query part of a string, given its index and separator: PART 2Update to previous post (<a href="http://ldunham.blogspot.com/2012/02/mel-query-part-of-string-given-its.html" target="_blank">here</a>), needed to grab a range of items from a string given a separator and index/range (supports reverse and extended indexing).<br />
I do have a horribly sneaky suspicion there is already a built in command for this...<br />
Will work with ranges given as "0", "-1", "0:","-2:", ":2", ":-2", "1:3" and "-3:-1" etc.<br />
<code>// get an item from a string given the string, separator and index number/range as string (supports reverse indexing)
//ld_getName "L_test_me_out_bind_jnt" "_" "2:-1" ;
global proc string ld_getName(string $obj,string $separator,string $index)
{
string $mulBuffer[],$indBuffer[],$name ;
int $range[],$start,$end ;
tokenize $index ":" $mulBuffer ;
$range[0]=int($mulBuffer[0]) ;
if(startsWith($index,":"))
{
$mulBuffer[1]=$range[0] ;
$range[0]=0 ;
}
else if(endsWith($index,":"))
$mulBuffer[1]=-1 ;
tokenize $obj $separator $indBuffer ;
$start=$range[0] ;
if($range[0]<0)
$start=size($indBuffer)-(abs($range[0])) ;
if(size($mulBuffer)>1)
{
$range[1]=int($mulBuffer[1]) ;
$end=$range[1] ;
if($range[1]<0)
$end=size($indBuffer)-abs($range[1]) ;
if($end>(size($indBuffer)-1))
return "" ;
$name=$indBuffer[$start] ;
for($n=($start+1);$n<$end;$n++)
$name+=$separator+$indBuffer[$n] ;
}
else
{
if($start<0)
$name=$indBuffer[size($indBuffer)-int(abs($start))] ;
else
$name=$indBuffer[$start] ;
}
return $name ;
}</code>
Would appreciate any feedback (I know how much simpler this is in python, was curious how simple it was to do in mel).<br />
Python, i think, would handle like this:
<br /><code>"L_test_me_out_bind_jnt".split("_")[2:-1]</code>Lee Dunhamhttp://www.blogger.com/profile/11548341409322230513noreply@blogger.com2tag:blogger.com,1999:blog-536028505499887975.post-31417938226885345212012-02-16T20:25:00.000+00:002012-02-20T14:36:01.892+00:00Mel: Query part of a string, given its index and separatorUPDATE: Updated version with better functioning <a href="http://ldunham.blogspot.com/2012/02/mel-query-part-of-string-given-its_20.html">here</a>.<br />
I realised how often I was using a mix of the tokenize, startString and endString to get sections of a string, whether the start or end (various ways) or the middle (ie getting the side "L_*" or "R_*" or type of object "*_ctrl" "*_bind_jnt") etc, and I loved the way python handles this instead (especially the reverse indexing) so I come up with this.<br />
<code>global proc string ld_getName(string $obj,string $separator,int $index)
{
string $buffer[],$name ;
tokenize $obj $separator $buffer ;
if($index<0)
$name=$buffer[size($buffer)-int(abs($index))] ;
else
$name=$buffer[$index] ;
return $name ;
}
//ld_getName "L_test_me_out_ctrl" "_" -1 ;</code><br />
EDIT: Changed positive indexing to match 0 = start, -1 = endLee Dunhamhttp://www.blogger.com/profile/11548341409322230513noreply@blogger.com0tag:blogger.com,1999:blog-536028505499887975.post-63080633736649967092012-02-04T03:44:00.001+00:002012-02-04T03:44:04.638+00:00Correctional blendshapesI always had nightmares creating correctional blendshapes for rigs, having to work on the duplicated default mesh whilst watching the result mesh update (still trying to get over how I ever did this on a single 15" monitor...),<br />
<div>
and then I found out how blendshape weights aren't limited from 0 to 1... and less than 0.</div>
<div>
<br /></div>
<div>
Now creating correctional blendshapes is far more enjoyable and takes up much less time, using a very simple setup.</div>
<div>
<br /></div>
<div>
Its actually very basic math (the way I see it anyways)</div>
<div>
a + b = c</div>
<div>
which therefore means...</div>
<div>
b = c - a</div>
<div>
so if "a" was a pose, "b" was its correction, and "c" the result of both. Now if you take the pose away from the result, your left with... the correction!</div>
<div>
<br /></div>
<div>
Corrective blendshape wise, you need to put your character into its pose you want to correct,<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiWYy1MoYEcAr2toz6aMO6uTVVcUAvkzYiZMkKdkTbUlKUnQMD6ef97FIfGnnApZzXHl9Lq_9DhUoADDKScsCUZRKtA6ycPdny6LAO3ZXhkLK6wCZTmtYtMj0VsHODHQEnvFihVg-DWKq0/s1600/Correctional+blendshapes01.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="143" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiWYy1MoYEcAr2toz6aMO6uTVVcUAvkzYiZMkKdkTbUlKUnQMD6ef97FIfGnnApZzXHl9Lq_9DhUoADDKScsCUZRKtA6ycPdny6LAO3ZXhkLK6wCZTmtYtMj0VsHODHQEnvFihVg-DWKq0/s320/Correctional+blendshapes01.jpg" width="320" /></a></div>
<br />
duplicate the mesh and create the correction ("b"),<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi7GUmuJIFZCPWCiptt0OvDnybKCxB-gcMjZ70EkkAdlm-48MZHvfQ7RQXA5SHbLEM-FVHyf87pANUiPYH3yXwuCkh5X68xED5kUvrlEnb60GxByErOdd68xBpw-oF0HocIsqTKw0FoyaQ/s1600/Correctional+blendshapes02.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="143" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi7GUmuJIFZCPWCiptt0OvDnybKCxB-gcMjZ70EkkAdlm-48MZHvfQ7RQXA5SHbLEM-FVHyf87pANUiPYH3yXwuCkh5X68xED5kUvrlEnb60GxByErOdd68xBpw-oF0HocIsqTKw0FoyaQ/s320/Correctional+blendshapes02.jpg" width="320" /></a></div>
<br />
duplicate the mesh orginal mesh off again (to get "a")
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjYlf-cnBhIf0cOpzUiJELD1o0drtDsbAVqtutWeexv_7NGgpm_NczdHKx-iFuz_7sAt2UAwJVbEqgMzp_7uB6gon7kV-wGdpiXsZvqTWbrRXi4mKnw7pf1I719WxjC4L0g4XAgZNxq2j8/s1600/Correctional+blendshapes03.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="143" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjYlf-cnBhIf0cOpzUiJELD1o0drtDsbAVqtutWeexv_7NGgpm_NczdHKx-iFuz_7sAt2UAwJVbEqgMzp_7uB6gon7kV-wGdpiXsZvqTWbrRXi4mKnw7pf1I719WxjC4L0g4XAgZNxq2j8/s320/Correctional+blendshapes03.jpg" width="320" /></a></div>
<br /></div>
<div>
Then you duplicate the mesh with no deformations on it (as you would creating a normal blendshape), and assign the pose mesh and the corrective mesh ("a" + "b"). You finally want to turn on the correction blend weight to 1, and the pose blend weight to -1.<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgDOwkGE121xtfu_kTb0ErYs_lyldb0-40VjN3qPVD38zxRi1tFxcQRcyzYO3VsNqSkligqDKsgDAEIG-4CMDa8XlWMJoUX5xskLh8Okq2EzCVVKqJGGWwdzzCACqGw4qaKPngSeE78SYg/s1600/Correctional+blendshapes04.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="143" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgDOwkGE121xtfu_kTb0ErYs_lyldb0-40VjN3qPVD38zxRi1tFxcQRcyzYO3VsNqSkligqDKsgDAEIG-4CMDa8XlWMJoUX5xskLh8Okq2EzCVVKqJGGWwdzzCACqGw4qaKPngSeE78SYg/s320/Correctional+blendshapes04.jpg" width="320" /></a></div>
<br /></div>
<div>
Your then left with just the correction, which you duplicate off and apply as a corrective blendshape target for you character.</div>
<div>
<br /></div>
<div>
This can be taken so much further to do live pose updates (above is all automated), but I wont go into that yet.</div>
<div>
<br /></div>
<div>
I hope this helps!</div>Lee Dunhamhttp://www.blogger.com/profile/11548341409322230513noreply@blogger.com7tag:blogger.com,1999:blog-536028505499887975.post-43677171234934963312012-01-31T22:26:00.000+00:002012-01-31T22:26:18.312+00:00Mel/Python: Adding number paddingI was looking through some older scripts and hit across my dirty attempt to add number padding, and I was surprised it actually worked.<br />
I went about tidying it up and came up with this little number in mel.<br />
<code>global proc string rt_addPadding(int $num,int $padding)
{
int $lengthNum=size(string($num)) ;
string $padString;
if($lengthNum<$padding)
for($i=0;$i<($padding-$lengthNum);$i++)
$padString=$padString+"0" ;
return $padString+string($num) ;
}</code>
<br />
Which works ok, and then a couple of minutes searching I came across a post by <a href="http://www.naughtynathan.co.uk/" target="_blank">Nathan</a> which instead uses python (and is far better).<br />
<code>string $pad = `python ("'%0"+$padding+"d' % "+$num)`;</code><br />
This then is used as this.<code>global proc string rt_addPadding(int $num,int $padding)
{
return `python("'%0"+$padding+"d' % "+$num)` ;
}
</code><br />
Useful :)Lee Dunhamhttp://www.blogger.com/profile/11548341409322230513noreply@blogger.com2tag:blogger.com,1999:blog-536028505499887975.post-51531506943017812732012-01-26T08:50:00.002+00:002012-01-26T09:19:35.987+00:00Bird Rig: Current WIP<a href="http://vimeo.com/24854434" target="_blank">Geraint Wright</a> asked if I could build a quick rig for a sparrow animation (model would be supplied).<br />
<br />
This is where it is atm. (still alot of work to go into it) but alot of the base ideas are there.<br />
<br />
<iframe src="http://player.vimeo.com/video/35679039?title=0&byline=0&portrait=0" width="468" height="342" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>
<br />
The separation of the feathers was far simpler than I though actually, using a couple of curves and the very useful pointOnCurveInfo nodes (same nodes used in motionpaths but without the extra crap), then just a basic heirachy of dependencies of controllers and aim constraints (the feather bending is hideous but was only quickly thrown together, needs more thought behind it so expect that to change).<br />
One issue (kinda solved, looking into better solutions) was due to the aim constraint, feathers wouldn't react accordingly to folding or certain positions, especially when pulled about a fair bit. Simple solution was to declare the aims up object as another controller (well, one for each segment).<br />
Alot of automation (of course each with manual overrides and on/off blending) will be needed to get a smoother transition and to 'hide' any smaller issues, included with a smart system to fold the wing (some scripting required).<br />
The animation it'll be used in you wont really see much of the detail but I'd rather put the work in now if any shots/ideas for closer cuts are thrown in...<br />
<br />
References:<br />
<a href="http://forums.cgsociety.org/showthread.php?f=7&t=836433&highlight=wing">http://forums.cgsociety.org/showthread.php?f=7&t=836433&highlight=wing</a>
<br />
<a href="http://www.brendanbody.co.uk/flight_tutorial/index.html">http://www.brendanbody.co.uk/flight_tutorial/index.html</a>Lee Dunhamhttp://www.blogger.com/profile/11548341409322230513noreply@blogger.com11tag:blogger.com,1999:blog-536028505499887975.post-39884619590989217192012-01-18T12:50:00.000+00:002012-01-20T10:44:37.783+00:00ld_animateMe v1.0.0<div style="text-align: center;">
<span style="font-size: large;">ld_animateMe now available!</span> <span style="font-size: large;">- <a href="http://www.creativecrash.com/maya/downloads/scripts-plugins/animation/c/ld_animateme-animation-tool" target="_blank">Download</a></span><br />
current version 1.2.1</div>
<div style="text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhPiGQiugj95d_P4IWyS6UwMREZgb8kunwAWbTzDVfLdpF5zuJKVEmyt95Iji4tAJtlBviQbkRUZ_zHmlfFC-pwFlwC-c7KaywpVPlBqdcqDlMAmE-NcdFElPhpnlg5t_RvH3L6uR_hQGk/s1600/01.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhPiGQiugj95d_P4IWyS6UwMREZgb8kunwAWbTzDVfLdpF5zuJKVEmyt95Iji4tAJtlBviQbkRUZ_zHmlfFC-pwFlwC-c7KaywpVPlBqdcqDlMAmE-NcdFElPhpnlg5t_RvH3L6uR_hQGk/s320/01.PNG" width="201" /></a></div>
<br />
Re-arrange, offset and reverse keyframes, plus other useful tools.<br />
<br />
<b>To Install:</b><br />
Place the downloaded "ld_animateMe.mel" file into one of your Maya scripts directories, restart Maya and use the following code to load the UI.<br />
<br />
<code>ld_animateMe;</code>
<br />
<br />
<b>To Use:</b><br />
animateMe is designed to be compact and clutter free, giving you the valuable screen space you need.<br />
Besides minimizing the frames for each section, you can remove it from the tool under the "Display" menu by unchecking the related box. If you cant it back, simply re-check the box.<br />
As well as clicking the relevant buttons, you can use the sliders to adjust the value you want and once released, it will run that tool, making it as quick as possible to use.<br />
<br />
<b> <span style="color: orange;">- User Info:</span></b>
<br />
The user info is designed to quickly let you know some useful information regarding your scene that could potentially save hassle later, such as; Forgetting to turn auto-save on, or whether your animating to 24fps or 25. The information is reloaded on creation of the UI, or by clicking the refresh icon to the right.<br />
<br />
<b><span style="color: orange;"> - Adjust Animation - Shift mode:</span></b><br />
To adjust animation, you must select keyframes from either the timeline, or the curve editor.<br />
Entering a number will shift the selected keys by that value, whether positive (ie "2" = shift selected keys 2 frames later, or "-2" = shift selected keys 2 frames earlier.)<br />
<span style="color: #666666; font-size: x-small;">EDIT:<b> </b>19/01/2012 - v 1.2.0</span><br />
<span style="color: #666666; font-size: x-small;">- If no range in timeline or keys selected in curve editor, animtaion will be adjusted from current point onwards.</span>
<br />
<br />
<b><span style="color: orange;"> - Adjust Animation - Offset mode:</span></b><br />
To adjust animation, you must select keyframes from either the timeline, or the curve editor.
<br />
Offset animation works with your selection order. It will offset every selected object's selected keyframes by X amount of frames relative to the object selected before it.<br />
<br />
1. object1, 2 and 3 each has a key on frame 1.<br />
2. You select them in numerical order (object1 first and object3 last).<br />
3. You use Offset mode with value of 2.<br />
4. object2's key will now be at frame 3 and object3's key will now be at frame 5.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhfVlSXfHlXGrWEJ3_jXMvctiH0gslVCkSBiYlykdnIA9-rHt41xWa66PHCuZTfiUmOH9lqnXCcYLNjpVp5v2vNuTYKAbT_uDBNHMVStMUqOsHYjRzkttCFzQB95qZB2X19Zo9ebE1E4UY/s1600/04.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="332" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhfVlSXfHlXGrWEJ3_jXMvctiH0gslVCkSBiYlykdnIA9-rHt41xWa66PHCuZTfiUmOH9lqnXCcYLNjpVp5v2vNuTYKAbT_uDBNHMVStMUqOsHYjRzkttCFzQB95qZB2X19Zo9ebE1E4UY/s400/04.PNG" width="400" /></a></div>
<br />
<b><span style="color: orange;"> - Adjust Animation - Reverse mode:</span></b><br />
You can reverse your animation by selecting the keys from either the timeline, or the curve editor.<br />
<br />
<b><span style="color: orange;"> - Scale Keys - Individual Pivots:</span></b><br />
To use scale keys, you must have keys or curves selected in the curve editor.<br />
For every key selected, it will scale it at the point between its previous and next value, as if it was blending the key between the keys either side. It works great for toning up or down, facial expressions, poses etc or even adding overshoot.<br />
<br />
<b><span style="color: orange;"> - Scale Keys - Pivot on 0:</span></b><br />
To use scale keys, you must have keys or curves selected in the curve editor.<br />
This mode will scale all the selected keys the same pivot of 0.<br />
<br />
<b><span style="color: orange;"> - Selection Sets:</span></b><br />
Compact version of ld_selectMe (<a href="http://www.creativecrash.com/maya/downloads/scripts-plugins/animation/c/ld_selectme-selection-sets" target="_blank">Link</a>).<br />
Maya's own selection sets are node based, meaning that creating a selection set for a character will only work in that file, which is and very limiting. This tool, instead, compiles a selection <i>script</i> and saves it to shelf to be used in<i> any</i> file, along with a toggle selection function by ctrl+clicking the shelf button.<br />
"Name" is to enter the name of the button as it will appear on the shelf.<br />
"clear" clears the list and name field.
<br />
"+" adds selected objects to list.
<br />
"-" removes selected list items from list (can also press "delete" key).<br />
<span style="color: #666666; font-size: x-small;">EDIT: 19/01/2012 - v 1.2.0</span><br />
<span style="color: #666666; font-size: x-small;">- Now creates selection shelf button that will attempt to use namespace of the FIRST currently selected object, if no objects currently select, default one is used.</span>
<br />
<br />
<br />
<b><span style="color: orange;">News/Updates:</span></b><br />
Version 1.5.0 is underway, automating the user info with extra information displayed, such as the last saved time for the current file, snapping tools (including component snapping), and a new Scale Keys mode, called "Falloff".<br />
Thanks to quick feedback, I've been able to make some adjustments to the functionality of the tool.
<br />
<br />
<b>Version 1.2.0:</b><br />
19/01/2012 -<br />
Edited functionality of Adjust Animation.<br />
- If no range in timeline or keys selected in curve editor, animtaion will be adjusted from current point onwards.<br />
Edited functionality of Selection Sets.<br />
- Now creates selection shelf button that will attempt to use namespace of the FIRST currently selected object, if no objects currently select, default one is used.
<br />
<br />
<b>Version 1.2.1:</b><br />
19/01/2012 -
<br />
Fixed issue with Selection Sets update.<br />
- If current selection's namespace didnt't contain an item in selection list, it would error, it will now instead just use default namespace.
<br />
<br />
Any suggestions, please let me know.<br />
<br />
<br />Lee Dunhamhttp://www.blogger.com/profile/11548341409322230513noreply@blogger.com1