button notes

 

general notes for scripting buttons

var tbbutt = Node.Create(‘Windows Manager Package/Toolbar Button Item’, mytoolbar);
Node.Value(tbbutt, “ControlID2D”) = “{2BBC850E-6EEF-4364-9265-A4A606AE464B}”;//must be this guid
Node.Value(tbbutt, “ControlID3D”) = “{2BBC850E-6EEF-4364-9265-A4A606AE464B}”;
//Node.Value(tbbutt ,”Package”) = “{E0C3ABBA-AA1C-4A09-8089-9ED4A8AC63B9}”;//needed for menu button
Node.Value(tbbutt, “Menu”) = false;
Node.Value(tbbutt, “Name”) = theframeSN;
//Node.Value(tbbutt ,”Preview2D”) = 303;//needed for image button
//Node.Value(tbbutt ,”Preview3D”) = 303;
var tbbutt2 = Node.Rename(tbbutt, theframeSN + “Button”);

truespace links(copied from wiki)

Truespace Links

* United 3d Artists website and forum
* truespace faq and download links

To install dribble:

  • download and install 3Delight
  • download dribble source code and unrar the file
  • inside find a zip archive – .\dribble_source_092509\dribble\install\dribble1.04wip080808.zip
  • unzip to find the setup program inside – dribble1.04wip080808_setup.exe
  • download dribble shaders for 3Delight 9.0 and copy to the \Program Files3Delight\shaders\ folder

truespace bugs(copied from wiki)

truespace 6.6

  • The truespace installers will work up to version 6.6 for windows7 64bit, but the service packs will not install. This may be true for win7 32bit as well. Workaround is to copy the folder directories from a machine that already has SP1 and or SP2 installed onto the unpatch truespace folders on the win7 machine. This is true for truespace and the conversion pak installers for the service packs.

truespace 7.6

  • The Soft Select custom profile image control has a bug in that it only sees the alpha channel not the color. So it needs a 32 bit image to work.
  • The Photoshop(psd), Tagged Image Format(tif) and Paint Shop Pro(psp) image formats do not load.
  • If you save an object from a material instanced scene and load it into a fresh scene it looks the same but the material has been corrupted and cannot be edited.
    • Workaround is to change material settings to No Instancing and uncheck Edit Material Directly then pick the object material and reapply it back onto the object to save the material definition within the object.

truespace7.61

  • trueSpace 7.61 Save Workspace Animation to file – going to Model Space and using the Render Scene To File, selecting the Workspace option produces an stationary animation. Problem also shows as no motion in model space when scrubbing the workspace time line.
  • Activate wireframe, transparent, or wireframe + transparent display mode, remove all lights and add a spotlight. The result is that all meshes in the scene disappear unless they fall within the spotlight cone. **Workaround is to add an ambient light with black color.
  • Render Engine selection does not work in the Panel view, PhotoRender. In fact none of the render settings from the PhotoRender panel works.
    • Workaround is to use TS6 Files – Preferences panel to select the render engine and right click the corresponding buttons to change items like background color.
  • The workspace Spotlight shines in 2 directions.
    • Workaround is to turn off hardware shadow filter in the hardware settings dialog.
  • The Displacement Mapper panel image control is the same color as the panel background. Making it invisible. The image control is located to the right of the words “Height map”, so control click in that general area to load an image.
  • The Soft Select custom profile image control is the same color as the background and so invisible. It also has a bug in that it only sees the alpha channel not the color.
  • The Photoshop(psd), Tagged Image Format(tif) and Paint Shop Pro(psp) image formats do not load.
  • If you expand a Matrix or OwnerMatrix input and decide to remove the ExpandInMatrix node, you must disconnect it first or the item will not move in 3d space until the input is reset.
  • “Zoom to Fit All” for colors in the FCurve editor will cause a crash.
  • The windows xp animated screen character that appears when you do a search in Explorer(Windows Explorer not Internet Explorer) stops the truespace button tooltips from displaying. Select “Change Preferences” then choose “Without an animated screen character” to fix it.
  • Loading a context does not load completely.
    • Close truespace and open it and the context load will be complete.
  • If you save an object from a material instanced scene and load it into a fresh scene it looks the same but the material has been corrupted and cannot be edited.
    • Workaround is to change material settings to No Instancing and uncheck Edit Material Directly then pick the object material and reapply it back onto the object to save the material definition within the object.
  • The material picker for workspace does not work when switching to the camera view.
    • Workaround is to make some change to the scene after the switch to camera view. Point Edit something, move or scale something, add a new primitive.

