<?xml version="1.0" encoding="utf-8"?>
<!-- generator="FeedCreator 1.7.2-ppt DokuWiki" -->
<?xml-stylesheet href="/lib/exe/css.php?s=feed" type="text/css"?>
<rdf:RDF
    xmlns="http://purl.org/rss/1.0/"
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
    xmlns:dc="http://purl.org/dc/elements/1.1/">
    <channel rdf:about="/feed.php">
        <title>Documentation Center public:software:dazstudio:4:referenceguide:scripting:api_reference:samples:material:deep_copy</title>
        <description></description>
        <link>/</link>
        <image rdf:resource="/lib/tpl/dazdoccenter/images/favicon.ico" />
       <dc:date>2026-04-28T00:56:29+00:00</dc:date>
        <items>
            <rdf:Seq>
                <rdf:li rdf:resource="/public/software/dazstudio/4/referenceguide/scripting/api_reference/samples/material/deep_copy/start"/>
            </rdf:Seq>
        </items>
    </channel>
    <image rdf:about="/lib/tpl/dazdoccenter/images/favicon.ico">
        <title>Documentation Center</title>
        <link>/</link>
        <url>/lib/tpl/dazdoccenter/images/favicon.ico</url>
    </image>
    <item rdf:about="/public/software/dazstudio/4/referenceguide/scripting/api_reference/samples/material/deep_copy/start">
        <dc:format>text/html</dc:format>
        <dc:date>2016-03-28T14:56:26+00:00</dc:date>
        <title>Deep Copy</title>
        <link>/public/software/dazstudio/4/referenceguide/scripting/api_reference/samples/material/deep_copy/start</link>
        <description>
&lt;h1 id=&quot;deep_copy&quot;&gt;Deep Copy&lt;/h1&gt;
&lt;div class=&quot;level1&quot;&gt;

&lt;/div&gt;

&lt;h2 id=&quot;summary&quot;&gt;Summary&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;

&lt;p&gt;
Below is an example demonstrating a deep copy of one material to another.
&lt;/p&gt;

&lt;/div&gt;

