[Closed] FFD2 Modifier Sub-Object Transform Properties
Hi, everyone :wip:.
I’m trying to move control points in FFD trough script.
Generallly I want to take world coordinates and transfrom them in FFD space and move specific contol point there.
in help I found that to convert from local to world coordinates, you multiply the local coordinates by the nodes objecttransform matrix. To convert from world to local coordinates, you multiple the world coordinates by the inverse of the nodes objecttransform matrix
like:
obj=box pos:[10,20,30]
addModifier obj (affect_region())
objTM=obj.objecttransform
modTM=getModContextTM obj obj.affect_region
– calculate world coordinates of end point
obj.affect_region.end_point * (inverse modTM) * objTM
– set end point at world coordinates [20,20,0]
obj.affect_region.end_point = [20,20,0] * modTM * (inverse objTM)
and also there is explanation about specific case regarding FFD and control points, couse it has it’s own local normalized space
[color=Yellow]
b=box pos:[10,20,0]
ffd=ffdbox()
addModifier b ffd
animateVertex ffd 64
cp64posL=ffd.control_point_64
objTM=b.objecttransform
modTM=(getModContextTM b ffd)ffd.lattice_transform.value
modBBMin=getModContextBBoxMin b ffd
modBBMax=getModContextBBoxMax b ffd
[u]cp64posW=(modBBMin+(cp64posL(modBBMax-modBBMin)) * (inverse modTM) * objTM[/u]
this is the way you get world coordinates of specific control pointg in FFD!
But I need the oposite! I want to transform world coordinates to FFd local space coordinates, and I,m still trying to figure how to do that.
Is there anyone who can help?
Best regards!
[/color]
There are some scripts on scriptspot that do this, I think this one does : http://www.scriptspot.com/3ds-max/dummiesforffd
Hope this helps,
-Johan