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?
 
Getting partitions from passes

Getting partitions from passes

2004-06-16       - By Bernard Lebel

 Back
Reply:     1     2     3     4     5     6     7     8     9  

Ahhh once again Felix saves the day.

Code to check all passes (wich is what I needed to do):
// Get passes
var oPasses = EnumElements( "Passes.List" );

// Enumerate through passes
for( var oPassEnum = new Enumerator( oPasses ); !oPassEnum.atEnd();
oPassEnum.moveNext() )
{
   // Get pass
   var oPass = getvalue( oPassEnum.item() );

   // Get pass elements
   var oPassElems = EnumElements( oPass )

   // Enumerate through pass elements
   for( var oPassElemEnum = new Enumerator( oPassElems );
!oPassElemEnum.atEnd(); oPassElemEnum.moveNext() )
   {
       // Check if pass element is named "Partitions" (wich is the
partition collection)
       if( oPassElemEnum.item().name == "Partitions" )
       {
           // Get partition collection elements
           var oPartitions = EnumElements( oPassElemEnum.item() );

           // Enumerate through partition collection elements
           for( var oPartsEnum = new Enumerator( oPartitions );
!oPartsEnum.atEnd(); oPartsEnum.moveNext() )
           {
               logmessage( oPartsEnum.item() );
           }
       }
   }
}

Thanks
Bernard



-- -- Original Message -- --
From: "Felix Gebhardt" <gebhardt@(protected)>
To: <XSI@(protected)>
Sent: Wednesday, June 16, 2004 10:13 AM
Subject: Re: [Script -3511] Getting partitions from passes


>
>
> There is probably a more direct way to get to the Partitions parameter
> containing the actual Partitioncollection but this might get you going.
>
> var oPassstuff = EnumElements( GetCurrentPass() )
> for(i=0; i<oPassstuff .count; i++)
> {
>  if (oPassstuff(i).name == "Partitions")
>  {
>   var oParts = EnumElements( oPassstuff(i) );
>   for(p=0; p<oParts.count; p++)
>   {
>    LogMessage(oParts(p));
>   }
>  }
> }
>
> Cheers,
> Felix
>
>
> Bernard Lebel wrote:
> > Hello,
> >
> > Sorry for the resend, but didn't get any answer. Is there a way to get
> > ALL the partitions from the pass? So far my code can collect the
> > backgroup partitions, but not additional ones under a pass.
> >
> >
> > // Get all passes
> > var oPasses = EnumElements( "Passes.List" );
> >
> > // Enumerate through passes
> > for( var oPassEnum = new Enumerator( oPasses ); !oPassEnum.atEnd();
> > oPassEnum.moveNext() )
> > {
> >     // Get pass
> >     var oPass = getvalue( oPassEnum.item() );
> >
> >     // Get pass elements, returns collection
> >     var oPassKids = EnumElements( oPass );
> >
> >     // Enumerate through children to find partitions
> >     for( var oPassKidsEnum = new Enumerator( oPassKids );
> > !oPassKidsEnum.atEnd(); oPassKidsEnum.moveNext() )
> >     {
> >         // Big problem: only the background partitions seem to be
> > accessible. There is no way to get other partitions.
> >         logmessage( oPassKidsEnum.item().fullname );
> >     }
> > }
> >
> > When I run this, I get this, even though I have additional partitions:
> >
> > //INFO : "Passes.Default_Pass.Partitions"
> > //INFO : "Passes.Default_Pass.Background_Objects_Partition"
> > //INFO : "Passes.Default_Pass.Background_Lights_Partition"
> > //INFO : "Passes.Default_Pass.RenderOptions"
> > //INFO : "Camera"
> > //INFO : "Passes.Default_Pass.EnvironmentShaderStack"
> > //INFO : "Passes.Default_Pass.OutputShaderStack"
> > //INFO : "Passes.Default_Pass.VolumeShaderStack"
> > //INFO : "Passes.Default_Pass.Name"
> >
> >
> >
> > I'm wondering what the heck is that Partitions object. I've run some
> > tests to find what it is, and seems to be a parameter.
> >
> > var oPartitions = dictionary.getobject( "Passes.Default_Pass.Partitions"
> > );
> > logmessage( oPartitions.type );
> > logmessage( classname(oPartitions) );
> > logmessage( oPartitions.value );
> >
> > Logs
> >
> > //INFO : "Partitions"
> > //INFO : "Parameter"
> > //INFO : ""
> >
> >
> >
> > Any suggestion to reliably get all partitions under a pass would be a
> > godsend.
> >
> > Thanks
> > Bernard
>
> ---
> Unsubscribe? Mail Majordomo@(protected) with the following text in body:
> unsubscribe xsi
>
---
Unsubscribe? Mail Majordomo@(protected) with the following text in body:
unsubscribe xsi