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?
 
Testing for presence of property

Testing for presence of property

2004-03-20       - By kim aldis

 Back
Reply:     1     2     3     4     5     6     7  

Try {
  // Get selected object
  var oSel = Selection(0);

  // Create enumator and populate with shaders of selection var
  e = new Enumerator( oSel.shaders );

} catch(ee) {
  logmessage( "oops" );
}

 

> -- --Original Message-- --
> From: owner-xsi@(protected)
> [mailto:owner-xsi@(protected)] On Behalf Of Bernard Lebel
> Sent: 20 March 2004 12:30
> To: XSI@(protected)
> Subject: [Script] Testing for presence of property
>
> Hello,
>
> Let say I want to check if a camera has any shader attached.
> If it has some, using the "shaders" property will work fine.
>
> But if there are no shaders, an 2000-unspecified failure will
> be thrown and the script will abort.
> Is there any way I can check if the shaders property is
> present on the object?
>
> Example of script that fails:
>
> // -- ------ Start here -- ---- -----
>
> // Get selected object
> var oSel = Selection(0);
>
> // Create enumator and populate with shaders of selection var
> e = new Enumerator( oSel.shaders );
>
> // -- ------ End here -- ---- -----
>
>
> Another example:
>
>
> // -- ------ Start here -- ---- -----
>
> // Get selected object
> var oSel = Selection(0);
>
> // Test if there are shaders attached to selection if(
> !oSel.shaders ) {
>      logmessage( "No shader attached to selection." ); }
>
> // -- ------ End here -- ---- -----
>
>
> 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