<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="../../support/xsl/i2html.xsl" ?>
<?file-path assets_create.xml?>
<topic xmlns:ink="http://sidefx.com/doc/ns/ink/1.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://sidefx.com/doc/ns/ink/1.1" id="assets_create" status="unfinished" xsi:schemaLocation="http://sidefx.com/doc/ns/ink/1.1 ../../support/schema/ink/1.1/ink.xsd"><title>Create a digital asset</title><body>
            <p>The overview of how to create a digital asset is to encapsulate functionality in a subnet, and then save the subnet as a new asset in an <link to="assets_otl">Operator Type Library (OTL) file</link>.</p>

            <p>You can create a digital asset for any Houdini network type. An asset will belong to the network type in which it was created (if you create an asset at the object level then it becomes an OBJ operator, if you create an asset at the geometry (SOP) level it becomes a SOP, and so on).</p>

            <steps>
                <li>
                    <p><link to="net_subnets">Encapsulate the network of nodes</link> that provide the asset's functionality inside a subnet.</p>

                    <p>Anything being referenced by the operators inside your subnet must either be moved into the subnet or re-referenced through the asset's interface.</p>

                    <p>If you decide to put the linked nodes inside the subnet you will need to use network managers (TBD) to mix network types. For example, if you put an object into a subnet that links to shaders under <code>/shop</code>, you must create a SHOP network manager inside your subnet and move your shader into the manager.</p>
                </li>

                <li>Press <key>RMB</key> on the subnet node and choose <menu>Create Digital Asset</menu>.</li>

                <li>In the window that appears, give your new asset a <link to="assets_name">unique internal <em>name</em></link> and a human-readable <em>label</em>. You can change the label later but <em>the name cannot be changed</em> after the asset is created.</li>

                <li>
                    <p>Use the sliders to set the minimum and maximum number of inputs to your new asset. In some cases, inputs may have been created when you collapsed your operators into a subnet.</p>
                    
                    <p>An asset with minimum inputs of 0 means the node doesn't need to have an input connected to be valid. For object-level assets, this means the node doesn't have to be parented.</p>
                </li>

                <li>
                    <p>Use the <button>Save to library</button> field to choose an OTL file to save the new asset into.</p>
                    
                    <p>While it's possible to save multiple assets into a single library file, we recommend you keep each asset in its own <code>.otl</code> file, and name it the same as the library. This makes managing assets in the pipeline much easier.</p>

                    <p>By default <filename>$HOME/opCustom.otl</filename> is filled in. This is a good place to put assets when you are first learning. See <link to="assets_manage">managing assets</link> for information on OTL locations.</p>
                    
                    <p>If you enter the special string <code>Embedded</code> instead of a filename, the asset will be saved in the <code>.hip</code> file instead of in a library.</p>
                </li>

                <li>
                    <p>Use the <button>Install Library To</button> option to choose where you want the type library to be available:</p>

                    <ul>
                        <li>
                            <p>For the current hip file.</p>
                        </li>

                        <li>
                            <p>For the current user (HOME).</p>
                        </li>

                        <li>
                            <p>For the current project (JOB).</p>
                        </li>

                        <li>
                            <p>Anywhere else in your <filename>HOUDINI_PATH</filename>.</p>
                        </li>
                    </ul>

                    <p>(If you choose a directory in your path, the OTL is not copied to the specified location. Instead Houdini adds a reference to the OTL to the <filename>OPLibraries</filename> file there.)</p>
                    
                    <p/>
                </li>

                <li>Click <button>Accept</button>. Houdini saves the new asset into the OTL file you chose.</li>

                <li>
                    <p>Houdini opens the <link to="ref_win_optype">type properties window</link> to allow you to edit more properties of the new asset, including:</p>
                    
                    <ul>
                        <li>You can choose an icon for the node tiles in the network editor.</li>
                        
                        <li>
                            <p>You can choose a <em>representative type</em>. This is a node inside the asset that represents the general type of node you want the asset to be. Houdini may use this information to filter and categorize your asset in the interface.</p>
                            
                            <p>For example, if you have created a light asset, choose a light object from inside the asset as the representative type. Houdini will then treat your asset like a light, such as in the <link to="ref_panes_linkedit">light linker</link>.</p>
                        </li>
                    </ul>
                    
                    <p>See the <link to="ref_win_optype">options available in the type properties window</link>.</p>
                </li>
            </steps>
        </body></topic>