PDA

View Full Version : Scripting doubt


crazyjc
28-07-2006, 03:00 PM
<P>Hey pple, i've just started learning mel, and i'm&nbsp;trying to figure&nbsp;out how i can change part of a string&nbsp;in a variable. Specifically, to change the "L" to "R" in the string. </P>
<P>I am a very lazy&nbsp;man&nbsp;and i really am getting tired of repeating the same task of setting driven keys for&nbsp;left and right hands. what i'm trying to&nbsp;do is make a script&nbsp;that can copy&nbsp;rotation values for the fingers from&nbsp;left to right (and also set the driven keys for me... i wish !!)... I know, i know. Asking for too much you say ?&nbsp;Well&nbsp;you know what ? Back in college,&nbsp;i was&nbsp;also called lazyjc !!</P>
<P>I've&nbsp;written&nbsp;a script for copying the rotations, but it works only for that particular rig. I'd like to be able to use it for any rig, so that i can set the driven keys for the left hand,&nbsp;then just&nbsp;click a button and Voila !!&nbsp;Its set on the right hand too!! Of course i could just search and replace the names of the bones in the script&nbsp;before applying it on the new rig,.. but...&nbsp;&nbsp;nah !!&nbsp;thats still too much work!&nbsp;&nbsp;</P>
<P>Thanks in advance. <IMG src="smileys/smiley17.gif" border="0"></P>

underearth
17-08-2006, 05:22 PM
okay i post the answer to your question but some crazy problem with this site and some ..$%#%&amp; error about sql came by..<br>so i will try to brief my technique.to mirror set driven keys..<br><br>select you node which has set driven key.. go to its input output connect. in hypergraph... and then select the animCurvenode that is created by setdriven key..<br>duplicate it ..(rename it if u wish) and then select the driven /driven which u want the mirror to...and read the info from previous driver and driven and connect them into animCurveNode (to input attrib for incoming&nbsp; and connect output attrib of animCurve to input of driven....)<br><br>This technique still involves some tweaking time like using reverse node etc , but at least you won't have to redo the values .. you can also create a simple script out of it ... like getting animcurveNode.duplicate it&gt;read the connectionInfo and the connect to new driver/driven...<br><br>(i again landup writing big post..damn me..)<br><br><br>

ashishdantu
29-08-2006, 01:55 AM
<P>hi ,,</P>
<P>sunny , u nailed it well !! yup, maybe u can write the script and give us all ?</P>
<P>but in case u r having ur bones, mirrored across, when u reconnect ur animcurve back to the new target bone's attribute and u connect the controller's driver atribute to the anim curve's input it shud work fine...with out a need for reverse node.. y ?? b'se the axis is already flipped !! so less work and better and easy with mirrored bones..</P>
<P>n what r u upto these days sunny ? </P>
<P>-rgds,</P>

crazyjc
06-09-2006, 05:07 PM
<P>Hey thanks !! I never expected a reply after so long :) I'll try that out as soon as i'm done with my reel ;) I'm working on a rig which has IK/FK snapping, and pose copying/mirroring options.. I'm just a beginner so it may not be&nbsp;that great.. But its something big for me :)&nbsp;I'll post it here so you guys can check it out and gimme some c&amp;c ;) </P>
<P>Thanks again </P>

underearth
24-09-2006, 06:24 PM
hi ashish.. i am doing fine.. came back to forum after long time..<br>i must say.. iyou are my mentor man. i started off in this field following your advice..<br><br>we can certainly write that ashish..but i think it will be difficult for me to make generalized script.. and i am still ignorant in GUI in mel.... but it is certainly agreat idea.. to script it out...<br><br><br>

ashishdantu
24-09-2006, 11:24 PM
hi sunny,<br><br>thanx man.. :-) i'm happy i cud be some use/guidance to u .. ya, me too checking forum after lonnng time.. umm.. will have to come back to this !!!<br><br>and actually this tool would be a bit tricky sometimes!!&nbsp; if u encounter unitconversion nodes (sdk&nbsp; translates with rots [or] vice-versa )....&nbsp; the tracing of connections becomes difficult..&nbsp; one more thing is ur script should be able to guess the mirror axes automatically, more importatnly correct every time !! <br><br>but check out this &gt; <a href="http://melandstuff.blogspot.com/" target="_blank" target="_blank">MEL &amp; Stuff Blog</a> and check out his SDK manager.. and you can have a quick look at this <a href="http://www.highend3d.com/maya/downloads/mel_scripts/animation/3881.html" target="_blank" target="_blank">OA Export SDK</a> tool on highend3d.&nbsp; i heard, bonus tools includes one such tool ?? i havent checked it yet.. but lemme know if u got it to work....<br><br>hope ur work is going on guudd.. lemme know ur further findings,,,<br><br>-rgds,<br>


<edited><editID>ashishdantu</editID><editDate>38984.5388194444</editDate></edited>

underearth
25-09-2006, 12:30 PM
if you remeber.. jason will include ..exactly same script on his 2006 animator friendly masterclass DVD...i hope my studio will buy that..(i am insisting managment to buy it..<img src="smileys/smiley9.gif" border="0">).. but i believe.. with naming convention oe rt_ or lt_ one can create macro script .. for his project specific use...