Wrapping a network of nodes serves a dual purpose of making the script more readable on the monitor, and allowing code to be duplicated without cluttering the drawing area.
To create a wrapper node:
Right-click (Windows) or Ctrl-click (Mac) on any node in the network, and select Wrap Marionette Network from the context menu.
The network becomes a wrapper node.
To allow inputs and outputs to the wrapper, the wrapped nodes must be named. In this example, you need to provide access to the origin of the rectangular prism, its dimensions (width, depth, and height), and the resulting extruded object.
Double click on the wrapper to enter object editing mode and access the Marionette script inside the wrapper.
Select each node listed, and enter its Name in the Object Info palette.
Node |
Name |
Get XYZ |
Origin |
Pass (attached to width input on Rectangle node) |
Width |
Pass (attached to height input on Rectangle node) |
Depth |
Pass (attached to top input on Extrude node) |
Height |
Extrude |
obj |
Click Exit Marionette Script to return to your drawing. The wrapped network displays with the named nodes that can be accessed.
Select the wrapper node, and enter the Name “Rectangular Prism Body” in the Object Info palette.
Make two copies of the Rectangular Prism Body wrapper. These will serve as the basis for the cabinet top and cavity in future steps; the parameters will be redefined for each piece of the cabinet.
On the original wrapper node (the body), attach a 3D Point node to the Origin port of the Rectangular Prism Body wrapper and a Dim node to each of the other ports. Connect the wires.
Select each Dim node, and assign the following names and dimension values in the Object Info palette.
Body Prism Port |
Dim Node Name |
Value |
Width |
Body Width |
3 feet |
Depth |
Body Depth |
2 feet |
Height |
Body Height |
3.5 feet |
Select a node and click Run from the Object Info palette.
A rectangular prism displays at the assigned origin (0,0,0) with the prescribed dimensions. This is the cabinet base. The prisms that compose the cabinet top and cavity are defined relative to the location and size of this base object.
You can download the tutorial at this stage here (internet access required).
~~~~~~~~~~~~~~~~~~~~~~~~~