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?
 
Create2DSkeleton/AppendBone root problem...

Create2DSkeleton/AppendBone root problem...

2005-06-15       - By Bradley R. Gabe

 Back
Reply:     1     2     3     4     5     6     7  

Thanks, Morten.

I think it serves as a better example for OM scripting and sharing
transform data between scene nodes than as a useful production tool.


>That's a gem Brad :)
>
>-
>
>Morten Bartholdy
>3D & VFX Artist
>
>
>
>-- -- Original Message -- --
>From: <mailto:brad@(protected)>Bradley R. Gabe
>To: <mailto:XSI@(protected)>XSI@(protected) ;
><mailto:XSI@(protected)>XSI@(protected)
>Sent: Wednesday, June 15, 2005 2:44 AM
>Subject: Re: Create2DSkeleton/AppendBone root problem...
>
>Select any number of scene objects, then run the following jscript. It
>will build a 2D chain with each bone pointing from one object to the next,
>in the order they were selected. The chain root and first bone match
>orientation. This is all object model, so it should be pretty fast, even
>for large selections:
>
>// BEGIN SCRIPT
>-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ----
>// Create SIVector3 objects to store position vectors
>var rootPos = XSIMath.CreateVector3();
>var effPos = XSIMath.CreateVector3();
>
>// Define Chain normal plane
>var normalArr = [0,1,0];
>
>// Get the global transforms from your first 2 selected objects
>var rootTrans = selection(0).kinematics.global.transform;
>var effTrans = selection(1).kinematics.global.transform;
>
>// Pull the position vectors from the transform objects
>rootTrans.GetTranslation(rootPos);
>effTrans.GetTranslation(effPos);
>
>// Create your chain root
>var root = ActiveSceneRoot.Add3DChain(rootPos, effPos, normalArr,
>"ChainRoot");
>var bone0 = root.bones(0);
>
>// Finish off the rest of the chain from the rest of the selection
>for(var i=2; i<selection.count; i++){
>
>         // Grab the global trans off the current item
>         effTrans = selection(i).kinematics.global.transform;
>
>         // Pull the position vector from the global transform;
>         effTrans.GetTranslation(effPos);
>
>         root.AddBone(effPos);
>}
>
>// Get the global transform off the first bone
>var boneTrans = bone0.kinematics.global.transform;
>
>// Assign the root and the first bone to the first bone's global trans
>root.kinematics.global.transform = boneTrans;
>bone0.kinematics.global.transform = boneTrans;
>// END SCRIPT
>-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ----
>
>
>>Okay, I have a solution for you. But first a quick question: How are you
>>getting your chain element coordinates, is it from existing elements in
>>the scene?
>>
>>One thing to keep in mind is the chain creation commands and methods rely
>>on global coordinates. So pulling them off existing nodes requires less
>>code than having to convert your own coordinates from local to global for
>>everything.
>>
>>>I'm not sure if there's a better way to do this trhough the object
>>>model, but I am trying to build chains by specifying an array of (x,y,z
>>>position coordinates) and a position for an up vector.
>>>
>>>My procedure involves creating the first bone in the chain using
>>>
>>>1- Create2DSkeleton command to generate the first bone
>>>2- zero out the root to match a null correctly oriented.
>>>3- zero out the first joint.
>>>3- AppendBone to add additional bones.
>>>
>>>Unfortunately, every time I use an AppendBone command, it seem to
>>>re-orient the root and throws off the rotation bone values.
>>>
>>>If anyone has a better procedure for handling chain ganeration, with
>>>zeroing bones ???
>>>
>>>
>>>THX
>>>RSM
>>>
>>>__ ____ ____ ____ ____ ____ ____ ____ ____ ____ _____
>>>Raffaele Scaduto-Mendola - www.turbolinea.com
>>>                            raffaele@(protected)
>>>---
>>>Unsubscribe? Mail Majordomo@(protected) with the following text in body:
>>>unsubscribe xsi
>>
>>---
>>Unsubscribe? Mail Majordomo@(protected) with the following text in body:
>>unsubscribe xsi

<html>
<body>
Thanks, Morten.<br><br>
I think it serves as a better example for OM scripting and sharing
transform data between scene nodes than as a useful production
tool.<br><br>
<br>
<blockquote type=cite class=cite cite=""><font face="arial" size=2>That's
a gem Brad :)<br>
</font>&nbsp;<br>
<font face="arial" size=2>-<br>
</font>&nbsp;<br>
<font face="arial" size=2>Morten Bartholdy<br>
3D &amp; VFX Artist<br><br>
</font>&nbsp;<br>
&nbsp;<br>

<dl>
<dd>-- -- Original Message -- -- <br>

<dd>From:</b> <a href="mailto:brad@(protected)">Bradley R. Gabe</a>
<br>

<dd>To:</b> <a href="mailto:XSI@(protected)">XSI@(protected)</a> ; <a href=
"mailto:XSI@(protected)">XSI@(protected)</a> <br>

