Mod Tool: Difference between revisions

794 bytes added ,  20 September 2012
m
scripting: getting bounding box values (should be useful for OFGA)
mNo edit summary
m (scripting: getting bounding box values (should be useful for OFGA))
Line 358: Line 358:
| [29] disabling PPG popups
| [29] disabling PPG popups
| [30] disabling logmessages
| [30] disabling logmessages
|-
| [31] getting bounding box values
|
|
|}
|}


Line 910: Line 914:
  setvalue "preferences.scripting.msglogverbose", false
  setvalue "preferences.scripting.msglogverbose", false
  setvalue "preferences.scripting.msglog", false
  setvalue "preferences.scripting.msglog", false
' '''[31] getting bounding box values'''
' this could be useful to a create bounding box for [[OBD_talk:OFGA#XML|OFGA files]]
' let's get the bounding box of a simple cylinder
' the output values will be absolute positions
CreatePrim "Cylinder", "MeshSurface"
dim xmin, ymin, zmin, xmax, ymax, zmax
dim list
'if you use SelectionList the objects will be treated as one single object
'set list = GetValue( "SelectionList" )
set list = GetValue( selection(0) )
GetBBox list, TRUE, xmin, ymin, zmin, xmax, ymax, zmax
LogMessage "Lower Bound: " & xmin & " / " & ymin & " / " & zmin
LogMessage "Upper Bound: " & xmax & " / " & ymax & " / " & zmax
' expected output:
' INFO : Lower Bound: -1 / -2 / -1
' INFO : Upper Bound: 1 / 2 / 1




8,452

edits