Creating Custom Tools
Power to the People

Use the History Palette as a Scripting Tutor

 

Introduction

In this tutorial, I'll demonstrate how to create your own custom tools in PiXELS 3D Studio.

This tutorial requires:

Pixels3D | studio | v3.x
Understanding of PiXELS 3D Studio Basics
The will to use PixelScript

The Concept
Before we can create a tool, we need to have an idea of the function of the tool. In this case, we're going to create a tool that creates cubes with rounded corners.
The Process
In a new file, create a default Cube, and call it RoundCube (or whatever you like).

Choose Reshape>Subdivide, and subdivide the cube 8x8.

This leaves us with a high-resolution cube.
Change the Cube's U & V Basis to B-Spline. Changing from Linear to B-Spline softens the corners of the Cube.

Choose Reshape>Optimize.

This eliminates the unnecessary U & V steps of the object, leaving us with a much lower CV Count, and a faster render.

Ancient History

If it isn't already open, open the History Window ( CMD + h ).

In the history window are the PixelScript commands we have just executed to create the object.

Select this text, and choose Edit>Copy.

This copies the text to the clipboard.

Transfer the Script to the Script Editor
Open the Script Editor ( CMD-2 ), and choose Edit>Paste.
Edit the Script

What's the point of a Script Editor? Editing scripts. Let's do that.

As is, this script will work perfectly - but only once. This is because the name of the object has been specified, and is referred to by a few of the commands. By making a few modifications, we can make this simple script work without object name conflicts.

1) Delete the select -r RoundCube line. Why? When we create an object, it is automatically selected, so there is no need for this line.

2) Create a variable to hold the name of the created object. The 2nd line (below) sets the variable cubeName to the name of the newly created object.

3) Replace any further occurances of a specific object name with the variable substitution $cubeName. When the interpreter comes across $cubeName, it replaces it with the actual name of the object, so the commands always point to the correct object.

Save the Script

Click the Green Dot in the upper-right corner of the Script Editor, and Choose Save...

Navigate to your PiXELS 3D Studio:Scripts folder, and save the script.

Re-Launch PiXELS 3D Studio
Choose File>Quit. Then Launch Pixels 3D Studio again. This refreshes the Extras, Scripts, and Favorites Editor.
Add the Tool to the Favorites Window
Click an Empty slot in the Favorites Window. If you don't have room, you can remove a favorite by Command-Clicking on it.

The Favorites Editor opens.

Click the Scripts Tab, and select the script we just saved. Click OK.

All Done!

Instantly, the tool is added to the ranks of the Favorites Window. It was a little bit of work, but next time you need a smooth cube, that single-click modeling approach will make you appreciate the time you spent setting it up.

Homework

Build your own custom tool, and add it to your favorites.

Here are a few simple ideas:

  • A Mesh rotated 90 degrees on the X-Axis, and parked.
  • Half of a Sphere ( set revolutions to 180 )
  • The Spline profile of a vase
  • A Torus ( path extrude a small circle over a larger one )

For more information on TCL scripting, see the Scriptics website.

 

Contact Us | Privacy Notice
Copyright © 2000 Pixels Animation Studios, Inc. All rights reserved.
1-619-220-4902