Mod Tool: Difference between revisions

1,484 bytes added ,  31 October 2012
m
no edit summary
mNo edit summary
mNo edit summary
Line 491: Line 491:
| [31] getting bounding box values
| [31] getting bounding box values
| [32] open an explorer window
| [32] open an explorer window
|
| [33] working with hierarchies
|}
|}


Line 1,274: Line 1,274:
  Set objShell = CreateObject("Wscript.Shell")
  Set objShell = CreateObject("Wscript.Shell")
  objShell.Run strPath
  objShell.Run strPath
' '''[33] working with hierarchies'''
' let's be sure we have an object selected
if selection.count > 0 and typename(selection(0)) = "X3DObject" then
 
' the object itself
logmessage selection(0)
' the parent object
logmessage selection(0).parent
' the children
for each n in selection(0).FindChildren( , , , 0 )
logmessage n
next
' the 4the parameter of FindChildren can be set to 0 or 1
' with 0 you get all direct children
' with 1 you get everything located under that object no matter how deep the level
' count all objects
logmessage "children: " & selection(0).FindChildren( , , , 1).count
' caution: if the 3rd parameter is set to siMeshFamily
' then the selected object will be also counted
' find the root object of the hierarchy, any object could be selected
SelectNeighborObj selection(0), 4
' go through the hierarchy in different directions
' SelectNeighborObj [parameter1], [parameter2], [parameter3], [parameter4]
' options of the second parameters
' 0 go one level up
' 1 go one level down
' 2 go to next silbing
' 3 go to previous silbing
' 4 go to highest level
' 5 go to deepest level
' select the hierarchy as a whole
SelectObj "left_thigh", "TREE", true
' first parameter could be any object of the hierarchy
' after using this the selection of an Oni character will be "B:pelvis"
else
msgbox "no object was selected"
end if


8,452

edits