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?
 
OBJ File sequence import

OBJ File sequence import

2004-02-18       - By Andre DeAngelis

 Back
Reply:     1     2  

HI Fabio,

I'm tryiong to get your script to work with the XSI file requester, but am
having no luck.  I hate to bother you with this, but if you have a chance,
could you please see if you can get this to work?

This is the bit that includes the file requester, but linking it to your
script is not working for me:

Many thanks,

Andre

main

sub main

dim loader

dim oFileBrowser

set oFileBrowser = XSIUIToolkit.FileBrowser

oFileBrowser.DialogTitle = "Select an .obj file sequence"

oFileBrowser.InitialDirectory = ActiveProject.Path

oFileBrowser.Filter = "OBJ Files (*.obj)|*.obj|All Files (*.*)|*.*||"

oFileBrowser.ShowOpen

If oFileBrowser.FilePathName = "" Then

logmessage "-- -----Cancelled"

exit sub

End If

-- --Original Message-- --
From: Fabio Lissi [mailto:flissi@(protected)]
Sent: Monday, January 12, 2004 5:18 PM
To: XSI@(protected)
Subject: Re: OBJ File sequence import


In this case :

Obj files are called cube.obj, cube1.obj and so on
The object is called "cube", the animation starts at frame 1.

oPath = "C:\Temp\objs"
Dim fs, f, s
Set fs = CreateObject("Scripting.FileSystemObject")
Set f = fs.GetFolder(oPath)
Set fc = f.Files
oStart = 1 ' Change if the animation starts in a different frame
ObjNum = 0 ' Index of the loaded object
oMaster = ""
For Each ofile in fc
   logmessage ofile
   ObjImport ofile, 1, 0, True, True
   if oStart = 0 then ' this is the first file we get "Master"
       oFilebuffer = Split(ofile.name,".")
       oMaster = oFilebuffer(0)
       SaveShapeKey oMaster, , ,oStart, , , , , siShapeLocalReferenceMode
       oStart = oStart + 1
       ObjNum = 1
   else
       SelectShapeKey oMaster , oMaster&ObjNum , siShapeLocalReferenceMode,
True, True
       SaveShapeKey oMaster, , , oStart, , , , , siShapeLocalReferenceMode
       DeleteObj oMaster&ObjNum
       'oStart = oStart + 1 ' Optional delete the last obj imported to keep
the scene light
       ObjNum = ObjNum + 1
   end if
Next

Let me know if you need something more or my explenation is not clear
enough.

   Fabio

-- -- Original Message -- --
From: Andre DeAngelis <mailto:adeangelis@(protected)>  
To: XSI@(protected) <mailto:XSI@(protected)>  
Sent: Monday, January 12, 2004 4:18 PM
Subject: RE: OBJ File sequence import

Thanks Fabio, you're a true genthemen. :-)

Script works fine.  What I am ultimately trying to achieve, is to take in an
OBJ sequence and then turn this into a shape animation.  In other words, OBJ
file 1 becomes the master and files 2-100 become the shape targets.  If
anyone has any suggestion as to how to achieve this, I would be very
grateful.

Thanks again Fabio.

AD

-- --Original Message-- --
From: Fabio Lissi [mailto:flissi@(protected)]
Sent: Monday, January 12, 2004 3:44 PM
To: XSI@(protected)
Subject: Re: OBJ File sequence import


Hi Andre,

Is this good enough ?

You just need to have all your obj files in one folder.

oPath = "C:\Temp"
Dim fs, f, s
Set fs = CreateObject("Scripting.FileSystemObject")
Set f = fs.GetFolder(oPath)
Set fc = f.Files
For Each ofile in fc
 logmessage ofile
 ObjImport ofile, 1, 0, True, True  
Next

      Fabio



-- -- Original Message -- --
From: Andre DeAngelis <mailto:adeangelis@(protected)>  
To: XSI@(protected) <mailto:XSI@(protected)>  
Sent: Monday, January 12, 2004 2:05 PM
Subject: OBJ File sequence import

Does anyone know of a script to import OBJ fiole sequences into XSI?  I know
I should write my own, but wondering if it's already publicly available.

