eon.Find(name, root, maxdepth)
eon.Find(name, root)
eon.Find(name)
eon.Find(regex, root, maxdepth)
eon.Find(regex, root)
eon.Find(regex)
Example 1 in VBScript:
Set nodes = EON.Find("Ambient", aNode)
eon.trace("nodes.Count = "& nodes.Count)
If ( (nodes.Count > 0) ) Then
Set firstNode = nodes.Item(0)
End If
Example 2 in VBScript:
rootnode_path = "simulation!scene!cube1"
Set rootnode = EON.FindNode(rootnode_path)
Set rexp = new Regexp
rexp.pattern = "Rot.*"
maxdepth = 1
Set nodes = EON.Find(rexp, rootnode, maxdepth)
For Each n in nodes
Set nn = n
eon.Trace("Found node " & eon.GetNodeName(n) )
End If
Next
FindNode()
Sub On_MoveCamera
' Find the Camera node
set CameraNode=EON.FindNode("Camera")
' Get a reference to the camera position
set Pos=CameraNode. GetFieldByName ("osition")
' Get the value
p=Pos.Value
' Increase the x pos
p(0)=p(0)+MoveCamera
' Assign a new value to the camera position
Pos.Value=p
end sub
为寻找Camera节点,EON函数FindNode将派上用场:
set CameraNode=EON.FindNode("Camera")
当一个参考窗口节点被保留,那必可找到位置(position)字段:
set Pos=CameraNode. GetFieldByName ("osition")