-Tutorial -
NextLimit Real Flow 3 - Cinema 4D R9 - XPresso Crash
Course
(most theory can be applied to other apps - esp
Thinking Particles 3DSMax)
This is a complex tutorial, if you want something easier
to star out with
http://www.project1media.com/tutorials/rfbin.htm
.MISSION.
Are you a glass half empty or
glass is half full kind of guy?
Well for arguements sake, you have a
glass with 50% H2O, content
and a pill that's going to;
a)
Make the water Fizz viloently
b) Make the water cloudly.
We're going to combine the physical accuracy of Real Flow
and
un-cover some of Cinema 4D's hidden gems.
LETS BEGIN
Create a new folder for your RealFlow project and Save to
begin.
You'll have several folders for exported content later on.

A Standard Cinema 4D Glass and a simple geometry pill.
Ensure
to triangulate both models and ...
Export the Geometry to RealFlow via - Plugins -Next Limit - SD-SceneExporter
![]()
In real flow, change the APP to Cinema and the Scale to
0.01

Import SD into RealFlow.

Select both geometry objects with the
Tool
and on the right hand
side in your prefs, you need to change
all 4 of the 'Dynamics' to match this
setup.
Now select the pill by itself and change the single property
'Dyn motion' to Yes
This allows the pill to fall.
Now if you hit
ACTION, nothing will happen.
So hit Save instead.

Select a 'Gravity' Deamon from the 'Deamon List'
Open up the 'SceneTree' and 1) select Gravity 2) ADD All
and
now both objects have Gravity.
If you hit 'ACTION' now, the pill will fall into the
glass.
Pretty crap huh?
Hit 'Reset' and then hit 'Lock'
We've locked the scene
now, which stops any of the geometry from moving
as we don't need motion
until we have the glass atleast 50% full.
Save
Select a Circle01
Emitter from the list.
And place
it by the glass. Beautiful, you're on Artist!

Select Collision from the 'Deamon List'
If you've been
paying attention!
Open the 'Scene Tree' and 'Add All' again
The 'Collision' and
'Circle Emitter' shift over to the right.


Circle Emitter still selected, change the Resolution to 3 and
the Density to 100
Default is = 1. But 3.0 at this scale give us more
particles per part of water for smoother results.
OK. Save the scene and Press 'ACTION'
It'll take some time to
fill, but you'll want to do a couple of things.

After 10 seconds only 2000 particles entered my glass, but it already appears to be a quater way full.
Hit 'Action' again. (to pause - DO NOT Reset)
and
change the 'Max Particles' number from the default to 200 or more beyond the
current number of 'Num Particles'
Hit Action and the solution will
begin to settle.
If it's looking good, increase the 'MaxParticles' to for example
5000 and wait again.
The solution will bounce around for a
while.
*Take a mini nap*
It's not perfect, but it'll do..
By Saving now, you do not
need to run this simulation again.

(This step is for explanation only)
Turning 'Lock' off and hitting 'ACTION' allows the pill to fall
into the liquid,
the physics calculate the weight and it falls slowly to the
bottom.
At this stage, 'Reseting' will make me re-run the entire
simulation again..
Hitting Revert from the File menu will take me back to the
Glass half empty stage.
.OK.
PART 2
Timing and the Curve Editor.
IMPORTANT NOTE:
Now that we're getting into the final stages of RealFlow work
you'll want to export your particle simulation as a *.bin sequence
and
your dynamics simulation as an *.sd file.
This is a simple task:
Open 'Export Central'
They'll end up in here for import into Cinema 4D later
on.
<><><><><><><><><><><><><><>

My testing earlier shows that the Pill hits the glass on frame
25.
What I want to achieve is; As the pill falls in,
the Internal
Pressure of the liquid becomes so much
that it boils over the top of the
glass.
With the Curve Editor Open, double click the 'Circle01.Int
Pressure'
and also move the key framefrom 0 to25 (frame 25 is where the
reaction will begin)
I'm going to fake the 'bubbling over' effect by increasng the
'Int.Pressure' from 1 to 50
over a period of 2 seconds (60 frames)
Which technically should make the water bubble over the
top.
But will require some experimenting.

