Re: [script] Waiting for playback completion
| Date : Wed, 22 Nov 2006 09:17:13 +1100 |
| To : XSI(at)Softimage.COM |
| From : "Aloys Baillet" <aloys.baillet(at)gmail.com> |
| Subject : Re: [script] Waiting for playback completion |
When you read the point position array of a piece of geometry, XSI will evaluate the graph of operators and if the syflex ops are dirty (they should be if you ask for a different frame), the cache will be generated. We used that on Happy Feet to compute syflex caches on the render farm, it's a very time-saving thing to do!
In a perfect world, you should be able to call the Geometry(frameNumber), but we had some problems on the farm with this method, using a SetValue of the current frame makes it work everywhere.
Here's a snippet:
syOps = XSIFactory.CreateActiveXObject('XSI.Collection')
syOps.Items = '*.*.polymsh.syCloth'
syObjs = [op.Parent.Parent for op in syOps]
playCtl = Application.Dictionary.GetObject('PlayControl')
for frame in range( playCtl.In.Value, playCtl.Out.Value):
Application.SetValue('PlayControl.Current', frame)
for syObj in syObjs:
Application.LogMessage('Frame: %d: Updating %s'%(frame,syObj))
points = syObj.ActivePrimitive.Geometry.Points.PositionArray
Cheers,
Aloys
On 11/22/06, Bernard Lebel <3dbernard@gmail.com> wrote:
Marc-AndrÃ: yes, I cleared the cache files :-)
Stefano: Yes, I'm using the command, not the PPG method.
Aloys: I'm not sure to understand. You mean that simply reading the
positionarray of the syflexed mesh(es) will launch the simulation?
Thanks
Bernard
On 11/21/06, Stefano Jannuzzo <stefanojannuzzo@tiscali.it> wrote:
> Be sure to use Application.Refresh, since a plain Refresh will just update
> the ppg.
> Not sure about syflex, but this surely works with our operators.
>
> function LQ_Manager_Play_OnClicked()
> {
> var i;
> var inF = GetValue("PlayControl.In ");
> var outF = GetValue("PlayControl.Out");
> SetValue("PlayControl.Current", inF, null);
> Application.Refresh();
> for (i=inF; i<outF; i++)
> {
> NextFrame();
> Application.Refresh();
> }
> }
>
>
> ----- Original Message -----
> From: "Bernard Lebel" < 3dbernard@gmail.com>
> To: <XSI@Softimage.COM>
> Sent: Monday, November 20, 2006 10:29 PM
> Subject: Re: [script] Waiting for playback completion
>
>
> > No luck either, even with Refresh after NextFrame it doesn't write the
> > Syflex file.
> >
> >
> > Bernard
> >
> >
> >
> > On 11/20/06, Luc-Eric Rousseau < lucer@softimage.com> wrote:
> >>
> >>
> >> I've never had luck with this, but it looks like with a Refresh() after
> >> your
> >> NextFrame() that you script does work.
> >>
> >> -----Original Message-----
> >> From: owner-xsi@Softimage.COM [mailto:owner-xsi@Softimage.COM ]On Behalf
> >> Of
> >> guillaume laforge
> >> Posted At: Monday, November 20, 2006 3:46 PM
> >> Posted To: xsi
> >> Conversation: [script] Waiting for playback completion
> >> Subject: Re: [script] Waiting for playback completion
> >>
> >> You can use use your own "custom PlayForwardsFromStart" command with your
> >> script in the "else" part of the function :
> >>
> >> function MyPlayForwardsFromStart()
> >> {
> >> var FirstFrame = GetValue("PlayControl.In");
> >> var LastFrame = GetValue("PlayControl.Out ");
> >>
> >> var oTotalLength = LastFrame-FirstFrame;
> >>
> >> SetValue("PlayControl.Current ", FirstFrame);
> >> for(var i=0; i<oTotalLength;i++)
> >> {
> >> if(i!= LastFrame-2)
> >> {
> >> NextFrame();
> >> LogMessage("Waiting for the end of the Playback...")
> >> }
> >> else
> >> {
> >> LogMessage("Run your script now !");
> >> }
> >> }
> >> }
> >>
> >> Should work...
> >>
> >> Cheers
> >>
> > ---
> > Unsubscribe? Mail Majordomo@Softimage.COM with the following text in body:
> > unsubscribe xsi
> >
> >
> > --
> > No virus found in this incoming message.
> > Checked by AVG Free Edition.
> > Version: 7.5.430 / Virus Database: 268.14.11/543 - Release Date:
> > 20/11/2006 21.20
> >
> >
>
> ---
> Unsubscribe? Mail Majordomo@Softimage.COM with the following text in body:
> unsubscribe xsi
>
---
Unsubscribe? Mail Majordomo@Softimage.COM with the following text in body:
unsubscribe xsi
--
Aloys Baillet - XSI Technical Director
Character Dpt - Animal Logic
--
- Follow-Ups:
- Re: [script] Waiting for playback completion
- From: "Bernard Lebel" <3dbernard(at)gmail.com>
- Re: [script] Waiting for playback completion
- References:
- RE: [script] Waiting for playback completion
- From: "Luc-Eric Rousseau" <lucer(at)Softimage.COM>
- Re: [script] Waiting for playback completion
- From: "Bernard Lebel" <3dbernard(at)gmail.com>
- Re: [script] Waiting for playback completion
- From: "Stefano Jannuzzo" <stefanojannuzzo(at)tiscali.it>
- Re: [script] Waiting for playback completion
- From: "Bernard Lebel" <3dbernard(at)gmail.com>
- RE: [script] Waiting for playback completion
| DATE: | << | >> | THREAD: | << | >> | INDEX: | Main | Thread |
|---|
- Previous by Date: Re: Starburts effect in FxTree?
- Next by Date: Re: Starburts effect in FxTree?
- Previous by Thread: Re: Starburts effect in FxTree?
- Next by Thread: Re: Starburts effect in FxTree?
- Index(es):
| Search the XSI List archives here or use the advanced search form to search across mailing lists. Searching help is available. |