&lt;h2 id=&quot;api_areas_of_interest&quot;&gt;API Areas of Interest&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;
&lt;ul&gt;
&lt;li class=&quot;level1 node&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;a href=&quot;/public/software/dazstudio/4/referenceguide/scripting/api_reference/object_index/object_q&quot; class=&quot;wikilink1&quot; title=&quot;public:software:dazstudio:4:referenceguide:scripting:api_reference:object_index:object_q&quot;&gt;QObject&lt;/a&gt;&lt;/div&gt;
&lt;ul&gt;
&lt;li class=&quot;level2&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;a href=&quot;/public/software/dazstudio/4/referenceguide/scripting/api_reference/object_index/app_dz&quot; class=&quot;wikilink1&quot; title=&quot;public:software:dazstudio:4:referenceguide:scripting:api_reference:object_index:app_dz&quot;&gt;DzApp&lt;/a&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level2 node&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;a href=&quot;/public/software/dazstudio/4/referenceguide/scripting/api_reference/object_index/base_dz&quot; class=&quot;wikilink1&quot; title=&quot;public:software:dazstudio:4:referenceguide:scripting:api_reference:object_index:base_dz&quot;&gt;DzBase&lt;/a&gt;&lt;/div&gt;
&lt;ul&gt;
&lt;li class=&quot;level3&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;a href=&quot;/public/software/dazstudio/4/referenceguide/scripting/api_reference/object_index/scene_dz&quot; class=&quot;wikilink1&quot; title=&quot;public:software:dazstudio:4:referenceguide:scripting:api_reference:object_index:scene_dz&quot;&gt;DzScene&lt;/a&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level3 node&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;a href=&quot;/public/software/dazstudio/4/referenceguide/scripting/api_reference/object_index/element_dz&quot; class=&quot;wikilink1&quot; title=&quot;public:software:dazstudio:4:referenceguide:scripting:api_reference:object_index:element_dz&quot;&gt;DzElement&lt;/a&gt;&lt;/div&gt;
&lt;ul&gt;
&lt;li class=&quot;level4 node&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;a href=&quot;/public/software/dazstudio/4/referenceguide/scripting/api_reference/object_index/node_dz&quot; class=&quot;wikilink1&quot; title=&quot;public:software:dazstudio:4:referenceguide:scripting:api_reference:object_index:node_dz&quot;&gt;DzNode&lt;/a&gt;&lt;/div&gt;
&lt;ul&gt;
&lt;li class=&quot;level5&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;a href=&quot;/public/software/dazstudio/4/referenceguide/scripting/api_reference/object_index/skeleton_dz&quot; class=&quot;wikilink1&quot; title=&quot;public:software:dazstudio:4:referenceguide:scripting:api_reference:object_index:skeleton_dz&quot;&gt;DzSkeleton&lt;/a&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level5&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;a href=&quot;/public/software/dazstudio/4/referenceguide/scripting/api_reference/object_index/bone_dz&quot; class=&quot;wikilink1&quot; title=&quot;public:software:dazstudio:4:referenceguide:scripting:api_reference:object_index:bone_dz&quot;&gt;DzBone&lt;/a&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li class=&quot;level4&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;a href=&quot;/public/software/dazstudio/4/referenceguide/scripting/api_reference/object_index/object_dz&quot; class=&quot;wikilink1&quot; title=&quot;public:software:dazstudio:4:referenceguide:scripting:api_reference:object_index:object_dz&quot;&gt;DzObject&lt;/a&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level4&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;a href=&quot;/public/software/dazstudio/4/referenceguide/scripting/api_reference/object_index/shape_dz&quot; class=&quot;wikilink1&quot; title=&quot;public:software:dazstudio:4:referenceguide:scripting:api_reference:object_index:shape_dz&quot;&gt;DzShape&lt;/a&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level4 node&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;a href=&quot;/public/software/dazstudio/4/referenceguide/scripting/api_reference/object_index/material_dz&quot; class=&quot;wikilink1&quot; title=&quot;public:software:dazstudio:4:referenceguide:scripting:api_reference:object_index:material_dz&quot;&gt;DzMaterial&lt;/a&gt;&lt;/div&gt;
&lt;ul&gt;
&lt;li class=&quot;level5&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;a href=&quot;/public/software/dazstudio/4/referenceguide/scripting/api_reference/object_index/defaultmaterial_dz&quot; class=&quot;wikilink1&quot; title=&quot;public:software:dazstudio:4:referenceguide:scripting:api_reference:object_index:defaultmaterial_dz&quot;&gt;DzDefaultMaterial&lt;/a&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level5&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;a href=&quot;/public/software/dazstudio/4/referenceguide/scripting/api_reference/object_index/shadermaterial_dz&quot; class=&quot;wikilink1&quot; title=&quot;public:software:dazstudio:4:referenceguide:scripting:api_reference:object_index:shadermaterial_dz&quot;&gt;DzShaderMaterial&lt;/a&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level5&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;a href=&quot;/public/software/dazstudio/4/referenceguide/scripting/api_reference/object_index/brickmaterial_dz&quot; class=&quot;wikilink1&quot; title=&quot;public:software:dazstudio:4:referenceguide:scripting:api_reference:object_index:brickmaterial_dz&quot;&gt;DzBrickMaterial&lt;/a&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li class=&quot;level2&quot;&gt;&lt;div class=&quot;li&quot;&gt; DzElementDuplicateContext&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level2&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;a href=&quot;/public/software/dazstudio/4/referenceguide/scripting/api_reference/object_index/messagebox_dz&quot; class=&quot;wikilink1&quot; title=&quot;public:software:dazstudio:4:referenceguide:scripting:api_reference:object_index:messagebox_dz&quot;&gt;DzMessageBox&lt;/a&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;a href=&quot;/public/software/dazstudio/4/referenceguide/scripting/api_reference/object_index/refcounteditem_dz&quot; class=&quot;wikilink1&quot; title=&quot;public:software:dazstudio:4:referenceguide:scripting:api_reference:object_index:refcounteditem_dz&quot;&gt;DzRefCountedItem&lt;/a&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;a href=&quot;/public/software/dazstudio/4/referenceguide/scripting/api_reference/object_index/error_dz&quot; class=&quot;wikilink1&quot; title=&quot;public:software:dazstudio:4:referenceguide:scripting:api_reference:object_index:error_dz&quot;&gt;DzError&lt;/a&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1 node&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;a href=&quot;/public/software/dazstudio/4/referenceguide/scripting/api_reference/object_index/object&quot; class=&quot;wikilink1&quot; title=&quot;public:software:dazstudio:4:referenceguide:scripting:api_reference:object_index:object&quot;&gt;Object&lt;/a&gt;&lt;/div&gt;
&lt;ul&gt;
&lt;li class=&quot;level2&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;a href=&quot;/public/software/dazstudio/4/referenceguide/scripting/api_reference/object_index/function&quot; class=&quot;wikilink1&quot; title=&quot;public:software:dazstudio:4:referenceguide:scripting:api_reference:object_index:function&quot;&gt;Function&lt;/a&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level2&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;a href=&quot;/public/software/dazstudio/4/referenceguide/scripting/api_reference/object_index/array&quot; class=&quot;wikilink1&quot; title=&quot;public:software:dazstudio:4:referenceguide:scripting:api_reference:object_index:array&quot;&gt;Array&lt;/a&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level2&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;a href=&quot;/public/software/dazstudio/4/referenceguide/scripting/api_reference/object_index/number&quot; class=&quot;wikilink1&quot; title=&quot;public:software:dazstudio:4:referenceguide:scripting:api_reference:object_index:number&quot;&gt;Number&lt;/a&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level2&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;a href=&quot;/public/software/dazstudio/4/referenceguide/scripting/api_reference/object_index/boolean&quot; class=&quot;wikilink1&quot; title=&quot;public:software:dazstudio:4:referenceguide:scripting:api_reference:object_index:boolean&quot;&gt;Boolean&lt;/a&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level2&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;a href=&quot;/public/software/dazstudio/4/referenceguide/scripting/api_reference/object_index/string&quot; class=&quot;wikilink1&quot; title=&quot;public:software:dazstudio:4:referenceguide:scripting:api_reference:object_index:string&quot;&gt;String&lt;/a&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;a href=&quot;/public/software/dazstudio/4/referenceguide/scripting/api_reference/object_index/global&quot; class=&quot;wikilink1&quot; title=&quot;public:software:dazstudio:4:referenceguide:scripting:api_reference:object_index:global&quot;&gt;Global&lt;/a&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;/div&gt;

