pin selected ffd 2x2x2 control points to an object

as the title say...so I could move control points with a master object.
as the control points are in their local space, it is tooooo hard for me.
If somebody can / have already do it.
Thanks.

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
miauu's picture

I try somethin like this for

I try somethin like this for my VisualPivotPlacer script. In the mxs referense you can find how to calculate the world coordinate of the FFD control points. I try it and it work well, except that the object must not be rotated. After the rotation of the object the returned resulat(the world coordinate of the control points) is not correct. See the image:

 

 

The orange cage with red dots represent the position of the object veits. As you can see when the object is not rotated there is no problems, but when the object is rotated the returned world coordinats is shifted. For this test I add a FFD_3x3x3 modifier and get all 27 control control points.

Here the function from mxs reference.

 

-- convert FFD local (normalized) coordinates to world coordinates
    fn ffdLocalToWorldPos obj ffdmod pos =
    (
        objTM = obj.objecttransform
        modTM = (getModContextTM obj ffdmod) * ffdmod.lattice_transform.value
        modBBMin = getModContextBBoxMin obj ffdmod
        modBBMax = getModContextBBoxMax obj ffdmod
        (modBBMin + (pos * (modBBMax-modBBMin)) * (inverse modTM) * objTM)
    )

        ffdMod = FFD3x3x3()    --    define ffd3x3x3 modifier
        addModifier selection[1] (ffdMod)    --    add it to the object
        animateVertex ffdMod #all    --    animate all certices, so their pos can be translatet to world coordinates
       
        cp1wp = ffdLocalToWorldPos selection[1] ffdMod (selection[1].modifiers[1].control_point_1)
        cp2wp = ffdLocalToWorldPos selection[1] ffdMod (selection[1].modifiers[1].control_point_2)
        cp3wp = ffdLocalToWorldPos selection[1] ffdMod (selection[1].modifiers[1].control_point_3)

If the image is not showed properly see it here.

nudity's picture

I'm working on a similar

I'm working on a similar concept right now. However I don't think yuo need a script to do this, if I'm not mistaken you can use linked-xforms with ffd modifiers.

titane357's picture

thanks for help. yes I can

thanks for help. yes I can use ffd and linked xform, but I don't want to move all control points, but just some of them to deform the whole object.
And I can't link Xform just some control points (if not tell me how) :-)

nudity's picture

I was messing around in max

I was messing around in max just now and your right about not being able to link-xform ffd's. Have you tried messing around with the skinwrap modifier, I was able to create something like you described using a simple box as the skin object, if you want something more complex you could set up linked-xforms for your skin mesh.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.