POV-Ray : Newsgroups : povray.general : test if object has been created : test if object has been created Server Time
5 Sep 2024 18:41:45 EDT (-0400)
  test if object has been created  
From: [GDS|Entropy]
Date: 7 Mar 2009 19:12:23
Message: <49b30d67$1@news.povray.org>
How might one test if an object has been created by a macro which may or may 
not produce an object, based upon various unpredictable factors? I'm trying 
to avoid the "need more than 1 object in csg" warnings.

If you place the macro call within an if statement, would it return true if 
an object has been created, and false if not?

If yes, would this be done like:

#local this = myMacro(params);
#if (this)
 union {
  object {this}
  someObject {}
 }
#end

Would it be better to perform an isCreated() test in the macro itself?

Just FWIW, I am making an extensible vine/ivy/moss/mushroom macro from a 
combination of Ron Parkers traceVines.pov (whose functionality I have 
decoupled from its intended use to facilitate extensibility) and calls to 
various macros from my framework. Its looking pretty damn good so far too. 
:-D

thanks!
ian


Post a reply to this message

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