Notifications
Clear all

[Closed] FFD Control Points Space

Hi guys. I’m trying to write script controllers for the control points of a FFD Spacewarp. The control points’ local space seems to be unique. It looks like its based on an identity vector from the pivot. Can anyone confirm this?

Khye

3 Replies
1 Reply
(@bobo)
Joined: 11 months ago

Posts: 0

It uses normalized coordinates in the Modifier Context which is the object-oriented bounding box represented by the selection brackets. If you add a Bend modifier to the same object, its bending gizmo will also be defined by the same space (but it also has a center that can be offset).

Each point of the FFD gets a coordinate in this space between 0,0,0 and 1,1,1 (the lower and upper points of the object-oriented bounding box). Notice that if you scale the object at mesh level or via XForm below the FFD, the modifier context scales with it and the FFD adapts to the new dimensions.

Ok, I’m using the spacewarp version. Using in coordsys local $.min gives me the origin I’m looking for until one of the control points exits the boudning brackets. The viewport doesn’t update the bounding brackets, but the .min value does change, which then throws off the calculations for the rest of the points. To keep it working I’m currently basing my origin calculation off of the LxWxH. Working code:

theFFD = $FFD01
worldPoint = [15,10,10]
localPoint = worldPoint * inverse theFFD.transform
dFactor = [theFFD.length,theFFD.width,theFFD.height]
origin = -[theFFD.length/2, theFFD.width/2, theFFD.height/2]
val = in coordsys $FFD01 (localPoint-origin)
val/dFactor

Is there a more elegant solution that I am missing?

 JHN

I don’t know if it’s exactly what you’re after, but maybe you could use some of it’s code:
http://www.scriptspot.com/3ds-max/dummiesforffd

-Johan