mcjBuilderA

When i built the mcjCastle prop i needed handrails for the stairs, and i wanted to be able to quickly re-build them.

So i wrote a script, then i improved it to build the castle wall's baseboards and crowns.

Basically, this script creates extruded moldings in wavefront ( obj ) format.

September 16th 2017 6:47am

the "material" command now works correctly with the loaded/dropped .obj

September 16th 2017 6:23am

Beta 9.0 Added operations loadObj dropObj and nomatObj

June 1 2014 6:00 pm

Beta 8.1 fixes issues with endCaps ( related tp the use of the profile-preview curves )

May 31 2014 3:24 am

Beta 8 - DS 4.6 compatibility - extended daz-script access to the scene

May 25 2014 11:59 pm

Beta 7 - multi-mesh closed-paths fixed, PathCaps

May 24 2014 1:30 pm

Beta 6.98 Var, Set,Trans,

May 12 2014 12:02 am

Beta 6 release - many improvements and safety checks

April 29, 2014 9:30 am

Beta 5 release - fixed issue with extrusion path scripts loaded / Imported in .obj format

Apr 28. 2014, 12h45 pm

Beta 4 release a bug limited to scripts using the "closePath" command was fixed,

The collection of txt-format path files now contains the "square" script which is the default

path-script mcjBuilderA looks for upon the first launch

Apr 27. 2014,

Beta 3 release "define" supports more than 1 parameter, slope now applies during "move/Move Z"

Apr 26. 2014

Beta 2 release

Apr 8, 2014, 10:23 PM

Beta 1 Release - with missing profile curves

Apr 8, 2014, 10:36 PM

Beta 1 Release includes paths and profile folders

==========================

Installation

==========================

The zip package is found at the bottom of this page

unzip it in a daz content folder, typically

C:\Program Files\DAZ\Studio\content\

or

C:\Users\YOURUSERNAME\Documents\DAZ 3D\Studio\My Library

once installed, it will appear in your content library, under

studio\Scripts\mcasual

or

My Library\Scripts\mcasual

The script is accompanied by a series of folders that contain molding profiles and some extrusion paths.

Since you may eventually add your own profiles and paths, it's better to install the script in

C:\Users\YOURUSERNAME\Documents\DAZ 3D\Studio\My Library

because you have full read/write access to the files contained in that folder


--------------------------------

Use

--------------------------------

Here is the default state of the script

You can always return to this state by clicking on the "Defaults" button

in the upper--left corner you see the extrusion path definition text, which we will call the extrusion path script

since the "View extrusion profile" option is selected, in the "blackboard" area you see the extrusion profile

if we click on "View extrusion path" now we see .... the extrusion path.

"hardturn 90" means , make a 90 degrees corner

"move 16" means : "advance 16 steps"

by editing the extrusion path script you could create different rectangular and square frames

lets build it !

click on the "Build" button

specify the location and name of the mesh file that will be created : example : basicMesh.obj

a few seconds later the object exists on your disk!

click on the "Load Obj" button

this will load the recently created object in the scene

The dimensions of the frame depend on the number of steps made by each "move" command ( ex: "Move 16" )

The length of each step is given by the "Tread" setting which can be found in mcjBuilder A's "Settings for the extrusion path" panel

The term "Tread" comes from the stairs building terminology.

The default value is 1 inch

You'll note at the top of the path script that we changed "Tread" to "2" by issuing a "Tread 2" command

The size of the extrusion profile ( the diameter of the tube ) can be found in "Settings for molding profile" panel

The default values were 1 x 1 inch

Other molding profiles - the profiles library

More than 84 molding profiles come bundled with this script

the profiles ( library ) folder is in the same folder where the script was installed

( in my case C:\Program Files (x86)\DAZ\Studio\content\Scripts\mcasual\mcjBuilder\profiles\obj )

using the drop-down list shown below you can select other profiles

using the "Profiles library ..." button you can specify the location of the library folder

If you intend to create your own profile curves:

The profile curves are contained in (.obj) files ( also called wavefront files )

the profile mesh must be one continuous polygon

this polygon must preferably be oriented on the XY plane

our default round profile shape for instance is a 32-sided polygon