Running into several issues with my own calculations in Real
Flow.
If the Internal Pressure simply isn't creating enough of a
reaction,
you can pause the simulation ('ACTION') and move the white bar to a
later stage in the animation to set a manual keyframe for the
'Int.Pressure'.
The grey space has not yet been calculated, so after setting
your key, return the white bar to the last calculated frame; i.e 103
You can
comfortably over-write the last frame. It will ask you for confirmation.
Here I've set my own key to 30.72 at frame 140.
The final
settings for a dramatic exit was IntPressure 200!!
I could have spent much
more time tweaking the 'Curve Editor', but sometimes
simple keyframes are
enough.
This result is okay for tutorial purposes, you may spend a few
hours
trying to get something to work in a convincing
manner.
<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
PART 3
Getting everything back to Cinema
Bringing RF Solutions into Cinema 4D is quite a simple
task.
I've explained it once before here, so you can skip most of this other
tutorial
and read the essentials aspects of loading rf bin sequences into
xpresso.
http://www.project1media.com/tutorials/rfbin.htm
Bringing the Dynamics *.sd file is as easy as pie also.
Locate the *.sd scene in your folder.
and the Pill will now have the same Animated properties from the
Real Flow Scene.
Follow the other tutorial, but don't bother with the
Metaball technique just yet,
It will only slow you down.
If you get stuck here, read the other tutorial twice..
If you
get really stuck, you can mail me; info@project1media.com
or
stuart_lynch@hotmail.com MSN.
PART 4
Creating a convincing look and feel with XPresso
Hopefully by now you have a working/viewable
particle system in Cinema 4D.
The next stage is to use the power of xpresso
to make some finer details.
Your scene should look
something like this
and this 
Copy only the Glass and
Pill into a new scene
as the *.bin sequence will distract you.
Create a Null Object from Objects Menu
Add an 'XPresso' tag
(right click - Cinema 4D Tags - XPresso)
Double click the node-box shown
above
To open the XPresso Editor
Add a 'PMatterWaves' Node (right click)
In the
Basic Properties for the 'PMatterWaves'
Copy these prefs and hit play in the
viewport.
These are the particles for the Pills Dissolve bubbles.
They
currently exit the glass and start too early, we'll fix that soon.
Right click in the Xpresso Editor and Create a New Node
'PGroup'
(Note - I will reference New Nodes as text from
now on.
All TP Nodes mentioned can be found in these 6
subgroups)
Connect the 'PMatterWaves' Particle Birth
output
to the
'PGroup' Particle input.
(right clicking the blue or red square reveals other input/output
options)
Open the 'Thinking
Particles Settings...'
Add a new
'Particle Group'
Rename the new group
"Bubbles"
And right click and view the settings for this group.
Change the
Color to Blue.
Drag the
'Bubbles' group into the 'PGroup'
Press play in the viewport to see the
effect.
You shoudl have Blue Particles.
In the Xpresso
Editor, create 2 new TP objects 'PPass' and 'PDeflector'
Pass the bubble
group into the 'PPass' node
This says; pass the Bubbles Group over to the
PDeflector Node.
We're going to create a deflection to prevent the bubbles
from escaping.
Select the 'PDeflector' Node and copy from the glass geometry
from the 'objects' menu
into the empty space above labelled
"Object"
Modify the other settings also, most important, change 'Deflector
Type' to Object.
This calculates the geometry.
Pressing play now reveals these results.
(Note, There's an
error in my *.sd file, which makes my scene glitch, shit happens
likely cause
is I failed to simulate a single frame at some point )
The next step is
very simple.
1. Create a 'PPass' Node
2. Create a 'PShape' Node.
3.
Drag 'Bubbles' group into 'PPass' Node.
4. Create and scale down a sphere -
Reduce 'segments'
5. Drag the 'Sphere' geometry directly into the 'Pshape'
Node.
We're telling XPresso to pass the Bubbles Particles into Sphere
instances.
From the Plugins Menu - Thinking Particles
Select
'ParticleGeometry'
Then copy your 'Bubbles' group into the 'Particle Group'
option
You've now used TP to create the Bubbles needed.
You can
scale the 'Sphere' object down if the bubbles render too large for your
liking
Or create another node 'PPass' into 'PSize' and scale them down in
XPresso.
Once you're happy, apply a tranparent material to the 'Particle
Geometry'
One Last Issue
The particles come on
too soon and requires a simple fix.
Right click in
Xpresso Editor
1) Create 'Time' - from New Node - XPresso - General - Time
2). Create 'Compare' as shown above
3). Drag the compare output to point
4. And choose option 'ON'
Select the
'Compare Node'
Change the Date type to Time
Function to ">" 'greater
than'
Input 2 = 00:00:08 (The time where the pill hits the
water)
Note: With a little tweaking, you can keyframe the 'birth
count' in the 'PMatterWaves' node to
quickly increase from 0 to 1000 in a
matter of frames, to create a convincing
effect.
"..Phew.."
PART 5
Making the pill vanish - The easy way.
Firstly I apply an 'Explosion' Deformer to the
pill.
I key frame over a period of about 2 seconds, only a
slight explosion, just to break it apart slightly.
The next part of that equation is to create a material than
gradually fades away completly
frame 45
Move the
white close to the black and add a new Keyframe
frame
120
I've done the same with Alpha channel, but the
reverse colors apply here.
That's it for the pill
effect.
Part 6
Cloudy
Effect.
'Proximal'' in Cinema 4D is a material effect affected
by the position of a null object or geometry.
In this case, I want the pill
to create a "greying" of the water as it slowly melts away.
To make life
easy for now, create a new cylinder similar in size the position of the liquid
in the glass.
as follows;

