Mod Tool: Difference between revisions

1,213 bytes added ,  5 August 2012
m
no edit summary
mNo edit summary
mNo edit summary
Line 51: Line 51:




===view port navigation===
===camera navigation===
* move camera: [S]+[LClick]+[Moving_Mouse]
* move camera: [S]+[LClick]+[Moving_Mouse]
* rotate camera: [S]+[RClick]+[Moving_Mouse]
* rotate camera: [S]+[RClick]+[Moving_Mouse]
Line 59: Line 59:


===mesh===
===mesh===
* copying a edges from an object: select the edges, right-click, "Extract Edge as Curve", to preserve the shape use "Mesh Subdivision Level: 0" as option
* extracting a polygon from an object: select polygon, right-click, "Extract Polygons (Delete)"
* extracting a polygon from an object: select polygon, right-click, "Extract Polygons (Delete)"
* copying an polygon from an object: select polygon, right-click, "Extract Polygons (Keep)"
* copying an polygon from an object: select polygon, right-click, "Extract Polygons (Keep)"
Line 140: Line 139:
* You can also change the language by right-click the white script box and click on "Set to JScript" or "Set to VBScript".
* You can also change the language by right-click the white script box and click on "Set to JScript" or "Set to VBScript".
* Same way you can load a few code piece, e.g. "Syntax Help" > "If..Else" or "Catch Error".
* Same way you can load a few code piece, e.g. "Syntax Help" > "If..Else" or "Catch Error".
* Mark code you want to disable ("Comment Out") with single apostrophes or enable ("Comment Remove").
* Mark code you want to disable ("Comment Out") with single apostrophes ' or enable ("Comment Remove").
* In VBS you declare variables only as a variant e.g. "dim PolygonCount". Mod Tool decides what type it becomes when it uses the variable the first time.
* In VBS you declare variables only as a variant e.g. "dim PolygonCount". Mod Tool decides what type it becomes when it uses the variable the first time.
* The commands are not case-sensitive, e.g. you can write ''LogMessage'' or logmessage.
* Some common vbs functions can be found [http://www.w3schools.com/vbscript/vbscript_ref_functions.asp HERE.]
' while it is possible to use + in strings,
' you should actually use & only for strings
' and + only for numbers
logmessage "How about ... " + "a riddle?"
logmessage "Where can you find following phrase in Oni? " & "The day is mine !!"
logmessage "Did you know that Bungie likes to hide sevens? The digits of the year 2032 add up to " & cstr(2 + 0 + 3 + 2) & "."
' INFO : How about ... a riddle?
' INFO : Where can you find following phrase in Oni? The day is mine !!
' INFO : Did you know that Bungie likes to hide sevens? The digits of the year 2032 add up to 7.




'''some VBS commands that might interesting for Oni related stuff'''
'''some VBS commands that might be interesting for Oni related stuff'''


{| class="wikitable" width="100%"
{| class="wikitable" width="100%"
| width=50% valign=top | LogMessage <nowiki>[string|var]</nowiki>
| width=50% valign=top | LogMessage <nowiki>[string | var]</nowiki>
| A command to log information. It requires a string or a variable. Example:
| A command to log information. It requires a string or a variable. Example:
: LogMessage "The object's name is: " & selection(0).Name
: LogMessage "The object's name is: " & selection(0).Name
Line 197: Line 210:
:5 = ZYX
:5 = ZYX
|-
|-
|valign=top| SelectObj <nowiki>[string|var]</nowiki>
|valign=top| SelectObj <nowiki>[string | var]</nowiki>
| select one or more objects. Comma serves as separator. Example:
| select one or more objects. Comma serves as separator. Example:
: SelectObj "grid,grid1"
: SelectObj "grid,grid1"
|-
|-
|valign=top| ToggleSelection <nowiki>[string|var]</nowiki>
|valign=top| ToggleSelection <nowiki>[string | var]</nowiki>
| Adds one or more objects from current selection. If the objects are already selected then they become subtracted from the selection. Example:
| Adds one or more objects from current selection. If the objects are already selected then they become subtracted from the selection. Example:
: ToggleSelection "grid2,grid3"
: ToggleSelection "grid2,grid3"
Line 215: Line 228:
| deselects everything
| deselects everything
|-
|-
|valign=top| DeleteObj <nowiki>[string|var]</nowiki>
|valign=top| DeleteObj <nowiki>[string | var]</nowiki>
| Deletes one or more objects. Comma used as separator. Example:
| Deletes one or more objects. Comma used as separator. Example:
: DeleteObj "grid"
: DeleteObj "grid"
Line 303: Line 316:
  logmessage selected(i)
  logmessage selected(i)
  next
  next
' '''converting euler rotations (in degrees) to quaternions
dim x, y, z, dRotation, qRotation
x = 90
y = 0
z = 0
set dRotation = XSIMath.CreateRotation(XSIMath.DegreesToRadians(x), XSIMath.DegreesToRadians(y), XSIMath.DegreesToRadians(z))
set qRotation = XSIMath.CreateQuaternion()
dRotation.GetQuaternion (qRotation)
LogMessage qRotation.W
LogMessage qRotation.X
LogMessage qRotation.Y
LogMessage qRotation.Z
' INFO : 0,707106781186548
' INFO : 0,707106781186547
' INFO : 0
' INFO : 0
' '''converting quarternions to euler rotations (in degrees)'''
dim qW, qX, qY, qZ, qRotation, x, y, z
qW = 0.707106781186548
qX = 0.707106781186547
qY = 0
qZ = 0
set qRotation = XSIMath.CreateQuaternion (qW, qX , qY, qZ)
qRotation.GetXYZAngleValues x, y, z
logmessage XSIMath.RadiansToDegrees(x)
logmessage XSIMath.RadiansToDegrees(y)
logmessage XSIMath.RadiansToDegrees(z)
' INFO : 89,9999999999999
' INFO : 0
' INFO : 0




Line 313: Line 367:
* copying animation data from one character to another
* copying animation data from one character to another
* creating new door animations
* creating new door animations
' VBScript code
set oRotation = XSIMath.CreateRotation( XSIMath.DegreesToRadians( 40 ), XSIMath.DegreesToRadians (0), XSIMath.DegreesToRadians (0) )
set oQuaternion = XSIMath.CreateQuaternion()
oRotation.GetQuaternion( oQuaternion )
Application.LogMessage "Quaternion rotation is " _
& oQuaternion.X & "," _
& oQuaternion.Y & "," _
& oQuaternion.Z & "," _
& oQuaternion.W


After a few experiments onisplit v0.9.54.0 seems to output XYZ-W instead of XYZW.
After a few experiments onisplit v0.9.54.0 seems to output XYZ-W instead of XYZW.
8,452

edits