NodeIcon Script

Only in Wrap4D

Runs a Python script. It can be used for filling the gaps in workflows with multiple Project nodes.

Tip

Currently Python 3.8.3 is using.

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.


Inputs

Input Signals

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

Tip

Signal connection type doesn’t transfer data. It just defines the node computation order and prerequests. It can be used in Project or Script nodes.

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:

write here a Python code to run. The code should not to return anything. See Python Scripting for the cheatsheet.