Collada plugin for After Effects

More info here
Plugins and Scripts > trueSpace > Modeling - Curves
curve nodes

NURBS Curves for trueSpace7.61(workspace)

A collection of scripts for using NURBS curves in the truespace workspace environment. Includes file loaders, polygon to curve conversion, curve from vertex selection, insert curve point, delete curve point, extend curve and polygon curve sweep. Animated svg export in css and greensock javascript formats.

persistent base install required

This script comes pre-installed in the Unofficial trueSpace Updates - https://www.united3dartists.com/forum/viewforum.php?f=55

Installation:

  1. install the persistent base if not already installed
  2. drag the node into the link editor
  3. delete the node from the scene after install is complete
  4. The installer will add a button to the toolbar. Pressing this button will open the curves toolbar.

Usage:

  • select cp mesh select the control point mesh so it can be edited
  • Curve resolution slider controls the resolution of the display curve
  • control points invisible hides the control point mesh
  • curve invisible hides the curve
  • even spacing makes the curve points have regular equal spacing between the points
  • -
  • Position on curve used to output the position along the curve via the Position on curve matrix output
  • -
  • update head move the head indicator to the start of the curve
  • toggle head indicator show/hide the head indicator
  • freeze curve convert to a plain mesh with only edges visible.
  • isaCurve value of 0 is an open curve, 1 is a closed curve

Notes:

  • Do NOT edit the curve node directly.
  • To edit the curve press the select cp mesh button then right click for normal point editing
  • Use Select All Geometry not Select Visible. Some control points/edges can be on invisible back faces.
  • The object coordinate system may be better for editing curves since the x axis will align with the handles
  • Use rectangle or lasso selection with context mode. Do not use face selection mode.
  • To straighten a handle, select it and set scale y and z to zero, do not set x scale to zero
  • To make a closed curve move the last point close to the first point and set isaCurve to 1
  • The curve is never actually closed, this acts as only a flag.
  • The LODin is limited internally to even numbers to avoid spikes in the curve. For example a value of 73 would display as 74 segments to the curve.
  • workspace curves cannot be seen in modelspace
January 7, 2011

Convert a Polygon to a Curve

polygon to curve

This button will convert the selected polygon to a curve.

The Polygon Draw tool will create a polygon with vertices ordered for good curve creation. Make a plane and draw a polygon on it. Select the polygon and push the button.

Preexisting polygons may or may not have good vertex order. If not the curve will be twisted.

poly 2 curve anim

Nov 21, 2015

  • use new curve node with extra points centered
  • not shown in the image above - will now close the curve

Vertex Selection to Curve

points to curve

Push this button to enter a special vertex selection mode. In this mode you select vertices one at a time and they will have a green line in between each selected vertex that represents the final curve. Right click to exit this mode to create the curve.

points 2 curve

Nov 21, 2015

  • use new curve node with extra points centered
  • not shown in the image above - will now close the curve when the last point is the same as the first point

Insert a Curve Control Point

insert cp

Push this button to enter a special mode for adding control points to the control point mesh. After pressing the button the handles will disappear and the previously invisible line segments between the handles will become visible. Select one of these line segments and a new set of control points will be added to the center of the line segment making a new handle.

insert new control point

Delete a Curve Control Point

delete cp

Select the vertex representing the root of a handle and push this button to delete the handle.

delete cp

Extend a Curve

extend curve

Select one of the vertices at the end(or start) of the control point mesh and push this button to extend the length of the curve with a new set of control points.

poly 2 curve anim

Curve Sweep

sweep path

Used to create a series of sweeps along a curve path. A usable uv mapping will be created with the sweep.

The mesh must already have uv assigned to set number 1.

The face that will be swept must have other faces connected to it. This is needed so the tool knows how to extend the existing uv into the sweep. A cylindrical uv assigned to the face and it's connected neighbors works best.

The mesh must also have no rotations in world space. The freeze transform script can be used before entering PE mode to freeze the rotations OR

  1. use the axis tool
  2. normalize rotation tool
  3. axis tool again to close the axis
  4. flatten axis tool (only available in the unofficial truespace update)
curve sweep