&lt;h2 id=&quot;example&quot;&gt;Example&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;
&lt;div class=&quot;wrap_center wrap_round wrap_download plugin_wrap&quot; style=&quot;width: 90%;&quot;&gt;&lt;ul&gt;&lt;li&gt;License: &lt;a href=&quot;http://creativecommons.org/licenses/by/3.0/&quot; class=&quot;urlextern&quot; target=&quot;_blank&quot; title=&quot;http://creativecommons.org/licenses/by/3.0/&quot; rel=&quot;nofollow noopener&quot;&gt;CC Attribution 3.0 Unported&lt;/a&gt;&lt;/li&gt;&lt;li&gt;Click the name of the example below to save it as a file&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div style=&quot;-webkit-user-select: none;-webkit-touch-callout: none;-moz-user-select: none;-ms-user-select: none;user-select: none;&quot;&gt;&lt;dl class=&quot;code&quot;&gt;
&lt;dt&gt;&lt;a href=&quot;/_export/code/public/software/dazstudio/4/referenceguide/scripting/api_reference/samples/material/deep_copy/start?codeblock=0&quot; title=&quot;Download Snippet&quot; class=&quot;mediafile mf_dsa&quot;&gt;Material_Deep_Copy.dsa&lt;/a&gt;&lt;/dt&gt;
&lt;dd&gt;&lt;pre class=&quot;code ecmascript&quot;&gt;&lt;span class=&quot;co1&quot;&gt;// Define an anonymous function;&lt;/span&gt;
&lt;span class=&quot;co1&quot;&gt;// serves as our main loop,&lt;/span&gt;
&lt;span class=&quot;co1&quot;&gt;// limits the scope of variables&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw2&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
&amp;nbsp;
	&lt;span class=&quot;coMULTI&quot;&gt;/*********************************************************************/&lt;/span&gt;
	&lt;span class=&quot;co1&quot;&gt;// Boolean : A function to [deep] copy a material from source to target&lt;/span&gt;
	&lt;span class=&quot;kw2&quot;&gt;function&lt;/span&gt; deepCopyMaterial&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; oSrcNode&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; sSrcMaterial&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; oTgtNode&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; sTgtMaterial &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
		&lt;span class=&quot;co1&quot;&gt;// If we don't have source and target information&lt;/span&gt;
		&lt;span class=&quot;kw2&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;!&lt;/span&gt;oSrcNode &lt;span class=&quot;sy0&quot;&gt;||&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;!&lt;/span&gt;oTgtNode &lt;span class=&quot;sy0&quot;&gt;||&lt;/span&gt; sSrcMaterial&lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;isEmpty&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;||&lt;/span&gt; sTgtMaterial&lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;isEmpty&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
			&lt;span class=&quot;co1&quot;&gt;// We're done...&lt;/span&gt;
			&lt;span class=&quot;kw2&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;false&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
		&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
