Click or drag to resize
AB4D logo

DXViewGetSceneNodeForWpfObject Method

GetSceneNodeForWpfObject returns the SceneNode in DXScene that was created to represent the wpfObject. The method returns null if SceneNode is not found.

Namespace: Ab3d.DirectX.Controls
Assembly: Ab3d.DXEngine.Wpf (in Ab3d.DXEngine.Wpf.dll) Version: 7.0.8865.1045
Syntax
C#
public SceneNode GetSceneNodeForWpfObject(
	Object wpfObject
)

Parameters

wpfObject  Object
WPF object

Return Value

SceneNode
SceneNode in DXScene that was created to represent the wpfObject or null if SceneNode is not found.
Remarks

GetSceneNodeForWpfObject returns the SceneNode in DXScene that was created to represent the wpfObject.

GetSceneNodeForWpfObject should be called after SceneNodes are created from WPF 3D objects. This can be done with using the DXSceneInitialized event - for example:

Example
C#
MainDXViewportView.DXSceneInitialized += delegate(object sender, EventArgs args)
{
    // Called after after SceneNodes are created and before RenderingQueus are filled (before they are rendered for the first time).
    if (MainDXViewportView.DXScene == null) // DXScene can be null in case of WPF rendering
        return;

    var boxSceneNode = MainDXViewportView.GetSceneNodeForWpfObject(BaseBoxVisual3D);
};

TIP:
To get all the SceneNode objects created by DXEngine, you can call the MainDXViewportView.DXScene.DumpSceneNodes() method in Visual Studio's Immediate Window. You can also use the DXEngineSnoop (in Tools folder) and in the actions menu select "Dump SceneNodes"

See Also