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?
 
Scripted Operators / Performance

Scripted Operators / Performance

2005-03-13       - By gmx

 Back
Reply:     1     2     3  

Hi everyone

I am trying to make a facial rig where you are able to cange the position of
the bones like you want so that you can simply envelope it on every human like
charakter.

For this I use scripted operators so that the controlers I made for the rig
will work also after changing the position of the bones.

Now my problem is the scopes needs a real big amount of my cpu power. Using the
controlers wich drive the bones (and scripts) isn't fun anymore because of the
bad performance.

Did I do something wrong in the scripts so that they are sooo slow or isnt't it
possible to write scopes AND have good XSI performance at the same time ??

My idea is, there are to many out connections updated every time the script is
running.
The idea behind is: There is one slider wich controls the open/close of the
lids (Lider steuern - in the script), and one slider wich controls the
direction of the eyes. When changing the direction the lids should slightly
move with the direction of the eyes (Augen Direction steuern - in the script)

Maybe you have some ideas on optimizing this, would be great.

greetings mario





Here is the script I wrote:
'-- ---- ---- ---- ----Augen Direction steuern-- ---- ---- ---- ---- -----
FaktorX = 600
FaktorY = 100

If controler_direction.value.posx <> "0" Or controler_direction.value.posy <>
"0" Then

Select Case Out.Name

Case "Bone0_out"
Out.value.posx = Bone0.value.posx.value + controler_direction.value.posx.value/
(FaktorX*0.8)
Out.value.posy = Bone0.value.posy.value + controler_direction.value.posy.value/
(FaktorY)

Case "Bone1_out"
Out.value.posx = Bone1.value.posx.value + controler_direction.value.posx.value/
(FaktorX*0.5)
Out.value.posy = Bone1.value.posy.value + controler_direction.value.posy.value/
(FaktorY)

Case "Bone2_out"
Out.value.posx = Bone2.value.posx.value + controler_direction.value.posx.value/
(FaktorX*0.3)
Out.value.posy = Bone2.value.posy.value + controler_direction.value.posy.value/
(FaktorY)

Case "Bone3_out"
Out.value.posx = Bone3.value.posx.value + controler_direction.value.posx.value/
(FaktorX*0.5)
Out.value.posy = Bone3.value.posy.value + controler_direction.value.posy.value/
(FaktorY)

Case "Bone4_out"
Out.value.posx = Bone4.value.posx.value + controler_direction.value.posx.value/
(FaktorX*0.8)
Out.value.posy = Bone4.value.posy.value + controler_direction.value.posy.value/
(FaktorY)

Case "Bone5_out"
Out.value.posx = Bone5.value.posx.value + controler_direction.value.posx.value/
(FaktorX*0.5)
Out.value.posy = Bone5.value.posy.value + controler_direction.value.posy.value/
(FaktorY)

Case "Bone6_out"
Out.value.posx = Bone6.value.posx.value + controler_direction.value.posx.value/
(FaktorX*0.3)
Out.value.posy = Bone6.value.posy.value + controler_direction.value.posy.value/
(FaktorY)

Case "Bone7_out"
Out.value.posx = Bone7.value.posx.value + controler_direction.value.posx.value/
(FaktorX*0.5)
Out.value.posy = Bone7.value.posy.value + controler_direction.value.posy.value/
(FaktorY)


End Select

End if



'-- ---- ---- ---- ---Lider steuern-- ---- ---- ---- ---- ---- ---- --

maxY = -4.8928

If controler_lider.value <> 0 then
Select Case Out.Name

'---Oberlid
Case "Bone1_out"
yDistanz = Bone1.value.posy.value - Bone7.value.posy.value
maxYoberlid = yDistanz * upper_lid_down
moveY = (maxYoberlid * (100/(maxY / controler_lider.value))/100)
out.value.posy = Bone1.value.posy.value - moveY
xDistanz = Bone7.value.posx.value - Bone1.value.posx.value
moveX = 0.5 * xDistanz * ((100/(maxY / controler_lider.value))/100)
out.value.posx = Bone1.value.posx.value + moveX

Case "Bone2_out"
yDistanz = Bone2.value.posy.value - Bone6.value.posy.value
maxYoberlid = yDistanz * upper_lid_down
moveY = (maxYoberlid * (100/(maxY / controler_lider.value))/100)
out.value.posy = Bone2.value.posy.value - moveY
xDistanz = Bone6.value.posx.value - Bone2.value.posx.value
moveX = 0.5 * xDistanz * ((100/(maxY / controler_lider.value))/100)
out.value.posx = Bone2.value.posx.value + moveX