truespace renderers(copied from wiki)

Dribble

To install dribble:

  • download and install 3Delight
  • download dribble source code and unrar the file
  • inside find a zip archive – .\dribble_source_092509\dribble\install\dribble1.04wip080808.zip
  • unzip to find the setup program inside – dribble1.04wip080808_setup.exe
  • download dribble shaders for 3Delight 9.0 and copy to the \Program Files\3Delight\shaders\ folder

Note that as of 3Delight ver 9.0.84(maybe earlier) that the license server is no longer required unless you need to run on more than 2 cores.
How to Recompile the Shaders:

3Delight must already be installed to run the shader compiler.

After unRaring the file find the shaders folder

\dribble_source_092509\dribble\shaders
new way:

select the sl files in explorer(max of 15 files at one time), right click and choose “Compile with 3Delight”
old way:

open a command window to this location – windows 7 shift-right click on the folder gives an option to open the command window to that location

type the following command:

shaderdl *.sl
The result will be that all the old *.sdl files will be replaced with new ones specific to the version of 3Delight you are running. Copy the new sdl files to the 3Delight shaders folder. C:\Program Files (x86)\3Delight\shaders

Indigo

Yafaray

Virtualight

The virtualight download includes some vs and bitmap files that are missing from the last trueSpace release(7.61)

truespace misc sdk notes from the wiki

RsApp.Help()

creates some xml documentation files RsCmdDoc.xml and RsNodeDoc.xml
RsImport.ExportCollada(‘filename’,’list of nodes’) – will export a collada file via script
Widgets.Rotate == rotate about origin (0,0,0) then offset back to original position
WindowsManager.MoveWindow name item enhanced about possibility to work with working area size or the whole window size.

   * Example:
         o WindowsManager.MoveWindow(idWindow, -1, -1, Width, Height, WorkAreaSize, -1, -1);

trueSpace Python Notes(copied from wiki)

The python samples don’t work for trueSpace7.61 unless you copy the contents of the PythonScripts folder into the tS folder. The other option is to add 2 lines to the top of your python script:

import sys

sys.path.append(‘PythonScripts’)

This tells python to look inside the PythonScripts folder for modules to load.

Bug: GetMaterial(matidx), the object get material function always returns None.
Tutorials on the Wayback Machine, look at the early years:

http://web.archive.org/web/20040415000000*/http://www.3dfuel.com

trueSpace General SDK Notes(copied from wiki)

To change the version of a plugin from v.1638401 in the plugin manager change the RpExamplesPlugin.h from
#define EXAMPLE_PACKAGE_VERSION1 1 // cmdprompt package version

#define EXAMPLE_PACKAGE_VERSION EXAMPLE_PACKAGE_VERSION1

to

#define EXAMPLE_PACKAGE_VERSION1 1 // cmdprompt package version

//#define EXAMPLE_PACKAGE_VERSION EXAMPLE_PACKAGE_VERSION1

#define EXAMPLE_PACKAGE_06192010 3 //my june 19 2010 version

#define EXAMPLE_PACKAGE_VERSION EXAMPLE_PACKAGE_06192010

will change the version to v.1635403
//from kernel.h

   //enum RtPixelFormat
   //{   
   BFMT_UNKNOWN    = 0;
   BFMT_A8R8G8B8    = 1;
   BFMT_A16B16G16R16    = 2;
   BFMT_A32fB32fG32fR32f    = 3;
   BFMT_R8    = 4;
   BFMT_R16    = 5;
   BFMT_R32f    = 6;
   BFMT_FORCE_DWORD    = -1;
  // } ;

