  | | | points transformation by script commands | points transformation by script commands 2004-04-09 - By Patrick Vier
Back Post_Logic - Mail paperHi Raffaele,
It's work good. But don't forget to FREEEEEEEZZZZE, before ! like you written. Thank you.
Patrick :) -- -- Original Message -- -- From: Raffaele "ThE_JacO" Fragapane To: XSI@(protected) Sent: Thursday, April 08, 2004 2:13 PM Subject: RE: points transformation by script commands
You want to get the selection, the object the selection is on and then get the activeprimitive.geometry of it.
From that you can get the points.positionarray, manipulate the array, and then store the manipulated array back in the positionarray.
Should be said tho that you can only manipulate the positionarray in a script if the object is frozen, if you need to keep the operators you’ll have to write a scop to do the same job, with the undertow that SCOPs manipulating partial selections of points need a cluster to relate to those points (or the pointIDs hardcoded in a loop).
Here’s an example
set oRoot = application.activeproject.activescene.root
set oSelection = Application.Selection
set oPoints=oSelection(0)
if oPoints.Type = "pntSubComponent" Then
set oObj = oRoot.FindChild(oPoints.Name)
set oGeom = oObj.ActivePrimitive.Geometry
ArrPoints = oPoints.SubElements
aPositions = oGeom.Points.PositionArray
aIndices = oPoints.SubElements
for i = LBound( aIndices, 1 ) to UBound( aIndices, 1 )
ii = aIndices(i)
aPositions(0,ii) = aPositions(0,ii) +1
aPositions(1,ii) = aPositions(1,ii) +1
aPositions(2,ii) = aPositions(2,ii) +1
next
oGeom.Points.PositionArray = aPositions
end if
select points on a frozen object and run it, it will shift every point by 1,1 ,1
-~== Raffaele Fragapane ==~- -~== Freelance Technical Animator & TD ==~- -~== Senior Technical Animator @ Peerless Camera ==~-
- Currently London Based - +44 798 4955734
-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- -----
From: owner-xsi@(protected) [mailto:owner-xsi@(protected)] On Behalf Of Patrick Vier Sent: Thursday, April 08, 2004 2:15 PM To: Softimage - XSI list Subject: points transformation by script commands
Hi all,
I select points on an object by tagging an d i need to GET (SRT info) and SET to a new positions (SRT) on each points by script, of course.
Have you an suggestion ?? Thanks.
Patrick *********
Patrick Vier Post Logic tel 33 (0)1 46 37 77 61 fax 33 (0)1 46 37 55 51 email patrick@(protected)
--- Incoming mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.638 / Virus Database: 409 - Release Date: 21-Mar-04 (See http://Mar-04.ora-code.com)
--- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.638 / Virus Database: 409 - Release Date: 21-Mar-04 (See http://Mar-04.ora-code.com)
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML xmlns="http://www.w3.org/TR/REC-html40" xmlns:v = "urn:schemas-microsoft-com:vml" xmlns:o = "urn:schemas-microsoft-com:office:office" xmlns:w = "urn:schemas-microsoft-com:office:word"><HEAD><TITLE>Post_Logic - Mail paper< /TITLE> <META content="text/html; charset=Windows-1252 (See http://ows-1252.ora-code.com)" http-equiv=Content-Type> <META content="MSHTML 5.00.3315.2870" name=GENERATOR><BASE href=file:///C:\Documents%20and%20Settings\PL\Local%20Settings\ppalettre\><!-- [if !mso]> <STYLE>v\:* { BEHAVIOR: url(#default#VML) } o\:* { BEHAVIOR: url(#default#VML) } w\:* { BEHAVIOR: url(#default#VML) } .shape { BEHAVIOR: url(#default#VML) } </STYLE> <![endif]--> <STYLE> <!-- /* Font Definitions */ @(protected) {font-family:Tahoma; panose-1 (See http://ose-1.ora-code.com):2 11 6 4 3 5 4 4 2 4;} /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal {margin:0cm; margin-bottom:.0001pt; font-size:12.0pt; font-family:"Times New Roman"; color:#000033;} a:link, span.MsoHyperlink {color:#000033; text-decoration:underline;} a:visited, span.MsoHyperlinkFollowed {color:blue; text-decoration:underline;} p.MsoPlainText, li.MsoPlainText, div.MsoPlainText {margin:0cm; margin-bottom:.0001pt; font-size:10.0pt; font-family:"Courier New"; color:windowtext;} p {mso-margin-top-alt:auto; margin-right:0cm; mso-margin-bottom-alt:auto; margin-left:0cm; font-size:12.0pt; font-family:"Times New Roman"; color:#000033;} span.EmailStyle18 {mso-style-type:personal-reply; font-family:Arial; color:navy;} @(protected) Section1 {size:612.0pt 792.0pt; margin:72.0pt 90.0pt 72.0pt 90.0pt;} div.Section1 {page:Section1;} --> </STYLE> <!--[if gte mso 9]><xml> <o:shapedefaults v:ext="edit" spidmax="1026" /> </xml><![endif]--><!--[if gte mso 9]><xml> <o:shapelayout v:ext="edit"> <o:idmap v:ext="edit" data="1" /> </o:shapelayout></xml><![endif]--></HEAD> <BODY bgColor=white lang=EN-US link=#000033 vLink=blue> <DIV><FONT face=Arial size=2>Hi Raffaele,</FONT></DIV> <DIV> </DIV> <DIV><FONT face=Arial size=2>It's work good. But don't forget to FREEEEEEEZZZZE , before ! like you written.</FONT></DIV> <DIV><FONT face=Arial size=2>Thank you.</FONT></DIV> <DIV> </DIV> <DIV><FONT face=Arial size=2>Patrick :)</FONT></DIV> <BLOCKQUOTE style="BORDER-LEFT: #000000 2px solid; MARGIN-LEFT: 5px; MARGIN-RIGHT: 0px; PADDING-LEFT: 5px; PADDING-RIGHT: 0px"> <DIV style="FONT: 10pt arial">-- -- Original Message -- -- </DIV> <DIV style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>From:</B> <A href="mailto:jaco@(protected)" title=jaco@(protected)>Raffaele "ThE_JacO" Fragapane</A> </DIV> <DIV style="FONT: 10pt arial"><B>To:</B> <A href="mailto:XSI@(protected)" title=XSI@(protected)>XSI@(protected)</A> </DIV> <DIV style="FONT: 10pt arial"><B>Sent:</B> Thursday, April 08, 2004 2:13 PM</DIV> <DIV style="FONT: 10pt arial"><B>Subject:</B> RE: points transformation by script commands</DIV> <DIV><BR></DIV> <DIV class=Section1> <P class=MsoNormal><FONT color=navy face=Arial size=2><SPAN style="COLOR: navy; FONT-FAMILY: Arial; FONT-SIZE: 10pt">You want to get the selection, the object the selection is on and then get the activeprimitive.geometry of it.<o:p></o:p></SPAN></FONT></P> <P class=MsoNormal><FONT color=navy face=Arial size=2><SPAN style="COLOR: navy; FONT-FAMILY: Arial; FONT-SIZE: 10pt">From that you can get the points.positionarray, manipulate the array, and then store the manipulated array back in the positionarray.<o:p></o:p></SPAN></FONT></P> <P class=MsoNormal><FONT color=navy face=Arial size=2><SPAN style="COLOR: navy; FONT-FAMILY: Arial; FONT-SIZE: 10pt"><o:p> </o:p>< /SPAN></FONT></P> <P class=MsoNormal><FONT color=navy face=Arial size=2><SPAN style="COLOR: navy; FONT-FAMILY: Arial; FONT-SIZE: 10pt">Should be said tho that you can only manipulate the positionarray in a script if the object is frozen, if you need to keep the operators you’ll have to write a scop to do the same job, with the undertow that SCOPs manipulating partial selections of points need a cluster to relate to those points (or the pointIDs hardcoded in a loop).<o:p></o:p></SPAN></FONT></P> <P class=MsoNormal><FONT color=navy face=Arial size=2><SPAN style="COLOR: navy; FONT-FAMILY: Arial; FONT-SIZE: 10pt"><o:p> </o:p>< /SPAN></FONT></P> <P class=MsoNormal><FONT color=navy face=Arial size=2><SPAN style="COLOR: navy; FONT-FAMILY: Arial; FONT-SIZE: 10pt">Here’s an example<o:p></o:p></SPAN></FONT></P> <P class=MsoNormal><FONT color=navy face=Arial size=2><SPAN style="COLOR: navy; FONT-FAMILY: Arial; FONT-SIZE: 10pt"><o:p> </o:p>< /SPAN></FONT></P> <P class=MsoNormal><FONT color=navy face=Arial size=2><SPAN style="COLOR: navy; FONT-FAMILY: Arial; FONT-SIZE: 10pt">set oRoot = application.activeproject.activescene.root<o:p></o:p></SPAN></FONT></P> <P class=MsoNormal><FONT color=navy face=Arial size=2><SPAN style="COLOR: navy; FONT-FAMILY: Arial; FONT-SIZE: 10pt">set oSelection = Application.Selection<o:p></o:p></SPAN></FONT></P> <P class=MsoNormal><FONT color=navy face=Arial size=2><SPAN style="COLOR: navy; FONT-FAMILY: Arial; FONT-SIZE: 10pt">set oPoints=oSelection(0)<o:p></o:p></SPAN></FONT></P> <P class=MsoNormal><FONT color=navy face=Arial size=2><SPAN style="COLOR: navy; FONT-FAMILY: Arial; FONT-SIZE: 10pt"><o:p> </o:p>< /SPAN></FONT></P> <P class=MsoNormal><FONT color=navy face=Arial size=2><SPAN style="COLOR: navy; FONT-FAMILY: Arial; FONT-SIZE: 10pt">if oPoints.Type = "pntSubComponent" Then<o:p></o:p></SPAN></FONT></P> <P class=MsoNormal><FONT color=navy face=Arial size=2><SPAN style="COLOR: navy; FONT-FAMILY: Arial; FONT-SIZE: 10pt"><o:p> </o:p>< /SPAN></FONT></P> <P class=MsoNormal><FONT color=navy face=Arial size=2><SPAN style="COLOR: navy; FONT-FAMILY: Arial; FONT-SIZE: 10pt"> set oObj = oRoot.FindChild(oPoints.Name) <o:p></o:p></SPAN></FONT></P> <P class=MsoNormal><FONT color=navy face=Arial size=2><SPAN style="COLOR: navy; FONT-FAMILY: Arial; FONT-SIZE: 10pt"> set oGeom = oObj.ActivePrimitive.Geometry<o:p></o:p></SPAN></FONT></P> <P class=MsoNormal><FONT color=navy face=Arial size=2><SPAN style="COLOR: navy; FONT-FAMILY: Arial; FONT-SIZE: 10pt"> ArrPoints = oPoints.SubElements<o:p></o:p></SPAN></FONT></P> <P class=MsoNormal><FONT color=navy face=Arial size=2><SPAN style="COLOR: navy; FONT-FAMILY: Arial; FONT-SIZE: 10pt"> aPositions = oGeom.Points.PositionArray<o:p></o:p></SPAN></FONT></P> <P class=MsoNormal><FONT color=navy face=Arial size=2><SPAN style="COLOR: navy; FONT-FAMILY: Arial; FONT-SIZE: 10pt"> aIndices = oPoints.SubElements<o:p></o:p></SPAN></FONT></P> <P class=MsoNormal><FONT color=navy face=Arial size=2><SPAN style="COLOR: navy; FONT-FAMILY: Arial; FONT-SIZE: 10pt"> <o:p></o:p></SPAN></FONT></P> <P class=MsoNormal><FONT color=navy face=Arial size=2><SPAN style="COLOR: navy; FONT-FAMILY: Arial; FONT-SIZE: 10pt"> for i = LBound( aIndices, 1 ) to UBound( aIndices, 1 )<o:p></o:p></SPAN></FONT></P> <P class=MsoNormal><FONT color=navy face=Arial size=2><SPAN style="COLOR: navy; FONT-FAMILY: Arial; FONT-SIZE: 10pt"> ii = aIndices(i) <o:p></o:p></SPAN></FONT></P> <P class=MsoNormal><FONT color=navy face=Arial size=2><SPAN style="COLOR: navy; FONT-FAMILY: Arial; FONT-SIZE: 10pt"> <o:p></o:p></SPAN></FONT></P> <P class=MsoNormal><FONT color=navy face=Arial size=2><SPAN style="COLOR: navy; FONT-FAMILY: Arial; FONT-SIZE: 10pt"> aPositions(0,ii) = aPositions(0,ii) +1<o:p></o:p></SPAN></FONT></P> <P class=MsoNormal><FONT color=navy face=Arial size=2><SPAN style="COLOR: navy; FONT-FAMILY: Arial; FONT-SIZE: 10pt"> aPositions(1,ii) = aPositions(1,ii) +1<o:p></o:p></SPAN></FONT></P> <P class=MsoNormal><FONT color=navy face=Arial size=2><SPAN style="COLOR: navy; FONT-FAMILY: Arial; FONT-SIZE: 10pt"> aPositions(2,ii) = aPositions(2,ii) +1<o:p></o:p></SPAN></FONT></P> <P class=MsoNormal><FONT color=navy face=Arial size=2><SPAN style="COLOR: navy; FONT-FAMILY: Arial; FONT-SIZE: 10pt"> next<o:p></o:p></SPAN></FONT></P> <P class=MsoNormal><FONT color=navy face=Arial size=2><SPAN style="COLOR: navy; FONT-FAMILY: Arial; FONT-SIZE: 10pt"> <o:p></o:p></SPAN></FONT></P> <P class=MsoNormal><FONT color=navy face=Arial size=2><SPAN style="COLOR: navy; FONT-FAMILY: Arial; FONT-SIZE: 10pt"> oGeom.Points.PositionArray = aPositions<o:p></o:p></SPAN></FONT></P> <P class=MsoNormal><FONT color=navy face=Arial size=2><SPAN style="COLOR: navy; FONT-FAMILY: Arial; FONT-SIZE: 10pt"><o:p> </o:p>< /SPAN></FONT></P> <P class=MsoNormal><FONT color=navy face=Arial size=2><SPAN style="COLOR: navy; FONT-FAMILY: Arial; FONT-SIZE: 10pt">end if<o:p></o:p></SPAN></FONT></P> <P class=MsoNormal><FONT color=navy face=Arial size=2><SPAN style="COLOR: navy; FONT-FAMILY: Arial; FONT-SIZE: 10pt"><o:p> </o:p>< /SPAN></FONT></P> <P class=MsoNormal><FONT color=navy face=Arial size=2><SPAN style="COLOR: navy; FONT-FAMILY: Arial; FONT-SIZE: 10pt">select points on a frozen object and run it, it will shift every point by 1,1,1<o:p></o:p></SPAN></FONT></P> <P class=MsoNormal><FONT color=navy face=Arial size=2><SPAN style="COLOR: navy; FONT-FAMILY: Arial; FONT-SIZE: 10pt"><o:p> </o:p>< /SPAN></FONT></P> <DIV> <P><FONT color=#000033 face=Arial size=2><SPAN style="FONT-FAMILY: Arial; FONT-SIZE: 10pt"> -~== Raffaele Fragapane ==~-</SPAN></FONT> <BR><FONT face=Arial size=2><SPAN style="FONT-FAMILY: Arial; FONT-SIZE: 10pt"> -~== Freelance Technical Animator & TD ==~-</SPAN></FONT> <BR><FONT face=Arial size=2><SPAN style="FONT-FAMILY: Arial; FONT-SIZE: 10pt">-~== Senior Technical Animator @ Peerless Camera ==~-</SPAN></FONT> <o:p></o:p></P> <P><FONT color=#000033 face=Arial size=2><SPAN lang=IT style="FONT-FAMILY: Arial; FONT-SIZE: 10pt">- Currently London Based</SPAN></FONT> <BR><FONT face=Arial size=2><SPAN lang=IT style="FONT-FAMILY: Arial; FONT-SIZE: 10pt">- +44 798 4955734</SPAN></FONT><SPAN lang=IT> </SPAN><o:p></o:p></P></DIV> <DIV> <DIV align=center class=MsoNormal style="MARGIN-LEFT: 36pt; TEXT-ALIGN: center"><FONT color=black face="Times New Roman" size=3><SPAN style="COLOR: windowtext; FONT-SIZE: 12pt"> <HR align=center SIZE=2 tabIndex=-1 width="100%"> </SPAN></FONT></DIV> <P class=MsoNormal style="MARGIN-LEFT: 36pt"><B><FONT color=black face=Tahoma size=2><SPAN style="COLOR: windowtext; FONT-FAMILY: Tahoma; FONT-SIZE: 10pt; FONT-WEIGHT: bold">From:</SPAN></FONT></B><FONT color=black face=Tahoma size=2><SPAN style="COLOR: windowtext; FONT-FAMILY: Tahoma; FONT-SIZE: 10pt"> owner-xsi@(protected) [mailto:owner-xsi@(protected)] <B><SPAN style="FONT-WEIGHT: bold">On Behalf Of </SPAN></B>Patrick Vier<BR><B><SPAN style="FONT-WEIGHT: bold">Sent:</SPAN></B> Thursday, April 08, 2004 2:15 PM<BR><B><SPAN style="FONT-WEIGHT: bold">To:</SPAN></B> Softimage - XSI list<BR><B><SPAN style="FONT-WEIGHT: bold">Subject:</SPAN></B> points transformation by script commands</SPAN></FONT><FONT color=black><SPAN style="COLOR: windowtext"><o:p></o:p></SPAN></FONT></P></DIV> <P class=MsoNormal style="MARGIN-LEFT: 36pt"><FONT color=#000033 face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt"><o:p> </o:p></SPAN></FONT></P> <TABLE border=0 cellPadding=0 class=MsoNormalTable style="MARGIN-LEFT: 36pt; WIDTH: 529.5pt" width=706> <TBODY> <TR> <TD style="PADDING-BOTTOM: 0.75pt; PADDING-LEFT: 0.75pt; PADDING-RIGHT: 0 .75pt; PADDING-TOP: 0.75pt" vAlign=top> <P><FONT color=#000033 face=Arial size=2><SPAN style="FONT-FAMILY: Arial; FONT-SIZE: 10pt">Hi all,</SPAN></FONT><o:p></o:p></P> <P><FONT color=#000033 face=Arial size=2><SPAN style="FONT-FAMILY: Arial; FONT-SIZE: 10pt">I select points on an object by tagging an d i need to GET (SRT info) and SET to a new positions (SRT) on each points by script, of course.</SPAN></FONT><o:p></o:p></P> <P><FONT color=#000033 face=Arial size=2><SPAN style="FONT-FAMILY: Arial; FONT-SIZE: 10pt">Have you an suggestion ??<BR>Thanks.</SPAN></FONT><o:p></o:p></P> <P><FONT color=#000033 face=Arial size=2><SPAN style="FONT-FAMILY: Arial; FONT-SIZE: 10pt">Patrick<BR>*********</SPAN> </FONT><o:p></o:p></P></TD></TR> <TR height=6 style="HEIGHT: 4.5pt"> <TD height=6 style="HEIGHT: 4.5pt; PADDING-BOTTOM: 0.75pt; PADDING-LEFT: 0.75pt; PADDING-RIGHT: 0.75pt; PADDING-TOP: 0.75pt"> <P align=center style="TEXT-ALIGN: center"><FONT color=#000033 face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt"><IMG height=1 id=_x0000_i1025 src="cid:004e01c41e06$1b393eb0$0c01a8c0@(protected)" width=700><o:p></o:p></SPAN></FONT></P></TD></TR> <TR height=76 style="HEIGHT: 57pt"> <TD height=76 style="HEIGHT: 57pt; PADDING-BOTTOM: 0.75pt; PADDING-LEFT: 0.75pt; PADDING-RIGHT: 0.75pt; PADDING-TOP: 0.75pt"> <P align=right class=MsoNormal style="TEXT-ALIGN: right"><B><FONT color=#0099ff face=Arial size=2><SPAN style="COLOR: #0099ff; FONT-FAMILY: Arial; FONT-SIZE: 10pt; FONT-WEIGHT : bold">Patrick Vier<BR></SPAN></FONT></B><B><FONT face=Arial size=2><SPAN style="FONT-FAMILY: Arial; FONT-SIZE: 10pt; FONT-WEIGHT: bold"><A href="http://www.post-logic.com">Post Logic</A></SPAN></FONT></B><FONT face=Arial size=2><SPAN style="FONT-FAMILY: Arial; FONT-SIZE: 10pt"><BR>tel <IMG border=0 height=13 id=_x0000_i1026 src="cid:004f01c41e06$1b393eb0$0c01a8c0@(protected)" width=13>33 (0)1 46 37 77 61<BR>fax <IMG border=0 height=13 id=_x0000_i1027 src="cid:004f01c41e06$1b393eb0$0c01a8c0@(protected)" width=13>33 (0)1 46 37 55 51</SPAN></FONT><FONT color=#0099ff face=Arial size=2><SPAN style="COLOR: #0099ff; FONT-FAMILY: Arial; FONT-SIZE: 10pt"><BR></SPAN> </FONT><FONT face=Arial size=2><SPAN style="FONT-FAMILY: Arial; FONT-SIZE: 10pt">email</SPAN></FONT><FONT color=#0099ff face=Arial size=2><SPAN style="COLOR: #0099ff; FONT-FAMILY: Arial; FONT-SIZE: 10pt"> </SPAN></FONT><FONT face=Arial size=2><SPAN style="FONT-FAMILY: Arial; FONT-SIZE: 10pt"><IMG border=0 height=13 id=_x0000_i1028 src="cid:004f01c41e06$1b393eb0$0c01a8c0@(protected)" width=13></SPAN></FONT><B><FONT color=#0099ff face=Arial size=2><SPAN style="COLOR: #0099ff; FONT-FAMILY: Arial; FONT-SIZE: 10pt; FONT-WEIGHT : bold"><A href="mailto:patrick@(protected)">patrick@(protected)</A></SPAN>< /FONT></B><FONT color=#0099ff face=Arial size=2><SPAN style="COLOR: #0099ff; FONT-FAMILY: Arial; FONT-SIZE: 10pt"> </SPAN></FONT><o:p></o:p></P></TD></TR> <TR> <TD style="PADDING-BOTTOM: 0.75pt; PADDING-LEFT: 0.75pt; PADDING-RIGHT: 0 .75pt; PADDING-TOP: 0.75pt"> <P align=center class=MsoNormal style="TEXT-ALIGN: center"><FONT color=#000033 face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt"> <o:p></o:p></SPAN></FONT></P></TD></TR>< /TBODY></TABLE> <P class=MsoNormal style="MARGIN-LEFT: 36pt"><FONT color=black face="Times New Roman" size=3><SPAN style="COLOR: windowtext; FONT-SIZE: 12pt"><o:p> </o:p></SPAN></FONT></P ></DIV><BR> <P><FONT size=2>---<BR>Incoming mail is certified Virus Free.<BR>Checked by AVG anti-virus system (http://www.grisoft.com).<BR>Version: 6.0.638 / Virus Database: 409 - Release Date: 21-Mar-04 (See http://Mar-04.ora-code.com)<BR></FONT></P> <P><FONT face=Arial size=2></FONT></P><BR> <P><FONT size=2>---<BR>Outgoing mail is certified Virus Free.<BR>Checked by AVG anti-virus system (http://www.grisoft.com).<BR>Version: 6.0.638 / Virus Database: 409 - Release Date: 21-Mar-04 (See http://Mar-04.ora-code.com)<BR></FONT></P> <P><FONT face=Arial size=2></FONT></P></BLOCKQUOTE></BODY></HTML>
|
|
 |