mcjPathTube



Introduction 



usually when i want to visualize a path in daz studio i use the mcjTracePath script and the mcjTracer plugin

when i want to make sinuous tubes i use mcjRibbons or mcjTransport

there’s a few other of my scripts which let you create/fashion tubes

notably https://sites.google.com/site/mcasualsdazscripts3/mcjbuildera

this script here lets you make a simple tube from a node path

( simple but very well UV mapped )

you select a node

set the Daz studio Timeline play-range to the start and end of your moving node’s trip

set the number of sides for your tube

press a button and bam a sinuous tube that precisely follows your node’s path appears

caveat is that, unless i fix the maths, this only works well for moderately horizontal paths
( because the transport frame relies on the (0,1,0)  vector and the node-movement vector

WARNING  : In very rare circumstances this script may produce a corrupt .obj file 
and when Daz Studio will attempt to load that file IT WILL CRASH
so save your work before using this script




History



May 7th 2015 11PM release

May 8th 2015 7:24PM multi-tube support and per-tube material




Installing




The zip package is found at the bottom of this page

unzip it in your daz content folder, typically

C:\program files\daz\studio\content\
or
C:\Users\YOURNAME\Documents\DAZ 3D\Studio\My Library

once installed the prop will appear in your library under

content/props/mcasual
or
My Library/Props/mCasual



Using



Select a moving object in the scene, in my example i animated a red ball over a 30 frames time range

Set the Daz Studio Timeline Play-range to the beginning and end of your moving object's journey

Click the "do it" button

Give a location and filename for the object

Warning: If the location is in Daz Studio's temp folder, this file will be destroyed when you exit Daz Studio

After creating the tube .obj file, mcjPathTube will load it in the scene

The object once loaded in the scene .... is in the scene and wont disappear just because the file it comes from is destroyed

warning all this works fine for almost-horizontal  paths but if your paths are more vertical, please try the other scripts mentioned in the introduction

WARNING  : In very rare circumstances this script may produce a corrupt .obj file 
and when Daz Studio will attempt to load that file IT WILL CRASH
so save your work before using this script

- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -
Options
- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -

Twist 

This setting is an angle in degrees. When you create a 4-sided tube, the Tube's outline is more like a diamond shape, by twisting it 45 degrees you obtain a grounded square


Mirror UVU 

flips the UV Map layout along the Horizontal axis


Mirror UVV

flips the UV Map layout along the Vertical axis


Invert Normals

If you use a shader and the renders show the tube as all pitch-black, it's because the tube happened to be built inside-out ( normals pointing inward )

by inverting the normals you are telling the shader "the exterior of the tube is ..... outside the tube

If you experience problems with Displacement maps or Bump maps, it may also be due to this issue 

Also for mcjElevale )



Splash

If you are nerdy enough to be unafraid to run it, here's the script i wrote/used to create the 32 animated nodes which were then used to create the static spaghetti monster
note that the gravity is set to 4G to enhamce the effect
the script creates and animates 32 null nodes over a 100 frames timerange

splish.dsa

var tick = Scene.getTimeStep();

var a = -4000; //10m/s2

for( var i = 0; i < 32; i++ )

{

var node = Scene.findNodeByLabel( "p" + i );

if( !node )

{

  node = new DzNode();

  node.name = "p" + i

  Scene.addNode( node );

}

var x = 2 * ( Math.random() ) - 1;

var z = 2 * ( Math.random() ) - 1;

var y = Math.random();

var v = new DzVec3( x*3, y*500, z*3 );

var pos = new DzVec3( 0, 0, 0 );

for( var fr = 0; fr < 100; fr++ )

{

  var t = fr / tick;

  Scene.setFrame( fr );

  var dy = v.y * t + 0.5 * a * t * t

  pos = pos.add( v );

  pos.y = dy 

  node.setWSPos( pos );

  }

}



License



// mcjPathTube

// by mCasual/Jacques

// You can use this software freely for personal or commercial use.

// You may not resell, sub-license or rent this software in any way.

// You may credit this software to mCasual/Jacques

// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,

// INCLUDING "wasBUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR

// PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE

// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,

// ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


ċ
mcjPathTube.zip
(28k)
mCasual Jacques,
May 10, 2017, 8:36 PM
ċ
splish.dsa
(1k)
mCasual Jacques,
May 8, 2015, 4:32 PM
Comments