the dimensions of the polygon do not matter, they get normalized by the script

Maintaining the profile proportions

Each time you select a new profile curve,

mcjBuilderA suggests a height

which will give the extrusion profile the same width-height ratio

as the original molding profile.

Other profile curve options

for profile curves like the U shaped curve shown below, you can de-select the "Close Profile" check-box

and the script will leave the extrusion curve open

The MirrorX and MirrorY options let you reorient the profile curve

the red cross in the preview screen indicates the [0,0,0] coordinate, it's also the attach point for the extrusion path

The path script editor buttons

Load - Lets you load a path curve from a .txt or .obj file - if the file is an obj file, it will be converted to text format

Save As... - Save the extrusion path script ( a text file ) at the specified location.

Save - Save the extrusion path script ( a text file ). overwriting the last one saved!

Clear - Clears the editor

Paste - The complete set of path and profile settings will be pasted at the bottom of the extrusion path script


Profile FrLegacy2
MoldSize 1 0.42
profileUnits in
profilemirrorx off
profilemirrory off
closeprofile on
PathUnits in
Tread 1
Slope 0
Radius 1
ClosePath on
WeldUVs off
StepAngle 11.25
InvertNormals off
InvertUVu off
RotateUVs off

The Extrusion path settings

Tread - the global scale of the extrusion path, Example: if Tread is 10 inches , and the path script contains

the command "Move 6" then the extrusion will advance by 60 inches. The path script may contain commands

that override this value.


Step Angle - when the extrusion path includes a "turn" command, this angle serves to control the smoothness

of the curve. For example, a 90° turn , with a Step Angle of 10 would give us a 9-steps arc. The path script

may contain commands that override this value.


Slope - with a default value of 0, the extrusion remains at floor level, setting Slope to a value of 1 means

the extrusion will ramp up at a rate of 1 " per 1" of extrusion. The path script may contain commands that

override this value.


Radius if the path script contains "turn" commands, then Radius is the default radius for those arcs of circle

the path script may contain "radius" commands that override this default value

Close Path - if this option is enabled, the script will add an extrusion segment going from the last point of the path to the first point.

note : if you create a straight molding segment and this option is on ... nothing good will come out of it !

WeldUVs - The UVs, also called texture coordinates tell the rendering program ( Daz Studio ) how to layout the image

applied to the 3d model surfaces. When the WeldUVs option is Off, the script is allowed to cut the UV map in sections

and achieves non-distorted texturing, notably for rectangular frames. When the WeldUVs option is ON, the UV

coordinates for subsequent segments of the extruded tube are merged / averaged / welded together this introduces

texture-image distortions , but is often not very noticeable, and for this price we get continuous surface textures.

Invert Normals:If you render an extruded object using Daz Studio's software renderer and you use the cartoony

shader or certain advanced shaders, the result may come out black! This is because this specific surface is seen

by Daz Studio as being inside-out. The extrusion profile and extrusion path you chose determined this. By turning

on the "invert normals" option, mcjBuilder will flip them outside-in.

technically speaking:

a facet is created by stringing vertices

if the vertices are given in the counter-clockwise order,

the surface normal is deemed to point toward the observer

and Daz Studio considers this side of the facet as being outside the object

if the vertices are given in the clockwise order

the surface normal is deemed to point away from the observer

and daz studio considers the observer side of the facet as being inside the object

... so it comes out black when using certain shaders

or inside out in the case of Poser

Invert Texture X: depending on the chosen extrusion profile and path, the texture image may come out mirrored,

This option will fix this by inverting the U's of the UV map

The Export as obj Polygon button

will export the current extrusion path as one polygon -

This polygon could then be used as the canvas if your path is a framed painting.

If the path has 32 segments, this polygon will have 32 sides ! If your path contains cavities ( non-convex),

then the polygon produced will not be usable as a cap/lid

Note that the paths exported using this method can be used as profile curves,

if you place them in your scripts/mcasual/mcjBuilder/profiles/obj folder !!

which is exactly what happened in the image below


The "Update Preview" button : when you click this button, mcjBuilder re-evaluates the content of the path script ( text ) panel

and re-generates the graphical display