trueSpace Tips & Tricks

Modelspace

The startup menu (accessible by holding the CTRL key while starting trueSpace) allows you to start trueSpace in any real time mode, as well as start a “clean” trueSpace session without automatically loading any stored configurations and projects.

[From United3dArtists forum author marcel]http://www.united3dartists.com/forum/viewtopic.php?f=39&t=2214:

You know TS is not a perfect software because it have a lot of bug. Most of them can be resolved when you know a trick like this (model side only):

– If you have a problem when you try to edit an object (TS crash), try to export the object with luuv (.obj) then import the new object and put it instead of the bad TS object in the scene. Edit mode could work now. I think because there is a bad thing saved with the TS object.

– if TS crash when you change the material of an object (wireframe), most of the time it is when TS do a render of the object. to avoid this problem use solid mode before apply a new texture. with solid mode TS don’t use Lightwork to show the new material on the screen.

– if TS crash when you change the view on a windows (ex: when you create a cam then open a windows), be sure you are on wireframe mode before you selected the cam icon of the windows to change the view.

-The best way to clean a bad TS scene (most of the time it is a problem with both side together) is to save each object (model, light, cam,…) as .cob then close TS, open TS, bridge off, open a new scene and load all the object to create a new scene without problem and keep brigde off.

– if you work on model side but you need a tool from workspace (displacement, hair,..) create a temporary scene, put bridge on and do what you need on the workspace. then on model side save the result as a .cob object. Turn bridge off and open your scene to add the new object.

– a .scn file can be ten time smaller than the same created with both side and with less problem. Be carefull about that and you can to continue to work with the model side with less RAM allowed for the workspace and more RAM for you.

Workspace

Files to delete for “clean” session, may also help some model side problems

C:\trueSpace761\tS\default.ctx
C:\trueSpace761Std\default.ctx

The Windows Manager Space node under Project has an attribute called “ShowFullPath”. Change this from 0 to 1 to show the full paths of nodes under Project in the title bar.
info panel math: +,-,*,/,sin,cos,arcsin,arcos,ln,log,exp,sqrt,PI

soft paint has a morph mode to paint one morph into another

truespace can save bvh files

LE panel editor – shift + size a control will effect entire row/column

It is possible to change topology after a vertex morph already defined

Primitive tool

   * Adding a cube. There are 3 modes how to add a cube.
         o Diagonal – this is Modeler way. LClick to define first corner, drag and rclick do define second corner.
         o Edges – define cube by defining two edges. First click & drag defines bottom X edge. Second click&drag defines Z edge.
         o Corners – cube is created after adding 4 points. (you can either click or drag to use xy or z movements).
   * For adding torus, sphere, cylinder, cone there are 2 modes.
         o Diameter – define diameter for base, by ldrag, rdgar defines height.
         o Radius - define center + radius for base, by ldrag, rdgar defines height.
   * Adding text has only one mode; ldrag + rdrag defines orientation of text XY plane rotation.
   * Primitive employs extensive snapping.
   * You can specify height directly by snapping to other objects during rdrag. Primitive base can be precisely aligned by
constraining movement to 1D and aligning with other objects like in rdrag mode. Constraining can be done either by locking
axes or locking to edges / faces.
   * You can specify edge endpoint (diagonal, radius…) in plane mode directly by snapping to other objects by holding ALT key.
   * ALT key can be used to force snapping even if cursor is in nosnap range defined by added primitive and nosnap radius
found in tool preferences panel.
   * To finish primitive tool, rclick in player view.
   * To access primitive preferences panel, rclick on appropriate tool button. To access primitive tool preferences panel,
rclick on any primitive tool and change preferences panel aspect to default.

Select by bounding box => smaller object has higher priority

Workspace View - Transparency
   * New Show hidden faces option in object and layer render attributes (Player - Rendering) allows to display otherwise
invisible faces of transparent objects.
   * New Transparency Mode option allows choosing transparent faces sorting option. No solving mode displays objects without
reorder. Triangle sort option is a bit slower and uses distance of triangles from the viewer to draw distant triangles first.
Transparency mode option is ignored when Show hidden faces is not enabled.
   Snapping & constraints
   * Snapping and constraints are used to allow high precision modeling. Snapping tools compute nearest position that may be
