Mod Tool

From OniGalore
Revision as of 20:23, 2 August 2012 by Paradox-01 (talk | contribs) (Created page with "==versions== Various modders of the community use "Autodesk Softimage Mod Tool". Usually we just call it "Mod Tool". Beside the free version, there's also the retail and student...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

versions

Various modders of the community use "Autodesk Softimage Mod Tool". Usually we just call it "Mod Tool".

Beside the free version, there's also the retail and student version "Autodesk Softimage [year]"

Those versions are also available as 64-bit versions.
If you are a student you can get Autodesk Software for free if your school is a partner of Autodesk.
In that case you can register with your email address given by your school.

But in the very most cases "Mod Tool" isn't really in disadvantage towards the retail version when it comes to modding Oni.


There's also the possibility to get files that extent Mod Tool's range of functions.

Those are scripts (*.vbs, js), toolbars (*.xsitb) and addons (*.xsiaddon).
They can be create on one's own and even shared with other users.


links to resources

  • OBJ exporter
  • OBJ / OFGA exporter for Oni (soon)
    • might need the regular OBJ exporter to be installed first
  • put more links here


extensions

how to bind scripts to buttons


how to install toolbars


how to install addons


selected wisdom

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)"
  • copying an polygon from an object: select polygon, right-click, "Extract Polygons (Keep)"
  • merging two objects: select one of them, goto Model>Modify>Poly.Mesh>Boolean>Union, select second object
(this makes a copy of the second object and attaches it to the first one, the merged objects must be freezed before the original second object can be removed)
  • filling a hole: select all edges surrounding the hole and choose one of the following methods
    • A) goto Model > Modify > Poly.Mesh > Weld Boundary Points/Edges
    • B) goto Model > Modify > Poly.Mesh > Bridge Boundary Points/Edges (if blue lines appear try to disable the checkbox "Angle > 90")
  • merging two objects at blue lines: merge the objects at first, then proceed with the point above "filling a hole"
  • hiding a single polygon: select polygon and hit [H], use [Control]+[H] to unhide
  • mirroring an object: select object, Edit > Duplicate/Instantiate > Duplicate Symmetry (center rotation might need to be changed afterwards)
  • working with symmetry mode
    • select object, Property > Symmetry Map (YZ/XZ/XY) (press [W] to preview symmetry plane)
    • click on Sym buttom (in Transform area) to enable/disable symmetry mode
    • changing the Symmetry plane: Explorer [8] > unfold object > Polygon Mesh > Cluster > delete SymmetryMapCls; then add a new symmetry plane


material and texture

  • objects use the scene material by default, objects need their own material if they should have individual textures
  • selecting a material and surface: Model>Material>Phong (simply close the windows that pops up)
  • connecting the texture with the material:
    • [7] to open Render Tree
    • in first column: "Texture"
    • in second column: drag'n'drop "Image" into the free space
    • click and hold the red point of "Image", then move it to "Phong" and release the mouse click
    • choose "diffuse" as illumination mode (for instance "ambient" won't work - the texture would be visible in Mod Tool but Onisplit can't use it)
  • now "Image" can be double-clicked (the Texture Editor will pop up), in the section "Image" click on "New" to choose an image


projection and UV

getting started

  • in section "Texture Projection" click on "New", choose a projection similar to the mesh shape (planar / cylindrical / cubic / spherical)
  • select the object
  • Texture editor: [Alt]+[7] (open it while being in selection mode "Object" or "Polygon", otherwise the UVs aren't shown)

modify single/all UVs

  • rotate 90°: [R]
  • rotate: [C]
  • scale: [X]
  • move: [V]
  • tearing single UV parts: [Control]+[T], then move [V]
  • heal (re-connect) selected UV parts: click on the plus symbol (the parts should be very near to each other, best if the points are on same spot)
  • snap function for move tool: Snap > Enable Snapping; check "Points" (if not already active)
  • relax (smooth warped UVs): [Control]+[R] (usually pressing several times that combination)
  • a new projection can also be applied to currently selected UV parts
  • freeze object to bake projections (green lines in the 3D view will disappear)
  • getting a picture of the UV: apply first a black texture then enter the Texture Editor [Alt]+[7], Edit > Stamp UV Mesh [Shift]+[S], save the texture


scripting

  • open the Script Editor: [Alt]+[4]
  • run the current code in the Script Editor window: [F5]
  • clear the log: Edit > Clear History Log
  • actions from button embedded code will be logged
  • actions from code files that are linked in a button won't be logged (results in a performance boost)


links


notes about polygon extraction

  • a grid of 9 polygons (ID 0 to 8)
  • you extract the middle polygon (ID 4)
  • grid's polygon of ID 8 will change to ID 4
  • if you now extract 5th, the 7th gets the ID
  • now the ID order is: 0, 1, 2, 3, 6, 5, 4
  • this means that an automatic extraction of several polygons requires two changes in the code
  • 1) the ID array of selected polygons must be sorted
  • 2) the extraction must start with the last ID to avoid ID shift during the process (see code pieces)