Case "Bone3_out"
yDistanz = Bone3.value.posy.value - Bone5.value.posy.value
maxYoberlid = yDistanz * upper_lid_down
moveY = (maxYoberlid * (100/(maxY / controler_lider.value))/100)
out.value.posy = Bone3.value.posy.value - moveY
xDistanz = Bone5.value.posx.value - Bone3.value.posx.value
moveX = 0.5 * xDistanz * ((100/(maxY / controler_lider.value))/100)

out.value.posx = Bone3.value.posx.value + moveX
'---Unterlid
Case "Bone5_out"
yDistanz = Bone3.value.posy.value - Bone5.value.posy.value
maxYunterlid = yDistanz * (1 - upper_lid_down)
moveY = (maxYunterlid * (100/(maxY / controler_lider.value))/100)
out.value.posy = Bone5.value.posy.value + moveY
xDistanz = Bone5.value.posx.value - Bone3.value.posx.value
moveX = 0.5 * xDistanz* ((100/(maxY / controler_lider.value))/100)
out.value.posx = Bone5.value.posx.value - moveX

Case "Bone6_out"
yDistanz = Bone2.value.posy.value - Bone6.value.posy.value
maxYunterlid = yDistanz * (1 - upper_lid_down)
moveY = (maxYunterlid * (100/(maxY / controler_lider.value))/100)
out.value.posy = Bone6.value.posy.value + moveY
xDistanz = Bone6.value.posx.value - Bone2.value.posx.value
moveX = 0.5 * xDistanz* ((100/(maxY / controler_lider.value))/100)
out.value.posx = Bone6.value.posx.value - moveX

Case "Bone7_out"
yDistanz = Bone1.value.posy.value - Bone7.value.posy.value
maxYunterlid = yDistanz * (1 - upper_lid_down)
moveY = (maxYunterlid * (100/(maxY / controler_lider.value))/100)
out.value.posy = Bone7.value.posy.value + moveY
xDistanz = Bone7.value.posx.value - Bone1.value.posx.value
moveX = 0.5 * xDistanz * ((100/(maxY / controler_lider.value))/100)
out.value.posx = Bone7.value.posx.value - moveX

End Select

End if

<!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>
<META http-equiv=Content-Type content="text/html; charset=iso-8859 (See http://iso-8859.ora-code.com)-1">
<META content=Word.Document name=ProgId>
<META content="MSHTML 6.00.2800.1106" name=GENERATOR>
<META content="Microsoft Word 10" name=Originator><LINK
href="cid:filelist.xml@(protected)" rel=File-List><!--[if gte mso 9]><xml>
<o:OfficeDocumentSettings>
 <o:DoNotRelyOnCSS/>
</o:OfficeDocumentSettings>
</xml><![endif]--><!--[if gte mso 9]><xml>
<w:WordDocument>
 <w:SpellingState>Clean</w:SpellingState>
 <w:GrammarState>Clean</w:GrammarState>
 <w:DocumentKind>DocumentEmail</w:DocumentKind>
 <w:HyphenationZone>21</w:HyphenationZone>
 <w:EnvelopeVis/>
 <w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel>
</w:WordDocument>
</xml><![endif]-->
<STYLE>@(protected) {
  font-family: Tahoma;
}
@(protected) Section1 {size: 595.3pt 841.9pt; margin: 70.85pt 70.85pt 2.0cm 70.85pt;
mso-header-margin: 35.4pt; mso-footer-margin: 35.4pt; mso-paper-source: 0; }
P.MsoNormal {
  FONT-SIZE: 12pt; MARGIN: 0cm 0cm 0pt; COLOR: black; FONT-FAMILY: "Times New
Roman"; mso-style-parent: ""; mso-pagination: widow-orphan; mso-fareast-font
-family: "Times New Roman"
}
LI.MsoNormal {
  FONT-SIZE: 12pt; MARGIN: 0cm 0cm 0pt; COLOR: black; FONT-FAMILY: "Times New
Roman"; mso-style-parent: ""; mso-pagination: widow-orphan; mso-fareast-font
-family: "Times New Roman"
}
DIV.MsoNormal {
  FONT-SIZE: 12pt; MARGIN: 0cm 0cm 0pt; COLOR: black; FONT-FAMILY: "Times New
Roman"; mso-style-parent: ""; mso-pagination: widow-orphan; mso-fareast-font
-family: "Times New Roman"
}
A:link {
  COLOR: blue; TEXT-DECORATION: underline; text-underline: single
}
SPAN.MsoHyperlink {
  COLOR: blue; TEXT-DECORATION: underline; text-underline: single
}
A:visited {
  COLOR: blue; TEXT-DECORATION: underline; text-underline: single
}
SPAN.MsoHyperlinkFollowed {
  COLOR: blue; TEXT-DECORATION: underline; text-underline: single
}
PRE {
  FONT-SIZE: 10pt; MARGIN: 0cm 0cm 0pt; COLOR: black; FONT-FAMILY: "Courier New"
; mso-pagination: widow-orphan; mso-fareast-font-family: "Times New Roman"
}
SPAN.EmailFormatvorlage18 {
  COLOR: navy; FONT-FAMILY: Arial; mso-style-type: personal; mso-style-noshow:
yes; mso-ansi-font-size: 10.0pt; mso-bidi-font-size: 10.0pt; mso-ascii-font
-family: Arial; mso-hansi-font-family: Arial; mso-bidi-font-family: Arial
}
SPAN.EmailFormatvorlage19 {
  COLOR: navy; FONT-FAMILY: Arial; mso-style-type: personal-reply; mso-style
-noshow: yes; mso-ansi-font-size: 10.0pt; mso-bidi-font-size: 10.0pt; mso-ascii
-font-family: Arial; mso-hansi-font-family: Arial; mso-bidi-font-family: Arial
}
DIV.Section1 {
  page: Section1
}
OL {
  MARGIN-BOTTOM: 0cm
}
UL {
  MARGIN-BOTTOM: 0cm
}
</STYLE>
<!--[if gte mso 10]>
<style>
/* Style Definitions */
table.MsoNormalTable
  {mso-style-name:"Normale Tabelle";
  mso-tstyle-rowband-size:0;
  mso-tstyle-colband-size:0;
  mso-style-noshow:yes;
  mso-style-parent:"";
  mso-padding-alt:0cm 5.4pt 0cm 5.4pt;
  mso-para-margin:0cm;
  mso-para-margin-bottom:.0001pt;
  mso-pagination:widow-orphan;
  font-size:10.0pt;
  font-family:"Times New Roman";}
