About this site
ScriptSpot is a diverse online community of artists and developers who come together to find and share scripts that empower their creativity with 3ds Max. Our users come from all parts of the world and work in everything from visual effects to gaming, architecture, students or hobbyists.
Comments
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.
Tools and Scripts for Autodesk 3dsMax
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.
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) :-)
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.