useful (grid point, vertex, edge…) and constraints lock movement to specified direction(s). These tools are accessible from
Player toolbar. Tool is activated by clicking on it; additional tool properties are accessible by rclicking on the tool icon.
Panels for snapping tools are located in preferences encapsulator (/Preferences/Snapping/ and /Preferences/Snapping/Point edit
snapping).
   * Snapping & constraints can be combined and activated together. For example you can have active grid snapping and snap to
edge at once. Then when moving or drawing a polygon nearest point will be used as a snap position. This is also valid for
constraints, for example when constraining movement to two non-parallel planes movement will be constrained to their
intersection.
   * You can have as many snapping managers as you wish, movement widget tools are now extended to contain snapping group
name. In this way you can add special controls to widgets that will cause snapping to selected elements, whereas other
controls can move without snapping or constraints. (Interesting?)

General Snapping & constraints

   * Grid snapping – snaps to grid when moving. There are two modes for grid snapping – Absoulte and Relative. Absolute mode
snaps in selected coordinate system where origin is defined by Offset parameters, Relative mode takes widget position as an
origin (so it snaps to original position). Mode is changed by checkbox near offset parameters. Step defines density of the
grid. When set to 0, snapping along that axis is disabled:
   * Axes locks – can be used to lock movement direction to selected axes(X,Y,Z checkboxes). If you check 2D in ortho view
than X and Y axes will be mapped according to camera view when using orthogonal views. Angle specifies rotation of axes in 2D
views and allows rotating constraint axes according to your needs.

Point edit Snapping & constraints

   *
     Showing properties panel will show default aspect of point edit snapping tools. Panel contains settings for both vertex
snapping and lock to selection constraint.
   *
     Vertex snapping snaps selected vertices to various positions when they are moved. Snap to vertices enables vertex to
vertex snapping. Snap to edges enables vertex to edge snapping. Edge points specifies count of internal edge points that
vertices will be snapped to. This setting requires that edge snapping is enabled. Setting to 0 will turn snapping to edge
mid-points off. Snap to faces controls vertex to face snapping.
   *
     Lock to selection constraint tool allows to constraint movement to specified plane or edge similar to axes locking.
Select a face or edge and press Set button to use face or edge plane as constraint direction.
   Note: Both vertex snapping and lock to selection have advanced panels that are accessible by changing aspect of point edit
snapping panel. 
   * Vertex snapping:
         o Snap Pairs control whether to snap widget position or perform snapping between vertices and all enabled elements.
         o Snap distance defines radius for snapping in screen pixels. In 3D depth is also restricted to snap distance, in 2D
depth is ignored.
         o Marker specifies vertex size and color for position when it is not active.
         o Snap defines vertex size and color for vertex when snapped.
         o Only face edges will disable snapping to internal face edges.
   *
     Select lock:
         o
           Marker color and Transparency define properties of marker that is displayed to show movement constraints.

Using point edit snapping & constraints

   *
     To use the tool point edit snapping, enable required snapping modes, make a selection and move it with point edit widget.
         o
           When vertex gets snapped, snap will be showed by displaying snapped vertex with Snap color.
         o
           If you snap any vertex to edge or triangle and hold shift, tool will show guide line and movement will get
constrained to that edge or plane.
         o
           If you have enabled edge points and you snap to edge, snapping positions will be evaluated also outside that edge.
         o
           Possible movement will be shown by rectangles with Marker properties.
   *
     Snapping to face and pressing shift will constraint to 2D plane.Not so sure about that
         o
           When constraints are active, snapping continues to work and you can move vertex and snap it to selected snapping
elements.
         o
           Following image shows case when vertex was snapped to face and shift was pressed. Then the vertex was moved in XZ
plane (the plane was rotated to constraint space) and snapped to face.
         o
           Yellow dashed lines show constraint space, top yellow triangle shows face triangle that defines constraint plane,
middle yellow triangle shows face that vertex is snapped to.
         o
           When guideline is showed, you can use Ctrl to specify perpendicular direction constraint. With Ctrl pressed, your
movement will be constrained to perpendicular motion to edge or face. (Is this true?)
   *
     Snapping for other tools work similarly.

Using Lock to selection

   * To use the tool, in point edit mode select face, two faces or edges.
         o When selecting face, movement will be constrained to that face. This will be visualized by showing 2 arrows from