&amp;nbsp;
		&lt;span class=&quot;co1&quot;&gt;// Get the objects&lt;/span&gt;
		&lt;span class=&quot;kw2&quot;&gt;var&lt;/span&gt; oSrcObject &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; oSrcNode&lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;getObject&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
		&lt;span class=&quot;kw2&quot;&gt;var&lt;/span&gt; oTgtObject &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; oTgtNode&lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;getObject&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
&amp;nbsp;
		&lt;span class=&quot;co1&quot;&gt;// If we don't have both objects&lt;/span&gt;
		&lt;span class=&quot;kw2&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;!&lt;/span&gt;oSrcObject &lt;span class=&quot;sy0&quot;&gt;||&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;!&lt;/span&gt;oTgtObject &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
			&lt;span class=&quot;co1&quot;&gt;// We're done...&lt;/span&gt;
			&lt;span class=&quot;kw2&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;false&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
		&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
&amp;nbsp;
		&lt;span class=&quot;co1&quot;&gt;// Get the current shapes&lt;/span&gt;
		&lt;span class=&quot;kw2&quot;&gt;var&lt;/span&gt; oSrcShape &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; oSrcObject&lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;getCurrentShape&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
		&lt;span class=&quot;kw2&quot;&gt;var&lt;/span&gt; oTgtShape &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; oTgtObject&lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;getCurrentShape&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
&amp;nbsp;
		&lt;span class=&quot;co1&quot;&gt;// If we don't have both shapes&lt;/span&gt;
		&lt;span class=&quot;kw2&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;!&lt;/span&gt;oSrcShape &lt;span class=&quot;sy0&quot;&gt;||&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;!&lt;/span&gt;oTgtShape &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
			&lt;span class=&quot;co1&quot;&gt;// We're done...&lt;/span&gt;
			&lt;span class=&quot;kw2&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;false&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
		&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
&amp;nbsp;
		&lt;span class=&quot;co1&quot;&gt;// Get the materials&lt;/span&gt;
		&lt;span class=&quot;kw2&quot;&gt;var&lt;/span&gt; oSrcMaterial &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; oSrcShape&lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;findMaterial&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; sSrcMaterial &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
		&lt;span class=&quot;kw2&quot;&gt;var&lt;/span&gt; oTgtMaterial &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; oTgtShape&lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;findMaterial&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; sTgtMaterial &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
