How do I get a Space Warp by Binding?

MAXScript FAQ > Working With Scene Nodes > How do I get a Space Warp by Binding?

A user asked:

I created an object and a Conform space warp. I used bindSpaceWarp to bind the object to the space warp. After doing this a dozen times, I wanted to know... "Which space warp was object A assigned to?"

Answer:

You can explore the dependencies of existing space warps in the scene in order to filter the one that is affecting your object:

EXAMPLE

fn getSpaceWarpByBinding theBinding =
(
  --Loop through all space warps in the scene
  for s in SpaceWarps do
  (
    --Loop through all dependents of the current space warp --If the space warp is dependent on the supplied binding, return it!
    for o in refs.dependents s where o == theBinding do returns
  )--end s loop
)--end fn
 
--Example Usage:
theSW = getSpaceWarpByBinding $Sphere01.modifiers[1]

See Also