Collada plugin for
After Effects

More info here
Plugins and Scripts > trueSpace

Development

trueSpace Blog

Collection of notes for use and development on trueSpace

username="generic", password="openup"

Clintons3dPlugin (OLD version)

This rsx plugin is used by several scripts from this site. It is used in the unreal scripts to read the binary formats and in the indigo script making it possible to read scene level materials. Several scripts now use the Save-As dialog from this package.

The source code for the plugin can be downloaded from here.

The source assumes to be added into d:\sdk_tS761B8\Examples\

  • UtilityDataObject - node connector info, select file folder dialog, save as dialog, set active material, guid for scene materials, point visualization, keyframe data info, window absolute position get and set
  • compositing nodes
  • sockets
  • ExamplesPlugin.TopologyExample2 = ImportPSK
  • ExamplesPlugin.TopologyExample4 = ImportPSA
  • ExamplesPlugin.TopologyExample5 = import Collada
  • ExamplesPlugin.HelloWorld2 = ExportPSK
  • ExamplesPlugin.HelloWorld3 = ExportPSA
  • ExampleDataObject2 = guid for scene materials

Be warned that much of the source code is very rough. I never fully figured out how to use the beta sdk, so it's a messy collection of code that works. Also the source is a little bloated from extra libraries and experimentation.

A version of this rsx plugin comes pre-installed in the Unofficial trueSpace Updates - https://www.united3dartists.com/forum/viewforum.php?f=55

August 22, 2025

  • v1638463
  • fix createmateriallookup function caused by improper error check added in previous release

August 19, 2025

  • v1638462
  • prevent some crashes from improper use and reorganize code(cpp file had 7500 lines)(embarrased emoji)

August 17, 2025

  • v1638461
  • new Clintons3dPlugin.SafeRename

August 7, 2025

  • v1638460
  • GetMaterialIndices will return blank if invalid instead of error
  • GetMaterialNode will return blank if invalid instead of error
  • Rename will return the new name or blank if it fails to rename
  • new SafeRename will add "_#" if the name is already taken

Update History

Note: may require VC++ runtime 2008 sp1 from Microsoft. (2010) Get it if the plugin does not install.

November 22, 2009

Clintons3dView Plugin package for trueSpace

This rsx plugin is used by the web based ui scripts and the node list view script.

The source code for the plugin can be downloaded from here.

August 22, 2025

  • v1638419
  • add checkbox context menu add to selection and remove from selection

August 19 2025

  • crash bug fix, blank rename in Scene View: Clintons3dRsView rsx plugin version v1638418

August 17 2025

  • crash bug fix, editable shape node: Clintons3dRsView rsx plugin version v1638417

August 16, 2025

  • v1638416
  • scene view 2 updates

Update History

Note: may require VC++ runtime 2008 sp1 from Microsoft. (2010) Get it if the plugin does not install.

xxx xx, xxxx

Clintons3D Plugin Ext package

Contains the tif loader, exr loader, png saver command and exr saver commands

Unzip and copy all 3 files together

Related Materials nodes

Script Commands

Native trueSpace will not save png files with an alpha channel

trueSpace will not save exr format images - ?and hdr has issues?

SaveEXR and SaveNoAlphaEXR:

save bitmap to a exr file with or without an alpha channel

  • extu = System.CreateDO("Clintons3D Package Ext Depends/Utility functions");
  • var result = extu.SaveEXR(BitmapNode, BitmapConn, FileName, PixelFormat, Compression)
    BitmapNode is the node that has a bitmap connector
    BitmapConn is the name of the connector
    FileName is the full path name of the png file to save
    PixelFormat 1=half float, 2=float
    Compression 0=none, 1=rle, 2=zips, 3=zip, 4=piz
    Result will contain a text message of any errors from the save

RGB no Alpha command

  • extu = System.CreateDO("Clintons3D Package Ext Depends/Utility functions");
  • var result = extu.SaveNoAlphaEXR(BitmapNode, BitmapConn, FileName, PixelFormat, Compression)

SavePNG:

save a bitmap to a png file that supports alpha values

  • extu = System.CreateDO("Clintons3D Package Ext Depends/Utility functions");
  • var result = extu.SavePNG(BitmapNode, BitmapConn, FileName)
    BitmapNode is the node that has a bitmap connector
    BitmapConn is the name of the connector
    FileName is the full path name of the png file to save
    Result will contain a text message of the final status of the save

Source code: Clintons3dExtSource.zip

Update History

April 28, 2019

SDK bug

The RsSelectionHelper.h file included in the DK has a bug that prevents selections unless something is already selected.

SelectNode function change in the RsSelectionHelper.h file

    // crashes if no preexisting selection Nov 2011
    //if(spNodeSelection->IsEmpty())
    //	return E_FAIL;
    // Aug 2021 probably because can't replace an empty selection
    if(spNodeSelection->IsEmpty())
        bReplace = false;
September 6, 2021

RsApp.Help()

Command generates xml files that can't be read properly by modern web browsers. Internet Explorer on win7 was used to convert the xml files to html files.

December 18 2023

Animation

maybe do list here

Dev Demos

maybe do list here

Materials

maybe do list here

Mesh

maybe do list here

Widgets and Windows

maybe do list here

Export Scripts

Export all scripts contained in the selected node to js or xml files. This is useful for searching all scripts and editing. Visual Studio Code "find in files" works well to see and search all the scripts in one easy location.

Usage:

  1. Load the script
  2. Options
    • Export Only Simple - The simple script command nodes will export to a single text file with a "SimpleCommands_" prefix.
    • Export as JScript Files - saves js format files, otherwise saves xml format
  3. choose an object - say "/Scripts/Commands"
  4. press Start

All the scripts inside the selected node will export as xml or js files to an ExportedScripts folder in the tS directory. The simple scripts are found in "/Widgets" and "/Physics/Widgets".
The folder structure will reflect the tS hierarchy.
Repeat names will be given a random postfix to differentiate the scripts.

ExportedScripts - xml export of all scripts found in the Unofficial Updates released on Dec 28 2021

November 20, 2023

  • if no selection export all starting from the root

November 11, 2023

  • much faster - no waiting
  • writes js files
  • requires latest rsx plugin v1638447
  • old version

March 30, 2023

  • fix mystery sendkeys bug when running on full tS uu9 scripts

October 28, 2022

  • recreate tS folder structure instead of creating a key file
  • new folder structure allows multiple runs without restarting to organize the files

June 10, 2022

  • add option to export the simple scripts used inside widgets
November 16, 2021

Dump Buttons and Shortcuts to a Web page

This script writes data to a web page from all buttons and shortcuts defined in truespace toolbars. Output results from trueSpace 7.11, 7.61 and 7.61(patched) links are below. The 7.11 dump includes the modelside button information.

  • Has the left and right mouse button commands
  • List of shortcuts
  • shortcut builder tool for use with manually editing the shortcuts file

Missing set keyframe button - tSBridge.SuggestTSStateByAlias("RecordKeyFrameButton"); found inside the tsxapi.dll file.

Import xml file to run in tS v7.11 link

shortcut builder shortcut keys are defined by pressing one button at a time, so CTRL Z would be CTRL then Z

March 18, 2020

Dump Buttons XML script

This script writes data from all buttons defined in truespace toolbars. It can be imported via the a jscript command node. Output results from trueSpace 7.11 and 7.61(patched) links are below. The 7.11 dump includes the modelside button information.

trueSpace7.11 button dump

trueSpace7.61 button dump

Missing set keyframe button - tSBridge.SuggestTSStateByAlias("RecordKeyFrameButton"); found inside the tsxapi.dll file.

December 19, 2015

Node Connectors info for trueSpace

Provides a list of a node's connectors including the name, type and flags. The first line returned is a header line. The list includes hidden connectors.

The plugin package is required to use this script. Download the plugin package here.

The header line includes the nodes persistentID which is valid while the scene is open

first line heading(connectors[0]) is "script conn name\tconn name\ttype\tflags\t" + persistentID found here