some basic stuff for VB Script

Logged stuff will be rewritten if you change the script language. (File > Preferences...)
LogMessage [string|var] A command to log information. It requires a string or a variable. Example:
LogMessage "The object's name is: " & selection(0).Name
logmessage selection(0).Name Logs the object name.
logmessage selection(0).Material.Name Logs the material name.
logmessage selection(0).Material.CurrentImageClip.Name Logs the texture name. "." before the file suffix is replaced by "_". Also a number might follow after the file suffix. Output example:
INFO : grid_part_8_tga4
logmessage selection(0).sclx.value Logs object's X scaling.
logmessage selection(0).scly.value Logs object's Y scaling.
logmessage selection(0).sclz.value Logs object's Z scaling.
logmessage selection(0).rotx.value Logs object's X rotation.
logmessage selection(0).roty.value Logs object's Y rotation.
logmessage selection(0).rotz.value Logs object's Z rotation.
logmessage selection(0).posx.value Logs object's X position.
logmessage selection(0).posy.value Logs object's Y position.
logmessage selection(0).posz.value Logs object's Z position.
logmessage selection(0).rotorder.value Logs object's rotation order.
0 = XYZ
1 = XZY
2 = YXZ
3 = YZX
4 = ZXY
5 = ZYX
SelectObj [string|var] select one or more objects. Comma serves as separator. Example:
SelectObj "grid,grid1"
ToggleSelection [string|var] 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"
SelectAllUsingFilter [SelFilter], [CheckComponentVisibility], [AffectSelectionList], [CheckObjectSelectability] Selects everything that matches the filter and other options. Example:
SelectAllUsingFilter "object", siCheckComponentVisibility
selects all roots, lights, cameras, and geometry (meshes)
SelectAllUsingFilter "geometry", siCheckComponentVisibility
selects all geometry (meshes)
DeselectAll deselects everything
DeleteObj [string|var] Deletes one or more objects. Comma used as separator. Example:
DeleteObj "grid"
DeleteObj "grid,grid1"
FreezeObj Makes all changes final. But saving those changes is still necessary. (Click on key symbol so it gets red.)
Translate [InputObjs], [X], [Y], [Z], [Delta], [RefMode], [Center], [AxesFilter], [Snap], [SnapReference], [SnapFilter], [SplitLocalComponents], [PropTagOnly], [Pivot], [PivotX], [PivotY], [PivotZ], [ConstructionMode], [SlideComponents] see link
Rotate [InputObjs], [X], [Y], [Z], [Delta], [RefMode], [Center], [AxesFilter], [Reference], [SplitLocalComponents], [PropTagOnly], [Pivot], [PivotX], [PivotY], [PivotZ], [ConstructionMode], [SlideComponents] see link


code pieces (VB Script)

' making an array
' make some object, select them and run the code

dim y
y = selection.count

redim x (y - 1)
	' redim is needed for arrays
	' () sets the number of array items
 
for i = 0 to y - 1
	x(i) = selection(i).fullname
	logmessage x(i)
next

logmessage "counted objects: " & y


' check selection mode 

checkfilter
'use sub to make use of the exit command

sub checkfilter
	Select Case Selection.Filter.Name
	'caution: case-sensitive

	Case "object"
		logmessage "object mode"
	Case "Edge"
		logmessage "edge mode"
	Case "Vertex"
		logmessage "point mode"
	Case "Polygon"
		logmessage "polygon mode"
		polymode
	Case Else
		logmessage "Choose Object or Polygon selection mode."
		exit sub
	End Select
end sub


' getting the IDs of selected polygons plus sorting them

poly_count = Selection(0).SubComponent.ComponentCollection.count
logmessage "poly_count: " & poly_count
redim selected (poly_count)
logmessage "Show ID as it is."
for i=0 to poly_count - 1
	' build ID array
	selected(i) = Selection(0).SubComponent.ComponentCollection(i).index
	logmessage selected(i)
next

' change sort order by replacing ">" with "<"
For i = 0 To poly_count - 1
	For j = 0 To poly_count - 1
		If selected(i) > selected(j) Then
			tmp = selected(i)
			selected(i) = selected(j)
			selected(j) = tmp
		End If
	Next
Next
logmessage "Show sorted ID."

for i=0 to poly_count - 1
	logmessage selected(i)
next


script ideas

  • making an import/export for some trigger volume data (semi-transparent cubes, the level geometry itself would just serve as reference)
  • hierarchy builder for characters
maybe null objects could stand for the centers of body parts Then one click and the centers gets positioned, rotations are known and the names lead to the correct hierarchy
  • autoheal discontinuities (blue lines) of overlaying edges (for repairing google sketchup objects that weren't yet textured)
  • making loops from parts of animations
  • copying animation data from one character to another