trueSpace General Script Notes(copied from wiki)

Clinick’s Clinic on Scripting #1: VBScript or JScript?

Special Edition Using Jscript, Including OOP in chapter 4

  1. Node.NearValue script property. Similar to Node.Value, but allows to specify short node name, if you want to access neighbor node from your script.
   * So instead of:
         o Node.Value( System.ThisOwner + “/Memory”, “A”) = 10
   * You can now use:
         o Node.NearValue( “Memory”, “A”) = 10
  1. Node.LookupParentValue script property (get only). The property look up parents for specified connector value. This can be useful for larger script projects with hierarchical structure – to access ‘common project parameters’ from all activity bricks without need to link to exported connector.
   * Example:
         o numPlayers = Node.LookupParentValue(“numPlayers”)
  1. Per widget visible/invisible settings in Desktop preferences.
   * Widgets saved in \scripts\desktop.widgets.xml, you can add your custom widgets here.

The way I understand the RsPackage.Install() command, it creates and or writes to the Plugins.xml file located in the Scripts folder. When you open tS761 the init.js file runs. In this script you will notice the RsPackage.Import(‘plugins.xml’); command. I believe the reset.js runs when a user Resets the Default Context. In that script you will notice two commands: ScriptObject.ImportScripts(0); ScriptObject.UpdatePck(0); As I understand it, this command reads the Scripts/ScriptCommands folder and loads all of the scripts within, into tS761 in the System/Scripts/Commands node. The scripts have to be named from within the Script Editor’s Attribute area in order for this to work right. This is how I loaded all of the scripts included in the last Unofficial Update. You will notice an OnNewScene script which gets called when you run Generate New Scene.

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()

%THIS_OWNER_NAME%

LE. – (L E dot) undocumented LE commands

Activity.Run(scene + “/second”);//runs after the calling script is done

ScriptObject.Execute(scene + “/second”);//runs immediately pausing the calling script

Scripts with the same command input connection will run in the order that they are connected. No parallel processing from parallel connections.

Script can combine different selection types like edge plus triangle.
sdk docs “structIRiTSBCommand.html” has “SuggestTSStateByAlias” command which is used to “Call to execute a Modeler’s action(click on a Modeler’s button)”. download Hexplorer http://sourceforge.net/projects/hexplorer/

and running it on the tsxapi.dll file. Do a search for “Button” and one by one you can find the aliases for all the modelside buttons. Also works with items found by searching for “Panel”.

Modelspace(trueSpace 6) Button Icon production

24 bit bmp format, background color about (192,192,192), size 30×22

Workspace Button Icon production

truespace button icon –

paint shop pro 32 bit tga, background color about (118,118,118), select background, invert and save to alpha, size 26×26
photoshop – same, but can also do bmp format in 32bit

Link Editor Panels Editor

   * Tab order edit field in control property window.
   * Expand / shrink control size functions.
         o expand enlarges object size until it touches neighboring controls.
         o shrink minimizes size of selected object so that it fits a gap under the control.
   * Controls snapping in Panel Editor:
         o edges of the selected control are snapped to edges of remaining controls during panel editing.
         o this feature can be turned off in panel properties dialog.
   * Decorative control
         o use it to fill empty spaces, to create separating lines and to create "radio group"-like looking panel
   *
         o use "fill gaps" function (located in decorative control properties dialog) to automaticaly clone this control to every hole in the panel
   *
         o use Bottom/Right checkbox to fine-tune line position or to change orientation of the "U" shape
   * moving edited control using arrows snaps to grid and other controls too
   * hold ctrl while moving edited control to turn of snapping
   * Holding shift while sizing a control resizes all controls in the same row/column.

If you add a new connector to a script used inside the Widgets it won’t work right away. Restarting truespace will unstick it.
MeshModifiers.WeldPairs() script command does not work. It is the script version of the Edge Weld Tool for trueSpace 7.1