</style>
<![endif]--><!--[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 lang=DE style="tab-interval: 35.4pt" vLink=blue link=blue bgColor=white>
<DIV><FONT face=Arial size=2>Hi everyone</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>I am trying to make a facial rig where you are
able
to cange the position of the bones like you want so that you can simply
envelope
it on every human like charakter.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>For this I use scripted operators so that the
controlers I made for the rig will work also after changing the position of the
bones.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>Now my problem is the scopes needs a real big
amount of my cpu power. Using the controlers wich drive the bones (and scripts)
isn't fun anymore because of the bad performance.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>Did I do something wrong in the scripts so that
they are sooo slow or isnt't it possible to write scopes AND have good XSI
performance at the same time ??</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>My idea is, there are to many out connections
updated every time the script is running.</FONT></DIV>
<DIV><FONT face=Arial size=2>The idea behind is: There is one slider wich
controls the open/close of the lids (Lider steuern - in the script), and one
slider wich controls the direction of the eyes. When changing the direction the
lids should slightly move with the direction of the eyes (Augen Direction
steuern - in the script)</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>Maybe you have some ideas on optimizing this,
would
be great.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>greetings mario</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>Here is the script I wrote:</FONT></DIV>
<DIV><FONT face=Arial size=2><FONT size=2>
<P>'-- ---- ---- ---- ----Augen Direction
steuern-- ---- ---- ---- ---- -----<BR>FaktorX = 600<BR>FaktorY = 100</P>
<P>If controler_direction.value.posx &lt;&gt; "0" Or
controler_direction.value.posy &lt;&gt; "0" Then</P>
<P>Select Case Out.Name</P>
<P>Case "Bone0_out"<BR>Out.value.posx = Bone0.value.posx.value +
controler_direction.value.posx.value/(FaktorX*0.8)<BR>Out.value.posy =
Bone0.value.posy.value + controler_direction.value.posy.value/(FaktorY)</P>
<P>Case "Bone1_out"<BR>Out.value.posx = Bone1.value.posx.value +
controler_direction.value.posx.value/(FaktorX*0.5)<BR>Out.value.posy =
Bone1.value.posy.value + controler_direction.value.posy.value/(FaktorY)</P>
<P>Case "Bone2_out"<BR>Out.value.posx = Bone2.value.posx.value +
controler_direction.value.posx.value/(FaktorX*0.3)<BR>Out.value.posy =
Bone2.value.posy.value + controler_direction.value.posy.value/(FaktorY)</P>
<P>Case "Bone3_out"<BR>Out.value.posx = Bone3.value.posx.value +
controler_direction.value.posx.value/(FaktorX*0.5)<BR>Out.value.posy =
Bone3.value.posy.value + controler_direction.value.posy.value/(FaktorY)</P>
<P>Case "Bone4_out"<BR>Out.value.posx = Bone4.value.posx.value +
controler_direction.value.posx.value/(FaktorX*0.8)<BR>Out.value.posy =
Bone4.value.posy.value + controler_direction.value.posy.value/(FaktorY)</P>
<P>Case "Bone5_out"<BR>Out.value.posx = Bone5.value.posx.value +
controler_direction.value.posx.value/(FaktorX*0.5)<BR>Out.value.posy =
Bone5.value.posy.value + controler_direction.value.posy.value/(FaktorY)</P>
<P>Case "Bone6_out"<BR>Out.value.posx = Bone6.value.posx.value +
controler_direction.value.posx.value/(FaktorX*0.3)<BR>Out.value.posy =
Bone6.value.posy.value + controler_direction.value.posy.value/(FaktorY)</P>
<P>Case "Bone7_out"<BR>Out.value.posx = Bone7.value.posx.value +
controler_direction.value.posx.value/(FaktorX*0.5)<BR>Out.value.posy =
Bone7.value.posy.value + controler_direction.value.posy.value/(FaktorY)<BR></P>
<P>End Select</P>
<P>End if</P>
<P>&nbsp;</P>
<P>'-- ---- ---- ---- ---Lider steuern-- ---- ---- ---- ---- ---- ---- --</P>
<P>maxY = -4.8928</P>
<P>If controler_lider.value &lt;&gt; 0 then<BR>Select Case Out.Name</P>
<P>'---Oberlid<BR>Case "Bone1_out"<BR>yDistanz = Bone1.value.posy.value -
Bone7.value.posy.value<BR>maxYoberlid = yDistanz * upper_lid_down<BR>moveY =
(maxYoberlid * (100/(maxY / controler_lider.value))/100)<BR>out.value.posy =
Bone1.value.posy.value - moveY<BR>xDistanz = Bone7.value.posx.value -
Bone1.value.posx.value<BR>moveX = 0.5 * xDistanz * ((100/(maxY /
controler_lider.value))/100)<BR>out.value.posx = Bone1.value.posx.value +
moveX</P>
<P>Case "Bone2_out"<BR>yDistanz = Bone2.value.posy.value -
Bone6.value.posy.value<BR>maxYoberlid = yDistanz * upper_lid_down<BR>moveY =
(maxYoberlid * (100/(maxY / controler_lider.value))/100)<BR>out.value.posy =
Bone2.value.posy.value - moveY<BR>xDistanz = Bone6.value.posx.value -
Bone2.value.posx.value<BR>moveX = 0.5 * xDistanz * ((100/(maxY /
controler_lider.value))/100)<BR>out.value.posx = Bone2.value.posx.value +
moveX</P>
<P>Case "Bone3_out"<BR>yDistanz = Bone3.value.posy.value -
Bone5.value.posy.value<BR>maxYoberlid = yDistanz * upper_lid_down<BR>moveY =
(maxYoberlid * (100/(maxY / controler_lider.value))/100)<BR>out.value.posy =
Bone3.value.posy.value - moveY<BR>xDistanz = Bone5.value.posx.value -
Bone3.value.posx.value<BR>moveX = 0.5 * xDistanz * ((100/(maxY /
controler_lider.value))/100)</P>
<P>out.value.posx = Bone3.value.posx.value + moveX<BR>'---Unterlid<BR>Case
"Bone5_out"<BR>yDistanz = Bone3.value.posy.value -
Bone5.value.posy.value<BR>maxYunterlid = yDistanz * (1 -
upper_lid_down)<BR>moveY = (maxYunterlid * (100/(maxY /
controler_lider.value))/100)<BR>out.value.posy = Bone5.value.posy.value +
moveY<BR>xDistanz = Bone5.value.posx.value - Bone3.value.posx.value<BR>moveX =
0.5 * xDistanz* ((100/(maxY / controler_lider.value))/100)<BR>out.value.posx =
Bone5.value.posx.value - moveX</P>
<P>Case "Bone6_out"<BR>yDistanz = Bone2.value.posy.value -
Bone6.value.posy.value<BR>maxYunterlid = yDistanz * (1 -
upper_lid_down)<BR>moveY = (maxYunterlid * (100/(maxY /
controler_lider.value))/100)<BR>out.value.posy = Bone6.value.posy.value +
moveY<BR>xDistanz = Bone6.value.posx.value - Bone2.value.posx.value<BR>moveX =
0.5 * xDistanz* ((100/(maxY / controler_lider.value))/100)<BR>out.value.posx =
Bone6.value.posx.value - moveX</P>
<P>Case "Bone7_out"<BR>yDistanz = Bone1.value.posy.value -
Bone7.value.posy.value<BR>maxYunterlid = yDistanz * (1 -
upper_lid_down)<BR>moveY = (maxYunterlid * (100/(maxY /
controler_lider.value))/100)<BR>out.value.posy = Bone7.value.posy.value +
moveY<BR>xDistanz = Bone7.value.posx.value - Bone1.value.posx.value<BR>moveX =
0.5 * xDistanz * ((100/(maxY / controler_lider.value))/100)<BR>out.value.posx =
Bone7.value.posx.value - moveX</P>
<P>End Select</P>
<P>End if</P></FONT></FONT></DIV></BODY></HTML>