Create a new Transparent material and turn off the color
channel.
Set the Fresnel to 1.5
and Hide the Glass Geometry (Do no
delete)
1) add a Luminance channel to your material
2) Create a
'Fusion' channel
3) In the 'Fusion' channel create a white color in the Blend
Channel
and a 'Proximal' Effect in the Base Channel
Change the Mode
to Multiply (is set to Normal above)
A) Add
the 'Pill' Geometry to the Objects list in the 'Proximal' shader
properties
B) Change the settings to the ones shown.
You can see from the results (Left) that the Luminance is having
an effect
on the color of the water. It is relative to the position of the
pill.
You will have to keyframe the 'End Distance' over time for the
effect to spread throughout.
This requires quite a large amount of time spent
experimenting to get a perfect result.
My result
Frame 30 - End
Distance 0%
Frame 120 - End Distance 100%
We don't need to the
cylinder once we're done.
The effect needs to be applied to the Metaball
Geometry in the final render.
Simply use this texture for the final
solution.
<><><><><><><><><><><><>
PART 7
Finishing up.
The next
task is to convert the RFBIN sequence into a metaball
liquid.
After following the "importing to cinema" part
of the Metaball tutorial,
you should have a clear understanding
on how
to bring in the RFBIN particle solution into XPresso
and converting those
particles into Metaball geometry.
Again, that tutorial:
http://www.project1media.com/tutorials/rfbin.htm
"It's actually one of the easiest parts, don't give up yet"
RealFlow will create a new Particle group for you called
"RF_Group"
You will need to create another Particle Geometry object for the
Liquid.
Remeber: keep your 'editor subdivision' at a high
'meter' length for metaballs, otherwise you will be in danger
of trying to
view polygons in the Millions in your viewport.
Set the Render subdivsion
about 1/8th the size of the editor view,
which will give you 8x the current
geometry.
Once you're happy. Light the scene and render.
(Will update with a new render soon)
HAPPY RENDERING
Stuart Lynch
InTheCity
www.project1media.com