<dd>Sent:</b> Wednesday, June 15, 2005 2:44 AM<br>

<dd>Subject:</b> Re: Create2DSkeleton/AppendBone root problem...<br><br>

<dd>Select any number of scene objects, then run the following jscript. It will
build a 2D chain with each bone pointing from one object to the next, in the
order they were selected. The chain root and first bone match orientation. This
is all object model, so it should be pretty fast, even for large selections:<br
><br>

<dd><font face="Courier New, Courier" color="#008000">// BEGIN SCRIPT -- ------
-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- -----<br>

<dd>// Create SIVector3 objects to store position vectors<br>
</font>
<dd>var rootPos = XSIMath.CreateVector3();<br>

<dd>var effPos = XSIMath.CreateVector3();<br><br>

<dd><font face="Courier New, Courier" color="#008000">// Define Chain normal
plane<br>
</font>
<dd>var normalArr = [0,1,0];<br><br>

<dd><font face="Courier New, Courier" color="#008000">// Get the global
transforms from your first 2 selected objects<br>
</font>
<dd>var rootTrans = selection(0).kinematics.global.transform;<br>

<dd>var effTrans = selection(1).kinematics.global.transform;<br><br>

<dd><font face="Courier New, Courier" color="#008000">// Pull the position
vectors from the transform objects<br>
</font>
<dd>rootTrans.GetTranslation(rootPos);<br>

<dd>effTrans.GetTranslation(effPos);<br><br>

<dd><font face="Courier New, Courier" color="#008000">// Create your chain root
<br>
</font>
<dd>var root = ActiveSceneRoot.Add3DChain(rootPos, effPos, normalArr, &quot
;ChainRoot&quot;);<br>

<dd>var bone0 = root.bones(0);<br><br>

<dd><font face="Courier New, Courier" color="#008000">// Finish off the rest of
the chain from the rest of the selection<br>
</font>
<dd>for(var i=2; i&lt;selection.count; i++){<br><br>

<dd><x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>// Grab the
global trans off the current item<br>

<dd><x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>effTrans =
selection(i).kinematics.global.transform;<br>

<dd><x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab><br>

<dd><x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>// Pull the
position vector from the global transform;<br>

<dd><x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>effTrans
.GetTranslation(effPos);<br>

<dd><x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab><br>

<dd><x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>root.AddBone
(effPos);<br>

<dd>}<br><br>

<dd><font face="Courier New, Courier" color="#008000">// Get the global
transform off the first bone<br>
</font>
<dd>var boneTrans = bone0.kinematics.global.transform; <br><br>

<dd><font face="Courier New, Courier" color="#008000">// Assign the root and
the first bone to the first bone's global trans<br>
</font>
<dd>root.kinematics.global.transform = boneTrans;<br>

<dd>bone0.kinematics.global.transform = boneTrans;<br>

<dd><font face="Courier New, Courier" color="#008000">// END SCRIPT -- ---- ---
-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---<br><br>
<br>
</font><blockquote type=cite class=cite cite="">
<dd>Okay, I have a solution for you. But first a quick question: How are you
getting your chain element coordinates, is it from existing elements in the
scene?<br><br>

<dd>One thing to keep in mind is the chain creation commands and methods rely
on global coordinates. So pulling them off existing nodes requires less code
than having to convert your own coordinates from local to global for everything
.<br><br>
<blockquote type=cite class=cite cite="">
<dd>I'm not sure if there's a better way to do this trhough the object model,
but I am trying to build chains by specifying an array of (x,y,z position
coordinates) and a position for an up vector.<br><br>

<dd>My procedure involves creating the first bone in the chain using<br><br>

<dd>1- Create2DSkeleton command to generate the first bone<br>

<dd>2- zero out the root to match a null correctly oriented.<br>

<dd>3- zero out the first joint.<br>

<dd>3- AppendBone to add additional bones.<br><br>

<dd>Unfortunately, every time I use an AppendBone command, it seem to re-orient
the root and throws off the rotation bone values.<br><br>

<dd>If anyone has a better procedure for handling chain ganeration, with
zeroing bones ???<br><br>
<br>

<dd>THX<br>

<dd>RSM<br><br>

<dd>__ ____ ____ ____ ____ ____ ____ ____ ____ ____ _____<br>

<dd>Raffaele Scaduto-Mendola - <a href="http://www.turbolinea.com/" eudora=
"autourl">www.turbolinea.com</a><br>

<dd>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp; raffaele@(protected)<br>

<dd>---<br>

<dd>Unsubscribe? Mail Majordomo@(protected) with the following text in body:
<br>

<dd>unsubscribe xsi</blockquote><br>

<dd>---<br>

<dd>Unsubscribe? Mail Majordomo@(protected) with the following text in body:
<br>

<dd>unsubscribe xsi</blockquote>
</dl></blockquote></body>
</html>