  | | | Basic scripting question.. | Basic scripting question.. 2005-04-15 - By Lee Hallett
Back I should also say a big thankyou to Peter!
Lee|3d animation and design..
Pixel pusher & 'telly colouring in' bloke
There are only 10 sorts of people in the World - those that understand binary, and those that don't.
* BBC Wales | C4 graphics area | Broadcasting House| Llandaff, Cardiff. CF5 2QY. * +44 (0)29 203 23370 e-* lee.hallett@(protected)
-- --Original Message-- -- From: owner-xsi@(protected) [mailto:owner-xsi@(protected)] On Behalf Of peterb Sent: 14 April 2005 22:16 To: XSI@(protected) Subject: Re: Basic scripting question..
>From the online help: (select a word in your script and click the ? button in the script editor, it ll give your the appropriate info) Scripting Syntax GetPrim (PresetObj, [Name], [Parent], [Primitive]) so the GetPrim "Null" line would become something like: GetPrim "Null" , nill & "_null" now there is also the MatchTransform command, that will allow to match the transforms of the null to the object, to avoid doing a constraint and then removing it and then the ParentObj command to do the parenting. Something like: -- ------ set A=GetValue("SelectionList") for each ab in A GetPrim "Null", ab & "_null" MatchTransform , ab, siSRT ParentObj ab & "_null", ab next -- ---- -- that should do the trick. You didnt want any constraints in the end right? Peter
-- -- Original Message -- -- From: Lee Hallett <mailto:lee.hallett@(protected)> To: XSI@(protected) Sent: Thursday, April 14, 2005 2:11 PM Subject: Basic scripting question..
I'm trying to modify matts nullifier script, but my scripting is somewhat below par (non existent).
The two extra things I need to do are 1) Make the null the parent of the object 2) Rename the null to *Objectname*_Null
Anyone got any quick tips!!
Original script:
' nullifier v1.1 by Matt Lowery
Dim A Dim nul Dim B
set A=GetValue("SelectionList") for each ab in A GetPrim "Null" set nul=GetValue("SelectionList") for each nil in nul ApplyCns "Pose",nil,ab Duplicate nil DeleteObj nil next set B=GetValue("SelectionList") for each ba in B RemoveAllCns ba ApplyCns "Pose", ab, ba next next
Lee|3d animation and design..
Pixel pusher & 'telly colouring in' bloke
There are only 10 sorts of people in the World - those that understand binary, and those that don't.
* BBC Wales | C4 graphics area | Broadcasting House| Llandaff, Cardiff. CF5 2QY. * +44 (0)29 203 23370 e-* lee.hallett@(protected)
http://www.bbc.co.uk/ This e-mail (and any attachments) is confidential and may contain personal views which are not the views of the BBC unless specifically stated. If you have received it in error, please delete it from your system. Do not use, copy or disclose the information in any way nor act in reliance on it and notify the sender immediately. Please note that the BBC monitors e-mails sent or received. Further communication will signify your consent to this.
http://www.bbc.co.uk/
This e-mail (and any attachments) is confidential and may contain personal views which are not the views of the BBC unless specifically stated. If you have received it in error, please delete it from your system. Do not use, copy or disclose the information in any way nor act in reliance on it and notify the sender immediately. Please note that the BBC monitors e-mails sent or received. Further communication will signify your consent to this.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML><HEAD><TITLE>Message</TITLE> <META http-equiv=Content-Type content="text/html; charset=us-ascii"> <META content="MSHTML 6.00.2800.1476" name=GENERATOR> <STYLE></STYLE> </HEAD> <BODY bgColor=#ffffff> <DIV><SPAN class=776220910-15042005><FONT face=Arial color=#0000ff size=2>I should also say a big thankyou to Peter!</FONT></SPAN></DIV> <DIV> </DIV> <DIV> </DIV><!-- Converted from text/rtf format --><BR> <UL> <P align=center><SPAN lang=en-gb><FONT face=Arial size=2>Lee|3d animation and design..<U></U></FONT></SPAN></P> <P align=center><SPAN lang=en-gb><FONT face=Arial size=2>Pixel pusher & 'telly colouring in' bloke</FONT></SPAN><SPAN lang=en-us></SPAN><SPAN lang=en-us></SPAN><SPAN lang=en-us></SPAN></P></UL> <P align=center><SPAN lang=en-gb><FONT face=Arial size=1>There are only 10 sorts of people in the World - those that understand binary, and those that don't.</FONT></SPAN></P><BR> <UL> <P><SPAN lang=en-us><FONT face=Wingdings size=1><FONT face="Courier New"></FONT></FONT><FONT face="Courier New"> </FONT><FONT face=Wingdings size=2>*</FONT><FONT face=Tahoma> </FONT><FONT face =Tahoma size=1> BBC Wales | C4 graphics area | Broadcasting House| Llandaff, Cardiff. CF5 2QY.</FONT></SPAN><SPAN lang=en-gb><B></B></SPAN><SPAN lang=en-gb><B> </B></SPAN><BR><B><SPAN lang=en-us><FONT face=Wingdings size=1><FONT face="Courier New"></FONT></FONT><FONT face="Courier New"> </FONT><FONT face=Wingdings size=2>(</FONT></SPAN></B><SPAN lang=en-us> <FONT face=Tahoma size=1> +44 (0)29 203 23370</FONT><B></B></SPAN> <BR><SPAN lang=en-gb><FONT face=Arial size=2>e-</FONT><FONT face=Wingdings size=2>*</FONT><FONT face="Courier New"> </FONT> <FONT face=Arial size=1>lee.hallett@(protected)</FONT></SPAN><SPAN lang=en-us></SPAN><SPAN lang=en-us><B></B></SPAN><SPAN lang=en-us><B></B></SPAN> </P><BR></UL> <DIV></DIV> <DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left><FONT face=Tahoma size=2>-- --Original Message-- --<BR><B>From:</B> owner-xsi@(protected) [mailto:owner-xsi@(protected)] <B>On Behalf Of </B>peterb<BR><B>Sent:</B> 14 April 2005 22:16<BR><B>To:</B> XSI@(protected)<BR><B>Subject:</B> Re: Basic scripting question..<BR><BR></FONT></DIV><FONT face=Arial> <DIV class=pHeading3><FONT size=2>From the online help: </FONT></DIV> <DIV class=pHeading3><FONT size=2>(select a word in your script and click the ? button in the script editor, it ll give your the appropriate info)</FONT></DIV> <DIV class=pHeading3><FONT size=2></FONT> </DIV> <DIV class=pHeading3><FONT size=2>Scripting Syntax </FONT></DIV> <DIV class=pHeading3><FONT face=Arial size=2>GetPrim (PresetObj, [Name], [Parent], [Primitive])</FONT><A name=wp659811><FONT face=Arial size=2> </FONT></A></DIV> <DIV class=pHeading3><FONT size=2></FONT> </DIV> <DIV class=pHeading3><FONT size=2></FONT> </DIV> <DIV class=pHeading3><FONT size=2>so the <FONT face=Courier>GetPrim "Null"</FONT> line would become something like:</FONT></DIV> <DIV><FONT size=2>GetPrim "Null" , nill & "_null"</FONT></DIV> <DIV><FONT size=2><FONT size=2></FONT></FONT> </DIV> <DIV><FONT size=2>now there is also the MatchTransform command, </FONT></DIV> <DIV><FONT size=2>that will allow to match the transforms of the null to the object, </FONT></DIV> <DIV><FONT size=2>to avoid doing a constraint and then removing it</FONT></DIV> <DIV><FONT size=2>and then the ParentObj command to do the parenting. </FONT></DIV> <DIV><FONT size=2>Something like: </FONT></DIV> <DIV><FONT size=2></FONT><FONT size=2></FONT> </DIV> <DIV><FONT size=2>-- ------</FONT></DIV> <DIV><FONT size=2><FONT size=2>set A=GetValue("SelectionList") </DIV> <DIV> for each ab in A </DIV> <DIV> GetPrim "Null", ab & "_null" </DIV> <DIV> MatchTransform , ab, siSRT</DIV> <DIV> ParentObj ab & "_null", ab </DIV> <DIV> next</DIV> <DIV>-- ---- --</DIV> <DIV> </DIV> <DIV>that should do the trick. </DIV> <DIV>You didnt want any constraints in the end right?</DIV> <DIV> </DIV> <DIV>Peter</DIV></FONT> <DIV> </DIV> <H4 class=pHeading3> </H4> <H4 class=pHeading3></FONT><BR> </H4></FONT> <BLOCKQUOTE style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px"> <DIV style="FONT: 10pt arial">-- -- Original Message -- -- </DIV> <DIV style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>From:</B> <A title=lee.hallett@(protected) href="mailto:lee.hallett@(protected)">Lee Hallett</A> </DIV> <DIV style="FONT: 10pt arial"><B>To:</B> <A title=XSI@(protected) href="mailto:XSI@(protected)">XSI@(protected)</A> </DIV> <DIV style="FONT: 10pt arial"><B>Sent:</B> Thursday, April 14, 2005 2:11 PM</DIV> <DIV style="FONT: 10pt arial"><B>Subject:</B> Basic scripting question..</DIV> <DIV><BR></DIV><!-- Converted from text/rtf format --> <P><FONT face=Arial size=2>I'm trying to modify matts nullifier script, but my scripting is somewhat below par (non existent). </FONT></P> <P><FONT face=Arial size=2>The two extra things I need to do are</FONT> <BR><FONT face=Arial size=2>1) Make the null the parent of the object</FONT> <BR><FONT face=Arial size=2>2) Rename the null to *Objectname*_Null</FONT> </P> <P><FONT face=Arial size=2>Anyone got any quick tips!!</FONT> </P><BR> <P><FONT face=Arial size=2>Original script:</FONT> </P><BR> <P><FONT face=Courier size=2>' nullifier v1.1 by Matt Lowery</FONT> </P> <P><FONT face=Courier size=2>Dim A</FONT> <BR><FONT face=Courier size=2>Dim nul</FONT> <BR><FONT face=Courier size=2>Dim B</FONT> </P> <P><FONT face=Courier size=2>set A=GetValue("SelectionList")</FONT> <BR><FONT face=Courier size=2>for each ab in A</FONT> <BR> <FONT face=Courier size=2>GetPrim "Null"</FONT> <BR> <FONT face=Courier size=2>set nul=GetValue("SelectionList")</FONT> <BR> <FONT face=Courier size=2>for each nil in nul</FONT> <BR> <FONT face=Courier size=2>ApplyCns "Pose",nil,ab</FONT> <BR> <FONT face=Courier size=2 >Duplicate nil</FONT> <BR> <FONT face=Courier size=2 >DeleteObj nil</FONT> <BR> <FONT face=Courier size=2>next </FONT><BR> <FONT face=Courier size=2>set B=GetValue("SelectionList")</FONT> <BR> <FONT face=Courier size=2>for each ba in B</FONT> <BR> <FONT face=Courier size=2>RemoveAllCns ba</FONT> <BR> <FONT face=Courier size=2>ApplyCns "Pose", ab, ba </FONT><BR> <FONT face=Courier size=2>next</FONT> <BR><FONT face=Courier size=2>next</FONT> </P><BR><BR> <UL> <P align=center><SPAN lang=en-gb><FONT face=Arial size=2>Lee|3d animation and design..<U></U></FONT></SPAN></P> <P align=center><SPAN lang=en-gb><FONT face=Arial size=2>Pixel pusher & 'telly colouring in' bloke</FONT></SPAN><SPAN lang=en-us></SPAN><SPAN lang=en-us></SPAN><SPAN lang=en-us></SPAN></P></UL> <P align=center><SPAN lang=en-gb><FONT face=Arial size=1>There are only 10 sorts of people in the World - those that understand binary, and those that don't.</FONT></SPAN></P><BR> <UL> <P><SPAN lang=en-us><FONT face=Wingdings size=1><FONT face="Courier New"></FONT></FONT><FONT face="Courier New"> </FONT> <FONT face=Wingdings size=2>*</FONT><FONT face=Tahoma> </FONT><FONT face=Tahoma size=1> BBC Wales | C4 graphics area | Broadcasting House| Llandaff, Cardiff. CF5 2QY.</FONT></SPAN><SPAN lang=en-gb><B></B></SPAN><SPAN lang=en-gb><B> </B></SPAN><BR><B><SPAN lang=en-us><FONT face=Wingdings size=1><FONT face="Courier New"></FONT></FONT><FONT face="Courier New"> </FONT> <FONT face=Wingdings size=2>(</FONT></SPAN></B><SPAN lang=en-us> <FONT face=Tahoma size=1> +44 (0)29 203 23370</FONT><B></B></SPAN> <BR><SPAN lang=en-gb><FONT face=Arial size=2>e-</FONT><FONT face=Wingdings size=2>*</FONT><FONT face="Courier New"> </FONT> <FONT face=Arial size=1>lee.hallett@(protected)</FONT></SPAN><SPAN lang=en-us></SPAN><SPAN lang=en-us><B></B></SPAN><SPAN lang=en-us><B></B></SPAN> </P><BR><BR></UL><BR>http://www.bbc.co.uk/<BR><BR>This e-mail (and any attachments) is confidential and may contain<BR>personal views which are not the views of the BBC unless specifically<BR>stated.<BR>If you have received it in error, please delete it from your system. <BR>Do not use, copy or disclose the information in any way nor act in<BR>reliance on it and notify the sender immediately. Please note that the<BR>BBC monitors e-mails sent or received. <BR>Further communication will signify your consent to this. </BLOCKQUOTE><br>http://www.bbc.co.uk/<br><br>This e-mail (and any attachments) is confidential and may contain<br>personal views which are not the views of the BBC unless specifically<br>stated.<br>If you have received it in error, please delete it from your system. <br>Do not use, copy or disclose the information in any way nor act in<br>reliance on it and notify the sender immediately. Please note that the<br>BBC monitors e-mails sent or received. <br >Further communication will signify your consent to this.</BODY></HTML>
|
|
|