POV-Ray : Newsgroups : povray.general : How to permit null objects? : Re: How to permit null objects? Server Time
8 Aug 2024 14:17:38 EDT (-0400)
  Re: How to permit null objects?  
From: Disnel
Date: 9 Feb 2001 06:03:10
Message: <3A83DE66.38DF64BC@hlavacek-partner.cz>
When I want use something like null object in macro parameters I use
array instead of variable:

#macro SomethingWithPossibleNullObject(Object)
  #ifdef (Object[0])
    // Work with it
  #else
    // No object
  #end
#end

SomethingWithPossibleNullObject(array[1])  // Null object
SomethingWithPossibleNullObject(array[1] { sphere{<0, 0, 0>, 1 }) //
Work with sphere

Regards

Disnel


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.