The control point curve was preventing selection during this capture so I used the "Invisible" check box on the node so that the curve was easier to select in the 3D view. This is no longer an issue in more recent curve versions.

Usage:

  1. Line up the face to the head of the curve
  2. Make sure mesh has 0 rotations frozen
  3. Enter point edit mode
  4. push the button
  5. script will now wait for you to select a curve
  6. After the selection the face will be swept once for each curve segment, then a copy of the mesh will be swept to generate uv values.

The number of curve points controls the smoothness of the sweep.

Load Curves from a file
Save Curves to a truespace object file
Save CSS Animation

This button will open a panel for loading curves from trueSpace scn and cob files generated from the modelside or earlier truespace versions. It also reads bezier curves from turbocad dxf files and svg format files. Another section is used to save curves in truespace format and to export svg animations for the web.

Save curves from modelside in trueSpace 6.6 ascii format. The version 7 format has a lot of extra information and will slow down the load process.

The scn and cob files must be ascii format. JScript only reads ascii text format files and has no check for binary format files.

curve import panel

Curve Import:

  • z offset - each curve will be offset in the z direction by this amount
  • svg scale - default of 0.01 correspondes to 1cm=1pixel
  • import svg ellipse as polygon - imports ellipses or circles and converts them polygon meshes
  • import svg line as polygon - lines and polylines imported as triangles each with only 1 edge visible
  • import svg path as polygon - import curves and convert them to polygon meshes
  • import svg rectangle as polygon - import rectangles as curves and convert them to polygon meshes
  • close curve with a line - add a line from the end to the beginning of closed curves - option is only valid with non-polygon import
  • seperate svg sub-paths - splits compound paths into distinct curves
  • preserve svg groups-if unchecked will ignore groups that have no transform values
  • expose extra attributes-exports the material transparency value to the top level for easier animation
  • show polygon edges- items converted to polygon meshes will have edge visibility turned on
  • flip path-reverses the direction of the curve resulting in a flipped normal for the polygons. not very useful since curves can go either way
  • "...", Import Curves - press buttons to first choose then load a curve file. Check options above for SVG files to import as polygons instead of curves.

Export Curves:

  • only export selected curves - option: don't export a curve unless it is part of the selection. All curves in the scene will export when unchecked.
  • "...", Export Curves - save in truespace modelside compatible format(COB). Only curves will export.

Export Animation:

  • repeat - how many times to play the animation. A value of -1 means infinite repeats.
  • "...", Export Animation - save CSS and Greensock javascript animation to be used with the imported SVG file. Saves translation, rotation, scale and opacity(transparency) animations. Only animated items will export. The greensock file has the same name as the css but with an html extension.
curve toolbar

2 new buttons on the toolbar for fixing curve based concave polygons and for flipping the normals of mesh faces. The fix polygon is set to work in object mode, not point edit mode. These 2 buttons were added to deal with SVG import problems.

Modelside SVG exporter plugin by "Fenerit" - http://www.united3dartists.com/forum/viewtopic.php?f=43&t=3147

Inkscape document setup:

  • File > New from Template... > Icon..., then press the Create from Template button
  • File > Document properties... > Page tab and set Custom size to desired values
  • File > Document properties... > Grid tab and press the New button then uncheck "Snap to visible grid lines only". Optionally uncheck Visible but leave Enabled checked.
  • Edit > Preferences > Tools > Text choose pixel as the text unit
  • layer1 will have a transform after the custom size is set - delete Layer 1 and add a new one if desired

Inkscape usage notes

  • Object > Object Properties set the item name in the ID field
  • use File > Save As... select "Plain SVG(*svg)
  • create groups if items need to be animated together
  • If incompatible curve types are generated from Object to Path then also use the Path Simplify
  • svg file must represent frame 0 of any animations
  • Path > Stroke to Path, if the stroke needs to be visible in trueSpace
  • avoid matrix type transforms for elements that are to be animated
    • XML editor view will show if transforms are applied to a group or element
    • ungrouping is one way to remove a transform
    • path > union is another way to remove a transform
  • Import does not support
    • clip paths
    • Reflection type curves - type S or T
    • named colors like "red" or "yellow"
    • concave shapes - can be manually fixed in trueSpace later
    • layer1 is ignored, do not rename layer1
    • gradients - average value is used as a single color fill
    • stroke styles, color, width
    • if a stroke is needed - Path > Stroke to Path.(Ctrl+Alt+C)

