20.08.2015 Views

TECHNICAL PAPER Building Tools for Houdini 9

TECHNICAL PAPER Building Tools for Houdini 9 - Digital Cinema Arts

TECHNICAL PAPER Building Tools for Houdini 9 - Digital Cinema Arts

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Exercise 4: Add Digital Asset to the Shelf and TAB menus1.2.3.Note:Install the Digital Asset to your hip file that you’d like to add to the shelf. For the sake of this exerciselet’s assume you have an asset named object_test.As <strong>for</strong> Exercise 3, select your asset in the <strong>Tools</strong> list and Accept.Select your tool from the shelf and observe what happens.If there is no current selection no nodes will be place in any networks.4. RMB on Test to Edit Tool… and Edit with an HDA Editor5.6.7.Because this is an asset you will not be modifying the shelf file, but will instead be modifying theasset itself.Go to the <strong>Tools</strong> Folder and notice a number of things:○○ The Name and Label have been filled in automatically based on the asset type.○○ The Script imports the appropriate utils module, also based on the asset type and calls thegenericTool function.○○ The Context uses the local variables $HDA_TABLE and $HDA_NAME to make an in<strong>for</strong>medguess as to which contexts you’d like this to work in.○○ The TAB Submenu Path initializes with a Digital Assets entry.You could at this point add some additional Python scripting to prompt the user or give other feedback.You could also add Help that would be visible in the Shelf. We go into more detail on how todo this in the next section.Cancel out of the Op Type Properties Editor.Exercise 5: Add Tool by Editing .shelf File1.2.Exit from <strong>Houdini</strong>.Open $HOME/houdini9.0/toolbars/test.shelf with your favorite text editor (preferably one withindentation and syntax color coding).3.4.5.6.Figure 11 - .shelf file exampleTo add an existing <strong>Houdini</strong> Tool to this shelf you just need to insert a new memberTool in the block between lines 8 and 12.To add a Digital Asset do as <strong>for</strong> an existing <strong>Houdini</strong> tool, but remember the asset must be in the pathor it will show as Undefined when you open your hip file.To add a new button-push script tool add the memberTool name and then define the script itself in a section similar to the “hello_world” exampleSave the new shelf file and open <strong>Houdini</strong> to see the results.12 | <strong>TECHNICAL</strong> <strong>PAPER</strong> Rev 1.0

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!