Mailing List
Home
Forum Home
Softimage
Carrara
trueSpace
Dir3d-l
Maya - a powerful 3D animation and visual effects software
Macromedia Flash Development
Subjects
Cameras
scaleDown command
black out solved
Aircraft Tutorial
Mathematical XYZ ?
Its done This vs That
Its done first week
recommendations for screen video captures?
3DExplorer "Oddity "
New Director
ProTeam renewals
Fuel 's new websites (X post)
Blue peter create a make toy
targeting groups question
XPost: Shockwave 3D game ( sort of )
RES: RES: RES: Fish Modeling
Emitting particles from object intersection
Fuel 's new websites (X post)
Texturing
Big Break Contest Videos
New Plugins
Models and Texture on my updated site
Error Installing Patch tS6 6
Plasma?
Looking for Inspiration
Weird EMail Q
It 's done first week ?
Cherry not cranberry
New game
Camera Animation Problem
Particle plugins?
 
Basic scripting question..

Basic scripting question..

2005-04-14       - By peterb

 Back
Reply:     1     2     3     4     5     6     7     8     9     10  

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
 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.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE>Basic scripting question..</TITLE>
<META http-equiv=Content-Type content="text/html; charset=iso-8859 (See http://iso-8859.ora-code.com)-1">
<META content="MSHTML 6.00.2800.1476" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff><FONT face=Arial>
<DIV class=pHeading3><FONT size=2>From the online help:&nbsp;</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>&nbsp;</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>&nbsp;</DIV>
<DIV class=pHeading3><FONT size=2></FONT>&nbsp;</DIV>
<DIV class=pHeading3><FONT size=2>so the &nbsp;<FONT face=Courier>GetPrim
"Null"</FONT> line would become something like:</FONT></DIV>
<DIV><FONT size=2>GetPrim "Null" ,&nbsp;nill &amp; "_null"</FONT></DIV>
<DIV><FONT size=2><FONT size=2></FONT></FONT>&nbsp;</DIV>
<DIV><FONT size=2>now there is also the MatchTransform command, </FONT></DIV>
<DIV><FONT size=2>that will allow to&nbsp;match the&nbsp;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>&nbsp;</DIV>
<DIV><FONT size=2>-- ------</FONT></DIV>
<DIV><FONT size=2><FONT size=2>set A=GetValue("SelectionList") </DIV>
<DIV>&nbsp;&nbsp;&nbsp; for each ab in A </DIV>
<DIV>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; GetPrim "Null", ab &amp; "_null"
</DIV>
<DIV>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; MatchTransform , ab, siSRT</DIV>
<DIV>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; ParentObj ab &amp; "_null", ab </DIV>
<DIV>&nbsp;&nbsp;&nbsp; next</DIV>
<DIV>-- ---- --</DIV>
<DIV>&nbsp;</DIV>
<DIV>that should do the trick. </DIV>
<DIV>You didnt want any constraints in the end right?</DIV>
<DIV>&nbsp;</DIV>
<DIV>Peter</DIV></FONT>
<DIV>&nbsp;</DIV>
<H4 class=pHeading3>&nbsp;</H4>
<H4 class=pHeading3></FONT><BR>&nbsp;</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>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT face=Courier
 size=2>GetPrim "Null"</FONT> <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
 <FONT face=Courier size=2>set nul=GetValue("SelectionList")</FONT>
 <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT face=Courier size=2>for
 each nil in nul</FONT> <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT face=Courier size=2>ApplyCns
 "Pose",nil,ab</FONT> <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT face=Courier size=2
>Duplicate
 nil</FONT> <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT face=Courier size=2
>DeleteObj
 nil</FONT> <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT face=Courier
 size=2>next </FONT><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT
 face=Courier size=2>set B=GetValue("SelectionList")</FONT>
 <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT face=Courier size=2>for each
 ba in B</FONT> <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT face=Courier
 size=2>RemoveAllCns ba</FONT> <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT face=Courier size=2>ApplyCns
 "Pose", ab, ba &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
 </FONT><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <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 &amp;
   '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">&nbsp;</FONT>
<FONT
   face=Wingdings size=2>*</FONT><FONT face=Tahoma>&nbsp;</FONT><FONT
   face=Tahoma size=1> &nbsp;&nbsp;&nbsp;&nbsp; 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">&nbsp;</FONT>
<FONT
   face=Wingdings size=2>(</FONT></SPAN></B><SPAN
   lang=en-us>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<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">&nbsp;&nbsp;&nbsp;&nbsp;</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></BODY></HTML>