SVG Import Notes:

Files from Adobe Illustrator and other sources may have a "DTD" line that prevents the Microsoft XML parser/loader from working. To fix open the file in a text editor and remove the line:
DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">

  • The plugin package v.1638404 or higher (March 23, 2014 plugin file date) can be used for simplified export of the cob file. The plugin is required for CSS animation export and it includes a proper file-save dialog. Click Clintons3dPlugin.rsx to download the plugin.
  • the import process will be slow if there are many items in the file
  • Will not parse exponential style numbers. Small exponential numbers are converted to zero.
  • Status will show in the Output Console(Log) view
  • Groups are not preserved when exporting to COB format
  • Use the import as polygon options for items to be animated and exported as CSS/greensock
  • Import has 2 stages the fast read file stage and the slow process curves stage. The end of each stage will have an alert dialog.
  • Best appearance for svg polygon import is in the top view and with 1 light in the scene - an ambient type light
  • The seperate svg sub-paths only works on absolute positioned type path points
  • object render attributes don't show in the panel view - it can be shown by right click on the show selected objects button or replaced with a left click on the same button
  • Items with too many parts can slow down animation in trueSpace. use boolean merge to combine them into one
    1. add a new mesh to the scene
    2. select all the parts using the link editor view
    3. do boolean merge and select the new mesh to combine into 1 mesh
    4. use point edit mode to delete the extra mesh faces
  • CSS animations do not work in Microsoft browsers (Jan 2018 this may no longer be true). Greensock javascript is cross browser compatible. https://greensock.com/
  • svg scale is used for curve import and the inverse is used for animation export in order to maintain scale with the original svg file.
  • larger svg scale values correspond to better text size
  • S type curves can be avoided in illustrator by not having perfectly symmetrical nodes, changing some point types in inkscape also seems to fix it

CSS Export Notes

  • All animations should start at zero and have the same length if they repeat
  • Animation clips names must be unique if there is more than 1 animation. "AnimClip" is the default name.
  • translation, rotation, scale and opacity animations are exported
  • animated items should have pivots assigned before animating
  • do not rename any animated items or they will not match the original svg file
  • timing function translation (trueSpace => CSS)
    • bezier => ease-in
    • custom => ease-in-out
    • linear => linear
    • constant start => step(1,start) for each keyframe
    • constant end => step(1,end) for each keyframe

Some Notes

A curve is composed of 3 parts. The Control Point Mesh(CPM), the curveShaper and the curve mesh.

  • The control point mesh, has the control handle vertices that determine the shape of the curve.
  • The curveShaper translates the control handle points into a curve shape for the curve node.
  • The slider controls the resolution / smoothness of the curve.
  • The head or start of the curve is represented by a small cube. The indicator follows the curve, but does not follow the shape of the curve, so there are buttons for connecting and disconnecting the head indicator.
  • The freeze curve button removes the control point mesh and the curve shaper from the scene, effectively freezing the shape of the curve. Do not just delete the curveShaper or trueSpace can become unstable and crash.
  • A closed curve can be simulated by moving the ends of the curve together and lining up the control handles into a straight line. Real closed curves are not supported.
  • The end handles have 2 points and the middle handles have 3.

The curves are really cone meshes with the faces and most of the edges set to be invisible. You edit the curve by point editing the control point mesh, controlPointMesh . The CPM looks like yellow bezier handles, but is also just a cone mesh. To edit the shape select the CPM and enter point edit mode. Select all the vertices or edges of a "handle" and use the transform widget to move, rotate or scale them. Change a control from smooth to sharp by selecting and moving just one of the handle vertices.

The curves are based on cone meshes because of their consistent point index order and it is the simplest polygon mesh that can represent a curve.

It is easier to use vertex snapping to vertices than to snap to edges.

Some uv editor script commands will crash truespace if the uv editor window is not open.

