Here's a compound that's similar to Renaud Bousquet's compound. I use the average of the current strand position and the points before and after, with a blend control and an iteration control to smooth further. Hope this helps.

-Mathieu

Dominik Kirouac wrote:
Thanks for the help guys,

Mathieu: I tried to resample strands, but it doesn't repair the zigzag deformation that I get in my simulation..

At the moment, I'm able to smooth(average) one position in the strandposition array with it previous and next index, but I'm not able to figure out how to do it for each index in the strandposition array.

How can I create a loop for this smooth to pass through each index of the strandposition array?

On 9/25/2012 11:07 AM, Dominik Kirouac wrote:
Hey all,

Anyone know if a compound exist to smooth strands deformation. I have some weird strand deformation after applying simulation and I want to smooth them in a postprocess icetree.

I'm able to do it for weightmap by getting the average of neighboring points and reapply it to the point, but I'm not able to apply this technic to strands.

Anyone could help me with this?

Thanks,

Dominik Kirouac // SHED
3D Artist / FX - SIMULATION
1410, RUE STANLEY, 11E ETAGE MONTREAL (QUEBEC) H3A 1P8
T 514 849-1555 F 514 849-5025
WWW.SHEDMTL.COM



-- 

  



<?xml version="1.0" encoding="UTF-8"?>
<xsi_file type="CompoundNode" name="Smooth Strand Position" formatversion="1.4" compoundversion="1.0">
	<definition>
		<nodes>
			<node type="[embedded_0]" index="0">
				<param name="Array.Array_x" type="4" value="0.000000"></param>
				<param name="Array.Array_y" type="4" value="0.000000"></param>
				<param name="Array.Array_z" type="4" value="0.000000"></param>
				<param name="Blend" type="4" value="0.500000"></param>
				<portdef name="Blend" type="4" structure="1" group="-1" instance="-1" port="-1"></portdef>
				<portdef name="Array" type="16" structure="2" group="-1" instance="-1" port="-1"></portdef>
				<datablob category="ui_infos">
					<prop name="posx">116</prop>
					<prop name="posy">394</prop>
					<prop name="state">Normal</prop>
				</datablob>
			</node>
			<node type="RepeatNode" index="1">
				<param name="iterations" type="3" value="1"></param>
				<portdef name="iterations" type="2" structure="1" group="0" instance="0" port="0"></portdef>
				<portdef name="port" type="4096" structure="1" group="0" instance="0" port="1"></portdef>
				<datablob category="ui_infos">
					<prop name="posx">542</prop>
					<prop name="posy">295</prop>
					<prop name="state">Normal</prop>
				</datablob>
			</node>
			<node type="[embedded_2]" index="6">
				<param name="Reference" type="31" value="self.strandposition"></param>
				<param name="Value.Value_x" type="4" value="0.000000"></param>
				<param name="Value.Value_y" type="4" value="0.000000"></param>
				<param name="Value.Value_z" type="4" value="0.000000"></param>
				<param_ext name="Reference" type="31" value="self.strandposition"></param_ext>
				<portdef name="In_Name" type="8192" structure="1" group="-1" instance="-1" port="-1"></portdef>
				<portdef name="Value" type="16" structure="2" group="2" instance="0" port="0" groupname="Value"></portdef>
				<datablob category="ui_infos">
					<prop name="posx">393</prop>
					<prop name="posy">355</prop>
					<prop name="state">Normal</prop>
				</datablob>
			</node>
			<node type="GetDataNode" index="9">
				<param name="reference" type="31" value="self.StrandPosition"></param>
				<param_ext name="reference" type="31" value="self.StrandPosition"></param_ext>
				<portdef name="source" type="2048" structure="1" group="1" instance="0" port="0"></portdef>
				<portdef name="inname" type="8192" structure="1" group="3" instance="0" port="0"></portdef>
				<datablob category="ui_infos">
					<prop name="posx">-141</prop>
					<prop name="posy">340</prop>
					<prop name="state">Normal</prop>
				</datablob>
			</node>
		</nodes>
		<exposed_ports>
			<port index="0" portname="Blend" username="Blend" basename="Blend" portlabel="Blend" exposetype="single"> </port>
			<port index="1" portname="execute" username="Execute" basename="Execute" portlabel="Execute" exposetype="single"> </port>
			<port index="1" portname="iterations" username="Iterations" basename="Iterations" portlabel="Iterations" exposetype="single"> </port>
		</exposed_ports>
		<connections>
			<cnx from_node="0" from_port="Result" to_node="6" to_port="Value"> </cnx>
			<cnx from_node="6" from_port="Execute" to_node="1" to_port="port"> </cnx>
			<cnx from_node="9" from_port="value" to_node="0" to_port="Array"> </cnx>
		</connections>
		<layout>
			<item type="input" name="Iterations"> </item>
			<item type="input" name="Blend"> </item>
			<item type="output" name="Execute"> </item>
		</layout>
		<blob_dictionary>
		</blob_dictionary>
	</definition>
	<embedded_1 name="Build Index Array" category="Array" formatversion="1.4" compoundversion="1.0" constructionmode="Current" backgroundcolor="6732954">
		<nodes>
			<node type="GetArraySubIndicesNode" index="0">
				<param name="array" type="3" value="0"></param>
				<portdef name="array" type="2" structure="2" group="0" instance="0" port="0"></portdef>
				<datablob category="ui_infos">
					<prop name="posx">439</prop>
					<prop name="posy">-56</prop>
					<prop name="state">Normal</prop>
				</datablob>
			</node>
			<node type="IntegerNode" index="1">
				<param name="value" type="3" value="0"></param>
				<portdef name="value" type="2" structure="1" group="0" instance="0" port="0"></portdef>
				<datablob category="ui_infos">
					<prop name="posx">103</prop>
					<prop name="posy">-13</prop>
					<prop name="state">Normal</prop>
				</datablob>
			</node>
			<node type="BuildArrayFromConstantNode" index="2">
				<param name="size" type="3" value="0"></param>
				<param name="value" type="3" value="0"></param>
				<portdef name="size" type="2" structure="1" group="0" instance="0" port="0"></portdef>
				<portdef name="value" type="2" structure="1" group="0" instance="0" port="1"></portdef>
				<datablob category="ui_infos">
					<prop name="posx">205</prop>
					<prop name="posy">-62</prop>
					<prop name="state">Normal</prop>
				</datablob>
			</node>
		</nodes>
		<exposed_ports>
			<port index="0" portname="indices" username="Indices" basename="Indices" portlabel="Indices" exposetype="single"> </port>
			<port index="2" portname="size" username="Size" basename="Size" portlabel="Size" exposetype="single"> </port>
		</exposed_ports>
		<connections>
			<cnx from_node="2" from_port="array" to_node="0" to_port="array"> </cnx>
			<cnx from_node="1" from_port="result" to_node="2" to_port="value"> </cnx>
		</connections>
		<layout>
			<item type="input" name="Size"> </item>
			<item type="output" name="Indices"> </item>
		</layout>
	</embedded_1>
	<embedded_0 name="Smooth Array by Neighbours" formatversion="1.4" compoundversion="1.0">
		<nodes>
			<node type="GetArraySizeNode" index="0">
				<param name="array.array_x" type="4" value="0.000000"></param>
				<param name="array.array_y" type="4" value="0.000000"></param>
				<param name="array.array_z" type="4" value="0.000000"></param>
				<portdef name="array" type="16" structure="2" group="0" instance="0" port="0"></portdef>
				<datablob category="ui_infos">
					<prop name="posx">-1985</prop>
					<prop name="posy">295</prop>
					<prop name="state">Normal</prop>
				</datablob>
			</node>
			<node type="AddNode" index="1">
				<param name="value1" type="3" value="0"></param>
				<param name="value2" type="3" value="1"></param>
				<portdef name="value1" type="2" structure="2" group="0" instance="0" port="0"></portdef>
				<portdef name="value2" type="2" structure="1" group="0" instance="1" port="0"></portdef>
				<datablob category="ui_infos">
					<prop name="posx">-1456</prop>
					<prop name="posy">399</prop>
					<prop name="state">Normal</prop>
				</datablob>
			</node>
			<node type="LinearInterpolateNode" index="2">
				<param name="first.first_x" type="4" value="0.000000"></param>
				<param name="first.first_y" type="4" value="0.000000"></param>
				<param name="first.first_z" type="4" value="0.000000"></param>
				<param name="second.second_x" type="4" value="0.000000"></param>
				<param name="second.second_y" type="4" value="0.000000"></param>
				<param name="second.second_z" type="4" value="0.000000"></param>
				<param name="blend" type="4" value="0.500000"></param>
				<param name="clamp" type="11" value="false"></param>
				<portdef name="first" type="16" structure="2" group="0" instance="0" port="0"></portdef>
				<portdef name="second" type="16" structure="2" group="0" instance="0" port="1"></portdef>
				<portdef name="blend" type="4" structure="1" group="0" instance="0" port="2"></portdef>
				<portdef name="clamp" type="1" structure="1" group="0" instance="0" port="3"></portdef>
				<datablob category="ui_infos">
					<prop name="posx">-498</prop>
					<prop name="posy">339</prop>
					<prop name="state">Normal</prop>
				</datablob>
			</node>
			<node type="MultiplyByScalarNode" index="3">
				<param name="value.value_x" type="4" value="0.000000"></param>
				<param name="value.value_y" type="4" value="0.000000"></param>
				<param name="value.value_z" type="4" value="0.000000"></param>
				<param name="factor" type="4" value="0.333333"></param>
				<portdef name="value" type="16" structure="2" group="0" instance="0" port="0"></portdef>
				<portdef name="factor" type="4" structure="1" group="0" instance="0" port="1"></portdef>
				<datablob category="ui_infos">
					<prop name="posx">-743</prop>
					<prop name="posy">256</prop>
					<prop name="state">Normal</prop>
				</datablob>
			</node>
			<node type="AddNode" index="4">
				<param name="value1.value1_x" type="4" value="0.000000"></param>
				<param name="value1.value1_y" type="4" value="0.000000"></param>
				<param name="value1.value1_z" type="4" value="0.000000"></param>
				<param name="value2.value2_x" type="4" value="0.000000"></param>
				<param name="value2.value2_y" type="4" value="0.000000"></param>
				<param name="value2.value2_z" type="4" value="0.000000"></param>
				<param name="value3.value3_x" type="4" value="0.000000"></param>
				<param name="value3.value3_y" type="4" value="0.000000"></param>
				<param name="value3.value3_z" type="4" value="0.000000"></param>
				<portdef name="value1" type="16" structure="2" group="0" instance="0" port="0"></portdef>
				<portdef name="value2" type="16" structure="2" group="0" instance="1" port="0"></portdef>
				<portdef name="value3" type="16" structure="2" group="0" instance="2" port="0"></portdef>
				<datablob category="ui_infos">
					<prop name="posx">-904</prop>
					<prop name="posy">275</prop>
					<prop name="state">Normal</prop>
				</datablob>
			</node>
			<node type="[embedded_1]" index="5">
				<param name="Size" type="3" value="0"></param>
				<portdef name="Size" type="2" structure="1" group="-1" instance="-1" port="-1"></portdef>
				<datablob category="ui_infos">
					<prop name="posx">-1778</prop>
					<prop name="posy">214</prop>
					<prop name="state">Normal</prop>
				</datablob>
			</node>
			<node type="SubtractNode" index="6">
				<param name="first" type="3" value="0"></param>
				<param name="second" type="3" value="0"></param>
				<portdef name="first" type="2" structure="1" group="0" instance="0" port="0"></portdef>
				<portdef name="second" type="2" structure="1" group="0" instance="0" port="1"></portdef>
				<datablob category="ui_infos">
					<prop name="posx">-1452</prop>
					<prop name="posy">545</prop>
					<prop name="state">Normal</prop>
				</datablob>
			</node>
			<node type="SelectInArrayNode" index="7">
				<param name="index" type="3" value="0"></param>
				<param name="array.array_x" type="4" value="0.000000"></param>
				<param name="array.array_y" type="4" value="0.000000"></param>
				<param name="array.array_z" type="4" value="0.000000"></param>
				<portdef name="index" type="2" structure="2" group="0" instance="0" port="0"></portdef>
				<portdef name="array" type="16" structure="2" group="0" instance="0" port="1"></portdef>
				<datablob category="ui_infos">
					<prop name="posx">-1105</prop>
					<prop name="posy">405</prop>
					<prop name="state">Normal</prop>
				</datablob>
			</node>
			<node type="SelectInArrayNode" index="8">
				<param name="index" type="3" value="0"></param>
				<param name="array.array_x" type="4" value="0.000000"></param>
				<param name="array.array_y" type="4" value="0.000000"></param>
				<param name="array.array_z" type="4" value="0.000000"></param>
				<portdef name="index" type="2" structure="2" group="0" instance="0" port="0"></portdef>
				<portdef name="array" type="16" structure="2" group="0" instance="0" port="1"></portdef>
				<datablob category="ui_infos">
					<prop name="posx">-1113</prop>
					<prop name="posy">304</prop>
					<prop name="state">Normal</prop>
				</datablob>
			</node>
			<node type="IntegerNode" index="9">
				<param name="value" type="3" value="1"></param>
				<portdef name="value" type="2" structure="1" group="0" instance="0" port="0"></portdef>
				<datablob category="ui_infos">
					<prop name="posx">-1632</prop>
					<prop name="posy">439</prop>
					<prop name="state">Normal</prop>
				</datablob>
			</node>
			<node type="SubtractNode" index="10">
				<param name="first" type="3" value="0"></param>
				<param name="second" type="3" value="0"></param>
				<portdef name="first" type="2" structure="2" group="0" instance="0" port="0"></portdef>
				<portdef name="second" type="2" structure="1" group="0" instance="0" port="1"></portdef>
				<datablob category="ui_infos">
					<prop name="posx">-1443</prop>
					<prop name="posy">125</prop>
					<prop name="state">Normal</prop>
				</datablob>
			</node>
			<node type="MaximumNode" index="11">
				<param name="value1" type="3" value="0"></param>
				<param name="value2" type="3" value="0"></param>
				<portdef name="value1" type="2" structure="2" group="0" instance="0" port="0"></portdef>
				<portdef name="value2" type="2" structure="1" group="0" instance="1" port="0"></portdef>
				<datablob category="ui_infos">
					<prop name="posx">-1267</prop>
					<prop name="posy">155</prop>
					<prop name="state">Normal</prop>
				</datablob>
			</node>
			<node type="MinimumNode" index="12">
				<param name="value1" type="3" value="0"></param>
				<param name="value2" type="3" value="0"></param>
				<portdef name="value1" type="2" structure="2" group="0" instance="0" port="0"></portdef>
				<portdef name="value2" type="2" structure="1" group="0" instance="1" port="0"></portdef>
				<datablob category="ui_infos">
					<prop name="posx">-1256</prop>
					<prop name="posy">419</prop>
					<prop name="state">Normal</prop>
				</datablob>
			</node>
			<node type="PassThroughNode" index="13">
				<param name="in.in_x" type="4" value="0.000000"></param>
				<param name="in.in_y" type="4" value="0.000000"></param>
				<param name="in.in_z" type="4" value="0.000000"></param>
				<portdef name="in" type="16" structure="2" group="0" instance="0" port="0"></portdef>
				<datablob category="ui_infos">
					<prop name="posx">-2173</prop>
					<prop name="posy">442</prop>
					<prop name="state">Normal</prop>
				</datablob>
			</node>
			<node type="SelectInArrayNode" index="14">
				<param name="index" type="3" value="0"></param>
				<param name="array.array_x" type="4" value="0.000000"></param>
				<param name="array.array_y" type="4" value="0.000000"></param>
				<param name="array.array_z" type="4" value="0.000000"></param>
				<portdef name="index" type="2" structure="2" group="0" instance="0" port="0"></portdef>
				<portdef name="array" type="16" structure="2" group="0" instance="0" port="1"></portdef>
				<datablob category="ui_infos">
					<prop name="posx">-1100</prop>
					<prop name="posy">204</prop>
					<prop name="state">Normal</prop>
				</datablob>
			</node>
		</nodes>
		<exposed_ports>
			<port index="2" portname="blend" username="Blend" basename="Blend" portlabel="Blend" exposetype="single"> </port>
			<port index="2" portname="result" username="Result" basename="Result" portlabel="Result" exposetype="single"> </port>
			<port index="13" portname="in" username="Array" basename="Array" portlabel="Array" exposetype="single"> </port>
		</exposed_ports>
		<connections>
			<cnx from_node="7" from_port="value" to_node="4" to_port="value3"> </cnx>
			<cnx from_node="8" from_port="value" to_node="4" to_port="value2"> </cnx>
			<cnx from_node="5" from_port="Indices" to_node="1" to_port="value1"> </cnx>
			<cnx from_node="5" from_port="Indices" to_node="8" to_port="index"> </cnx>
			<cnx from_node="5" from_port="Indices" to_node="10" to_port="first"> </cnx>
			<cnx from_node="0" from_port="size" to_node="5" to_port="Size"> </cnx>
			<cnx from_node="0" from_port="size" to_node="6" to_port="first"> </cnx>
			<cnx from_node="1" from_port="result" to_node="12" to_port="value1"> </cnx>
			<cnx from_node="3" from_port="result" to_node="2" to_port="second"> </cnx>
			<cnx from_node="4" from_port="result" to_node="3" to_port="value"> </cnx>
			<cnx from_node="6" from_port="result" to_node="12" to_port="value2"> </cnx>
			<cnx from_node="9" from_port="result" to_node="1" to_port="value2"> </cnx>
			<cnx from_node="9" from_port="result" to_node="6" to_port="second"> </cnx>
			<cnx from_node="9" from_port="result" to_node="10" to_port="second"> </cnx>
			<cnx from_node="10" from_port="result" to_node="11" to_port="value1"> </cnx>
			<cnx from_node="11" from_port="max" to_node="14" to_port="index"> </cnx>
			<cnx from_node="12" from_port="min" to_node="7" to_port="index"> </cnx>
			<cnx from_node="13" from_port="out" to_node="0" to_port="array"> </cnx>
			<cnx from_node="13" from_port="out" to_node="7" to_port="array"> </cnx>
			<cnx from_node="13" from_port="out" to_node="8" to_port="array"> </cnx>
			<cnx from_node="13" from_port="out" to_node="14" to_port="array"> </cnx>
			<cnx from_node="13" from_port="out" to_node="2" to_port="first"> </cnx>
			<cnx from_node="14" from_port="value" to_node="4" to_port="value1"> </cnx>
		</connections>
		<layout>
			<item type="input" name="Array"> </item>
			<item type="input" name="Blend"> </item>
			<item type="output" name="Result"> </item>
		</layout>
	</embedded_0>
	<embedded_2 name="Set Data" category="Data Access" author="Softimage" formatversion="1.4" compoundversion="1.0" constructionmode="Current" backgroundcolor="12693621">
	<description><![CDATA[Sets the specified attributes to the supplied values.]]></description>
		<nodes>
			<node type="PassThroughNode" index="0">
				<portdef name="in" type="8192" structure="1" group="0" instance="0" port="0"></portdef>
				<datablob category="ui_infos">
					<prop name="posx">49</prop>
					<prop name="posy">114</prop>
					<prop name="state">Normal</prop>
				</datablob>
			</node>
			<node type="ExecuteNode" index="1">
				<portdef name="port1" type="4096" structure="1" group="0" instance="0" port="0"></portdef>
				<datablob category="ui_infos">
					<prop name="posx">368</prop>
					<prop name="posy">114</prop>
					<prop name="state">Normal</prop>
				</datablob>
			</node>
			<node type="SetOneDataNode" index="2">
				<param name="reference" type="31" value="self.strandposition"></param>
				<param name="source.source_x" type="4" value="0.000000"></param>
				<param name="source.source_y" type="4" value="0.000000"></param>
				<param name="source.source_z" type="4" value="0.000000"></param>
				<param_ext name="reference" type="31" value="self.strandposition"></param_ext>
				<portdef name="source" type="16" structure="2" group="1" instance="0" port="0"></portdef>
				<portdef name="inname" type="8192" structure="1" group="3" instance="0" port="0"></portdef>
				<datablob category="ui_infos">
					<prop name="posx">209</prop>
					<prop name="posy">114</prop>
					<prop name="state">Normal</prop>
				</datablob>
			</node>
		</nodes>
		<exposed_ports>
			<port index="0" portname="in" username="In_Name" basename="In Name" portlabel="In Name" exposetype="single">
				<description><![CDATA[Name prefixed to each attribute to be set. Use this to specify the object name, and then specify each attribute in the Reference ports.]]></description>
			</port>
			<port index="1" portname="execute" username="Execute" basename="Execute" portlabel="Execute" exposetype="single"> </port>
			<port index="2" portname="source" username="Value" basename="Value" overridelabel="Reference" portlabel="Value" exposetype="use_node_import">
				<description><![CDATA[The value to set.]]></description>
			</port>
			<port index="2" portname="reference" username="Reference" basename="Reference" portlabel="Reference" exposetype="use_node_import">
				<description><![CDATA[The name of the attribute to set.]]></description>
			</port>
		</exposed_ports>
		<connections>
			<cnx from_node="0" from_port="out" to_node="2" to_port="inname"> </cnx>
			<cnx from_node="2" from_port="value" to_node="1" to_port="port1"> </cnx>
		</connections>
		<layout>
			<item type="input" name="In_Name"> </item>
			<item type="input" name="Value" min="0" max="0"> </item>
			<item type="input" name="Reference"> </item>
			<item type="output" name="Execute"> </item>
		</layout>
	</embedded_2>
</xsi_file>

Reply via email to