face center.
         o When selecting two faces, movement will be constrained to edge defined by intersection of two planes.
         o When selecting edges, movement will be constrained to 1D.
   * This tool is useful when modeling in 2D views where 3rd coordinate can be automatically computed from constraints (for
example when modeling a roof on a house).
   * To set constraint, make a selection and press Set button in Point edit snapping panel. To remove constraints, press Reset
button.
Polygon draw
   * Polygon draw tool allows directly drawing faces or edges during point edit mode.
   * Activate the tool by clicking on Polydraw tool icon in Player toolbar.
   * When selected object is not in point edit mode tool will activate it.
   * You add vertices connected by edges, by clicking on the mesh faces.
   * To modify vertex position during polygon draw, drag existing vertex.
   * To add new vertex on the edge, click on it.
         o When hovering above edge, Polydraw tool shows highlite of vertex that will be added.
         o To remove the vertex, move the vertex you want to delete to another vertex.
         o Tool will not allow creating invalid geometry. When trying to create bad polygon highlite will show in red.
         o To close the loop, click on the first vertex.
         o You can draw polygon across multiple faces, but edges need to pass thru edges or vertices on neighboring faces.
         o When you draw acceptable set of edges, Polydraw will change highlite to selection color.
               + When you activate other widget tool in this state, tool will finish without closing whole polygon. This
behavior is intended for drawing edges or adding vertices.
Snapping and Polydraw
   * You can use snapping with Polydraw:
         o simply enable or disable snapping & constraint tools when drawing polygons.
         o Activate guideline by snapping current vertex to edge and press shift key. If you want to move in perpendicular
direction, hold shift and ctrl.(that ctrl bit part may not work)

Extract a deformed mesh from a character by running the Flatten History tool. Open 2 Link Editor windows one to the scene and one to the Actor node. Ctrl – drag the mesh node out of the Actor and into the scene.

C++ handle to window

truespace 6

HWND tswnd;
tswnd = tsxGetMainViewHwnd();

truespace 7.6

HRESULT hr;
HWND tswnd;
// get Window manager package
CComPtr spKernelPackage;
hr = CRpExamplesPlugin::GetKernelPackage(&spKernelPackage);
if (FAILED(hr))
   return hr;
CComPtr spPackage;
hr = spKernelPackage->FindPackage(DEF_GUIDNAME(CRpWinMng), &spPackage);
if (FAILED(hr))
   return hr;
CComQIPtr spWinPackage = spPackage;
// get windows manager node
CComPtr spWinMgrNode;
hr = spWinPackage->GetWindowsManagerNode(&spWinMgrNode);
if (FAILED(hr))
   return hr;
CComQIPtr spWinMng = spWinMgrNode;
spWinMng->get_MainWindowHandle(&tswnd);

trueSpace Scripting Matrix

Matrix multiplication

myMatrix.LoadIdentity();
rollMatrix.LoadIdentity();
yawMatrix.LoadIdentity();

yawMatrix.SetYaw(22);
rollMatrix.SetRoll(13);

last rotation
myMatrix.SetPitch(-90);// myMatrix = -90 deg pitch

(this is the second rotation)
myMatrix.Mult(rollMatrix);// rollMatrix * myMatrix => myMatrix

(this is the first rotation)
myMatrix.Mult(yawMatrix);// yawMatrix * myMatrix => myMatrix

myMatrix is yaw 22 deg then roll 13 deg then pitch -90 deg

Local matrix from world matrices

theMatrix = Node.Value(bindgroup + "/" + subNode, "WldMatrix");
parentMatrix = Node.Value(bindParent, "WldMatrix");
parInvert = parentMatrix.Invert();
theMatrix.Mult(parInvert);

//now theMatrix contains local instead of world

trueSpace Scripting Selection

Space.Select() – select multiple nodes from text string separated by semi colons, node paths in the list must not have leading spaces

Node.Selection() – returns a selection list with a semicolon delimination, but has leading spaces in each nodes path so needs to be adjusted to work with Space.Select

sel = Node.Selection();
selArray = sel.split(";");
re = /^\s/; // whitespace in first character position
sel = selArray[0].replace(re,"");
if(selArray.length > 1)
	for(i=1;i<selArray.length;i++)
		sel = sel + ";" + selArray[i].replace(re,"");

Node.Select – select one node

Space.Unselect()