&amp;nbsp;
		&lt;span class=&quot;co1&quot;&gt;// If we didn't find both materials&lt;/span&gt;
		&lt;span class=&quot;kw2&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;!&lt;/span&gt;oSrcMaterial &lt;span class=&quot;sy0&quot;&gt;||&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;!&lt;/span&gt;oTgtMaterial &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
			&lt;span class=&quot;co1&quot;&gt;// We're done...&lt;/span&gt;
			&lt;span class=&quot;kw2&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;false&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
		&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
&amp;nbsp;
		&lt;span class=&quot;co1&quot;&gt;// Create an element duplication context&lt;/span&gt;
		&lt;span class=&quot;kw2&quot;&gt;var&lt;/span&gt; oContext &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;new&lt;/span&gt; DzElementDuplicateContext&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
&amp;nbsp;
		&lt;span class=&quot;co1&quot;&gt;// Duplicate the material&lt;/span&gt;
		&lt;span class=&quot;kw2&quot;&gt;var&lt;/span&gt; oDupeMaterial &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; oSrcMaterial&lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;doDuplicateElement&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; oContext &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
&amp;nbsp;
		&lt;span class=&quot;co1&quot;&gt;// Set the name of the duplicate to the name of the target&lt;/span&gt;
		oDupeMaterial&lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;name&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; oTgtMaterial&lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
&amp;nbsp;
		&lt;span class=&quot;co1&quot;&gt;// Set the label of the duplicate to the label of the target&lt;/span&gt;
		oDupeMaterial&lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;setLabel&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; oTgtMaterial&lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;getLabel&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
&amp;nbsp;
		&lt;span class=&quot;co1&quot;&gt;// If the duplicate material classname and the source material&lt;/span&gt;
		&lt;span class=&quot;co1&quot;&gt;// classname do not match and the duplicate material inherits&lt;/span&gt;
		&lt;span class=&quot;co1&quot;&gt;// one of the types we know provide a setMaterialName function&lt;/span&gt;
		&lt;span class=&quot;kw2&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; oDupeMaterial&lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;className&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;!=&lt;/span&gt; oSrcMaterial&lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;className&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt;
			&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;oDupeMaterial&lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;inherits&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;DzShaderMaterial&amp;quot;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;||&lt;/span&gt;
			oDupeMaterial&lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;inherits&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;DzBrickMaterial&amp;quot;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
				&lt;span class=&quot;co1&quot;&gt;// Copy the material name&lt;/span&gt;
				oDupeMaterial&lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;setMaterialName&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; oSrcMaterial&lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;getMaterialName&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
		&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
&amp;nbsp;
		&lt;span class=&quot;co1&quot;&gt;// Re-create any aliases that exist&lt;/span&gt;
		oContext&lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;createAlaises&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
&amp;nbsp;
		&lt;span class=&quot;co1&quot;&gt;// Re-create any ERC links that exist&lt;/span&gt;
		oContext&lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;createERC&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
&amp;nbsp;
		&lt;span class=&quot;co1&quot;&gt;// Resolve references to the source material&lt;/span&gt;
		oContext&lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;doResolve&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
&amp;nbsp;
		&lt;span class=&quot;co1&quot;&gt;// Finalize the duplication&lt;/span&gt;
		oContext&lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;doFinalize&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
&amp;nbsp;
		&lt;span class=&quot;co1&quot;&gt;// Replace the target material with the duplicate of the source material&lt;/span&gt;
		&lt;span class=&quot;kw2&quot;&gt;var&lt;/span&gt; oError &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; oTgtShape&lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;replaceMaterial&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; oTgtMaterial&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; oDupeMaterial &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
&amp;nbsp;
		&lt;span class=&quot;co1&quot;&gt;// Return whether there was an error&lt;/span&gt;
		&lt;span class=&quot;kw2&quot;&gt;return&lt;/span&gt; oError&lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;valueOf&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;nu12&quot;&gt;0x00000000&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
	&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
&amp;nbsp;
	&lt;span class=&quot;coMULTI&quot;&gt;/*********************************************************************/&lt;/span&gt;
	&lt;span class=&quot;kw2&quot;&gt;var&lt;/span&gt; sMessage&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
	&lt;span class=&quot;kw2&quot;&gt;var&lt;/span&gt; sOk &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; qsTr&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&amp;quot;&amp;amp;Ok&amp;quot;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
