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.

back to workspace nurbs

Usage:

  • Select LOD Mesh select the NURBS display mesh
  • Curve resolution slider controls the resolution of the display curve
  • Even Spacing makes the curve points have regular equal spacing between the points
  • Use Plugin Code uses the rsx plugin to generate the curve shape
  • Position on Curve used to output the position along the curve via the PositionMatrix output. Connect the OwnerMatrix of a node to the PositionMatrix to make it follow the curve. Reset the node Matrix connector to place it directly on the curve position.
January 7, 2011

Draw Curve

draw curve

Use existing scene geometry as a "draw panel" for curve creation.

Drag for a freehand drawing style.

RMB panel for PickSelect and Draw Panel options.

  • Control colors during tool run
  • Min Distance is the minumum distance between control points, useful for freehand drawing to reduce the number of control points generated. The rebuild tool can also be used afterward to reduce unnecessary detail in the final curve.
  • ctrl + lclick to snap to vertices - requires updated rsx v 1638452 and the updated GetPointsWidget

Convert a Polygon to a Curve

polygon to curve

This button will convert a polygon to a curve.

Select the polygon and push the button.

poly 2 curve anim

December 13, 2020

  • Twisting bug fixed. Vertex order derived from triangle edge visibility

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

Circle Curve

circle circle 2 points circle 3 points

Create circles by selecting point edit geometry.
From left to right is Circle Center Point and plane, Circle by 2 Points and plane and Circle by 3 points no plane needed. The circle curves will be named "NURBS Circle".

The circle NURBS control point data does not generate a perfect circle. It has slightly bulging sides with a squarish shape.
New Info: scale each of the 4 pairs of circle handles to about 0.942 will improve the circle shape.

Usage:

RMB panel, Half Circle option to create half a circle instead of a full circle.

When not in point edit mode the selections will be points and a triangle for the orientation.

Circle Center
  1. first selection will be the center of the circle
  2. second selection will be the start of the circle
  3. third face selection will give the normal orientation for the circle
Circle 2 Points
  1. first selection will be the start of the circle
  2. second selection will be on the opposite side of the circle from the first selection
  3. third face selection will give the normal orientation for the circle
Circle 3 Points
  1. first selection will be the start of the circle
  2. second selection will be the second point on the circle
  3. third selection will be the third point on the circle

The 3 point circle does not select a face for orientation because the 3 points form a plane and the circle is created in that plane.

Dev Note: the plugin returns a second set of tesselated circle points. Not used in these scripts.

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 any element of an interior handle and push this button to delete the handle. Select one or more points of the handle or select one or two edges of the handle.

delete cp

Extend a Curve

extend curve

Select any element 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. Select one or more points of the start or end handle or select the edge that makes up the start or end handle.

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.

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. Enter point edit mode
  3. push the button
  4. script will now wait for you to select a curve
  5. 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.

This button has been removed and corresponding items have been added to the file import and export menus.

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 export panel curve import utility panel

Curve Import:

    SVG Import Options:
  • Scale - default of 0.01 correspondes to 1cm=1pixel for svg files
  • Z Offset - each curve will be offset in the z direction by this amount
  • Ellipse as Polygon - imports ellipses or circles and converts them polygon meshes
  • Line as Polygon - lines and polylines imported as triangles each with only 1 edge visible
  • Path as Polygon - import curves and convert them to polygon meshes
  • Rectangle as Polygon - import rectangles as curves and convert them to polygon meshes
  • Freeze polygons - useful for objects that will be animated and the animation exported
  • Close path with a line - add a line from the end to the beginning of closed curves - option is only valid with non-polygon import
  • Break down compound paths - splits compound paths into distinct curves
  • Always close paths - close all open paths
  • Preserve groups-if unchecked will ignore groups that have no transform values
  • Show polygon edges- items converted to polygon meshes will have edge visibility turned on
  • Constant color materials- use a constant color material for curves imported as polygons
  • Create pivots- pivots are needed for items that will be animated and exported as css animations
  • Path Resolution - High, Medium and Low presets for curve display detail. Medium and Low good for complex path reduction.
  • Polygon Thickness - if greater than 0 the polygons will be extruded by this amount.
  • Use Stroke For Fill - if curve fill color is no defined then use the curve color for the fill color.
  • Import - press to 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 COB - 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.
  • SVG File - input file to use to generate the sample html file
  • Export Animation - save html file and 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.
    Open the html file to see the animation in a browser
    The html file will have the same name as the css file created.

Fix Concave Face, Flip Face: 2 utility buttons 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.

TODO notes for responsive svg display

Think have some workflow notes somewhere for import, animate, export process

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.

Inkscape usage notes

  • Edit > XML Editor to expose the id for renaming
  • 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
    • rotate and then scale will create matrix type transform on primitive shapes
    • 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
    • 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:

  • Use the import as polygon options for items to be animated and exported as CSS/html
  • 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
  • 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
  • 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
  • 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

CSS Animation Export Notes

  • All animations should start at zero
  • Animated items should have pivots assigned before animating
  • Animation clips names must be unique if there is more than 1 animation. "AnimClip" is the default name.
  • Only objects imported as polygons will export animations to the css file.
  • translation, rotation, scale and opacity animations are exported
  • 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

It's easier to select a straight line curve in the middle of the line.

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.
  • 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

Legacy Curve tools installer NURBS Curves for trueSpace7.61(workspace)

September 6, 2009
September 19, 2009