Sample Code:

    var CONFLG_HIDDEN = 32;
    var CONFLG_OUT = 2;
    var CONFLG_IN = 4;

    var utilitydata = System.CreateDO("Clintons3D Package/Utility functions");
    var currentnode = Node.FirstSelected();
    var thedata = utilitydata.GetConnectorData(currentnode);

    var allConnectors = thedata.split("\n");
    for(var i=0; i < allConnectors.length; i++) {
        var connector = allConnectors[i].split("\t");
        if( (connector[3] & CONFLG_HIDDEN) != 0) continue;

        var In = "";
        if((connector[3] & CONFLG_IN) != 0) In = "input  ";
        var Out = "";
        if((connector[3] & CONFLG_OUT) != 0) Out = "output ";

        System.Trace(In + Out + connector[0] + " - " + connector[2]);

    //connector[0] = script connector name
    //connector[1] = connector name
    //connector[2] = connector type
    //connector[3] = flags
    } 
                        
flags:

enum tagRtConFlags
{ CONFLG_DIRTY = 1,
CONFLG_OUT = 2,
CONFLG_IN = 4,
CONFLG_INOUT = 6,
CONFLG_RESERVED = 8,
CONFLG_EXPORTED = 16,
CONFLG_HIDDEN = 32,
CONFLG_CACHING = 64,
CONFLG_NONOTIFY = 128,
CONFLG_CONTROLFLOW = 256,
CONFLG_DISABLECACHING = 512,
CONFLG_REGISTERED = 1024,
CONFLG_CUSTOM = 2048,
CONFLG_TOPOLOGY = 4096,
CONFLG_LOCAL = 8192,
CONFLG_LAST = 8193
} RtConFlags;

May 19, 2013

Test Panel Controls

Script adds UI controls, but no way to adjust them for labels, position, size etc. Controls disappear when the aspect is changed. Can make controls persistent by editing the panel.

June 20, 2010

Offline Render hooks

setup offline render hooks for jscript

steps to install offline renderer

  1. open the offline preferences
  2. create the node in the now visible Offline renderers node
  3. now can call the offline script hooks
    //
    //Add Yafaray to offline renderers
    //
    //create/open render preferences node
    ScriptObject.RunCmd("space 3d package/open offline renderer preferences");

    if(!Node.Exists("/Offline renderers/Yafaray")) {
        try {
            Node.Create("Clintons3D Package/Yafaray", "/Offline renderers");
        } catch (err) {
            System.Trace("Error: Clintons3D Package plugin should be installed first");
        }
    }
                    
August 26, 2018

Generate Outputs

generate outputs panel

Utility script that will read an exported scripts xml file, read the input parameters and create a new xml file with corresponding output parameters.

Usage:

  1. use the Export Script button to save an xml file
  2. choose the xml file with the ... button and press Start
  3. a new file is create - filename.xml => filename_Processed.xml
  4. use the Import Script button on the new xml file

Notes:

  • uses "Msxml2.DOMDocument.6.0"
  • each "parameter" will have a corresponding "parameterOUT" connector
  • CDATA is ignored and simply copied to the new file
  • can transfer between script objects and command scripts by editing the first lines after importing (Execute, OnComputeInputs...)
April 11, 2019

TCP Sockets client

Communicate with other processes or servers via tcp sockets

util.SocketComm(text message, ip address of socket server, port number on socket server, timeout in ms - 0 means no timeout, true ==> use UDP otherwise use TCP) returns a text response

    function writeOut(val)
    {
        var result = util.SocketComm(val,"127.0.0.1", 5000, 300, false)
        System.Trace(result);
    }

    util = System.CreateDO("Clintons3D Package/Utility functions");

    writeOut('some text to send')
                    

Notes:

Status Line

Status Message autoloader copied from the Unofficial Update. Loads from preobjects.

Updating the status line from script adds to the undo history. This plugin based status line does not.

Set status message with a 5000 mS delay before clearing the message
var util = System.CreateDO("Clintons3D Package/Utility functions");
util.SetStatusMessage("Some message here", 5000);

Clear status message and do not clear the Model status, only clear the workspace ":" status
var util = System.CreateDO("Clintons3D Package/Utility functions");
var clearModelStatus = false;
util.ClearStatusMessage(clearModelStatus)

