This script is not extremely difficult to understand and use but it's not a trivial affair.
This script lets you create dynamic looking animations, a common use may be breast bounces as a figure dances
2019 December 16th 03:53 PM - repaired the Load function
2017 May 29th 11:23PM - added a "delay" option to the translators panel
2017 May 29th 11:23PM - corrected an issue with the "modify" button of the translators panel
2017 April 8th 2017 - corrected a bug at line inCtl = obj.findModifier( inName ); needed to be inCtl = obj.findModifier( inPropName );
2016 October 10th 2016 - release
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
Phase 1
The first phase is to create a "simulator device"
A simulator device is composed of 2 nodes
there's the simulator base which will be parented to your actor
and there's the simulator sim which will be parented to the simulator base
if you "run the simulation", the script will animate the sim position for each frame of the current timeline play-range
The sim will swing just as if it was attached to the base using a rubber band.
Hands-on test:
Animate Aiko 4 over a 30-frames playrange.
I used one of the dance loops from my site: https://sites.google.com/site/mcasualsdazscripts2/mcj-2
then i added abdomen swings and hip hoppings
Select Aiko4's chest node
Launch mcjElasticSim
Go in the "Simulators" tab
here you can see we decided to call the simulator device ChestSimDev
i wanted the simulator in the center so i set x = 0
i wanted the simulator in front of the chest, so i set z = 16
y is set to 8, so the base it right in front if the breasts
the other 12 parameters will constrain the simulation movement, but for now, we leave it as-is.
Click on the "Add" button
a simulation device should appear in front of the chest ( shown below as red/green/blue cross )
Click on the Run Simulation button
That's it, for each frame of the timeline playrange, the script animated the sim and it now swings around the base
Since we have a dance loop here, we can click on the Run Oversim button a few times
The script recycles the position of the sim at the end of the playrange, this improves the loopingness of the sim node animation.
Here you see the X and Y animation curves of the sim ( viewed using my mcjSceneGraf plugin )
you will notice that the curves are constrained in the -4 to 4 ( centimeters ) range
That was the purpose of the minX, maxX, minY, maxY, minZ, maxZ parameters we saw previously
the Y curve shows signs that it's hitting the minY floor very hard, this won't look good
so i change minY to -10
i click the "Modify" button and i re-run the simulation
now you can see our sim swings between -9.5 and -1.3 so it never "hits" a floor nor a ceiling
Note that my mcjCycleFilter script is another tool which lets you inspect and modify animation curves
Phase 2
Using "translators" we will convert the movements of the sim into movements of the actor body.
Hands-on test:
Since we "hanged" our simulator device right in front of the chest of our actress,
we can transform the movement of the sim, into movements of the breasts
A translator is simply a set of factors, a source property and a destination property
If mcjElasticSim is still running, press the Exit button
The breast morphs are attached to the root node of the Aiko4 figure, so, select Aiko 4
Now, and this is a bit annoying, but for the sake of versatility, you must also select the source of the movement
in our case it means the sim node ( not the base node! ) named ChestSimDev
Start mcjElasticSim
you will notice that mcjElasticSim detected the presence of the simulator device we created earlier
Go in the Translators tab
the source movements for our translator is the ChestSimDev's YTranslate property
the destination is Aiko4's PBMBreastUpR morph
when the source moves up and down between -9.5 and -1.3
we want the BreastUp morph to swing between -0.5 and 0.4
Next, and this is easy to forget, click on the "Add" button and the settings will appear in the table.
Then, click on the "Sim to Morph" button, and the movements of the sim will be translated into movements of the PBMBreastUpR morph
Trick: set the timeline framerate at 120 fps, create your simulation, set the timeline back to 30 fps. This sometimes improves the results.
Trick: The simulator parameters discussed here correspond to a channel in the parameter tab of the sim.
Trick Change simulation parameters only when you are at frame 0 of the timeline to avoid creating unmanageable animated parameters.
Simulator Tab
As we mentioned, minX, maxX, minY, maxY, minZ, maxZ limit the movements of the sim. The default is 4cm. in Many cases you may want to increase this.
vMax is the maximum speed the sim is allowed to travel per frame, the default is 10
aMax is the maximum acceleration the sim is allowed to achieve, the default is 400
stiff is the stiffness of the imaginary rubberband that goes from the base and the sim the default is 10. You could call this the Hooke spring constant.
here is the same simulation with a stiff factor of 1000 instead of 10
i was a bit surprised that i needed to change it that much to get clearly visible differences
damp stands for "damping", if damp is 1.0 it means 100% of the energy is carried along for each frame of the animation.
If our actress jumped even just 1 time, her breasts would bounce up and down forever.
using a damp value of 0.95 means only 95% of the energy is carried along each grame of the animation
so if the actress stands still, the movements will eventually die down.
here is our simulation with stiff = 10 and damp = 0.98
xAcc yAcc and zAcc is the 3 dimentional force acting on our imaginary weight
we have yAcc = -980, but the x and z components are null, this represents gravity on Earth, 980 cm/s²
changing this should change the apparent weight of the simulator mass.
if you use mcjElasticSim's WebHelp button you will be sent right here,
and be able to see if i posed bug-fixed versions and improvements
a moderately not-too-bad result was obtaines using
the default simulator settings, but the simulator device is attached to the lower-chest node
the position is x,y,z = 0, 8, 20
For the translator, the settings are
source node : simulator001
source property: YTranslate
source min : -4
source max : 0
destination node : Genesis3Female/Zephyra
destination property: pCTRLBreastsUp-Down
destination min : -1
destination max: 1
This is the up-down movement of the sim node ( inspected using my mcjCycleFilter script )
we immediatety see that the lower limit of -4 is way too high, the breasts hit an invisible floor
so we'll try something, we'll set it to -1000000
... way better
and here you can see the XTranslate movement
the small kink in the curve is due to a dance-animation defect
i then set the xMin and xMax limits at -4000 to 4000 and re-ran the simulation
, the simulated range is -4.75 to 4.5 instead of -4 to 4, so there's a bit less "hitting a wall" effects
also note that i constrained to sim's zMin/zMax to 0 .... so the sim moves in a flat X-Y plane
i then tested different simulation settings until i liked the resulting simulation curves
here you see i basically removed the min/max position limits by setting them to -4000/4000
i reduced the damping to 0.94
i also ran the simulation at 60 frames per second
here you see the sim now swings left-right -2.2 to 2 and up-down -6.7 to 3
we manually activate the breast-up morph and determine that the range should be -0.67 to 0.67 ( in the parameters tab it reads as -67% yto 67% )
for the horizontal movements of the sim we will be activating the Breasts Side-Side morphs between -0.67 and 0.67
so we select Genesis3 then add the sim ( the mobile part of it ) to the selection
we run mcjElastic sim
we go in the Tranlate table
and create these settings
notice how the -2 to 2 left-right movements translate to +0.67 to -0.67 Breasts Left-Right morph strengths
════════════════════════════════════════════════════════════════════════
════════════════════════════════════════════════════════════════════════
The translator panel now includes a "Delay" option
when this delay is not zero the property values will be copied from the source property to the target property with a delay expressed in frame
There's also a "looping" option,
when the looping option is in effect, the keyframes that fall out of the PlayRange window will be placed at the beginning of the playrange
so if the source property was looping/cyclical, the delayed target property will also be looping/cyclical
════════════════════════════════════
════════════════════════════════════
by mCasual/Jacques
Copyright (c) 2015 <mCasual/Jacques>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files ( mcjAutoLimb2014 ), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so.
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 NONINFRINGEMENT. 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.