X3DObject.RemoveFromParent

説明

この子オブジェクトとその親との間の階層リンクを切断します。このオブジェクトは、自動的にX3DObjectシーンルートの下に移動します。この操作は、シーンルートの子オブジェクトには影響を与えません。

スクリプト 構文

X3DObject.RemoveFromParent();

VBScript の例

NewScene , false
set oRoot = Application.ActiveProject.ActiveScene.Root
set oSphere = oRoot.AddGeometry( "Sphere", "NurbsSurface" )
set oCube = oRoot.AddGeometry( "Cube", "NurbsSurface" )
for each oChild in oRoot.Children
        Application.LogMessage oChild.Name
next
Application.LogMessage "Remove"
oSphere.RemoveFromParent
for each oChild in oRoot.Children
        Application.LogMessage oChild.Name
next
' Expected results:
'INFO : Camera_Root
'INFO : light
'INFO : sphere
'INFO : cube
'INFO : Remove
'INFO : Camera_Root
'INFO : light
'INFO : cube
'INFO : sphere