October 14, 2020

Resource Hacker

Resource Hacker can be used to look inside and change exe and dll files

http://www.angusj.com/resourcehacker/

ts7.exe contains the splash screen image

tSCommon.dll contains button icons and images

WindowsManager.dll contains button icons

October 14, 2020

No Undo Commands

Collection of script commands that do not add to the undo history.

Usage:

  • util = System.CreateDO("Clintons3D Package/Utility functions");
  • util.xxx(yyy, zzz, ...)
  • the associated nodes and connectors must exist for all these commands. Ex. if you try to delete a non-existent node it will error out

Commands - prefix as shown above

  • ConRename(BSTR bszNode, BSTR bszConnector, BSTR bszNewName );
  • ConRemove(BSTR bszNode, BSTR bszConnector );
  • ConnectTo(BSTR bszNode, BSTR bszConnector, BSTR bszOtherNode, BSTR bszOtherConnector );
  • Disconnect(BSTR bszNode, BSTR bszConnector, BSTR bszOtherNode, BSTR bszOtherConnector );
  • Rename(BSTR bszNode, BSTR newName ); - will return the new name. if it fails it will return blank
  • SafeRename(BSTR bszNode, BSTR newName ); - will return the new name with a numerical postfix. if it fails it will return blank
  • Copy(BSTR bszNode, BSTR bszDestNode ); - this command returns the full path of the new node
    bszNode='' will copy the first selected node
    bszDestNode='' will use the owner node of the bszNode
  • Delete(BSTR bszNode );
    bszNode='' will delete the first selected node
  • DisconnectAll(BSTR bszNode); - ends up this command is not the same as the script command. The script command removes all connections on 1 connector, this command removes all connections on all connectors of a node.
  • SetNodeValueFloat(BSTR bszNode, BSTR bszConnector, float value );
  • SetNodeValueInt(BSTR bszNode, BSTR bszConnector, int value );
  • SetNodeValueUnsigned(BSTR bszNode, BSTR bszConnector, unsigned int value );
  • SetNodeValueString(BSTR bszNode, BSTR bszConnector, BSTR value );
  • SetNodeValueColor(BSTR bszNode, BSTR bszConnector, float red, float green, float blue, float alpha );
  • SetNodeValueColorRGB8(BSTR bszNode, BSTR bszConnector, unsigned int red, unsigned int green, unsigned int blue );
  • SetNodeValueMatrix(BSTR bszNode, BSTR bszConnector,
    float i00, float i10, float i20, float i30,
    float i01, float i11, float i21, float i31,
    float i02, float i12, float i22, float i32,
    float i03, float i13, float i23, float i33);
    - this command uses the same layout as the matrix.setat command

Easier function to use for SetNodeValueMatrix

function SetNodeValueMatrix(node, conn, matrix)
{
    var util = System.CreateDO("Clintons3D Package/Utility functions")
    util.SetNodeValueMatrix(node, conn, 
            matrix.GetAt(0,0), matrix.GetAt(1,0), matrix.GetAt(2,0), matrix.GetAt(3,0),
            matrix.GetAt(0,1), matrix.GetAt(1,1), matrix.GetAt(2,1), matrix.GetAt(3,1),
            matrix.GetAt(0,2), matrix.GetAt(1,2), matrix.GetAt(2,2), matrix.GetAt(3,2),
            matrix.GetAt(0,3), matrix.GetAt(1,3), matrix.GetAt(2,3), matrix.GetAt(3,3)
    );
}

Code Equivalent of Node.ReconnectFrom

Node.ReconnectFrom(SourceNode1, SourceNode1Conn, SourceNode2, SourceNode2Conn, Destination, DestinationConn);
===

  1. util.ConnectTo(SourceNode2, SourceNode2Conn, Destination, DestinationConn);
  2. util.Disconnect(SourceNode1, SourceNode1Conn, Destination, DestinationConn);

v1638431

  • altered commands so not error out from invalid node:
    ClearStatusMessage, ConnectTo, ConRemove, Delete, Disconnect and DisconnectAll
