<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Workflow Archive - LEFX</title>
	<atom:link href="https://www.lefx.de/en/tag/workflow/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.lefx.de/en/tag/workflow/</link>
	<description>manufacturing realities</description>
	<lastBuildDate>Wed, 18 Nov 2020 14:13:20 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	
	<item>
		<title>Workflow Tips &#124; Random Material ID</title>
		<link>https://www.lefx.de/en/workflow-tips-random-material-id/</link>
					<comments>https://www.lefx.de/en/workflow-tips-random-material-id/#respond</comments>
		
		<dc:creator><![CDATA[Tom Micklich]]></dc:creator>
		<pubDate>Sat, 19 Dec 2015 11:47:14 +0000</pubDate>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[3ds Max]]></category>
		<category><![CDATA[MaxScript]]></category>
		<category><![CDATA[Workflow]]></category>
		<guid isPermaLink="false">http://www.lefx.de/?p=572</guid>

					<description><![CDATA[<p>One of the main problems of rendering is its perfection. Tree objects, that consist of many leaf elements with the same material applied to them, are often lack the natural variations the viewer would expect. In our production workflow we faced this problem on a daily basis. As we always try to improve the quality [&#8230;]</p>
<p>Der Beitrag <a href="https://www.lefx.de/en/workflow-tips-random-material-id/">Workflow Tips | Random Material ID</a> erschien zuerst auf <a href="https://www.lefx.de/en">LEFX</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>One of the main problems of rendering is its perfection. Tree objects, that consist of many leaf elements with the same material applied to them, are often lack the natural variations the viewer would expect. In our production workflow we faced this problem on a daily basis. As we always try to improve the quality of our architectural renderings we decided to create an easy to use script to set random material IDs to give the perception of natural variations.</p>
<p>Our main content creation software is 3ds Max, so we created a Macro Script (in MAXScript) for this problem.</p>
<p><img decoding="async" class="img-responsive" src="https://www.lefx.de/wp-content/uploads/2016/02/DE_intro.png" alt="DE_intro" /></p>
<h2>Recursive or iterative approach</h2>
<p>There are basically two possible approaches to handle this problem. The iterative first oneone iterates through all faces for setting a random material ID while the recursive one version divides the big vast amount of faces into smaller parts groups(groups?) and then assigns a material ID to all the elements contained in this group. ?.connected to the face selection.</p>
<p>At first we implemented the iterative approach to take a look at its possibilities and restrictions. After that we thought about possible optimizations and other ideas how to solve this problem more efficiently with an optimum balance of between speed and a visual qualitygood result. That’s why we created further looked into the a recursive version to solve the problem from another perspective point of view.</p>
<h2>Algorithms</h2>
<h3>Iterative version</h3>
<pre style="color: #000000; background: #f1f0f0;"><span style="color: #400000; font-weight: bold;">function</span> changeIDsIterative obj minID maxID stepSize <span style="color: #806030;">=</span>
<span style="color: #806030;">(</span>
	getElement <span style="color: #806030;">=</span> polyop<span style="color: #8c0000;">.</span>getElementsUsingFace
	setFaceID <span style="color: #806030;">=</span> polyop<span style="color: #8c0000;">.</span>setFaceMatID
			
	range <span style="color: #806030;">=</span> <span style="color: #8c0000;">1</span>
			
	<span style="color: #400000; font-weight: bold;">for</span> i <span style="color: #806030;">=</span> <span style="color: #8c0000;">1</span> <span style="color: #400000; font-weight: bold;">to</span> obj<span style="color: #8c0000;">.</span>numfaces by stepSize <span style="color: #400000; font-weight: bold;">do</span> <span style="color: #806030;">(</span>
				
		randomID <span style="color: #806030;">=</span> random minID maxID
				
		range <span style="color: #806030;">=</span> i <span style="color: #806030;">+</span> stepSize
				
		<span style="color: #400000; font-weight: bold;">if</span><span style="color: #806030;">(</span>range <span style="color: #806030;">&gt;</span> obj<span style="color: #8c0000;">.</span>numfaces<span style="color: #806030;">)</span> <span style="color: #400000; font-weight: bold;">do</span> <span style="color: #806030;">(</span>
			range <span style="color: #806030;">=</span> obj<span style="color: #8c0000;">.</span>numfaces
		<span style="color: #806030;">)</span>
		
		element <span style="color: #806030;">=</span> getElement obj <span style="color: #806030;">#</span>{i<span style="color: #8c0000;">..</span>range}
		setFaceID obj element randomID
	<span style="color: #806030;">)</span>
<span style="color: #806030;">)</span>
</pre>
<p>Basically this script iterates through all faces with a given step. There it takes the takes the elements which are connected with the faces within the step range and gives this selection of faces a random material ID in the range of the minimal ID and the maximal ID (minID &lt;= ID &lt;= maxID).</p>
<p>Larger values of stepsizestep size would give result in more speed by skipping a lot of faces but would result in a visible repetition of the same used material ID.</p>
<p>So the number of function calls when to setting a random material ID depends on the step size s:</p>
<p><img decoding="async" class="img-responsive" src="https://www.lefx.de/wp-content/uploads/2016/02/Formel0.png" alt="Formel0" /></p>
<p>You may have noticed that in the first two lines two function calls are assigned to variables.</p>
<pre style="color: #000000; background: #f1f0f0;">getElement <span style="color: #806030;">=</span> polyop<span style="color: #8c0000;">.</span>getElementsUsingFace
setFaceID <span style="color: #806030;">=</span> polyop<span style="color: #8c0000;">.</span>setFaceMatID
</pre>
<p>That’s because ofThis is done for performance reasons. By Iinitializing the function call as a variable these many function callswill allow it to run are slightly faster.</p>
<h3>Recursive version</h3>
<pre style="color: #000000; background: #f1f0f0;"><span style="color: #400000; font-weight: bold;">function</span> changeIDs depth obj minFace maxFace minID maxID <span style="color: #806030;">=</span>
<span style="color: #806030;">(</span>
	<span style="color: #400000; font-weight: bold;">if</span><span style="color: #806030;">(</span>depth <span style="color: #806030;">&gt;</span> <span style="color: #8c0000;">0</span><span style="color: #806030;">)</span> <span style="color: #400000; font-weight: bold;">then</span> <span style="color: #806030;">(</span> <span style="color: #806030;">-</span><span style="color: #806030;">-</span>Clustering<span style="color: #806030;">,</span> <span style="color: #400000; font-weight: bold;">if</span> depth !<span style="color: #806030;">=</span> <span style="color: #8c0000;">0</span>
		partSize <span style="color: #806030;">=</span> <span style="color: #806030;">(</span><span style="color: #806030;">(</span>maxFace <span style="color: #806030;">-</span> minFace<span style="color: #806030;">)</span> <span style="color: #806030;">/</span> <span style="color: #8c0000;">2</span> <span style="color: #806030;">+</span> <span style="color: #8c0000;">1</span><span style="color: #806030;">)</span> <span style="color: #400000; font-weight: bold;">as</span> <span style="color: #400000; font-weight: bold;">Integer</span> <span style="color: #806030;">-</span><span style="color: #806030;">-</span>calculate the clustersize
		
		changeIDs <span style="color: #806030;">(</span>depth<span style="color: #806030;">-</span><span style="color: #8c0000;">1</span><span style="color: #806030;">)</span> obj minFace <span style="color: #806030;">(</span>partSize <span style="color: #806030;">+</span> minFace<span style="color: #806030;">)</span> minID maxID <span style="color: #806030;">-</span><span style="color: #806030;">-</span> first part
		changeIDs <span style="color: #806030;">(</span>depth<span style="color: #806030;">-</span><span style="color: #8c0000;">1</span><span style="color: #806030;">)</span> obj <span style="color: #806030;">(</span>partSize <span style="color: #806030;">+</span> minFace <span style="color: #806030;">+</span> <span style="color: #8c0000;">1</span><span style="color: #806030;">)</span> maxFace minID maxID <span style="color: #806030;">-</span><span style="color: #806030;">-</span> <span style="color: #400000; font-weight: bold;">second</span> part 
		
	<span style="color: #806030;">)</span> <span style="color: #400000; font-weight: bold;">else</span> <span style="color: #806030;">(</span> <span style="color: #806030;">-</span><span style="color: #806030;">-</span><span style="color: #400000; font-weight: bold;">set</span> material IDs
		getElement <span style="color: #806030;">=</span> polyop<span style="color: #8c0000;">.</span>getElementsUsingFace
		setFaceID <span style="color: #806030;">=</span> polyop<span style="color: #8c0000;">.</span>setFaceMatID
		
		randomID <span style="color: #806030;">=</span> random minID maxID 
                <span style="color: #806030;">-</span><span style="color: #806030;">-</span><span style="color: #400000; font-weight: bold;">get</span> a random ID between the given values
		element <span style="color: #806030;">=</span> getElement obj <span style="color: #806030;">#</span>{minFace<span style="color: #8c0000;">..</span>maxFace} 
                <span style="color: #806030;">-</span><span style="color: #806030;">-</span><span style="color: #400000; font-weight: bold;">select</span> all elements <span style="color: #400000; font-weight: bold;">with</span> faces in the given cluster of faces
		setFaceID obj element randomID 
                <span style="color: #806030;">-</span><span style="color: #806030;">-</span><span style="color: #400000; font-weight: bold;">set</span> the random ID <span style="color: #400000; font-weight: bold;">to</span> all faces in the selection
	<span style="color: #806030;">)</span>
<span style="color: #806030;">)</span>
</pre>
<p>The recursive version divides the huge amount of into smaller clusters of faces before setting a material ID.</p>
<p>The algorithm basically divides the amount of faces into halves until the depth value is zero. Then for every subpart the script selects all elements which are connected with the faces of the subpart and assigns a random ID. So the second part is equal to the iterative version.</p>
<p>The only difference is the manner of selecting the faces.</p>
<p>Example for depth = 3</p>
<p><img decoding="async" class="img-responsive" src="https://www.lefx.de/wp-content/uploads/2016/02/DepthValue.png" alt="DepthValue" /></p>
<p>So the number of parts where to set a random material ID is:</p>
<p><img decoding="async" class="img-responsive" src="https://www.lefx.de/wp-content/uploads/2016/02/Formel2.png" alt="Formel2" /></p>
<p>Dividing the amount of faces recursively into subparts is very fast. The main bottleneck of this script is the access of the 3dx Max-Interfaces getElement and setFaceID.</p>
<p>The equivalent parameters for iterative and recursive function calls can be calculated by:</p>
<p><img decoding="async" class="img-responsive" src="https://www.lefx.de/wp-content/uploads/2016/02/Formel1.png" alt="Formel1" /></p>
<h3>Which one is better now?</h3>
<p>Basically both version do the same work and should be able to give a comparable result. The main differences are the parameters and the internal procedure.</p>
<p>If you have an object with a lot of polygons and (nearly) every element should have a random material ID then the iterative version will be easier to use because you simply enter 1 or comparable low values for the step size s. or other small values. Then the script would go assignto a random ID to every face and set a random ID. But On the other hand if the elements have a lot of faces the work would often be done more than once. This will be also very slow because of many interface accesses of 3ds Max.</p>
<p>Then it would be easier to use the recursive approach and begin with small values for the depth until you get a satisfying result with enough mixture by increasing the depth value.</p>
<h2>Examples</h2>
<h3>Different material IDs: 3</h3>
<p><img decoding="async" class="img-responsive" src="https://www.lefx.de/wp-content/uploads/2016/02/DE_mat.png" alt="DE_mat" /></p>
<h3>Duration &#8211; iterative</h3>
<p><img decoding="async" class="img-responsive" src="https://www.lefx.de/wp-content/uploads/2016/02/itereative.png" alt="Iterative" /></p>
<h3>Duration &#8211; recursive</h3>
<p><img decoding="async" class="img-responsive" src="https://www.lefx.de/wp-content/uploads/2016/02/rekursiv.png" alt="Rekursiv" /></p>
<p>It was a pleasure for us to show you these little thoughts about our workflow. We hope you had fun while reading the text and looking to the pictures. To see more of our projects, visit our <a href="https://www.lefx.de/showroom/">Showroom</a>.</p>
<p>Der Beitrag <a href="https://www.lefx.de/en/workflow-tips-random-material-id/">Workflow Tips | Random Material ID</a> erschien zuerst auf <a href="https://www.lefx.de/en">LEFX</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.lefx.de/en/workflow-tips-random-material-id/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Workflow Tips &#124; Multiscatter &#8211; How to scatter by Maps for small areas</title>
		<link>https://www.lefx.de/en/workflow-tips-multiscatter-scatter-maps-small-areas/</link>
					<comments>https://www.lefx.de/en/workflow-tips-multiscatter-scatter-maps-small-areas/#respond</comments>
		
		<dc:creator><![CDATA[Guido Lein]]></dc:creator>
		<pubDate>Sat, 12 Dec 2015 11:05:10 +0000</pubDate>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[3ds Max]]></category>
		<category><![CDATA[Multiscatter]]></category>
		<category><![CDATA[Workflow]]></category>
		<guid isPermaLink="false">http://www.lefx.de/?p=548</guid>

					<description><![CDATA[<p>For the project golf course we used the 3ds Max plug-in Multiscatter of the company Visual Dynamics to create the vegetation. It is a great plug-in for scattering objects on a surface. During the process of the project we noticed that Multiscatter has a few problems with maps for distribution which are much smaller than [&#8230;]</p>
<p>Der Beitrag <a href="https://www.lefx.de/en/workflow-tips-multiscatter-scatter-maps-small-areas/">Workflow Tips | Multiscatter &#8211; How to scatter by Maps for small areas</a> erschien zuerst auf <a href="https://www.lefx.de/en">LEFX</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>For the project <a href="https://www.lefx.de/en/visualisierung-golfplatz/">golf course</a> we used the 3ds Max plug-in <a href="http://www.multiscatter.com/" target="_blank">Multiscatter of the company Visual Dynamics</a> to create the vegetation. It is a great plug-in for scattering objects on a surface. During the process of the project we noticed that Multiscatter has a few problems with maps for distribution which are much smaller than surface. </p>
<p>The next pictures are an example for such this situation. The white area, the distribution map, is nearly 16th part of the black area, which is the distribution object. </p>
<p><img decoding="async" src="https://www.lefx.de/wp-content/uploads/2016/02/MS_02_area.jpg" alt="MS_02_area" class="img-responsive" /></p>
<p>Our first thoughts for the project were, to model the environment from a plane and then scatter the different objects like trees, grass and bushes by maps on the same plane. The advantage is that all areas have the same mapping and so it is possible to create the maps easily in Photoshop. Additionally it is easy to create hard edges between different areas, like the dark and the bright grass of the green. In the next picture you can see the different areas for the scattering in the project. Every different color is an area.</p>
<p><img decoding="async" src="https://www.lefx.de/wp-content/uploads/2016/02/MS_03_area_colored.jpg" alt="MS_03_area_colored" class="img-responsive" /></p>
<p>Simplified this method <strong>-for that article called Method 1-</strong> looks like in the next picture. For the distribution object we took the plane with a fit planar UVW mapping. The Multiscatter plugin arrange the objects only in the areas, which are visible by the map for the mask.</p>
<p><img decoding="async" src="https://www.lefx.de/wp-content/uploads/2016/02/MS_05_start.jpg" alt="MS_05_start" class="img-responsive" /></p>
<p>At this point of the project we noticed that we have to use a higher count for the quantity of the scattered objects as we could see in the result. And a higher count of objects in a scene is equalized to use more of the memory. For just a few objects <strong>-for example just one or two types for the trees-</strong> it is not important, but for this project we wanted to reach the limit by using many different types for the trees and the grass. For this reason we tried to find a solution, <strong>our method 2</strong>.</p>
<p>After some tests we figured out, that Multiscatter first scatter the objects over the whole distribution object and not till then cut off by the map. So Multiscatter creates <strong>-in these example-</strong> 16000 objects and then cut nearly 15000. So we have a multiplier by 16 for not used objects.</p>
<p>Our idea was to minimize the objects which are not used in the areas, which are invisible by the map. The only way to make it possible is to delete the unused areas. It is necessary that there are some polygons around the white area, so don´t delete them all. The next picture shows it for this example. </p>
<p><img decoding="async" src="https://www.lefx.de/wp-content/uploads/2016/02/MS_07_delete.jpg" alt="MS_07_delete" class="img-responsive" /></p>
<p>The third step, by copying the UVW mapping of the big plane to the new cut plane and not to fit the mapping, is very important. Without this step it isn´t sure, that the objects are scattered at the same part in the scene.</p>
<p><img decoding="async" src="https://www.lefx.de/wp-content/uploads/2016/02/MS_06_vergleich.jpg" alt="MS_06_vergleich" class="img-responsive" /></p>
<p>After deleting the unused polygons it is possible to set the count from 16000 to 1000, because the white area is nearly 16th part of the big plane. The following picture shows a comparison of both methods. The distribution objects and the count are changed and the map is the same.</p>
<p><img decoding="async" src="https://www.lefx.de/wp-content/uploads/2016/02/MS_04_vergleich.jpg" alt="MS_04_vergleich" class="img-responsive" /></p>
<p>Finally we have decreased the count from 16000 objects to 1000 just by deleting some polygons. In our project we had 6 distribution objects instead of one and for every distribution object 3 till 6 Multiscatters. The next picture shows one of these distribution objects.</p>
<p><img decoding="async" src="https://www.lefx.de/wp-content/uploads/2016/02/MS_08_object.jpg" alt="MS_08_object" class="img-responsive" /></p>
<p>It was a pleasure for us to show you these little thoughts about our workflow. We hope you had fun while reading the text and looking to the pictures. To see more of our projects, visit our <a href="https://www.lefx.de/showroom/">Showroom</a>.</p>
<p>Der Beitrag <a href="https://www.lefx.de/en/workflow-tips-multiscatter-scatter-maps-small-areas/">Workflow Tips | Multiscatter &#8211; How to scatter by Maps for small areas</a> erschien zuerst auf <a href="https://www.lefx.de/en">LEFX</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.lefx.de/en/workflow-tips-multiscatter-scatter-maps-small-areas/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
