I have not tested it but sometimes when you assign a value to a
variable by calling a member attribute it returns null, so you only to
test null.
Example:
var oPar = oObject.parameters( "<parameter name>" );
if( oPar == null )
logmessage( "Parameter " + "<parameter name"> + " not found.", siError )
In this case, perhaps doing something similar with the Material
attribute might work:
var oPartMat = oPartition.material
if( oPartMat == null )
logmessage( "Partition has no material" );
Cheers
Bernard
On 5/24/07, squid <squid(at)3d-palace.com> wrote:
test for 'Nothing' as a return ?
Adam Seeley wrote:
> Hi,
>
> Another basic scripty question (in VB).
>
> I'm looping through the Partitions in a Pass and printing out the Material names.
> This is fine if there is a Material, but falls over if none exists.
> How do I check to see if it exists at all before I hit an error?
>
> E.g.
> for each oPartition in oPartitionList
>
> logmessage oPartition.name
> if oPartition.Material <> false then logmessage "MATERIAL : " & oPartition.Material.Name
>
> next
>
> Will give
>
> 'INFO : Background_Objects_Partition
> 'INFO : MATERIAL : Scene_Material
> 'INFO : Background_Lights_Partition
> 'ERROR : Object variable not set - [line 27]
>
>
> Thanks again,
>
> Adam.
>
>
> No virus found in this outgoing message.
> Checked by AVG Free Edition.
> Version: 7.5.467 / Virus Database: 269.7.6 - Release Date: 20/05/2007 00:00
>
>
> ---
> Unsubscribe? Mail Majordomo(at)Softimage.COM with the following text in body:
> unsubscribe xsi
>
>
>
---
Unsubscribe? Mail Majordomo(at)Softimage.COM with the following text in body:
unsubscribe xsi
---
Unsubscribe? Mail Majordomo(at)Softimage.COM with the following text in body:
unsubscribe xsi