Maybe you can do a check before you parent:
var oObj= CreatePrim("Cube", "MeshSurface", null, null);
var oParent = ActiveSceneRoot;
if ( oObj.Parent.IsEqualTo( oParent ) == false)
{
ParentObj(oParent, oObj);
}
On Mon, Jan 20, 2014 at 4:25 AM, Eugen Sares <[email protected]> wrote:
> Hi,
> for the sake of cleanness in my code - is there a way to hide the error
> message that shows when trying to parent an object to something that it is
> already child of?
> Can't get that try catch trick to work.
> Thanks!
> Eugen
>
>
> var oObj= CreatePrim("Cube", "MeshSurface", null, null);
> var oParent = ActiveSceneRoot;
> //ParentObj(oParent, oObj); // WARNING : 3030-EDIT-ParentObj - Command was
> cancelled.
> try
> {
> ParentObj(oParent, oObj);
> }
> catch(e)
> {
> //LogMessage(e);
> }
>
>
>
>
> ------------------------------
> <http://www.avast.com/>
>
> Diese E-Mail ist frei von Viren und Malware, denn der avast!
> Antivirus<http://www.avast.com/>Schutz ist aktiv.
>
>