AD


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<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.1141" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><SPAN class=304154417-18022004><FONT face=Arial color=#0000ff size=2>HI
Fabio,</FONT></SPAN></DIV>
<DIV><SPAN class=304154417-18022004><FONT face=Arial color=#0000ff
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=304154417-18022004><FONT face=Arial color=#0000ff size=2>I'm
tryiong to get your script to work with the XSI file requester, but am having
no
luck.&nbsp; I hate to bother you with this, but if you have a chance, could you
please see if you can get this to work?</FONT></SPAN></DIV>
<DIV><SPAN class=304154417-18022004><FONT face=Arial color=#0000ff
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=304154417-18022004><FONT face=Arial color=#0000ff size=2>This
is the bit that includes the file requester, but linking it to your script is
not working for me:</FONT></SPAN></DIV>
<DIV><SPAN class=304154417-18022004><FONT face=Arial color=#0000ff
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=304154417-18022004><FONT face=Arial color=#0000ff size=2>Many
thanks,</FONT></SPAN></DIV>
<DIV><SPAN class=304154417-18022004><FONT face=Arial color=#0000ff
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=304154417-18022004><FONT face=Arial color=#0000ff
size=2>Andre</FONT></SPAN></DIV>
<DIV><SPAN class=304154417-18022004><FONT face=Arial color=#0000ff
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=304154417-18022004><FONT size=2><FONT size=2>
<P>main</P>
<P>sub main</P>
<P>dim loader</P>
<P>dim oFileBrowser</P>
<P>set oFileBrowser = XSIUIToolkit.FileBrowser</P>
<P>oFileBrowser.DialogTitle = "Select an .obj file sequence" </P>
<P>oFileBrowser.InitialDirectory = ActiveProject.Path</P>
<P>oFileBrowser.Filter = "OBJ Files (*.obj)|*.obj|All Files (*.*)|*.*||"</P>
<P>oFileBrowser.ShowOpen</P>
<P>If oFileBrowser.FilePathName = "" Then</P>
<P>logmessage "-- -----Cancelled" </P>
<P>exit sub</P>
<P>End If</P></FONT></FONT></SPAN></DIV>
<BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px">
 <DIV class=OutlookMessageHeader dir=ltr align=left><FONT face=Tahoma
 size=2>-- --Original Message-- --<BR><B>From:</B> Fabio Lissi
 [mailto:flissi@(protected)]<BR><B>Sent:</B> Monday, January 12, 2004 5:18
 PM<BR><B>To:</B> XSI@(protected)<BR><B>Subject:</B> Re: OBJ File sequence
 import<BR><BR></FONT></DIV>
 <DIV><FONT size=2>
 <P><FONT face=Arial>In this case :</FONT></P>
 <P><FONT face=Arial>Obj files are called cube.obj, cube1.obj and so on<BR>The
 object is called "cube", the animation starts at frame 1.</FONT></P>
 <P><FONT face=Arial>oPath = "C:\Temp\objs"<BR></FONT><FONT face=Arial>Dim fs,
 f, s<BR></FONT><FONT face=Arial>Set fs =
 CreateObject("Scripting.FileSystemObject")<BR></FONT><FONT face=Arial>Set f =
 fs.GetFolder(oPath)<BR></FONT><FONT face=Arial>Set fc =
 f.Files<BR></FONT><FONT face=Arial>oStart = 1 ' Change if the animation
starts
 in a different frame<BR>ObjNum = 0 ' Index of the loaded
 object<BR></FONT><FONT face=Arial>oMaster = ""<BR></FONT><FONT face=Arial>For
 Each ofile in fc<BR></FONT><FONT face=Arial>&nbsp;&nbsp;&nbsp; logmessage
 ofile <BR></FONT><FONT face=Arial>&nbsp;&nbsp;&nbsp; ObjImport ofile, 1, 0,
 True, True<BR></FONT><FONT face=Arial>&nbsp;&nbsp;&nbsp; if oStart = 0 then '
 this is the first file we get "Master"&nbsp;</FONT><FONT
 face=Arial><BR></FONT><FONT
 face=Arial>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; oFilebuffer =
 Split(ofile.name,".") <BR></FONT><FONT face=Arial>&nbsp;&nbsp;&nbsp;
 &nbsp;&nbsp;&nbsp; oMaster = oFilebuffer(0)<BR></FONT><FONT
 face=Arial>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; SaveShapeKey oMaster, ,
 ,oStart, , , , , siShapeLocalReferenceMode<BR>&nbsp;&nbsp;&nbsp;
 &nbsp;&nbsp;&nbsp; </FONT><FONT face=Arial>oStart = oStart +
 1<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ObjNum =&nbsp;1</FONT><FONT
 face=Arial><BR></FONT><FONT face=Arial>&nbsp;&nbsp;&nbsp; else<BR></FONT>
