  | | | points transformation by script commands | points transformation by script commands 2004-04-08 - By Raffaele "ThE_JacO" Fragapane
Back Once you are done manipulating the aindices array all you need to do is
oGeom.Points.PositionArray = aPositions
and that will force the new array (the one with your manipulation in it) into the objects geometry, doing effectively what you wanted to do.
Again you only have to be careful that the object is frozen, or trying to write into the position array will result in an illegal operation.
Good luck :)
-~== 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 6:15 PM To: XSI@(protected) Subject: Re: points transformation by script commands
Raffaele,
Great, i can get the positions on each points inside the "for next" loop.
My goal is to modify the positions of the points.
An exemple :
- some points position can be 10.05897423 or 5.693145 or 7.00026
- my goal is to modify their position like this : 10.05 or 5.69 or 7.00
- have a choice to keep 2 (ie) number after the dot...
with your help i've made that, but I don't know how to modify the posXYZ of the point.
-- ---- ---- ---- ---- ---- --
set oRoot = application.activeproject.activescene.root set oSelection = Application.Selection set oPoints=oSelection(0)
ApresLaVirgule = InputBox ("Nbs de chiffre apès la virgule :","XSI Script","2") If ApresLaVirgule <> "" then
if oPoints.Type = ".....
.................oPoints.SubElements
for i = LBound( aIndices, 1 ) to UBound( aIndices, 1 ) ii = aIndices(i) for axis=0 to 2
pos = aPositions(axis,ii) LaVirgule=inStr(1,pos,".",0) aPositions(axis,ii) = left(pos,ApresLaVirgule + LaVirgule)
Next
....
-- ---- ---- ---- ---- ---- --
Hope that i'm clear
Thank
Patrick
--- 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)
<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft -com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns="http: //www.w3.org/TR/REC-html40">
<head> <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859 (See http://iso-8859.ora-code.com)-1">
<meta name=Generator content="Microsoft Word 11 (filtered medium)"> <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]--> <title>Post_Logic - Mail paper</title> <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.EmailStyle19 {mso-style-type:personal; font-family:Arial; color:navy;} span.EmailStyle21 {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 class=Section1>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size: 10.0pt;font-family:Arial;color:navy'>Once you are done manipulating the aindices array all you need to do is<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size: 10.0pt;font-family:Arial;color:navy'>oGeom.Points.PositionArray = aPositions<o :p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size: 10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size: 10.0pt;font-family:Arial;color:navy'>and that will force the new array (the one with your manipulation in it) into the object’s geometry, doing effectively what you wanted to do.<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size: 10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size: 10.0pt;font-family:Arial;color:navy'>Again you only have to be careful that the object is frozen, or trying to write into the position array will result in an illegal operation.<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size: 10.0pt;font-family:Arial;color:navy'>Good luck :)<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size: 10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>
<div>
<p><font size=2 color="#000033" face=Arial><span style='font-size:10.0pt; font-family:Arial'> -~== Raffaele Fragapane ==~-</span></font> <br> <font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'> -~== Freelance Technical Animator & TD ==~-</span></font> <br> <font size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>-~== Senior Technical Animator @ Peerless Camera ==~-</span></font> <o:p></o:p></p>
<p><font size=2 color="#000033" face=Arial><span lang=IT style='font-size:10 .0pt; font-family:Arial'>- Currently London Based</span></font> <br> <font size=2 face=Arial><span lang=IT style='font-size:10.0pt;font-family:Arial '>- +44 798 4955734</span></font><span lang=IT> </span><o:p></o:p></p>
</div>
<div>
<div class=MsoNormal align=center style='margin-left:36.0pt;text-align:center'> <font size=3 color=black face="Times New Roman"><span style='font-size:12.0pt; color:windowtext'>
<hr size=2 width="100%" align=center tabindex=-1>
</span></font></div>
<p class=MsoNormal style='margin-left:36.0pt'><b><font size=2 color=black face=Tahoma><span style='font-size:10.0pt;font-family:Tahoma;color:windowtext; font-weight:bold'>From:</span></font></b><font size=2 color=black face=Tahoma> <span style='font-size:10.0pt;font-family:Tahoma;color:windowtext'> 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 6:15 PM<br> <b><span style='font-weight:bold'>To:</span></b> XSI@(protected)<br> <b><span style='font-weight:bold'>Subject:</span></b> Re: 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:36.0pt'><font size=3 color="#000033" face="Times New Roman"><span style='font-size:12.0pt'><o:p> </o:p></span>< /font></p>
<div>
<p class=MsoNormal style='margin-left:36.0pt'><font size=2 color=black face=Arial><span style='font-size:10.0pt;font-family:Arial;color:windowtext' >Raffaele,</span></font><font color=black><span style='color:windowtext'><o:p></o:p></span></font></p>
</div>
<div>
<p class=MsoNormal style='margin-left:36.0pt'><font size=3 color=black face="Times New Roman"><span style='font-size:12.0pt;color:windowtext'> <o :p></o:p></span></font></p>
</div>
<div>
<p class=MsoNormal style='margin-left:36.0pt'><font size=2 color=black face=Arial><span style='font-size:10.0pt;font-family:Arial;color:windowtext' >Great, i can get the positions on each points inside the "for next" loop.< /span></font><font color=black><span style='color:windowtext'><o:p></o:p></span></font></p>
</div>
<div>
<p class=MsoNormal style='margin-left:36.0pt'><font size=2 color=black face=Arial><span style='font-size:10.0pt;font-family:Arial;color:windowtext'>My goal is to modify the positions of the points.</span></font><font color=black> <span style='color:windowtext'><o:p></o:p></span></font></p>
</div>
<div>
<p class=MsoNormal style='margin-left:36.0pt'><font size=2 color=black face=Arial><span style='font-size:10.0pt;font-family:Arial;color:windowtext'>An exemple :</span></font><font color=black><span style='color:windowtext'><o:p>< /o:p></span></font></p>
</div>
<div>
<p class=MsoNormal style='margin-left:36.0pt'><font size=2 color=black face=Arial><span style='font-size:10.0pt;font-family:Arial;color:windowtext'>- some points position can be 10.05897423 or 5.693145 or 7.00026</span></font> <font color=black><span style='color:windowtext'><o:p></o:p></span></font></p>
</div>
<div>
<p class=MsoNormal style='margin-left:36.0pt'><font size=2 color=black face=Arial><span style='font-size:10.0pt;font-family:Arial;color:windowtext'>- my goal is to modify their position like this : 10.05 or 5.69 or 7.00</span>< /font><font color=black><span style='color:windowtext'><o:p></o:p></span></font></p>
</div>
<div>
<p class=MsoNormal style='margin-left:36.0pt'><font size=2 color=black face=Arial><span style='font-size:10.0pt;font-family:Arial;color:windowtext'>- have a choice to keep 2 (ie) number after the dot...</span></font><font color=black><span style='color:windowtext'><o:p></o:p></span></font></p>
</div>
<div>
<p class=MsoNormal style='margin-left:36.0pt'><font size=3 color=black face="Times New Roman"><span style='font-size:12.0pt;color:windowtext'> <o :p></o:p></span></font></p>
</div>
<div>
<p class=MsoNormal style='margin-left:36.0pt'><font size=2 color=black face=Arial><span style='font-size:10.0pt;font-family:Arial;color:windowtext' >with your help i've made that, but I don't know how to modify the posXYZ of the point.</span></font><font color=black><span style='color:windowtext'><o:p></o:p ></span></font></p>
</div>
<div>
<p class=MsoNormal style='margin-left:36.0pt'><font size=2 color=black face=Arial><span style='font-size:10.0pt;font-family:Arial;color:windowtext'>-- -- ---- ---- ---- ---- -----</span></font><font color=black><span style='color:windowtext'><o:p></o:p></span></font></p>
</div>
<div>
<p class=MsoNormal style='margin-left:36.0pt'><font size=2 color=black face=Arial><span style='font-size:10.0pt;font-family:Arial;color:windowtext'>set oRoot = application.activeproject.activescene.root<br> set oSelection = Application.Selection<br> set oPoints=oSelection(0)</span></font><font color=black><span style='color:windowtext'><o:p></o:p></span></font></p>
</div>
<div>
<p class=MsoNormal style='margin-left:36.0pt'><font size=3 color=black face="Times New Roman"><span style='font-size:12.0pt;color:windowtext'> <o :p></o:p></span></font></p>
</div>
<div>
<p class=MsoNormal style='margin-left:36.0pt'><em><i><font size=2 color=blue face=Arial><span style='font-size:10.0pt;font-family:Arial;color:blue' >ApresLaVirgule = InputBox ("Nbs de chiffre apès la virgule :","XSI Script","2")</span></font></i></em><i><font size=2 color=blue face=Arial><span style='font-size:10.0pt;font-family:Arial;color:blue; font-style:italic'><br> <em><i><font face=Arial><span style='font-family:Arial'>If ApresLaVirgule <> "" then</span></font></i></em></span></font></i><font color=black><span style='color:windowtext'><o:p></o:p></span></font></p>
</div>
<div>
<p class=MsoNormal style='margin-left:36.0pt'><font size=3 color=black face="Times New Roman"><span style='font-size:12.0pt;color:windowtext'> <o :p></o:p></span></font></p>
</div>
<div>
<p class=MsoNormal style='margin-left:36.0pt'><font size=2 color=black face=Arial><span style='font-size:10.0pt;font-family:Arial;color:windowtext'> if oPoints.Type = ".....</span></font><font color=black><span style='color:windowtext'><o:p></o:p></span></font></p>
</div>
<div>
<p class=MsoNormal style='margin-left:36.0pt'><font size=2 color=black face=Arial><span style='font-size:10.0pt;font-family:Arial;color:windowtext'>.. ...............oPoints.SubElements</span></font><font color=black><span style='color:windowtext'><o:p></o:p></span></font></p>
</div>
<div>
<p class=MsoNormal style='margin-left:36.0pt'><font size=3 color=black face="Times New Roman"><span style='font-size:12.0pt;color:windowtext'> <o :p></o:p></span></font></p>
</div>
<div>
<p class=MsoNormal style='margin-left:36.0pt'><font size=2 color=black face=Arial><span style='font-size:10.0pt;font-family:Arial;color:windowtext'> for i = LBound( aIndices, 1 ) to UBound( aIndices, 1 )<br> ii = aIndices(i)<br> </span></font><em><i><font size=2 color=blue face=Arial><span style='font-size:10.0pt;font-family:Arial; color:blue'>for axis=0 to 2</span></font></i></em><font color=black><span style='color:windowtext'><o:p></o:p></span></font></p>
</div>
<div>
<p class=MsoNormal style='margin-left:36.0pt'><em><i><font size=2 color=blue face=Arial><span style='font-size:10.0pt;font-family:Arial;color:blue'> pos = aPositions(axis,ii)</span></font>< /i></em><i><font size=2 color=blue face=Arial><span style='font-size:10.0pt;font-family:Arial; color:blue;font-style:italic'><br> <em><i><font face=Arial><span style='font-family:Arial'>   ; LaVirgule=inStr(1,pos,".",0)   ; < /span></font></i></em><br> <em><i><font face=Arial><span style='font-family:Arial'>   ; aPositions(axis,ii) = left(pos,ApresLaVirgule + LaVirgule)< /span></font></i></em></span></font></i><font color=black><span style='color:windowtext'><o:p></o:p></span></font></p>
</div>
<div>
<p class=MsoNormal style='margin-left:36.0pt'><em><i><font size=2 color=blue face=Arial><span style='font-size:10.0pt;font-family:Arial;color:blue'> Next</span></font></i></em ><font color=black><span style='color:windowtext'><o:p></o:p></span></font></p>
</div>
<div>
<p class=MsoNormal style='margin-left:36.0pt'><font size=2 color=black face=Arial><span style='font-size:10.0pt;font-family:Arial;color:windowtext'>.. ..</span></font><font color=black><span style='color:windowtext'><o:p></o:p></span></font></p>
</div>
<div>
<p class=MsoNormal style='margin-left:36.0pt'><font size=2 color=black face=Arial><span style='font-size:10.0pt;font-family:Arial;color:windowtext'>-- -- ---- ---- ---- ---- -----</span></font><font color=black><span style='color:windowtext'><o:p></o:p></span></font></p>
</div>
<div>
<p class=MsoNormal style='margin-left:36.0pt'><font size=3 color=black face="Times New Roman"><span style='font-size:12.0pt;color:windowtext'> <o :p></o:p></span></font></p>
</div>
<div>
<p class=MsoNormal style='margin-left:36.0pt'><font size=2 color=black face=Arial><span style='font-size:10.0pt;font-family:Arial;color:windowtext' >Hope that i'm clear</span></font><font color=black><span style='color:windowtext'><o :p></o:p></span></font></p>
</div>
<div>
<p class=MsoNormal style='margin-left:36.0pt'><font size=3 color=black face="Times New Roman"><span style='font-size:12.0pt;color:windowtext'> <o :p></o:p></span></font></p>
</div>
<div>
<p class=MsoNormal style='margin-left:36.0pt'><font size=2 color=black face=Arial><span style='font-size:10.0pt;font-family:Arial;color:windowtext' >Thank</span></font><font color=black><span style='color:windowtext'><o:p></o:p></span></font></p>
</div>
<div>
<p class=MsoNormal style='margin-left:36.0pt'><font size=3 color="#000033" face="Times New Roman"><span style='font-size:12.0pt'>Patrick <o:p></o:p></span ></font></p>
</div>
</div>
</body>
</html> <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 SIZE=2 FACE="Arial"> </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>
|
|
 |