OBJ File sequence import 2004-02-18 - By Fabio Lissi
Back Hi Andre,
Can you send to me the whole code you are using ? Answer me privately if you want.
Fabio -- -- Original Message -- -- From: Andre DeAngelis To: XSI@(protected) Sent: Wednesday, February 18, 2004 12:47 PM Subject: RE: OBJ File sequence import
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 To: 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 To: 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.1400" name=GENERATOR> <STYLE></STYLE> </HEAD> <BODY bgColor=#ffffff> <DIV><FONT face=Arial size=2>Hi Andre,</FONT></DIV> <DIV><FONT face=Arial size=2></FONT> </DIV> <DIV><FONT face=Arial size=2>Can you send to me the whole code you are using ?</FONT></DIV> <DIV><FONT face=Arial size=2>Answer me privately if you want.</FONT></DIV> <DIV> </DIV> <DIV><FONT face=Arial size=2> Fabio</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> Wednesday, February 18, 2004 12:47 PM</DIV> <DIV style="FONT: 10pt arial"><B>Subject:</B> RE: OBJ File sequence import</DIV> <DIV><BR></DIV> <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> </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. 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> </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> </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> </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> </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> logmessage ofile <BR></FONT><FONT face=Arial> ObjImport ofile, 1, 0, True, True<BR></FONT><FONT face=Arial> if oStart = 0 then ' this is the first file we get "Master" </FONT><FONT face=Arial><BR></FONT><FONT face=Arial> oFilebuffer = Split(ofile.name,".") <BR></FONT><FONT face=Arial> oMaster = oFilebuffer(0)<BR></FONT><FONT face=Arial> SaveShapeKey oMaster, , ,oStart, , , , , siShapeLocalReferenceMode<BR> </FONT><FONT face=Arial>oStart = oStart + 1<BR> ObjNum = 1</FONT><FONT face=Arial><BR></FONT><FONT face=Arial> else<BR></FONT><FONT face=Arial> SelectShapeKey oMaster , oMaster&ObjNum , siShapeLocalReferenceMode, True, True<BR></FONT><FONT face=Arial> SaveShapeKey oMaster, , , oStart, , , , , siShapeLocalReferenceMode<BR> DeleteObj oMaster&ObjNum <BR></FONT><FONT face=Arial> 'oStart = oStart + 1 ' Optional delete the last obj imported to keep the scene light<BR> ObjNum = ObjNum + 1<BR></FONT><FONT face=Arial> 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> 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> </DIV> <DIV><SPAN class=137021621-12012004><FONT face=Arial color=#0000ff size=2>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.</FONT></SPAN></DIV> <DIV><SPAN class=137021621-12012004><FONT face=Arial color=#0000ff size=2></FONT></SPAN> </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> </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> </DIV> <DIV><FONT face=Arial size=2>Is this good enough ?</FONT></DIV> <DIV><FONT face=Arial size=2></FONT> </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> </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> logmessage ofile <BR> ObjImport ofile, 1, 0, True, True <BR>Next</FONT></DIV> <DIV><FONT face=Arial size=2></FONT> </DIV> <DIV><FONT face=Arial size=2> Fabio</FONT></DIV> <DIV><FONT face=Arial size=2></FONT> </DIV> <DIV><FONT face=Arial size=2></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 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? 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> </DIV> <DIV><SPAN class=687120419-12012004><FONT face=Arial color=#0000ff size=2>AD</FONT></SPAN></DIV></BLOCKQUOTE></BLOCKQUOTE></BLOCKQUOTE>< /BLOCKQUOTE></BLOCKQUOTE></BODY></HTML>
|
|