<?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/tag/workflow/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.lefx.de/tag/workflow/</link>
	<description>manufacturing realities</description>
	<lastBuildDate>Wed, 18 Nov 2020 14:13:20 +0000</lastBuildDate>
	<language>de</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/workflow-tips-random-material-id/</link>
					<comments>https://www.lefx.de/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>Eines der Hauptprobleme der Wiedergabe ist ihre Perfektion. Baumobjekten, die aus vielen Blattelementen bestehen, auf die das gleiche Material aufgetragen wurde, fehlen oft die natürlichen Variationen, die der Betrachter erwarten würde. In unserem Produktionsablauf sind wir täglich mit diesem Problem konfrontiert. Da wir immer versuchen, die Qualität unserer Architektur-Renderings zu verbessern, haben wir uns entschieden, [&#8230;]</p>
<p>Der Beitrag <a href="https://www.lefx.de/workflow-tips-random-material-id/">Workflow Tips | Random Material ID</a> erschien zuerst auf <a href="https://www.lefx.de">LEFX</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Eines der Hauptprobleme der Wiedergabe ist ihre Perfektion. Baumobjekten, die aus vielen Blattelementen bestehen, auf die das gleiche Material aufgetragen wurde, fehlen oft die natürlichen Variationen, die der Betrachter erwarten würde. In unserem Produktionsablauf sind wir täglich mit diesem Problem konfrontiert. Da wir immer versuchen, die Qualität unserer Architektur-Renderings zu verbessern, haben wir uns entschieden, ein einfach zu bedienendes Skript zu erstellen, mit dem wir zufällige Material-IDs setzen können, um die Wahrnehmung natürlicher Variationen zu ermöglichen.</p>
<p>Unsere wichtigste Software zur Erstellung von Inhalten ist 3ds Max, daher haben wir ein Makro-Skript (in MAXScript) für dieses Problem erstellt.</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>Rekursiver oder iterativer Ansatz</h2>
<p>Es gibt grundsätzlich zwei mögliche Ansätze zur Lösung dieses Problems. Die iterative erste iteriert durch alle Flächen, um eine zufällige Material-ID festzulegen, während die rekursive erste Version die große Menge an Flächen in kleinere Teilgruppen aufteilt und dann allen in dieser Gruppe enthaltenen Elementen eine Material-ID zuweist; verbunden mit der Flächenauswahl.</p>
<p>Zuerst haben wir den iterativen Ansatz implementiert, um einen Blick auf seine Möglichkeiten und Einschränkungen zu werfen. Danach dachten wir über mögliche Optimierungen und andere Ideen nach, wie dieses Problem effizienter gelöst werden könnte, mit einem optimalen Gleichgewicht zwischen Geschwindigkeit und einem visuell hochwertigen Ergebnis. Deshalb haben wir die rekursive Version weiter untersucht, um das Problem von einem anderen perspektivischen Standpunkt aus zu lösen.</p>
<h2>Algorithmen</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>Im Grunde genommen iteriert dieses Skript durch alle Flächen mit einem bestimmten Schritt. Dabei nimmt es die Elemente, die mit den Flächen innerhalb des Stufenbereichs verbunden sind und gibt dieser Auswahl von Flächen eine zufällige Material-ID im Bereich der minimalen ID und der maximalen ID (minID &lt;= ID &lt;= maxID).</p>
<p>Größere Werte der Schrittweite würden zu einer höheren Geschwindigkeit führen, indem viele Flächen übersprungen werden, aber zu einer sichtbaren Wiederholung der gleichen verwendeten Material-ID.</p>
<p>Die Anzahl der Funktionsaufrufe zum Setzen einer zufälligen Material-ID hängt also von der Schrittweite <em>s</em> ab:</p>
<p><img decoding="async" class="img-responsive" src="https://www.lefx.de/wp-content/uploads/2016/02/Formel0.png" alt="Formel0" /></p>
<p>Vielleicht ist Ihnen aufgefallen, dass in den ersten beiden Zeilen zwei Funktionsaufrufe Variablen zugeordnet sind.</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>Dies geschieht aus Leistungsgründen. Durch die Iinitialisierung des Funktionsaufrufs als Variable sind diese vielen Funktionsaufrufe etwas schneller auszuführen.</p>
<h3>Rekursive 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>Die rekursive Version teilt die riesige Menge von in kleinere Gruppen von Flächen auf, bevor eine Material-ID festgelegt wird.</p>
<p>Der Algorithmus teilt grundsätzlich die Anzahl der Flächen in Hälften, bis der depth-wert Null ist. Dann wählt das Skript für jeden Unterabschnitt alle Elemente aus, die mit den Flächen des Unterabschnitts verbunden sind, und weist ihnen eine zufällige ID zu. Der zweite Teil ist also gleich der iterativen Version.</p>
<p>Der einzige Unterschied besteht in der Art und Weise der Auswahl der Flächen.</p>
<p>Beispiel für 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>Also die Anzahl der Teile, bei denen eine zufällige Material-ID gesetzt werden soll:</p>
<p><img decoding="async" class="img-responsive" src="https://www.lefx.de/wp-content/uploads/2016/02/Formel2.png" alt="Formel2" /></p>
<p>Die Anzahl der faces rekursiv in Unterteile zu zerlegen, geht sehr schnell. Der Hauptengpass dieses Skripts ist der Zugriff der 3dx Max-Schnittstellen getElement und setFaceID.</p>
<p>Die äquivalenten Parameter für iterative und rekursive Funktionsaufrufe können durch berechnet werden:</p>
<p><img decoding="async" class="img-responsive" src="https://www.lefx.de/wp-content/uploads/2016/02/Formel1.png" alt="Formel1" /></p>
<h3>Welche ist jetzt besser?</h3>
<p>Im Grunde leisten beide Versionen die gleiche Arbeit und sollten ein vergleichbares Ergebnis liefern können. Die Hauptunterschiede sind die Parameter und das interne Verfahren.</p>
<p>Wenn Sie ein Objekt mit vielen Polygonen haben und (fast) jedes Element eine zufällige Material-ID haben sollte, dann ist die iterative Version einfacher zu benutzen, weil Sie einfach 1 oder vergleichbar niedrige Werte für die Schrittweite <em>s</em>. oder andere kleine Werte eingeben. Dann würde das Skript jeder Fläche eine zufällige ID zuweisen und eine zufällige ID festlegen. Aber andererseits, wenn die Elemente viele faces haben, würde die Arbeit oft mehr als einmal durchgeführt werden. Dies wird auch wegen der vielen Schnittstellenzugriffe von 3ds Max sehr langsam sein.</p>
<p>Dann wäre es einfacher, den rekursiven Ansatz zu verwenden und mit kleinen Werten für die depth zu beginnen, bis man ein zufriedenstellendes Ergebnis mit genügend Mischung erhält, indem man den depth-wert erhöht.</p>
<h2>Beispiele</h2>
<h3>Unterschiedliche 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>Laufzeit: iterativ</h3>
<p><img decoding="async" class="img-responsive" src="https://www.lefx.de/wp-content/uploads/2016/02/itereative.png" alt="Iterative" /></p>
<h3>Laufzeit: rekursive</h3>
<p><img decoding="async" class="img-responsive" src="https://www.lefx.de/wp-content/uploads/2016/02/rekursiv.png" alt="Rekursiv" /></p>
<p>Es war uns eine Freude, Ihnen diese kleinen Gedanken über unseren Arbeitsablauf zu zeigen. Wir hoffen, Sie hatten Spaß beim Lesen des Textes und beim Betrachten der Bilder. Um mehr von unseren Projekten zu sehen, besuchen Sie unseren <a href="https://www.lefx.de/showroom/">Showroom</a>.</p>
<p>Der Beitrag <a href="https://www.lefx.de/workflow-tips-random-material-id/">Workflow Tips | Random Material ID</a> erschien zuerst auf <a href="https://www.lefx.de">LEFX</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.lefx.de/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/workflow-tips-multiscatter-scatter-maps-small-areas/</link>
					<comments>https://www.lefx.de/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/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">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/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">LEFX</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.lefx.de/workflow-tips-multiscatter-scatter-maps-small-areas/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
