tag:blogger.com,1999:blog-47823685971419943912024-03-18T21:40:07.633-07:00Particle EffectsHere I will present some useful tips for VFX artists who use particles in their work. It will be mostly Maya but increasingly ICE and Realflow as I learn the ropes. Please feel free to comment or correct as appropriate.Unknownnoreply@blogger.comBlogger15125tag:blogger.com,1999:blog-4782368597141994391.post-13088661045430771772014-01-06T04:39:00.000-08:002014-01-06T05:00:56.342-08:00Getting scene name into ICEI have found a way to get the scene name into ICE<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjSiXm_Ykkcdw-caFBYfoRn5EStEIvbiA2GLc8gd5Hb3sPFqrxgfPEU-X_UgRwwxWqqtqDVP5cFW1PDPy0VOMbJrHF1LtTb2RQy_5h3cd6j_4wSUn9qwrr9kUvxELC5TT6LdVN2MqgTtPk/s1600/ICE_sceneName.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjSiXm_Ykkcdw-caFBYfoRn5EStEIvbiA2GLc8gd5Hb3sPFqrxgfPEU-X_UgRwwxWqqtqDVP5cFW1PDPy0VOMbJrHF1LtTb2RQy_5h3cd6j_4wSUn9qwrr9kUvxELC5TT6LdVN2MqgTtPk/s1600/ICE_sceneName.png" height="390" width="640" /></a></div>
<br />
<br />
<ol>
<li>Set your Explorer window to show Sources/Clips</li>
<li>Drag Sources (yourSceneName) from the Explorer into your ICE tree</li>
<li>Plug Out Name into a Reference To String node</li>
<li>Use a Get Sub String to trim off the bits of the string you don't want</li>
</ol>
<div>
There you have your scene name as a string in ICE.</div>
<div>
<br /></div>
<div>
I found this useful for setting custom paths on my ICE Caches.</div>
<div>
<br /></div>
<div>
<br /></div>
<br />
<br />Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-4782368597141994391.post-54420039250893436282013-11-12T00:49:00.004-08:002013-11-12T03:44:47.456-08:00UV particles via SOuPHere is a small SOuP technique for producing a plane of particles with a UV gradient on their RGB.<br />
<br />
First you need a plane, then emit some particles from that plane. Make sure that the particles have the rgbPP attribute available as we will need to put an expression on it.<br />
<br />
Create a SOuP TextureToArray node<br />
Create a SOuP rgbaToColorAndAlpha node<br />
Create two ramp texture nodes - ramp1 is black to red along U, ramp two is black to green along V<br />
<br />
Connect the following:<br />
<br />
<blockquote class="tr_bq">
<span style="color: orange;">ramp2.outColor --> ramp1.colorOffset</span></blockquote>
<blockquote class="tr_bq">
<span style="color: orange;">ramp1.outColor --> textureToArray1.inColor</span></blockquote>
<blockquote class="tr_bq">
<span style="color: orange;">polyPlaneShape.worldMesh[0] --> nParticleShape.inputGeometry</span></blockquote>
<blockquote class="tr_bq">
<span style="color: orange;">polyPlaneShape.worldMesh[0] --> textureToArray1.inGeometry</span></blockquote>
<blockquote class="tr_bq">
<span style="color: orange;">textureToArray1.outRgbaPP --> rgbToColorAndAlpha1.inRgbaPP </span></blockquote>
<br />
Also connect the emitting plane's transform node to the particle's transform node as shown in the node graph.<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjRJMYRCRHyHpd89dYfWkcoB-qC9jiZk1PGWCEhuqiIe6HJoaDkONbKITSBAHwQwnzis3ElHLylRHWuWifCEHYKSLrpaAo96fmBq8kvLBlujZIr_e2BDHMMDQ5shmZsTRM_7QBtKXGOYd0/s1600/UVgrid_nodes.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="396" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjRJMYRCRHyHpd89dYfWkcoB-qC9jiZk1PGWCEhuqiIe6HJoaDkONbKITSBAHwQwnzis3ElHLylRHWuWifCEHYKSLrpaAo96fmBq8kvLBlujZIr_e2BDHMMDQ5shmZsTRM_7QBtKXGOYd0/s640/UVgrid_nodes.jpg" width="640" /></a></div>
<br />
Now set the rgbPP using the creation expression:<br />
<br />
<blockquote class="tr_bq">
<span style="color: orange;">rgbPP=rgbaToColorAndAlpha1.outRgbPP</span></blockquote>
<br />
Rewind and step forward one frame so that the particles are emitted. Then set their initial state and disconnect the emitter and the connection between <span style="color: orange;">polyPlaneShape.worldMesh[0] --> nParticleShape.inputGeometry</span><br />
<span style="color: orange;"><br /></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjl0D3BWJSvXSD7AOY1SzWhUV63TbexEcJdB6KDVUPgVO4vBTEJaU9Aw6bjG3AcI4AiRYRUYMA4OrEH0YLKicMznAhxzOQV3q8bK_Gws9KHiZl0FNAp2kTAt-tsrxFL4a_w98pbguVQepY/s1600/UVgrid_particleShape.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="400" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjl0D3BWJSvXSD7AOY1SzWhUV63TbexEcJdB6KDVUPgVO4vBTEJaU9Aw6bjG3AcI4AiRYRUYMA4OrEH0YLKicMznAhxzOQV3q8bK_Gws9KHiZl0FNAp2kTAt-tsrxFL4a_w98pbguVQepY/s640/UVgrid_particleShape.jpg" width="640" /></a></div>
<span style="color: orange;"><br /></span>
<span style="color: orange;"><br /></span>
<span style="color: orange;"><br /></span>
The particles will now be dynamic again.<br />
<br />
<br />
In Nuke, plug in your rendered particles into the STMap node as shown in the image below<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhy21PdiOfNudPiQm5ihlath_ngimjF-g_6Ic0vNOMKm0zi1FNZseJzsm3c-LHwYA4UT_uml_Ub39u3_0h0JpFOBRSEZgcg7Zpd0gz956eV5OmF-EW6bp9LKsCuMtoPpLyqPxW3dO9XEoA/s1600/UVgrid_STmap.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="390" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhy21PdiOfNudPiQm5ihlath_ngimjF-g_6Ic0vNOMKm0zi1FNZseJzsm3c-LHwYA4UT_uml_Ub39u3_0h0JpFOBRSEZgcg7Zpd0gz956eV5OmF-EW6bp9LKsCuMtoPpLyqPxW3dO9XEoA/s640/UVgrid_STmap.jpg" width="640" /></a></div>
<br />Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-4782368597141994391.post-75291239397096652212013-11-11T23:19:00.001-08:002013-11-11T23:20:39.996-08:00Ticker-Tape TumbleHere is an expression I used to simulate the tumbling motion of ticker-tape.<br />
The ticker tape need to tumble fast around its long axis, in my case the x-axis.<br />
<br />
<br />
<blockquote class="tr_bq">
<span style="color: orange; font-weight: normal;">//which direction to tumble?</span><span style="color: orange; font-weight: normal;">userScalar1PP=rand(1);</span><span style="color: orange; font-weight: normal;">if(userScalar1PP<0.5){tumble_dirPP=1;}</span><span style="color: orange; font-weight: normal;">else {tumble_dirPP=-1;}</span></blockquote>
<br />
<blockquote class="tr_bq">
<span style="color: orange; font-weight: normal;"></span><span style="color: orange; font-weight: normal;">tumble_speedPP=rand(30,60);</span></blockquote>
<br />
<blockquote class="tr_bq">
<span style="color: orange; font-weight: normal;">rotStartPP=sphrand(360);</span><span style="color: orange; font-weight: normal;">rotIncrPP=<<(tumble_speedPP * tumble_dirPP),rand(-2,2),rand(-10,10)>>;</span></blockquote>
<br />
<blockquote class="tr_bq">
<span style="color: orange; font-weight: normal;">rotationPP=rotStartPP;</span></blockquote>
<br />
<blockquote class="tr_bq">
<span style="color: orange; font-weight: normal;"></span><span style="color: orange; font-weight: normal;">sizePP=rand(0.25,0.35);</span></blockquote>
<br />
<blockquote class="tr_bq">
<span style="color: orange; font-weight: normal;">indexPP=rand(3);</span></blockquote>
<br />
<blockquote class="tr_bq">
<span style="color: orange; font-weight: normal;">lifespanPP=99;</span></blockquote>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-4782368597141994391.post-19571397470794531882013-09-13T04:41:00.004-07:002013-10-15T22:57:19.342-07:00GPU renderersI will be testing some particle renderers in the next few days - Arnold, Fury and Krakatoa.<br />
<br />
<br />
This first test is Fury<br />
<br />
20 million nParticles<br />
motion blur switched ON<br />
4 x multisampling<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjlphyphenhyphenq_iqo1OYlP707btq29vC2Hn2fBdTIwCvjh3MPfcNPTDSuhGSBOeEfobxXL7lbM3Bi-Laxa6pmW6hXDbs6brO65R26E1sWFx_fyHp1OW43_IQ-8ndS1-Sf4_HC-ovo5R5_AgMVq_o/s1600/furyTest_01.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="211" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjlphyphenhyphenq_iqo1OYlP707btq29vC2Hn2fBdTIwCvjh3MPfcNPTDSuhGSBOeEfobxXL7lbM3Bi-Laxa6pmW6hXDbs6brO65R26E1sWFx_fyHp1OW43_IQ-8ndS1-Sf4_HC-ovo5R5_AgMVq_o/s320/furyTest_01.jpg" width="320" /></a></div>
<div style="text-align: center;">
<span style="font-size: x-small;">13.26 seconds (dual Xeon E5 - 32 cores, 48GB RAM, Nvidia Quadro 4000)</span></div>
<br />
I'm showing the alpha channel only because I currently just have the demo version of Fury and the watermark is distracting in the colour channel.<br />
<br />
<br />
The next test is Krakatoa<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgH_l04WGcKPVC1VWNiU-bXhgOlz9puI0BXsRvbpIQAFY6brDPO06rxvuql2qXRidPZN91LaC6yfj4D9SHgdXNBFQaV55p43bmI8ufY4ELAbDXG-6JbepMCj6wth4METHqfcBV3HcVQhWg/s1600/krakatoaTest_01.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="216" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgH_l04WGcKPVC1VWNiU-bXhgOlz9puI0BXsRvbpIQAFY6brDPO06rxvuql2qXRidPZN91LaC6yfj4D9SHgdXNBFQaV55p43bmI8ufY4ELAbDXG-6JbepMCj6wth4METHqfcBV3HcVQhWg/s320/krakatoaTest_01.jpg" width="320" /></a></div>
<div style="text-align: center;">
<span style="font-size: x-small;">motion blur OFF, render time 11 seconds </span></div>
<br />
It's slightly trickier to get started with Krakatoa, but I think the results look amazing. Again, this is a lot of particles (14 million)<br />
<br />
<br />
Here is my setup for Arnold, but I cannot seem to get the opacity to work properly.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhhnA2GkSty8mn52J8Cd5DK1xCI24gcQTTrIOsI5uDAMlzHkLM7yMwk-7fymKlgF086suTW7FvShq_GULtmoZWkZ6qsvpvjUOX9cyyqdYevm2eCt7oWSHNtW05Dk4N5EyQxHPw7_JI9Ofo/s1600/Arnold_02.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhhnA2GkSty8mn52J8Cd5DK1xCI24gcQTTrIOsI5uDAMlzHkLM7yMwk-7fymKlgF086suTW7FvShq_GULtmoZWkZ6qsvpvjUOX9cyyqdYevm2eCt7oWSHNtW05Dk4N5EyQxHPw7_JI9Ofo/s320/Arnold_02.jpg" width="254" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjW-H4-kdOJW_RrzGhHtwXW28mCn9oO7r8T1HIMXFg-j4L62E1h9YyVUAzXO4Q3yY01y7Ae_7so6Vh6lpyi5lKlH5Owu326Zb_c-pFtTlmqLltcLBRk5wsFH9dSwKielWx-J5y6OvQmbaw/s1600/Arnold_03.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjW-H4-kdOJW_RrzGhHtwXW28mCn9oO7r8T1HIMXFg-j4L62E1h9YyVUAzXO4Q3yY01y7Ae_7so6Vh6lpyi5lKlH5Owu326Zb_c-pFtTlmqLltcLBRk5wsFH9dSwKielWx-J5y6OvQmbaw/s320/Arnold_03.jpg" width="115" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjzu0Rr34IV4RQvvYdRRtgPEc__f4eCjkHgezKJGCPo3Qi65HZHmqz1fuwrY2gIhQpUEci-dBmXzSDPydAxiTTlELMEFzyOCfWh_IZgd6pfndmd_DIyqSeBvVNxR8u_2jfS4pAg0HGWZWE/s1600/Arnold_04.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="219" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjzu0Rr34IV4RQvvYdRRtgPEc__f4eCjkHgezKJGCPo3Qi65HZHmqz1fuwrY2gIhQpUEci-dBmXzSDPydAxiTTlELMEFzyOCfWh_IZgd6pfndmd_DIyqSeBvVNxR8u_2jfS4pAg0HGWZWE/s320/Arnold_04.jpg" width="320" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhyzrbOqXgsjn8SxhFwaNii3ZV3pGFHTY_Rkwa4gJvU0kvfml-1JuTCOepvc7yvBb7LT4aVsSJwfjOD8k90l6DEz1tekL7LF-bfYu28Jwu_n0j8URfBn1iqYJtlEASsHA0HCI7dLJEzrwU/s1600/Arnold_05.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="226" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhyzrbOqXgsjn8SxhFwaNii3ZV3pGFHTY_Rkwa4gJvU0kvfml-1JuTCOepvc7yvBb7LT4aVsSJwfjOD8k90l6DEz1tekL7LF-bfYu28Jwu_n0j8URfBn1iqYJtlEASsHA0HCI7dLJEzrwU/s320/Arnold_05.jpg" width="320" /></a></div>
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
More details as soon as I can get some help making this work.<br />
<br />
<br />Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-4782368597141994391.post-51605207437053961382013-09-09T03:03:00.005-07:002013-09-09T03:03:58.500-07:00nCloth instancesI have been working on a confetti shot and wanted to use nCloth. I decided to use a particle emitter and to instance the nCloth object onto the particles - but how? If I were to simply assign the nCloth object to the instance, then each instance would be identical. I wanted to have a different starting point in the nCloth cache for each instance. Unfortunately Maya's instancer doesn't support this kind of connection. I tried to use an userScalarPP attribute along with a particle sampler to access the cacheStart attribute on the nCloth cache, but that didn't work.<br />
<br />
Here's how I did it:<br />
<br />
First cache the nCloth object<br />
<br />
Export the nCloth as a sequence of OBJs. I used a python script called <a href="http://www.creativecrash.com/maya/downloads/scripts-plugins/utility-external/export/c/objs-exporter--2" target="_blank">objsExporter_v2</a> from Christos Parliaros<br />
<br />
Re-import the OBJ sequence using Dave Girard's <a href="http://www.creativecrash.com/maya/downloads/scripts-plugins/data-management/c/obj-sequence-importer" target="_blank">objSequenceImporter</a><br />
<br />
Use the imported OBJs to create an instancer with cycling set to On<br />
<br />
On the particle object I setup a per-particle attribute; cyclePP and used this to select the correct OBJ in the sequence. For example, if there are 30 OBJs in your sequence, in the creation expression:<br />
<br />
cyclePP=0;<br />
<br />
and in the Runtime before dynamics:<br />
<br />
cyclePP=(cyclePP+1) % 30;<br />
<br />
so the nCloth object will loop through the cache and start from the beginning at the end of the loop.Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-4782368597141994391.post-40177725013936221272013-09-09T03:03:00.002-07:002013-09-09T03:03:28.941-07:00Maya Strands**OK, not exactly the same as Softimage ICE strands (which are great, by the way), but here is a way to get a very basic approximation.<br />
<br />
I am basically taking <a href="http://www.sigillarium.com/blog/lang/en/228/">Sigillarium's</a> particle expression for making a uniform trail of particles and adding a line to take the seed particle's colour attribute and passing it to the emit command. This way, the trails have the same colour as the emitter particle, which is very handy if you are emitting from a surface and inheriting particle colour from that surface.<br />
<div>
<br /></div>
<div>
Here is the expression:</div>
<div>
<br /></div>
<div>
//runtime before dynamics</div>
<div>
<div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">
seed_particleShape.beforePosition = seed_particleShape.position;</div>
<div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">
<br /></div>
<div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">
<br /></div>
<div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">
//runtime after dynamics</div>
<div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">
</div>
<div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">
string $trail_pt = "smoke_nParticle"; </div>
<div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">
float $separ = seed_particleShape.separation;</div>
<div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">
</div>
<div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">
vector $lastPos = seed_particleShape.beforePosition;</div>
<div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">
vector $pos = seed_particleShape.position;</div>
<div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">
vector $move = <<(($pos.x)-($lastPos.x)), (($pos.y)-($lastPos.y)), (($pos.z)-($lastPos.z))>>;</div>
<div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">
<br /></div>
<div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">
//get colour info</div>
<div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">
</div>
<div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">
vector $rgb=seed_particleShape.rgbPP;</div>
<div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">
float $r=$rgb.r;</div>
<div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">
float $g=$rgb.g;</div>
<div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">
float $b=$rgb.b;</div>
<div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">
<br /></div>
<div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">
//get number of particles to emit per frame</div>
<div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">
</div>
<div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">
int $num = ceil( mag( $move ) / $separ );</div>
<div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">
<br /></div>
<div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">
//loop !</div>
<div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">
<span style="font-family: 'courier new'; font-size: small;">if( $num != 0 ) {</span></div>
<div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">
vector $step = $move / $num;</div>
<div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">
for( $i = 1; $i <= $num; $i++ ) {</div>
<div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">
vector $newPos = $lastPos + $step*$i;</div>
<div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">
float $life = time - (1.0/25/$num * ($num-$i));</div>
<div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">
emit -o $trail_pt -pos ($newPos.x) ($newPos.y) ($newPos.z) -at rgbPP -vv ($r) ($g) ($b) -at "birthTime" -fv $life;</div>
<div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">
}</div>
<div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">
}</div>
<div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">
<br /></div>
<div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">
<br /></div>
<div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">
There are a couple of things to note:</div>
<div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">
<br /></div>
<div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">
The seed particle shape node has an extra attribute added - separation. This is a float value that determines the distance between each particle in the trail. The number you use depends on the scale of the scene and velocity of the seed particle. It's handy to have this variable on the shape node rather than in the expression.</div>
<div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">
<br /></div>
<div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">
There is a per-particle vector attribute called beforePosition, which stores a particle's position from the previous frame. This attribute needs to be created using the Add Attribute dialogue:</div>
<br />
<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjtZWZU7xsnJLD5MjUGADK8pggUDV1UU-wl218QmRBlG1YLXIz21aBOOd74PYYbEborV9UO1gp0CxGBLA-Dqv44XgRh6WspGRkLzPmSl7YvBRzexXbkgY6RWdkJZsM0sl_gJS9mEw5fuUcI/s1600/trails_02.jpg"><img alt="" border="0" id="BLOGGER_PHOTO_ID_5693363786897143298" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjtZWZU7xsnJLD5MjUGADK8pggUDV1UU-wl218QmRBlG1YLXIz21aBOOd74PYYbEborV9UO1gp0CxGBLA-Dqv44XgRh6WspGRkLzPmSl7YvBRzexXbkgY6RWdkJZsM0sl_gJS9mEw5fuUcI/s400/trails_02.jpg" style="cursor: hand; cursor: pointer; display: block; height: 400px; margin: 0px auto 10px; text-align: center; width: 367px;" /></a><br />
<br />
<div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">
Also, note the variable $trail_pt in the expression. This is just the name of the trail particle object. Create this object before running the expression either by a 'particle' or 'nParticle' MEL command or by creating an emitter via the menus and deleting the emitter and leaving the particle object behind. Set the $trail_pt variable to the name of your trail particle object.</div>
<div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">
<br /></div>
<div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">
<br /></div>
<div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">
</div>
</div>
<br />
<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjP4Txkv4-mMznxdi46IdC7XXvBLbxaRlrtm8Qln3VWUfz2BTNtPRwyaRzpjjDtKnHlnbYAAAMGNcRmLldIsQPWU8Rz9rZ7pvnnl1xfYYWobssDbfdh2pLGD3rtJ8umVLaATp3TjJo-qacq/s1600/trails.jpg"><img alt="" border="0" id="BLOGGER_PHOTO_ID_5693328134091706162" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjP4Txkv4-mMznxdi46IdC7XXvBLbxaRlrtm8Qln3VWUfz2BTNtPRwyaRzpjjDtKnHlnbYAAAMGNcRmLldIsQPWU8Rz9rZ7pvnnl1xfYYWobssDbfdh2pLGD3rtJ8umVLaATp3TjJo-qacq/s400/trails.jpg" style="cursor: hand; cursor: pointer; display: block; height: 244px; margin: 0px auto 10px; text-align: center; width: 400px;" /></a><br />
<br />
<div>
So, you can hopefully see that I have an image on a plane from which I am emitting some particles which are taking the colour from the plane. Those particles are then emitting more particles in a trail and inheriting the colour from the first particles. </div>
<div>
<br /></div>
<div>
Thanks to Sigillarium for the excellent expression. Please check the <a href="http://www.sigillarium.com/blog/">Sigillarium blog</a> as it is outstanding and very clearly explains some difficult concepts.</div>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-4782368597141994391.post-87209422966114087822013-09-09T03:02:00.005-07:002013-09-09T03:02:58.104-07:00Motion Vectors for hardware particlesI am trying to write an expression which will mimic the mv2DToxik motion vectors, but for hardware particles. Therefore removing the need to instance some geo to get the motion vectors to render.<br />
<br />
I have not got very far before I came across some vector maths...<br />
<br />
<br />
Here is the setup which works for a camera pointing exactly down the z-axis.<br />
<br />
<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiUp8Ooz-ShE0Uyconu1Mg8UjzhsVB0vs9_NqeqibqMj8CXmSc3EtrOTzzkiUVsxWPxOVfGeOtIaYI53nL2u14RZjK6kEZLrxPp1qQbWS3kgywcAKL0w7oUceODqP_7F87q6i526mawhXu6/s1600/mv_01.jpg" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"><img alt="" border="0" id="BLOGGER_PHOTO_ID_5680356188648334658" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiUp8Ooz-ShE0Uyconu1Mg8UjzhsVB0vs9_NqeqibqMj8CXmSc3EtrOTzzkiUVsxWPxOVfGeOtIaYI53nL2u14RZjK6kEZLrxPp1qQbWS3kgywcAKL0w7oUceODqP_7F87q6i526mawhXu6/s400/mv_01.jpg" style="cursor: hand; cursor: pointer; display: block; height: 250px; margin: 0px auto 10px; text-align: center; width: 400px;" /></a><br />
<br />
<br />
<br />
<br />
Here is the render loaded into Nuke. Notice the RGB values.<br />
<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhA2CGrS9JUCGcgR6pvbtEK1NnxumPtsZMcEce20ic-mQzLl-G9pUXTTk5juVmVr2wwh52V4fYMLX1TC17K2kuxxt-NoAjuKWzZrhx8_3o1FqbgxHpw1GZDTclfEcXuU5wSbwRkeNG6007l/s1600/mv_02.jpg" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"><img alt="" border="0" id="BLOGGER_PHOTO_ID_5680356190950091778" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhA2CGrS9JUCGcgR6pvbtEK1NnxumPtsZMcEce20ic-mQzLl-G9pUXTTk5juVmVr2wwh52V4fYMLX1TC17K2kuxxt-NoAjuKWzZrhx8_3o1FqbgxHpw1GZDTclfEcXuU5wSbwRkeNG6007l/s400/mv_02.jpg" style="cursor: hand; cursor: pointer; display: block; height: 250px; margin: 0px auto 10px; text-align: center; width: 400px;" /></a><br />
<br />
I now need to find a way to convert World Velocity to Screen Space Velocity.<br />
In a MEL expression. Hmmm, time to ask the <a href="http://forums.cgsociety.org/showthread.php?p=7180108#post7180108">Forum</a><br />
<br />
After some great advice from Zoharl, I grabbed some code which uses the camera's worldInverseMatrix to transform the velocity vector.<br />
<br />
Here is the expression:<br />
<br />
//multiplier<br />
float $mult=0.5;<br />
<br />
//get the particle's World Space velocity<br />
vector $vel=particleShape1.worldVelocity;<br />
float $xVel=$vel.x;<br />
float $yVel=$vel.y;<br />
float $zVel=$vel.z;<br />
<br />
// create particle's velocity matrix which is in World Space<br />
matrix $WSvel[1][4]=<<$xVel,$yVel,$zVel,1>>;<br />
<br />
// get the camera's World Inverse Matrix<br />
float $v[]=`getAttr camera1.worldInverseMatrix`;<br />
matrix $camWIM[4][4]=<< $v[ 0], $v[ 1], $v[ 2], $v[ 3]; $v[ 4], $v[ 5], $v[ 6], $v[ 7]; $v[ 8], $v[ 9], $v[10], $v[11]; $v[12], $v[13], $v[14], $v[15] >>;<br />
<br />
//multiply particle's velocity matrix by the camera's World Inverse Matrix to get the velocity in Screen Space<br />
matrix $SSvel[1][4]=$WSvel * $camWIM;<br />
<br />
vector $result = <<$SSvel[0][0],$SSvel[0][1],$SSvel[0][2]>>;<br />
float $xResult = $mult * $result.x;<br />
float $yResult = $mult * $result.y;<br />
float $zResult = $mult * $result.z;<br />
<br />
//rgbPP<br />
particleShape1.rgbPP=<<$xResult,$yResult,0>>;<br />
<br />
<br />
So far it seems to be working, but I will try to test it and see if it breaks down.<br />
<br />
<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgHp_eiuOfFB1gNqo-ZB-LyjMgGlMZcpvkjDLivH_uN6koZWQE2Pc4E-CmclWmReTzzvJaVn5tQwlyHHShrKjirFsWl6S-05Px6cGnMCuAFMqO_QAGQCWwAxow3yEXN6i7gN1d_wAx70XgX/s1600/mv_03.jpg" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"><img alt="" border="0" id="BLOGGER_PHOTO_ID_5680381125201092930" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgHp_eiuOfFB1gNqo-ZB-LyjMgGlMZcpvkjDLivH_uN6koZWQE2Pc4E-CmclWmReTzzvJaVn5tQwlyHHShrKjirFsWl6S-05Px6cGnMCuAFMqO_QAGQCWwAxow3yEXN6i7gN1d_wAx70XgX/s400/mv_03.jpg" style="cursor: hand; cursor: pointer; display: block; height: 250px; margin: 0px auto 10px; text-align: center; width: 400px;" /></a><br />
<br />
<br />
Thanks to Zoharl on the CGTalk forum and to <a href="http://xyz2.net/mel/mel.087.htm">xyz2.net</a> and <a href="http://www.185vfx.com/2003/03/convert-a-3d-point-to-2d-screen-space-in-maya/">185vfx</a> who came up with the original matrix manipulation code.Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-4782368597141994391.post-53331644640581951742013-09-09T03:02:00.002-07:002013-09-09T03:02:12.028-07:00Emit particles upon the death of another particle<div>
In Maya it is relatively easy to emit particles when another particle collides with an object, but to emit a particle when another particle dies required a different procedure, and... an expression !</div>
<div>
I wanted to use this little trick today so I will show how it is done:</div>
<div>
<br /></div>
<div>
The effect I wanted to create was for a load of small zingy trails roughly following a path. There a many ways to create this, here is how I did it:</div>
<div>
<br /></div>
<div>
1<span class="Apple-tab-span" style="white-space: pre;"> </span>create a path</div>
<div>
<br /></div>
<div>
2<span class="Apple-tab-span" style="white-space: pre;"> </span>create a emitter for some particles that will die quickly but randomly and emit particles upon their death. Those emitted particles will themselves emit a trail of streaky particles.</div>
<div>
<br /></div>
<div>
so we have three particle objects: death_particles, birth_particles, trail_particles. The death_particles will die and give birth to the birth_particles, which will then emit the trail_particles. Still with me ? Then let's do it !</div>
<div>
<br /></div>
<div>
3<span class="Apple-tab-span" style="white-space: pre;"> </span>give death_particle a lifespanPP</div>
<div>
<br /></div>
<div>
4<span class="Apple-tab-span" style="white-space: pre;"> </span>create a particle object using either the particle MEL command or by using the Create Emitter command from the menus and then deleting the emitter but keeping the particle object. Rename the particle object to 'birth'</div>
<div>
<br /></div>
<div>
5<span class="Apple-tab-span" style="white-space: pre;"> </span>Now we need to make the runtime expression. here it is, I will explain it afterwards:</div>
<div>
<br /></div>
<div>
//</div>
<div>
// emit upon death</div>
<div>
//</div>
<div>
<br /></div>
<div>
if (death_particleShape.age >= death_particleShape.lifespanPP) {<br />
<div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">
</div>
<div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">
vector $pos = death_particleShape.position;</div>
<div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">
vector $vel = death_particleShape.velocity;</div>
<div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">
float $randVelMag=10;</div>
<div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">
float $randPosMag=1;</div>
<div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">
float $velMult=0.1;</div>
<div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">
float $emitNum = rand(1,3);</div>
<div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">
</div>
<div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">
for ($i=0; $i<$emitNum; $i++) {</div>
<div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">
vector $randVel = <<$randVelMag*rand(-1,1),$randVelMag*rand(-1,1),$randVelMag*rand(-1,1)>>;</div>
<div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">
vector $randPos = <<$randPosMag*rand(-1,1),$randPosMag*rand(-1,1),$randPosMag*rand(-1,1)>>;</div>
<div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">
vector $newVel=<<($velMult*(($randVel.x)+($vel.x))),($velMult*(($randVel.y)+($vel.y))),($velMult*(($randVel.z)+($vel.z)))>>;</div>
<div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">
emit -o birth -position (($randPos.x)+($pos.x)) (($randPos.y)+($pos.y)) (($randPos.z)+($pos.z)) -at velocity -vv ($newVel.x) ($newVel.y) ($newVel.z);</div>
<div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">
};</div>
<div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">
</div>
<div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">
};</div>
<div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">
<br /></div>
<div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">
basically it is an EMIT command with some randomness added to the position and velocity parameters. </div>
<div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">
<br /></div>
<div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">
$randVelMag is a multiplier for the randomness in the velocity of the birth_particle when it is emitted</div>
<div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">
$randPosMag is a multiplier for the emitted position of the birth_particle</div>
</div>
<div>
$velMult is another multiplier of the velocity, just so I can go in and change one parameter and all the velocity vectors are affected.</div>
<div>
$emitNum is how many birth_particles are created each time a death_particle dies</div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj8cgw6N4FWC336T1hQDOeQCPbnM2az6UBThPG96hpwl34J6c75HIEpbAD5axawZ8CB0GBrFWW6tOVnD4I8Cee0h1CeG4-QuxEeKB24Tv-iIWWTOjfVbLNwkEzp4ksvv0qMvUN9MoPJc8AT/s1600/zing_01.jpg" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"><img alt="" border="0" id="BLOGGER_PHOTO_ID_5673310383375128898" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj8cgw6N4FWC336T1hQDOeQCPbnM2az6UBThPG96hpwl34J6c75HIEpbAD5axawZ8CB0GBrFWW6tOVnD4I8Cee0h1CeG4-QuxEeKB24Tv-iIWWTOjfVbLNwkEzp4ksvv0qMvUN9MoPJc8AT/s400/zing_01.jpg" style="cursor: hand; cursor: pointer; display: block; height: 246px; margin: 0px auto 10px; text-align: center; width: 400px;" /></a><br />
<br />
I then applied some turbulence fields to the birth_particles to get them to wiggle a bit and tweaked the conserve on them and the trail_particles. Here is a rendered frame.<br />
<div>
<br /></div>
<div>
<br />
<div>
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEizfORYscq_N2wKNIvfEvCYp0YdkUIod3uQYvEAexYhuyVopf4gCt9PG3XpNB-lwKjBQC0VHRV5DDNJb2mXxgBuHfnBPyYqnqtaFFpUu55STxQbz4fhlkAuFsjxwtckUJCbiWGRzZJXnN76/s1600/zing_02.jpg" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"><img alt="" border="0" id="BLOGGER_PHOTO_ID_5673316369160949714" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEizfORYscq_N2wKNIvfEvCYp0YdkUIod3uQYvEAexYhuyVopf4gCt9PG3XpNB-lwKjBQC0VHRV5DDNJb2mXxgBuHfnBPyYqnqtaFFpUu55STxQbz4fhlkAuFsjxwtckUJCbiWGRzZJXnN76/s400/zing_02.jpg" style="cursor: hand; cursor: pointer; display: block; height: 225px; margin: 0px auto 10px; text-align: center; width: 400px;" /></a></div>
<div>
<br /></div>
</div>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-4782368597141994391.post-40069901103027384482013-09-09T03:01:00.003-07:002013-09-09T03:01:32.937-07:00Rendering a refraction UV pass for water droplets<div style="text-align: left;">
<br /></div>
<div style="text-align: left;">
<br /></div>
<div style="text-align: left;">
I've been working on a shot with a swimming pool and some splashes and water droplets. There was no light probe so I needed to replicate the lighting and refraction within the droplets.</div>
<div>
I used the UV pass method with Nuke's STmap node- here's how:</div>
<div style="text-align: center;">
<br /></div>
<div>
1.<span class="Apple-tab-span" style="white-space: pre;"> </span>Once you have your droplets simulated and you are ready to render, assign your particles as Blobby Surface (s/w) type.</div>
<div>
<br /></div>
<div>
2.<span class="Apple-tab-span" style="white-space: pre;"> </span>Create a Blinn shader with 100% transparency, switch on refractions in the raytrace options and assign that shader to your particle object.</div>
<div>
<br /></div>
<div>
<div style="text-align: center;">
<span class="Apple-style-span" style="-webkit-text-decorations-in-effect: underline; color: #0000ee;"><br /></span></div>
<img alt="" border="0" id="BLOGGER_PHOTO_ID_5668214815475569730" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgXzH8eAe-_YAFeo9D47Z8_9-J3Ev-ldbV-WfBnOAl14IY7cK3fMlJzzV8Ukrok94VNTOeSNdlgzMxnvGx7iEOv3eAlp1iTOg_wjwO6L10tiLwbcze2qY8cGGxh94qFa1Kv_kjJk8Dy2i89/s400/1.jpg" style="cursor: hand; cursor: pointer; display: block; height: 290px; margin: 0px auto 10px; text-align: center; width: 400px;" /><br />
<div style="text-align: center;">
<br /></div>
</div>
<div>
<br /></div>
<div style="text-align: left;">
<br /></div>
<div>
3.<span class="Apple-tab-span" style="white-space: pre;"> </span>create a poly plane that fills the frame and is behind the particles (i.e. you can see the particles in front of the place when looking through your camera). rename the plane to UVplane. In the UVplane's render options, set the primary visibility to be off but make sure it is visible in refractions.</div>
<div>
<br /></div>
<div>
<img alt="" border="0" id="BLOGGER_PHOTO_ID_5668214818704665778" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiFuNiSIhBu_NXxuwc7_yeio_Dzdd4v6X5_BBfvmWzjTARLeDd0Pz6c995l-YxJIgq1bsDXwq6H5A9oDVqjFxTPuHCCWAqZms_6jVKeMz1G4jQlhVi8-mGKmzg8dCY1K21UgMwaTtlDC5RE/s400/2.jpg" style="cursor: pointer; display: block; height: 290px; margin-bottom: 10px; margin-left: auto; margin-right: auto; margin-top: 0px; text-align: center; width: 400px;" /><br />
<div style="text-align: center;">
<br /></div>
</div>
<div>
<br /></div>
<div>
4.<span class="Apple-tab-span" style="white-space: pre;"> </span>create a surface shader and assign it to the UVplane</div>
<div>
<br /></div>
<div>
5.<span class="Apple-tab-span" style="white-space: pre;"> </span>create a sampler info node and make the following connections:</div>
<div>
<br /></div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>samplerInfo.vCoord -> surfaceShader.outColorG</div>
<div>
<br /></div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>samplerInfo.uCoord -> surfaceShader.outColorR</div>
<div>
<br /></div>
<div>
<img alt="" border="0" id="BLOGGER_PHOTO_ID_5668214824950715250" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhroP7Lrsrv3fwHW5Pj-N0XL9MQRHiIKanjnK41dXaF2M2_4h4TKSjseDIpfhhGV4BikrZe6y0-7t2LlpoKQT-8dHtNkkRMNVewqeMbqWsDYgisVNcUb_k85hP6UfgovYaE89tt2Ysq04UB/s400/3.jpg" style="cursor: pointer; display: block; height: 290px; margin-bottom: 10px; margin-left: auto; margin-right: auto; margin-top: 0px; text-align: center; width: 400px;" /></div>
<div>
<br /></div>
<div>
6.<span class="Apple-tab-span" style="white-space: pre;"> </span>Render.</div>
<div>
<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiTZxs8d9juQZks6ol1a0mL4yVruAAgFvbB90g0j63TDcToSl5dNttmz-xyn6HK8yxXOlRodxLhNT2U-fga3vmL3ixNmEHopb2prLsucZhLbzSmRyhwMbrvnULpViSZbcTk4IuLacc1kYEY/s1600/4.jpg" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"><img alt="" border="0" id="BLOGGER_PHOTO_ID_5668214836453709954" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiTZxs8d9juQZks6ol1a0mL4yVruAAgFvbB90g0j63TDcToSl5dNttmz-xyn6HK8yxXOlRodxLhNT2U-fga3vmL3ixNmEHopb2prLsucZhLbzSmRyhwMbrvnULpViSZbcTk4IuLacc1kYEY/s400/4.jpg" style="cursor: hand; cursor: pointer; display: block; height: 290px; margin: 0px auto 10px; text-align: center; width: 400px;" /></a></div>
<div>
7.<span class="Apple-tab-span" style="white-space: pre;"> </span>In Nuke, get a STMap node and plug in the background plate into the src pipe and your render into the stmap pipe</div>
<div>
<br />
<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEipKqMdLRUmIuX8elq5QE6lEOgcBw_FuhaqJL7ojgrkv24Tvdl1OG3VS4ok83MWXIahT0Prhzk90fiAtg8zS3qDUJYHKJ6Q4KZrvzyXORZxMq_tBacCggbaZ4kyaM1_dm0XMBXnfDo4EO6h/s1600/5.jpg" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"><img alt="" border="0" id="BLOGGER_PHOTO_ID_5668214838208571010" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEipKqMdLRUmIuX8elq5QE6lEOgcBw_FuhaqJL7ojgrkv24Tvdl1OG3VS4ok83MWXIahT0Prhzk90fiAtg8zS3qDUJYHKJ6Q4KZrvzyXORZxMq_tBacCggbaZ4kyaM1_dm0XMBXnfDo4EO6h/s400/5.jpg" style="cursor: hand; cursor: pointer; display: block; height: 290px; margin: 0px auto 10px; text-align: center; width: 400px;" /></a></div>
<div>
You will see a refracted background in your droplets and you can composite this how you like.</div>
<div>
<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiz0Z35OCt75RHXouiVZiqZnO_s36e-kmCeMjx3zFXPI02jGlWoFnLg91p-mk_-mOCxixwMSToXPVYL-bvwCgx8oRWTvF7QHykem3jib9mrpgidMrat3PZefsULJVh8KJ-jcLtggmG8oQt9/s1600/6.jpg" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"><img alt="" border="0" id="BLOGGER_PHOTO_ID_5668214940994461650" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiz0Z35OCt75RHXouiVZiqZnO_s36e-kmCeMjx3zFXPI02jGlWoFnLg91p-mk_-mOCxixwMSToXPVYL-bvwCgx8oRWTvF7QHykem3jib9mrpgidMrat3PZefsULJVh8KJ-jcLtggmG8oQt9/s400/6.jpg" style="cursor: hand; cursor: pointer; display: block; height: 290px; margin: 0px auto 10px; text-align: center; width: 400px;" /></a></div>
<div>
In this example, you can see the original plate with the swimming pool and the person in the pool refracted through the water droplets (just...).</div>
<div>
<br /></div>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-4782368597141994391.post-88685205144243262592013-09-09T03:00:00.005-07:002013-09-09T03:00:59.305-07:00SOuP shatter recipeThis is not strictly a particle effect tip, but particles are involved in a way.<br /><br /><br /><br />I will simply outline the steps involved in creating a shatter effect using Peter Shipkov's most excellent <a href="http://www.soup-dev.com/">SOuP</a> plugin suite for Maya. I recommend all Maya users to install SOuP and learn how to use it. I am also referring to <a href="http://www.vimeo.com/20823202">Jostein Finnekasa's excellent tutorial on Vimeo</a>.<br /><br /><br /><br />The purpose of this post is simply to write down all the steps that have already been outlined by Peter and Jostein, so that I can remember them!<br /><br /><br /><br />Here are my notes on how to set up the shatter effect:<br /><br /><br /><br />1. Drag any poly object's shape node from the Outliner to the Hypershade<br /><br /><br /><br />2. Create a Scatter node from the SOuP shelf<br /><br /><br /><br />3. Create a Shatter node from the SOuP shelf<br /><br /><br /><br />4. Connect:<br /><br /><br /><br /><span class="Apple-style-span">polyShape.worldMesh -&gt; scatterShape.inGeometry<br />polyShape.worldMatrix -&gt; scatterShape.inWorldMesh</span><br /><br /><br /><br />5. Connect:<br /><br /><br /><br /><span class="Apple-style-span">scatterShape.outPositionPP -&gt; shatter.inPositionPP<br />scatterShape.outGeometry -&gt; shatter.inGeometry</span><br /><br /><br /><br />6. Make a copy of the poly object, set its scale to (1,1,1), drag its shape node into the Hypershade<br /><br /><br /><br />7. Connect:<br /><br /><br /><br /><span class="Apple-style-span">shatter.outGeometry -&gt; polyShape2.inMesh</span><br /><br /><br /><br />You should have a network like this one:<br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEja-7ikgEobiqiUwNswjWH-m0h2nvMi6EL27LKNrQpDD5ZWgJyHCC8PzbSzk2GRfE18LX4upgLE1wz5gKXKXk7Ltf5AnhLL-g_ILmi50WF60rYZDWAIguHZONOP8DFUTzT6pAFAFBX8FCNv/s1600/SOuP_01.bmp"><img alt="" border="0" id="BLOGGER_PHOTO_ID_5660322291054215586" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEja-7ikgEobiqiUwNswjWH-m0h2nvMi6EL27LKNrQpDD5ZWgJyHCC8PzbSzk2GRfE18LX4upgLE1wz5gKXKXk7Ltf5AnhLL-g_ILmi50WF60rYZDWAIguHZONOP8DFUTzT6pAFAFBX8FCNv/s320/SOuP_01.bmp" style="cursor: hand; display: block; height: 176px; margin: 0px auto 10px; text-align: center; width: 320px;" /></a><br /><br />Now, you will notice that my horse is shattered but yours is not, that is because I checked Auto Evaluate on the Shatter node which is disabled by default. This is because the shattering process can take a long time to calculate depending on the number of points generated by the Scatter node. I suggest lowering the Max Number of Points on the Scatter node to 10 before checking the Auto Evaluate on the Shatter node so you can check that everything is connected up and working correctly.<br /><br /><br /><br /><br /><br />So, you have a shattered poly, but there are no dynamics. The method that I have used to add dynamics is to make the shattered geometry a nCloth object. Here are my notes taken from Jostein Finnekasa's <a href="http://www.vimeo.com/20823202">Vimeo tutorial </a>which explains everything very clearly.<br /><br /><br /><br />1. Check Auto Evaluate on the Shatter node<br /><br /><br /><br />2. Click the Bake Result on the shatter node when you are happy with your shatter results.<br /><br /><br /><br />3. Apply a shader to the bakedResult<br /><br /><br /><br />4. Create nCloth with the bakedResult selected<br /><br /><br /><br /><br /><br />This will give you a nCloth object to which ou can apply all the usual forces and collisions. The workflow goes on to create dynamic contraints, nComponents and SOuP's Attribute Transfer node with Bounding Boxes to override the constraints. Here are my notes:<br /><br /><br /><br />1. Select all vertices of the nCloth object<br /><br />2. create a Transform nContsraint<br /><br />3. Making the constraint created a Dynamic Constraint node. Drag this node from the outliner to the Hypershade<br /><br />4. If you select and graph the bakedResult and the Dynamic Constraint nodes. You should see a graph like this one:<br /><br /><br /><br /><br /><br /><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiwA0vGONe-4GcQdO1VALyLbvfJEKUa25yt0B1oio97TKxMUP96_U8vpheJgsEbBDaqBqPmUut10NigMMW6RW-0cqB2ag2DMomvAgCYePNzut6Kixm4t2Q8zEFo1Yy7VMIl8JjRFco5gdoc/s1600/SOuP_02.bmp"><img alt="" border="0" id="BLOGGER_PHOTO_ID_5660343643447136050" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiwA0vGONe-4GcQdO1VALyLbvfJEKUa25yt0B1oio97TKxMUP96_U8vpheJgsEbBDaqBqPmUut10NigMMW6RW-0cqB2ag2DMomvAgCYePNzut6Kixm4t2Q8zEFo1Yy7VMIl8JjRFco5gdoc/s400/SOuP_02.bmp" style="cursor: hand; display: block; height: 220px; margin: 0px auto 10px; text-align: center; width: 400px;" /></a><br /><br />Here is the method for setting up the Attribute Transfer on the nCloth constraint:<br /><br />1. Create an Attribute Transfer node<br /><br />2. Check the Weight box on the Attribute Transfer node<br /><br />3. In the Attribute Transfer node, create two Bounding Box objects.<br /><br />4. Set the first Bounding Box to a cube and scale it so that it completely envelopes the poly object.<br /><br />5. Set the first Bounding Box's Weight Falloff to a flat ramp with value 1<br /><br />6. Set the second Bounding Box shape to a sphere<br /><br />7. Set the second Bounding Box's Weight Falloff to a flat ramp with value -1<br /><br />8. Connect:<br /><br /><span class="Apple-style-span">bakedResultShape.worldMesh -&gt; attributeTransfer.inGeometry</span><br /><br />9. Connect:<br /><br /><span class="Apple-style-span">attributeTransfer.outWeight -&gt; nComponent.strengthPerVertex</span><br /><br />attributeTransfer.outWeight -&gt; nComponent.glueStrengthPerVertex<br /><br /><span class="Apple-style-span">attributeTransfer.outWeight -&gt; nComponent.weightPerVertex</span><br /><br />10. Set nComponent Map Types to per vertex for all three maps<br /><br />11. In the Dynamic Constraint node, set the Strength to 1, the Glue Strength to 0.1 and Glue Strength Scale to 0.1. These values are just starting points to control the way the nCloth acts, but they give good results for the tests I have done.<br /><br />So, that is the setup done, you should have a network like this one:<br /><br /><br /><br /><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgrUrYF7kIz_SniRWIpA-yN2g5g3aXBv4iyge0gJFhBVy9gkj4VU-TBBJlZC12SKpB4O2AsvwLkkRfUFlmStYK2_l6ouYnII-MPH0jbhTKbwo9XcByd0_-oOTQ2RS1Qdqb7eaocMwllH3CY/s1600/SOuP_03.bmp"><img alt="" border="0" id="BLOGGER_PHOTO_ID_5660396592331998866" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgrUrYF7kIz_SniRWIpA-yN2g5g3aXBv4iyge0gJFhBVy9gkj4VU-TBBJlZC12SKpB4O2AsvwLkkRfUFlmStYK2_l6ouYnII-MPH0jbhTKbwo9XcByd0_-oOTQ2RS1Qdqb7eaocMwllH3CY/s400/SOuP_03.bmp" style="cursor: hand; display: block; height: 245px; margin: 0px auto 10px; text-align: center; width: 400px;" /></a><br /><br />Please go to the <a href="http://www.soup-dev.com/index.html">SOuP website</a> and get the plugin. It's free, it's very powerful and there is loads of help, examples, tutorials. Also, the developer, Peter, seems to read all the forum posts and will reply to questions.<br /><br />I will attempt to post more walk-throughs for SOuP as I learn them and use them in a production.<br /><br />Here is a little shatter effect I created using SOuP ( and a couple of regular particle objects with instanced shard objects).<br /><br /><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhwPF0BQm03IxbncdblBlrFEihUnjImBHXiR4KtZnLHxfmeomqPKB7QoVFMWtunkcQvvq0OKcSBdlL53s9Lfy82fnykOE2ylleXnE6mNfira_hSAfWifVHS1BgskS2K7uKnD0CzvuU1abM0/s1600/bash_17.0025.jpg"><img alt="" border="0" id="BLOGGER_PHOTO_ID_5660402501643973330" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhwPF0BQm03IxbncdblBlrFEihUnjImBHXiR4KtZnLHxfmeomqPKB7QoVFMWtunkcQvvq0OKcSBdlL53s9Lfy82fnykOE2ylleXnE6mNfira_hSAfWifVHS1BgskS2K7uKnD0CzvuU1abM0/s400/bash_17.0025.jpg" style="cursor: hand; cursor: pointer; display: block; height: 225px; margin: 0px auto 10px; text-align: center; width: 400px;" /></a>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-4782368597141994391.post-33367920408916091412013-09-09T03:00:00.001-07:002013-09-09T03:00:22.711-07:00Using multiple emFly compounds<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj7F5Hk6cW5oEkn96mjTLC7rgkK7BZc6Y9ncDCfgu22LIOQqR4VwcHU50T8BWZsIbqy8G26jmMfv5vDiUjGnvwu_8zbTDlWnlfnhlQDQ6TxfNd2GebkmvuehP28WRbpCvJzr4ZDGswKCDsV/s1600/emFly_01.jpg" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"><br /></a>
When using Eric Mootz's excellent <a href="http://www.mootzoid.com/wb/">emFly</a> system, it is possible to use multiple emFly compounds.<br />
<br />
Let's say you have a complex flight plan and you want two different landing behavours, you will need to use a unique emFly compound for each landing.<br />
<br />
Using ICE States, you can plug in a new emFly compound into each State's 'execute once enter' and 'execute every frame'.<br />
<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj7F5Hk6cW5oEkn96mjTLC7rgkK7BZc6Y9ncDCfgu22LIOQqR4VwcHU50T8BWZsIbqy8G26jmMfv5vDiUjGnvwu_8zbTDlWnlfnhlQDQ6TxfNd2GebkmvuehP28WRbpCvJzr4ZDGswKCDsV/s1600/emFly_01.jpg"><img alt="" border="0" id="BLOGGER_PHOTO_ID_5600568637212870482" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj7F5Hk6cW5oEkn96mjTLC7rgkK7BZc6Y9ncDCfgu22LIOQqR4VwcHU50T8BWZsIbqy8G26jmMfv5vDiUjGnvwu_8zbTDlWnlfnhlQDQ6TxfNd2GebkmvuehP28WRbpCvJzr4ZDGswKCDsV/s320/emFly_01.jpg" style="cursor: hand; cursor: pointer; display: block; height: 218px; margin: 0px auto 10px; text-align: center; width: 320px;" /></a><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjq93rebpBMErjWYn9Ltd4v5lp44a41yo99zpLflBu96pQ0C4KizhF7CVqSV4FvUc0kQ8UY1oRudtFeVoIiqp3be7Xk8DkngzPvMBYGdusa_rRXZHl6rH1bv_tlYunDkOrApIQkIksvnE8J/s1600/emFly_01.jpg"><br /></a><br />
I haven't seen this documented anywhere, but it worked for me in Softimage 2011.<br />
<br />
Hey, my first Softimage ICE post !Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-4782368597141994391.post-36532844609269445412013-09-09T02:59:00.002-07:002013-09-09T02:59:37.686-07:00nParticle cache creation - use forward slash<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgotuIxkjgfQzRbuQ1XhHaVGHkib1ocBsiEoTqNvN8wE5Wc9CgUv63GpvQlb9Ylod-EYur4mCN8PQ3HBtFHE28Pb76mXIhxt6J_yfTqrMI6hYHxW8ABaHY0O5K-OQQ9WGhJgOtE9XL-wWlK/s1600/forwardSlash.jpg" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"></a>
When you want to create a nParticle cache in a custom folder, say c:\particles,<br />
enter that folder in the options box, but use the forward slash instead.<br />
<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgotuIxkjgfQzRbuQ1XhHaVGHkib1ocBsiEoTqNvN8wE5Wc9CgUv63GpvQlb9Ylod-EYur4mCN8PQ3HBtFHE28Pb76mXIhxt6J_yfTqrMI6hYHxW8ABaHY0O5K-OQQ9WGhJgOtE9XL-wWlK/s1600/forwardSlash.jpg"><img alt="" border="0" id="BLOGGER_PHOTO_ID_5597212477647023906" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgotuIxkjgfQzRbuQ1XhHaVGHkib1ocBsiEoTqNvN8wE5Wc9CgUv63GpvQlb9Ylod-EYur4mCN8PQ3HBtFHE28Pb76mXIhxt6J_yfTqrMI6hYHxW8ABaHY0O5K-OQQ9WGhJgOtE9XL-wWlK/s320/forwardSlash.jpg" style="cursor: hand; cursor: pointer; display: block; height: 228px; margin: 0px auto 10px; text-align: center; width: 320px;" /></a><br />
<br />
I'm not sure if this is a bug, but I found that using a backslash will not work.Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-4782368597141994391.post-63983587563587254022013-09-09T02:58:00.003-07:002013-09-09T02:58:43.115-07:00Adding variation to per particle attributes that use rampsLet's say you have a classic particle (not an nParticle) which will use a ramp to assign it's radiusPP.<br />
You want to add some variation to the ramp but have each particle read a unique value and then travel up the ramp over it's lifespan as usual.<br />
<br />
Here are the steps:<br />
<br />
1. Create the radiusPP via the Add Dynamics Attibutes button<br />
2. Create the ramp by right-clicking in the RadiusPP box<br />
3. Right-click the RadiusPP box again and hold over the menu item until the second menu appears. Choose Create RadiusUPP<br />
<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh-wy-1DMjSjinKkWDEys1YzYkdsHCLimWpfCL3yWkbfbArcWBrClpC8brnHfr6v0Ke6tJp-4WaiBj1peftTT8nc5Jnc0X3eHrEu1UkiPV2DqXDL1SsTFhhxJ70GDLDLGrteV_Twm3D8VRk/s1600/radiusUPP_01.jpg"><img alt="" border="0" id="BLOGGER_PHOTO_ID_5595860456428029874" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh-wy-1DMjSjinKkWDEys1YzYkdsHCLimWpfCL3yWkbfbArcWBrClpC8brnHfr6v0Ke6tJp-4WaiBj1peftTT8nc5Jnc0X3eHrEu1UkiPV2DqXDL1SsTFhhxJ70GDLDLGrteV_Twm3D8VRk/s320/radiusUPP_01.jpg" style="cursor: hand; cursor: pointer; display: block; height: 320px; margin: 0px auto 10px; text-align: center; width: 320px;" /></a><br />
4. Once you have the RadiusUPP attribute, give it a random value betweek 0 and 1 via the expression editor<br />
<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiA2DScS9rhB0TyuMRM8jaic0fToiEK1cwWi7fkv2mYlc1KFiLUf3GMNv3YW9Hon8Btx1UOceB0qTh4n0L0CWjk9c5YraDPjVObasDAJdUhjSYHbbRrMDrv7dNYfk7wMVopUUrFoOQgYL2z/s1600/radiusUPP_02.jpg"><img alt="" border="0" id="BLOGGER_PHOTO_ID_5595861208484408210" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiA2DScS9rhB0TyuMRM8jaic0fToiEK1cwWi7fkv2mYlc1KFiLUf3GMNv3YW9Hon8Btx1UOceB0qTh4n0L0CWjk9c5YraDPjVObasDAJdUhjSYHbbRrMDrv7dNYfk7wMVopUUrFoOQgYL2z/s320/radiusUPP_02.jpg" style="cursor: hand; cursor: pointer; display: block; height: 320px; margin: 0px auto 10px; text-align: center; width: 320px;" /></a><br />
5. To link the UPP value to the ramp, we need to re-make the array mapper. Right-click on the RadiusPP box and delete the arrap mapper (you will want to rename or check the name of the ramp before you do this)<br />
<br />
6. Right-click in the RadiusPP box again and click on the Create Ramp options box. Choose RadiusUPP for the input U, leave input V as Particle's Age and then choose the ramp in the Map To list.<br />
<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgM176HannaaKe7mJwlcIgc6otiwVBjFovRoH7T5vmRB25LilVDemJNOUW_7-k4len5Y3wFKLY8RroD-M2wFKT9hZ7MvC0HwtAbXzDofE1Yy17HQnY7kObosUZzTxOjXjJSiYUwZNHekpqB/s1600/radiusUPP_03.jpg"><img alt="" border="0" id="BLOGGER_PHOTO_ID_5595863563591173858" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgM176HannaaKe7mJwlcIgc6otiwVBjFovRoH7T5vmRB25LilVDemJNOUW_7-k4len5Y3wFKLY8RroD-M2wFKT9hZ7MvC0HwtAbXzDofE1Yy17HQnY7kObosUZzTxOjXjJSiYUwZNHekpqB/s320/radiusUPP_03.jpg" style="cursor: hand; cursor: pointer; display: block; height: 320px; margin: 0px auto 10px; text-align: center; width: 320px;" /></a><br />
<br />
Now each particle is going to read a value at a random point across the bottom of the ramp and then move up the ramp over it's lifetime. Now we need to add some variation to the ramp. A quick way to do this is to use the ramp's built in noise functions<br />
<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjOddf6NQLqqBGe50t0mRt1DdN2_OlmScXHGvjFACOiKN6D7dDeaAqZoh8VlZ5cfS5gQiNm6bnJtP_nawc-ltgwVFewdDgQ8gpqnTEEc5FwfD7oEApjZms5waXD0vS-0J_oPbv0ZHTtGhjC/s1600/radiusUPP_04.jpg"><img alt="" border="0" id="BLOGGER_PHOTO_ID_5595865518024876754" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjOddf6NQLqqBGe50t0mRt1DdN2_OlmScXHGvjFACOiKN6D7dDeaAqZoh8VlZ5cfS5gQiNm6bnJtP_nawc-ltgwVFewdDgQ8gpqnTEEc5FwfD7oEApjZms5waXD0vS-0J_oPbv0ZHTtGhjC/s320/radiusUPP_04.jpg" style="cursor: pointer; display: block; height: 594px; margin: 0px auto 10px; text-align: center; width: 277px;" /></a>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-4782368597141994391.post-34786542049953524352013-09-09T02:57:00.000-07:002013-09-09T02:57:15.991-07:00Approximating ConservePP <h3 class="post-title entry-title" itemprop="name">
</h3>
<div class="post-header">
</div>
Wouldn't it be nice sometimes if we could have a per-particle Conserve
attribute? Well, a reasonable approximation can be to use the mass
attribute instead.<br /><br />The conserve attribute essentially is a
multiplier on the particle's velocity. For example, if a particle has
velocity 100 at frame 1 and a conserve of 0.5, then a frame 2 the
velocity would be 50, at frame 3 it would be 25, and so on.<br /><br />So, the conserve attribute acts as a brake on the velocity. <br /><br />In
the physical world, mass (specifically Inertial mass) can be defined as
'resistance to acceleration'. When simulating particle dynamics we can
use mass as a dampening effect on the motion of a particle, in a similar
way that conserve does. The main difference is that we can define the
mass on a per-particle basis: the higher the mass the higher the
resistance to motion and the lower the 'conservePP' value we are
creating.Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-4782368597141994391.post-33861522477184374782013-09-09T02:55:00.002-07:002013-09-09T02:55:38.494-07:00Gravity versus Uniform field <h3 class="post-title entry-title" itemprop="name">
</h3>
<div class="post-header">
</div>
In nature, a body is affected by gravity in relation to its mass. Newton's equation of gravity show this:<br /><br />F= G (M * m) / r^2<br /><br />Where M and m are the masses of the bodies affected.<br /><br />Also, Newton's laws of motion (he was a clever guy) show that force is also proportional to mass:<br /><br />F = m a<br /><br />If we equate the two forces we see that both sides have the mass, m, which cancel each other out.<br /><br />So, the acceleration that the body experiences is not proportional to its mass.<br /><br />This
is not true for a Universal force. The strength of a universal force is
not linked to the mass of the body and so when we equate it with the
law of motion we get something like this:<br /><br />m a = U<br /><br />Where U is the arbitrary universal force.<br /><br />So the acceleration experienced by the body is now (inversely) proportional to its mass.<br /><br />Maya
copies nature in this regard, so if you want to use variable masses to
drive your simulations, be aware that the Gravity force will affect all
the particles uniformly but a Uniform field will affect them in
(inverse) proportion to their mass.
Unknownnoreply@blogger.com0