mcjAddRadialMorph

Iimportant Note : versions before V4 could make a scene un-loadable if the morphed object was a subdivided surface at the moment of creation of the morph. Version 4 forces the shape in its safe non-subdivided state

══════════════════

Introduction

══════════════════

This script lets you quickly add a radial morphs to a prop.

══════════════════

History

══════════════════

v4 February 23rd 2019 17:26 - Very important safety feature added, and a new single-selection mode

v3 September11th 2015 21:58 - Major update, added an Append To Morph" and a "Remove from Morph" button

v2 October 12th 4:30 am the 2-cylinder mode for the displace effect was fixed

v1 October 11th Release

══════════════════

Installation

══════════════════

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:\Program Files (x86)\DAZ\Studio\content\

once installed, it will appear in your content library, under Studio / Scripts / mcasual

or

C:\Users\Public\Documents\My DAZ 3D Library\

once installed, it will appear in your content library, under My DAZ 3D Library / Scripts / mcasual

Note that this package includes a sub-folder named Ressources, containing 54 icons

Those icons are needed by the script. Depending on your version of Windows/Mac

you may need to explicitly allow the creation of folders wherever you install this.

══════════════════

Use

══════════════════

Step 1 : Select the object to be morphed and 1 or 2 "domain" cylinders

You must select 2 or 3 nodes before using this script

1 - The object which will receive a new morph

2 - A cylinder containing the vertices to morph ( like a d-form field ). The Y Axis of this cylinder is used as the center of the radial push.

or

1 - The object which will receive a new morph

2 - The external cylinder : A cylinder containing the vertices to morph ( like a d-form field ) The Y Axis of the external cylinder is used as the center if the radial push.

3 - A smaller cylinder containing vertices that will be excluded from the morph

This setup is used in cases like : adding a radius morph to a tire without affecting the rim

NOTE: this script is meant mainly for props ( .obj ) if you are using DS 4.X, you can select the root

node of a figure and add a morph using this script.But your figure must be zero-posed.

Though you could move limbs out of your way, example, move the left leg up when you want to

create a morph that affects only the right leg

Step 2 : Launch the script

If the installation went well, the script is in a 'Scripts / mCasual' section of your Daz Studio library

Step 3 : Identify the morph receiver object

In this case the object which will receive the morph is "mcjEyeT"

Step 4 : Chose a Radial effect

There's 3 types of Radial effects

Displace :

The vertices will be pushed away from the center axis of the external domain cylinder by the "displacement" amount. Ex.: 'displacement' is 10cm. A vertex presently 20 cm away from the center axis of the cylinder will end up 30 cm away from the center axis of the cylinder

Scale:

The vertices will be pushed away from the center axis of the cylinder by their current distance. Therefore doubling that distance. Ex.: A vertex presently 20 cm away from the center axis of the cylinder will end up 40 cm away from the center axis of the cylinder

Press:

The vertices will be pushed away from or pulled nearer to the center axis of the cylinder until they are at the distance specified by the 'displacement' setting. Ex.: 'displacement' is 10cm. A vertex presently 20 cm away from the center axis of the cylinder will end up 10 cm away from the center axis of the cylinder

example: Radial effect = Scale; Axial effect = Widen

Step 5 : Chose an Axial effect

The default axial effect is named 'constant' and is the easiest to figure.

The behavior is exactly as described in Step 4

The other effects modulate the vertex displacements according to their position in the domain cylinder ( the yellow/green cylinder ).

For example, we saw that the "Scale" radial effect normally doubles the distance of a vertex from the central axis of the domain cylinder. If we select the 'Widen' axial effect, the vertices at the bottom of the cylinder will not move at all and the vertices at the top of the cylinder will be pushed away to twice their original distance.

Step 5e : Custom axial effect

This option is meant for users with some script/programming experience.

If you chose the axial effect named "Custom", then you must supply a formula ( script ) in the "Custom Equation" text box.

in your context you have access to all the script's global variables and these important ones

f : the position of this vertex along the center axis of the external domain cylinder, a number ranging from 0 to 1

v : the World-Space position of the vertex ( cached geometry )

vGeo : the non-transformed, non-morphed position of the vertex.

vPush : the morph delta vector

angleY : angle of vGeo in the XZ plane = pi + atan2( vGeo.z, vGeo.x );

i also included in your context short-hand notation for the main Math functions

sin, cos, tan, pi, PI, abs, log, pow, random, sqrt, tan, atan2

example : f = ( sin( f * 2 * pi * 3 ) - 1 ) / 2;

f = angleY;

Step 6 : Chose a name for your new morph

There's also a button labeled "As Morph Name which will set the morph name to the name of the Radial and Axial morphs

ex: "Displace Taper"

Step 7 : Do the deed

Press the "Do it" button.

The morph will be added to your prop and is now in the prop's parameters tab.

You may use the "Toggle" button to view the morph result without exiting the script

and use the toggle button again to set the new morph strength back to 0%

New in version 3

If your target object does have a morph named, for example "Stretch" and the current specified morph name is "Stretch"

then using the "Append To Morph" button will add the selected vertices movements to that existing morph

If your target object does have a morph named, for example "Stretch" and the current specified morph name is "Stretch"

then using the "Remove From Morph" button will remove the selected vertices from the existing morph

]

New in version 4

Safety feature: prevents the creation of morphs when the surface is Subdivided

without this, a scene file could be rendered un-loadable!!

there's now a button to set the strength of the currently named morph to 100%

there's now a button to set the strength of the currently named morph to 0%

there's now a mode for single-node selections, the object will receive the morph,

all the vertices will be affected, the object's Y Axis will serve as the center of the push/pull effect


══════════════════

License

══════════════════

You can use this script freely for personal or commercial use.

You may not sell, resell, sub-license or rent this models in any way.

you may credit this script to mCasual/Jacques

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

INCLUDING BUT 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.