NodeIcon Script

Only in Wrap4D

Runs a Python script. It can be used for writing intermediate scripts in Project workflows.

Tip

Currently Python 3.12.9 is used.

Example of Usage

You have a project, that saves an image sequence. With Project and Script node you can convert it to the single video file.

../../_images/SaveImageProject.png

Create a new project, drop the render project to the graph. It will create a Project node. Then connect the Project output to the new Script node.

../../_images/ProjectScriptFfmpeg.png

In the Script param write the following code, using FFMPEG.

import subprocess

cmd = [
        "ffmpeg",
        "-framerate", "60",
        "-pattern_type", "glob", "-i", "C:/path/to/image/sequence/*.jpg",
        "-c:v", "libx264", "-preset", "slow", "-crf", "12", "-pix_fmt", "yuv420p",
        "C:/path/to/video.mp4"
]
subprocess.run(cmd, check=True)

Then hit CTRL + SHIFT + U (or click Nodes >> Compute Current Frame). It will first compute the render project, then executes a script.


Visual Editor

Shows output and errors from the latest script execution.

Inputs

Input Signals

Signal You may connect here other workflow nodes, that must be computed beforehead

Tip

A Signal connection defines computation dependencies and the order in which nodes are computed. It can also carry data of different types, but does not have to carry any data. This makes it a flexible connection type for nodes such as Project, Script, and Null.

Output

Signal Use this signal to trigger next workflow nodes

Parameters

Compute:

runs a node.

Compute Frame Range:

runs a node for frame range specified. Frame range affects the context of the Project node, not the project being computed.

Auto-Compute:

if set, the node will be recomputed each time some parameter or input data is changed.

Script:

Python code to run. Press Alt + F to open the code editor. This parameter also supports Python Scripting expressions that generate the script text.