&amp;nbsp;
	&lt;span class=&quot;co1&quot;&gt;// If the version of the application is older than 4.6.3.39&lt;/span&gt;
	&lt;span class=&quot;kw2&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; App&lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;version64&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;nu12&quot;&gt;0x0004000600030027&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
		&lt;span class=&quot;co1&quot;&gt;// Construct a message&lt;/span&gt;
		&lt;span class=&quot;kw2&quot;&gt;var&lt;/span&gt; sMessage &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; qsTr&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&amp;quot;This script requires a newer version of the application. &amp;quot;&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;+&lt;/span&gt;
			&lt;span class=&quot;st0&quot;&gt;&amp;quot;Update to the current version and try again.&amp;quot;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
		&lt;span class=&quot;co1&quot;&gt;// Inform the user&lt;/span&gt;
		MessageBox&lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;information&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; sMessage&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; qsTr&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&amp;quot;Version Error&amp;quot;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; sOk &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
&amp;nbsp;
		&lt;span class=&quot;co1&quot;&gt;// We're done...&lt;/span&gt;
		&lt;span class=&quot;kw2&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
	&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
&amp;nbsp;
	&lt;span class=&quot;co1&quot;&gt;// Get the selected nodes&lt;/span&gt;
	&lt;span class=&quot;kw2&quot;&gt;var&lt;/span&gt; aNodes &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; Scene&lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;getSelectedNodeList&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
&amp;nbsp;
	&lt;span class=&quot;co1&quot;&gt;// If we do not have more than one&lt;/span&gt;
	&lt;span class=&quot;kw2&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; aNodes&lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;length&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
		&lt;span class=&quot;co1&quot;&gt;// Construct a message&lt;/span&gt;
		sMessage &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; qsTr&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&amp;quot;This script requires two (2) nodes to be selected. &amp;quot;&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;+&lt;/span&gt;
			&lt;span class=&quot;st0&quot;&gt;&amp;quot;Select two nodes and try again.&amp;quot;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
		&lt;span class=&quot;co1&quot;&gt;// Inform the user&lt;/span&gt;
		MessageBox&lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;information&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; sMessage&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; qsTr&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&amp;quot;Selection Error&amp;quot;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; sOk &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
&amp;nbsp;
		&lt;span class=&quot;co1&quot;&gt;// We're done...&lt;/span&gt;
		&lt;span class=&quot;kw2&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
	&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
&amp;nbsp;
	&lt;span class=&quot;co1&quot;&gt;// Get the first node&lt;/span&gt;
	&lt;span class=&quot;kw2&quot;&gt;var&lt;/span&gt; oSrcNode &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; aNodes&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
	&lt;span class=&quot;co1&quot;&gt;// If the node is a bone&lt;/span&gt;
	&lt;span class=&quot;kw2&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; oSrcNode&lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;inherits&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;DzBone&amp;quot;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
		&lt;span class=&quot;co1&quot;&gt;// Get the skeleton&lt;/span&gt;
		oSrcNode &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; oSrcNode&lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;getSkeleton&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
	&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
&amp;nbsp;
	&lt;span class=&quot;co1&quot;&gt;// Get the second node&lt;/span&gt;
	&lt;span class=&quot;kw2&quot;&gt;var&lt;/span&gt; oTgtNode &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; aNodes&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
	&lt;span class=&quot;co1&quot;&gt;// If the node is a bone&lt;/span&gt;
	&lt;span class=&quot;kw2&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; oTgtNode&lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;inherits&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;DzBone&amp;quot;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
		&lt;span class=&quot;co1&quot;&gt;// Get the skeleton&lt;/span&gt;
		oTgtNode &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; oTgtNode&lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;getSkeleton&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
	&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
&amp;nbsp;
	&lt;span class=&quot;co1&quot;&gt;// Define the source material names&lt;/span&gt;
	&lt;span class=&quot;kw2&quot;&gt;var&lt;/span&gt; aSrcMaterials &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;Face&amp;quot;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