Moving a point selection is enough to change the triangle indices. The vertex indices are fine but the triangles get scrambled.

The original author of the program used to generate the curves is Rob Bateman. http://nccastaff.bournemouth.ac.uk/jmacey/RobTheBloke/www/opengl_programming.html.

The Nano SVG parser code was used to enhance the import section (Nov 2015) https://github.com/memononen/nanosvg

May 19, 2019

  • new option to make curve points evenly spaced
  • new animation position control

May 2, 2019

  • enhanced add control point script does not alter the selection mode or tool

February 24, 2018

  • persistent install v2 compatible
  • compatible with new batch installer

January 14, 2018: widget install fix

January 7, 2018

  • persistent installer
  • new button to open the curves toolbar
  • unique id for toolbar frame
  • removed right click on polygon to curve button
  • load curve bug: name already exist in scene
  • load curve bug: mirrored in x
  • load curve new: reads curve transform
  • save curve bug: fixed trasnform
  • sweep curve works with the new curve node from July 9, 2012
  • LODin slider limited to even numbers to avoid spikes
  • curve sweep bug: if uv editor not open then get random hard crashes
  • curve sweep improved uv generation and no need to clear the mesh edit settings preserve unwrap

May 31, 2017

  • dont add simple rectangle to freeze curves list
  • new image tags working
  • new option constant color materials
  • css animation export checks and ignores disabled clips
  • opacity only keys - fixed bug
  • april 9 fixed a file path bug css anim export - weird should not have worked
  • partially tested with new keyframes format from rsx plugin, release early because tied to new od_copypaste

March 4, 2017

  • spikey representation fixed
  • freeze curves keeps grouping relationships
  • curve points no longer visible

March 10, 2017

  • added Greensock javascript animation export
  • added scale value to the ui
  • option to break paths into seperate curves
  • better text sizing
  • buttons for fixing and flipping curve based polygons

March 5, 2017 - SVG improvements and CSS export

  • fixed a path bug
  • better color processing - added 3 digit hex and rgb() formats
  • polygon import and improved ellipse and rounded rectangle polygon modes
  • import color and transparency
  • curves as polygons improvements
    • expose transparency for easy animation
    • import as curves then freeze and add pivots
  • import viewbox representation
  • better random names for items without id
  • import at increasing z value to overlap properly in 3D space
  • freeze curve maintains hierarchy
  • text import font, font size, font style and transforms
  • will read style from parent group and apply to the children
  • NEW - CSS animation export

April 5, 2016 - read small exponential values as zero instead of just failing

November 21, 2015 -

  • reads svg files and only saves cob format files
  • supports the new curve close flag
  • saves curves to a single cob file instead of an scn file

Nov 21, 2015

  • use new curve node with extra points centered
  • closed curves
  • head indicator does not interfere with editing
  • svg file support and many curves export to 1 cob file
  • easier to select the control points mesh for editing
  • freeze curve has a cleaner result
  • easy visibility controls

December 1 2012: unique button ids

July 9 2012 - Curves are encapsulated inside a group. The name of the group is assigned from the load script and the save scripts use the group name for the curve name. To rename a group, select the curve in the 3D view and press the up narrow key once to select the group. To edit a curve select it in the 3D view. It's name will be "controlPointMesh". If the "LODMesh" is selected use the left or right arrow keys until controlPointMesh is selected. Once a curve is selected the left and right arrows can be used to select the curve shaper node and it's controls will show in the panel view.

June 17, 2012 - bug fix for the points to curve widget, had mouse drag instead of mouse click node

June 3, 2012

  • save curves to truespace cob and scn files
  • save multiple curves to multiple cob files or to a single scn file

January 16 2012: bug fix for the sweep function which worked in one computer but failed in another. Made it more robust by breaking out a selection and a conversion into seperate script nodes so the scene can update more consistently.

January 8, 2012

  • old version was uploaded(fixed)
  • new automatic installer
  • installs to a NURBS toolbar instead of the Custom toolbar

October 9, 2011 - reads bezier curves from TurboCAD(v14) dxf files

September 6, 2009
September 19, 2009