May 17, 2021

Plugin Status

Get the plugin status, "PACKAGE_INSTALLED", "PACKAGE_LOADED", "PACKAGE_UNINSTALLED".
This is useful for the View sample based plugins.

Usage:

  • util = System.CreateDO("Clintons3D Package/Utility functions");
  • plugStat = util.GetPluginState("Clintons3d ViewPlugin Package")

Name is from the "Name" field of the Package manager window.

Jan 4 2023

Misc Commands

CopyNodeValue:

copy a value from one source node to another destination node without creating an undo entry

  • util = System.CreateDO("Clintons3D Package/Utility functions");
  • util.CopyNodeValue(sourceNode, sourceConnector, destinationNode, destinationConnector )

ConReset:

reset a node connector without creating an undo entry

  • util = System.CreateDO("Clintons3D Package/Utility functions");
  • util.ConReset(Node, Connector, Node2, Connector2 );

The ConReset works the same as the original Node.ConReset except it has 2 extra arguements. The second 2 are for reading the default value that will be applied to the first 2. This is needed bacause the default value may be active on an internal node.
If the node connector does not have any internal connections then repeat the first 2 arguments in the second spots.
If the connector has an internal connector trace it back to the node that has the default value and use it in the second set of arguments.

ExportConnector (no undo version):

Export a connector and prevent undo - blank undo may be created. Similar to Node.ExportConnector

  • util = System.CreateDO("Clintons3D Package/Utility functions");
  • util.ExportConnector(SourceNode, SourceConn, bConnect, bSetValue)
    SourceNode - the node to export form
    SourceConn - the name of the connector to export
    bConnect - Connect immediately flag, "If true, also connect original connector to connector just created on encapsulator."
    bSetValue - Set value immediately flag, "If true, also transfer value from exported to new connector"
  • The util version does not include the 3rd arguement, the DestNodeName, used in the Node version. based off of IRfEncapsulatorSet::ExportConnector
    Node.ExportConnector(SourceNode, SourceConn, DestNodeName,bConnect, bSetValue)
    Do not include the DestNodeName argument.

GetScriptBody

Get the text content of a script node

  • util = System.CreateDO("Clintons3D Package/Utility functions");
  • text = util.GetScriptBody(ScriptNode)
    ScriptNode - command, object or function set node path

SetScriptBody

Set the text content of a script node

  • util = System.CreateDO("Clintons3D Package/Utility functions");
  • util.SetScriptBody(ScriptNode, text)
    ScriptNode - command, object or function set node path
    text - content of the script code

SaveScriptToFile

Save xml format of the script node

  • util = System.CreateDO("Clintons3D Package/Utility functions");
  • util.SaveScriptToFile(ScriptNode, filename)
    ScriptNode - command, object or function set node path
    filename - xml file to write to

LoadScriptFromFile

Load xml format file into the script node

  • util = System.CreateDO("Clintons3D Package/Utility functions");
  • util.SaveScriptToFile(ScriptNode, filename)
    ScriptNode - command, object or function set node path
    filename - xml file to read from

GetNodeValueXXX

GetNodeValueXXX() commands can be used inside toolbar buttons where Node.Value() does not. Also useful inside widget script command nodes.

  • toolbar buttons
  • widget script command nodes
  • function sets

GetNodeValueInt, GetNodeValueFloat

get integer and float values from a node

  • util = System.CreateDO("Clintons3D Package/Utility functions");
  • intVal = util.GetNodeValueInt(theNode, theConn)
    fltVal = util.GetNodeValueFloat(theNode, theConn)
  • GetNodeValueInt can be used to read a boolean connector value

GetNodeValueString

Get the text content, color or matrix value from a node

  • util = System.CreateDO("Clintons3D Package/Utility functions");
  • strVal = util.GetNodeValueString(theNode, theConn)
  • Color conn will return a comma separated string in the form of "red, green, blue"
  • matrix conn will return a comma separated string in the column matrix form of "m00, m01, m02...m33"
  • use matrix.SetAt(0, 0, m00)... matrix.SetAt(3, 3, m33)

