Shade3D Help (Contents)

Using Scripts

The Script Window is used for writing and recording scripts.

Select View > Script to open the Script Window.

Scripts

Creating Scripts

To create scripts in Shade3D you can either write your own or record a sequence of operations in Shade3D.

Writing Your Own Script

By using a supported programming language in Shade3D, you can write your own scripts directly. The following programming language can be used in Shade3D:

You can write scripts in the Script Window, or use a different text editor and copy and paste it in.

Save your script by clicking the Save button on the right side of the Script Window. A File Save dialog appears, allowing you to specify a name for your script.

To load a previously saved script, click the Load button in the Script Window.

Scripts

A script in the Script Window

Recording Shade3D Operations

Many Shade3D operations can be recorded as scripts. Even if you are not very familiar with programming languages, you may be able to create a very useful script simply by recording a sequence of Shade3D operations. By modifying a recorded script, even more complex scripts are possible. To start recording to a script, click the Record checkbox in the top left corner of the Script Window.

  1. Select File > New to open a new scene.
  2. Create a sphere and extruded closed line similar to those in the image below, and arrange them as shown.
  3. If the Script Window is not already open, open it now by selecting View > Script.
  4. With only the sphere selected in the Browser, select the Record checkbox in the Script Window.
  5. Drag the red arrow of the Manipulator to move the sphere 500 grid units in the X direction.
    The Translate operation is recorded as a script in the Script Window.

    Scripts
  6. Now drag the red square of the Manipulator to scale up the sphere in the X direction.
    The Scale operation is recorded as a script in the Script Window.

    Scripts
  7. Deselect the Record checkbox in the Script Window.
  8. Now select the extruded closed line.
  9. Click the Run button in the Script Window.
    The operations recorded for the sphere (Translate and Scale) are now applied to the extruded closed line.

Running Scripts

There are two main ways to run scripts:

From the Script Window

With the script you wish to run displayed in the Script Window, click the Run button.

The text area can be used for writing your own script, recording a script, or loading an existing script.

This method works well if you wish to run the same script several times with variables set to different values.

From the Scripts Menu

By saving a frequently used script as a file in the “scripts” folder, it can be run from the Scripts menu. The "scripts" folder is in the following location:

Windows7/8:
\Users\user name\Documents\Shade3D\Shade3D ver.16\scripts
Mac:
/Users/user name/Documents/Shade3D/Shade3D ver.16/scripts

Let's save the script we just created.

  1. Click the Save button in the Script Window.
    A Save as dialog box opens.
  2. Navigate to the scripts folder.
  3. Enter an appropriate name for your script. For the file type, use the default Python script type (*.py).
  4. Close and re-launch Shade3D.
  5. Select the Scripts menu, and verify that your newly saved Python script is listed in the menu.

    Selecting Run... from the Scripts menu opens a dialog in which you can specify the file of a script to run.

Caution Shade3D script files distributed online may not run in versions of Shade3D older than the version used to write them.

Copyright © 1986-2024 FORUM8 Co., Ltd.