Parameter Wiring

Topic: version 4 MAXScript New Features/Parameter Wiring

The Parameter Wire manager is described in the core interface 'paramWire' .

In the general case, a wire controller can be wired to any number of other wire controllers in two-way relationships. Each wire has a set of information that defines it, accessible using the indexed accessor functions.

Example:

The following will demonstrate a way to query a wire controller and determine what parameters it is referencing.

local wc = $foo.pos.controller -- get pos controller
if classOf wc == WirePosition then
( -- list out its connections
for i in 1 to wc.numWires do
(
local parent = wc.getWireParent i,
parent_owner = (refs.dependents parent)[1], -- hack!
param_name = getSubAnimName parent wc.getWireSubnum

format "wire %: % in %\n" i param_name parent_owner
)
)

Additionally, you can use the subAnim indexing operator as a way to scan down through an object for wire controllers:

for i in 1 to $foo.numSubs do
if classOf $foo[i].controller == ...

Also, you might also find the exprForMAXObject() method useful here to get a scripter expression for the parent or parent owner.

See also