GetLinkedInputNodeAndConn:

similar to the built in Node.LinkedInputNode command but returns the node at index 0 and the connector of the node

GetLinkedInputNodeAndConn2 is the updated version of this command

  • util = System.CreateDO("Clintons3D Package/Utility functions");
  • result = util.GetLinkedInputNodeAndConn(theNode, theNodeConnector )
  • result will be tab seperated text = "linked input node [tab] linked input node output connector"
  • invalid values will return an empty string

GetLinkedInputNodeAndConn2:

similar to the built in Node.LinkedInputNode command but also returns the connector of the linked node

  • util = System.CreateDO("Clintons3D Package/Utility functions");
  • result = util.GetLinkedInputNodeAndConn2(theNode, theNodeConnector, index )
  • result will be tab seperated text = "linked input node [tab] linked input node output connector"
  • invalid values will return an empty string

GetLinkedOutputNodeAndConn2:

similar to the built in Node.LinkedOutputNode command but also returns the connector of the linked node

  • util = System.CreateDO("Clintons3D Package/Utility functions");
  • result = util.GetLinkedOutputNodeAndConn2(theNode, theNodeConnector, index )
  • result will be tab seperated text = "linked input node [tab] linked input node output connector"
  • invalid values will return an empty string

GetLinkedOutputNodeAndConn2 has the same bugs as the Node.GetLinkedOutputNode and requires special processing. Also not that if the node is selected it may be connected to a "Widget" on the WldMatrix output.

for(var i=0; i< Node.LinkedOutputNodeCount(firstsel, "WldMatrix");i++) {
    var outnode = Node.LinkedOutputNode(firstsel, "WldMatrix", i);
    if(outnode && Node.Exists(outnode)) {
        System.Trace(i + " " + outnode );
        result = util.GetLinkedOutputNodeAndConn2(firstsel, "WldMatrix", i+1)
        System.Trace("result " + result)
    }
}

CopyNodeContent:

will copy the contents of one node into another including all internal and exported connections

  • util = System.CreateDO("Clintons3D Package/Utility functions");
  • result = util.CopyNodeContent(destinationEncapsNode, sourceEncapsNode, bCopySrcCons )
  • bCopySrcCons - when true it will copy all the node connectors and their values
    when false it will not copy unconnected connectors

The plan is to use this with a new discovery. Node.Create for a kernel DummyEncaps will not be selectable in the 3D view. Used for Kernel Object and the result is selectable. So make new unselectable script that does not depend on widget additions.

SafeRename:

rename using underscores instead of commas

Note that this is not a util style command

Does not return the new node

Will create undo history, unlike the util.SafeRename version

  • Clintons3dPlugin.SafeRename(bsFullNodeName, bsNewShortNodeName )

The following sequence can be used to get the new name


owner=Node.Owner(bsFullNodeName)
Clintons3dPlugin.SafeRename(bsFullNodeName, bsNewShortNodeName )
newName = owner + "/" + Node.SubObject(owner, Node.SubObjectCount(owner)-1);
Jan 19, 2023

Custom Watchdog

setup setup exp

Exp aspect above far right shows the result of adding one of each of the input types, BoolVal, IntVal, MatrixVal, NumVal, StrVal and StrEnumVal. Timeout and SingleShot are only used during setup.

Truespace watchdogs can be unreliable. This is an alternative means to setup a watchdog behavior type node.

Setup:

  • Single Shot - watchdog will only run 1 time. It will need to be activated for every run.
  • Timeout - amount of time that will go by before stopping the watchdog. -1=never timeout
  • Boolean, Integer, Matrix, Number, String, String Enum - create inputs for the different types of connectors
  • Remove Unused - if added inputs are not connected remove them (not really all that useful)
  • Flatten - remove nodes used to build the watchdog

After setup connect the inputs in the Exp aspect.

If Timeout is used, the TimeoutDetected will fire off after the time is up.

Use Defaults aspect to activate, deactive and set the period for the watchdog

For normal operation the Activate/Deactivate would be run via code. This is one of the differences from the standard watchdog in that it needs to be activated.

April 19, 2024
June 5, 2013