<FONT
 face=Arial>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; SelectShapeKey oMaster ,
 oMaster&amp;ObjNum , siShapeLocalReferenceMode, True, True<BR></FONT><FONT
 face=Arial>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; SaveShapeKey oMaster, , ,
 oStart, , , , ,
 siShapeLocalReferenceMode<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
 DeleteObj oMaster&amp;ObjNum&nbsp;<BR></FONT><FONT
 face=Arial>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'oStart = oStart +
 1&nbsp;' Optional delete the last obj imported to keep the scene
 light<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ObjNum
 =&nbsp;ObjNum&nbsp;+ 1<BR></FONT><FONT face=Arial>&nbsp;&nbsp;&nbsp;&nbsp;end
 if<BR></FONT><FONT face=Arial>Next</FONT></P>
 <P><FONT face=Arial>Let me know if you need something more or my explenation
 is not clear enough.</FONT></P>
 <P><FONT face=Arial>&nbsp;&nbsp;&nbsp; Fabio</FONT></P></FONT></DIV>
 <BLOCKQUOTE dir=ltr
 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=adeangelis@(protected)
   href="mailto:adeangelis@(protected)">Andre DeAngelis</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> Monday, January 12, 2004 4:18
   PM</DIV>
   <DIV style="FONT: 10pt arial"><B>Subject:</B> RE: OBJ File sequence
   import</DIV>
   <DIV><BR></DIV>
   <DIV><SPAN class=137021621-12012004><FONT face=Arial color=#0000ff
   size=2>Thanks Fabio, you're a true genthemen. :-)</FONT></SPAN></DIV>
   <DIV><SPAN class=137021621-12012004><FONT face=Arial color=#0000ff
   size=2></FONT></SPAN>&nbsp;</DIV>
   <DIV><SPAN class=137021621-12012004><FONT face=Arial color=#0000ff
   size=2>Script works fine.&nbsp; What I am ultimately trying to achieve, is
   to take in an OBJ sequence and then turn this into a shape animation.&nbsp;
   In other words, OBJ file 1 becomes the master and files 2-100 become the
   shape targets.&nbsp; If anyone has any suggestion as to how to achieve this
,
   I would be very grateful.</FONT></SPAN></DIV>
   <DIV><SPAN class=137021621-12012004><FONT face=Arial color=#0000ff
   size=2></FONT></SPAN>&nbsp;</DIV>
   <DIV><SPAN class=137021621-12012004><FONT face=Arial color=#0000ff
   size=2>Thanks again Fabio.</FONT></SPAN></DIV>
   <DIV><SPAN class=137021621-12012004><FONT face=Arial color=#0000ff
   size=2></FONT></SPAN>&nbsp;</DIV>
   <DIV><SPAN class=137021621-12012004><FONT face=Arial color=#0000ff
   size=2>AD</FONT></SPAN></DIV>
   <BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px">
     <DIV class=OutlookMessageHeader dir=ltr align=left><FONT face=Tahoma
     size=2>-- --Original Message-- --<BR><B>From:</B> Fabio Lissi
     [mailto:flissi@(protected)]<BR><B>Sent:</B> Monday, January 12, 2004 3:44
     PM<BR><B>To:</B> XSI@(protected)<BR><B>Subject:</B> Re: OBJ File
     sequence import<BR><BR></FONT></DIV>
     <DIV><FONT face=Arial size=2>Hi Andre,</FONT></DIV>
     <DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
     <DIV><FONT face=Arial size=2>Is this good enough ?</FONT></DIV>
     <DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
     <DIV><FONT face=Arial size=2>You just need to have all your obj files in
     one folder.</FONT></DIV>
     <DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
     <DIV><FONT face=Arial color=#0000ff size=2>oPath = "C:\Temp"<BR>Dim fs, f
,
     s<BR>Set fs = CreateObject("Scripting.FileSystemObject")<BR>Set f =
     fs.GetFolder(oPath)<BR>Set fc = f.Files<BR>For Each ofile in
     fc<BR>&nbsp;&nbsp;logmessage ofile <BR>&nbsp;&nbsp;ObjImport ofile, 1, 0,
     True, True&nbsp; <BR>Next</FONT></DIV>
     <DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
     <DIV><FONT face=Arial
     size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Fabio</FONT></DIV>
     <DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
     <DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
     <BLOCKQUOTE dir=ltr
     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=adeangelis@(protected)
       href="mailto:adeangelis@(protected)">Andre DeAngelis</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> Monday, January 12, 2004 2
:05
       PM</DIV>
       <DIV style="FONT: 10pt arial"><B>Subject:</B> OBJ File sequence
       import</DIV>
       <DIV><BR></DIV>
       <DIV><SPAN class=687120419-12012004><FONT face=Arial color=#0000ff
       size=2>Does anyone know of a script to import OBJ fiole sequences into
       XSI?&nbsp; I know I should write my own, but wondering if it's already
       publicly available.</FONT></SPAN></DIV>
       <DIV><SPAN class=687120419-12012004><FONT face=Arial color=#0000ff
       size=2></FONT></SPAN>&nbsp;</DIV>
       <DIV><SPAN class=687120419-12012004><FONT face=Arial color=#0000ff
       size=2>AD</FONT></SPAN></DIV></BLOCKQUOTE></BLOCKQUOTE></BLOCKQUOTE><
/BLOCKQUOTE></BODY></HTML>