&amp;nbsp;
	&lt;span class=&quot;co1&quot;&gt;// Define the target material names&lt;/span&gt;
	&lt;span class=&quot;kw2&quot;&gt;var&lt;/span&gt; aTgtMaterials &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;Default&amp;quot;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
&amp;nbsp;
	&lt;span class=&quot;co1&quot;&gt;// If the source and target material name lists are not the same length&lt;/span&gt;
	&lt;span class=&quot;kw2&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; aSrcMaterials&lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;length&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;!=&lt;/span&gt; aTgtMaterials&lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;length&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
		&lt;span class=&quot;co1&quot;&gt;// Construct a message&lt;/span&gt;
		sMessage &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; qsTr&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&amp;quot;This script requires pairs of material names to be defined. &amp;quot;&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;+&lt;/span&gt;
			&lt;span class=&quot;st0&quot;&gt;&amp;quot;The source and target material name lists are not the same length.&amp;quot;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
		&lt;span class=&quot;co1&quot;&gt;// Inform the user&lt;/span&gt;
		MessageBox&lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;information&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; sMessage&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; qsTr&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&amp;quot;Resource Error&amp;quot;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; sOk &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
&amp;nbsp;
		&lt;span class=&quot;co1&quot;&gt;// We're done...&lt;/span&gt;
		&lt;span class=&quot;kw2&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
	&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
&amp;nbsp;
	&lt;span class=&quot;co1&quot;&gt;// Declare working variables&lt;/span&gt;
	&lt;span class=&quot;kw2&quot;&gt;var&lt;/span&gt; sSrcMaterial&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; sTgtMaterial&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
	&lt;span class=&quot;kw2&quot;&gt;var&lt;/span&gt; bSuccess&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
&amp;nbsp;
	&lt;span class=&quot;co1&quot;&gt;// Iterate over the material names&lt;/span&gt;
	&lt;span class=&quot;kw2&quot;&gt;for&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;var&lt;/span&gt; i &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; nNames &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; aSrcMaterials&lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;length&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt; i &lt;span class=&quot;sy0&quot;&gt;&amp;lt;&lt;/span&gt; nNames&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt; i &lt;span class=&quot;sy0&quot;&gt;+=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
		&lt;span class=&quot;co1&quot;&gt;// Get the 'current' source material name&lt;/span&gt;
		sSrcMaterial &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; aSrcMaterials&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt; i &lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
		&lt;span class=&quot;co1&quot;&gt;// Get the 'current' target material name			&lt;/span&gt;
		sTgtMaterial &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; aTgtMaterials&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt; i &lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
		&lt;span class=&quot;co1&quot;&gt;// If performing a deep copy, source to target was not successful&lt;/span&gt;
		&lt;span class=&quot;kw2&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;!&lt;/span&gt;deepCopyMaterial&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; oSrcNode&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; sSrcMaterial&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; oTgtNode&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; sTgtMaterial &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
			&lt;span class=&quot;co1&quot;&gt;// Next!!&lt;/span&gt;
			&lt;span class=&quot;kw2&quot;&gt;continue&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
		&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
&amp;nbsp;
		&lt;span class=&quot;co1&quot;&gt;// Provide feedback on successful copying&lt;/span&gt;
		print&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;Copied::&amp;quot;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; oSrcNode&lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;getLabel&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;:&amp;quot;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; sSrcMaterial&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt;
			&lt;span class=&quot;st0&quot;&gt;&amp;quot;&amp;gt;&amp;gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; oTgtNode&lt;span class=&quot;sy0&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;me1&quot;&gt;getLabel&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&amp;quot;:&amp;quot;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; sTgtMaterial &lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
	&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
&amp;nbsp;
&lt;span class=&quot;co1&quot;&gt;// Finalize the function and invoke&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;&lt;/pre&gt;
&lt;/dd&gt;&lt;/dl&gt;
&lt;/div&gt;
&lt;/div&gt;
</description>
    </item>
</rdf:RDF>
