Script comes pre-installed in the Unofficial trueSpace Updates - https://www.united3dartists.com/forum/viewforum.php?f=55
Installation:
- install the persistent base if not already installed
- install the global function set
- drag the node into the link editor and press install
- delete the nodes from the scene after install is complete
Usage:
- This script only works when using the file menu to save collada files.
- After normal export a panel will display giving the option to run the Collada post processor.
- Close the panel to export without the optional enhancements.
- Choose options:
- Include Morphs - mesh and actor morphs will be added to the file
- Name and Instanced Only - materials are scene instanced and have a unique Name parameter assigned to them
- Animation Clips - write animation clips from the story view
- Run to update dae the file
BlankDXMaterial on the left and Compiled material on the right
as shown in the link editor.
Actual file names from workspace will only be used if the
material is based on the BlankDXMaterial which is composed of
shader nodes connected to a Material node. The Material
Converter script can be used to convert the materials. It
can be found on the materials page.
A replacement Alpha Shader node can be found on the same page.
It enables the export of alpha textures in the collada file even
when the postprocessor is not run.
Best results from scene instanced and named materials
The name of the materials can be set by adding a node that has a "Name" input connector and exporting that connector to the D3D material node.
TODO link to material and export utility scripts when they are developed for setting the material name, checking for valid material setup, unique names for everything, check mesh validity etc
reorganize code if any more changes, 1 command node text way to many lines
trueblue says it doesn't work with scenes - maybe new bug? - test this
Compatible with Null objects
A compatble specular texture material can be found here: variousmaterials
you tube here
Notes:
- trueSpace without any enhanced export is not fully compatible with the characters from the built in library.
For example the Horse will not export material textures because of outdated lightworks materials.
Fix by repainting the material. For rosetta change some value first so it overwrites and removes the old lightworks material.
-
This script only works when using the file menu.
Dragging to a library will not work because the script uses the
most recent saved file information which is bypassed when drag saving
to a library.
-
If Copy textures option is selected on export the the
original collada file is slightly altered (spaces or added for some attributes) and the enhanced version
will be in the folder with the textures.
-
Objects in truespace need to be named. Automatic names like
"Torus, 1" cannot be reverse matched from the Collada file for
material processing. The collada file will change the name to
"Torus_1". Truespace "Torus, 1", "Torus_1" and "Torus 1" will
all translate to the same name in the Collada file potentially causing
texture fixes to fail.
- trueSpace does not export scene instanced materials as instanced in the collada file
- The Materials encapsulator of the scene will export as empty nodes in the collada file
- trueSpace will export the material name based on the material index used in the mesh object, so index 5 would be "material_5"
- trueSpace will export invisible objects
- Mesh objects with axis applied needs to be flattened before export when the object is animated
- DIFFUSEMAP, ALPHAMAP and NORMALMAP Input usage must be set properly for each kind of texture bitmap. The usage is used by the trueSpace exporter to determine the type of texture exported, so if you have a diffuse use on an alpha image it will export as diffuse. These are the only options found in the View3D.dll file.
- A color texture will create an identical specular map texture on output
- A color texture is required before emission or specular textures will export, a small black color texture can be used
- Dev Note: dae mesh x values are negative of tS values
- Every joint exported from tS in collada format will have unique ids and names assigned to them. So 2 skeletons with the same joints will have different joint names on exporting.
- https://www.khronos.org/collada/wiki/Skin_and_morph
info on morphs with incomplete sample code.
Github repo with complete sample code is found here
https://github.com/spe3d/SkinAndMorph/blob/master/SkinAndMorph/skin_and_morph_example.dae
-
General
- all morphs must be at 0 values for the export
- vertex normal changes are not included in the morph export, but is likely not needed for most cases.
- When exporting clips, assign unique names to all animation clips.
- Do not overlap clips or export 1 clip at a time in different files by disabling all clips expect for one
- set the default pose for actors before exporting with morph targets, otherwise the pose will be included in the morph definition
- export actors requires?: start estabished skeleton from fbx scripts details later, rename all joints, imported actors may not work with tS collada because of joint angles
- name all morphs, meshes, actors, materials(with name node details later), animation clips
-
Godot
- parent the collision mesh to it's target, name postfix of "-colonly", if not parented then the collision will not move with it's parent
- postfix of -noimp will not import into Godot
- every mesh will have a unique material unless the material has a Name node or scene instancing is used
- alphamap will not import, transparency in godot from alpha channel of color map
- animation clips will need to be trimmed, shifted to time 0 and their lengths set
Lightwave(Modeler):
- top view rotate 180, right view rotate 270(left view 90)
Lightwave(Layout):
- no scale(or scale=1)
- script collada_add_spot_extra.py to make spotlights readable to Lightwave
- import fixed file, no scale(or scale=1)
- fix_collada_import.py if camera fov, or light properties are animated
- spotlight color will not import
- parent scene to null
- rotate null heading 180, pitch 90
- light color read
Blender:
- no scale(or scale=1)
>
- spotlight color will not import
- parent scene to empty(ctrl p)
- rotate null in z 180
- light color read
- material import better in older 2.79 version
- actors may need to export with stretchy bones option
- v3.1.2 actors with morphs don't import properly
August 27, 2023
- fixed actor materials processing
August 25, 2023
- fix error caused by exporting blinn type material. collada can do blinn but there is nothing in the current code to handle it
August 12, 2023
- non-instanced material texture bug, type of texture failure bug
- add check for no node connected to specular connector, unusual to have none, but it happened.
Related to tS bug: always export specular texture if color texture used
July 22, 2023
- add support for null objects
July 16, 2023
- fix image bug when exporting model or constant textures without scene instancing
February 15, 2023
- fix collada vertex colors export
June 1, 2022
- add support for morphs
- export animation clips
- options panel instead of query popups
- log view auto open
- install button
November 10, 2021
- fix multi-material object material export - was only updating the first material of a mesh
September 27, 2021
- new instanced and named materials export option with improved error checking
- broke script into 4, was 2000 lines now largest is about 1000 lines so bad, but only half as bad as before
- replaced tS normalmap with FCollada compatible normalmap
September 18, 2021
- use utility status message
- fix bug where a texture must exists before parenting will export
- same bug above in a couple of other places
- parented item needed -X translation value
February 19, 2021
- supports parenting structures
- update safe naming to translate dash to underscore
- no error when export scene instanced materials
- material names are unique - before only the material id was unique
- will use a "Name" connector for the material name
- will trace scene instanced materials back to their source to get the material name
- feedback on the status line
- check that original collada file exists
- remove dummy Materials node from the visual scene from the export
February 24, 2018
- persistent install v2 compatible
- compatible with new batch installer
January 12 2018: - persistent install
July 8 2014:
- export constant colors and textures as emission nodes
-
export specular texture by using the
DefaultModelTextureShader
-
fix bug where any texture ends up in the collada file
diffuse and specular nodes
Sept 10 2013: -
slightly improved Blender compatibility
June 14 2013:
-
bug fix - ignores a second type of compiled material which has
a "D3DMaterial" connector
- works when the normalmap bitmap connector is named "Bitmap" as well as "NormalMap"
June 8, 2013:
-
use actual texture files instead of the file_0,1,2...
when materials are DX blank style
- texture file paths are now relative for modelspace and workspace
Feb 4 2013:
- forgotten update for Dec 18 2012
- changes DATA to ANGLE for Blender compatibility
- does not use vertex colors as a flag - uses a dialog instead
- test for absolute path was finding paths with spaces instead
-
ambient and spot fixed -
broken because of Unoffical
Upgrade #3?
Sept 2 2012:
- camera fov animation
- light color animation
- spot light cone angle animation
- fix ambient light - changes it from mesh to a light
- fix area light - changes it from a null to a light
-
fix spotlight angle to use the angle instead of the hotspot
angle