//functions for generating random guid for marker display

function S4() {

return (((1+Math.random())*0x10000)|0).toString(16).substring(1);

}

function guid() {

return ("{" + S4()+S4()+"-"+S4()+"-"+S4()+"-"+S4()+"-"+S4()+S4()+S4() + "}");

}

//functions for generating random guid for marker display

function S4() {

return (((1+Math.random())*0x10000)|0).toString(16).substring(1);

}

function guid() {

return (“{“ + S4()+S4()+“-“+S4()+“-“+S4()+“-“+S4()+“-“+S4()+S4()+S4() + “}”);

}

Toolbar Prototype notes

create a toolbar by normal means – will often end up in a frame named “ToolbarFrame”

find the Toolbar inside Windows Manager Space inside the ToolbarFrame

type a name into the Prototype field of the Toolbar node and a prototype will be created inside the Toolbar Prototype Encapsulator

to recreate the toolbar – create a toolbar(drag and drop a button from another toolbar), find it’s Toolbar node and type the same name into the Prototype field and the toolbar will be recreated

OpenToolbarfromPrototype does not return the name of the node created
WScript Shell

//WshShell = WScript.CreateObject(“WScript.Shell”);

WshShell = new ActiveXObject(“WScript.Shell”);

WshShell.Run(“calc”);

matrix multiplication

   myMatrix.LoadIdentity();
   myMatrix.SetPitch(-90);// myMatrix = -90 deg pitch => last rotation
   myMatrix.Mult(rollMatrix);// rollMatrix (this is the second rotation) * myMatrix => myMatrix
   myMatrix.Mult(yawMatrix);// yawMatrix (this is the first rotation) * myMatrix => myMatrix
   final result in myMatrix is yaw then roll then pitch
 

trueSpace Collada Export

Collada

Workspace: If the copy textures option is not selected, image references with made up names(file_0, file_1, file_2) are created in the dae file with a relative path in the same location as the dae file.

Modelspace(procedural textures): If the copy textures option is not selected, the collada file will refer to texture files file_0… in the same location as the dae file, but no texture files will be created.

Modelspace(texture map): If the copy textures option is not selected, the collada file will refer to the texture directly but in a bad format and using an absolute path instead of relative.

Workspace: If copy textures option is selected then a folder with the same name as the dae file is created and the texture files(file_0…) are created in the folder and relative paths are created in the dae file to these textures.

Modelspace(procedural textures): If copy textures option is selected a folder with the same name as the dae file is created and texture files are created in it.

Modelspace(texture map): If copy textures option is selected an empty folder with the same name as the dae file is created(BUG), the texture file is copied to the same path as the dae file not into the new folder and the dae file will refer to the original texture file using absolute addressing in a bad format.(BUG)

Workspace texture in modelspace is treated the same way as modelspace procedural texture, but if the model is altered through point edit then a texture is created in the “Rs Tmp Textures” folder and it will act like a modelspace texture map export.

Normal map textures are referred in an xml “extra” tag, because these maps are not directly supported by the collada standard.

The diffuse and specular tags in the dae file from truespace always refers to the same texture.(BUG?)
The modelspace and precompiled workspace textures will export diffuse, alpha and normal maps.

Workspace materials composed of the various shaders bricks use the InputBitmap node to define the textures used. The InputBitmap nodes “Input usage” connector determines how it is exported, “DIFFUSEMAP” goes to diffuse, “NORMALMAP” goes to normal. Chapter 5 pg 143 of the truespace manual has a list under the heading “Material Compatibility”. The only maps listed are diffuse and normal. No alpha map is listed, but experimentation shows that if “ALPHAMAP” is typed into the input usage field an alpha texture is created for the collada file.
Vertex paint does not export even though the exporter has an option for it.(BUG)

Modelspace skeletons exports as a hierarchy of nodes/nulls made from truespaces bones and joints instead of actual joint nodes and no skinning information is exported.