View Full Version : Controller for Lattice Points on FFD
pappy 08-12-2002, 09:32 PM I have been trying every way I can think of to attach selected control points of an FFD to a controlling object. So far, it has resisted my every attempt to do this. Has anyone succeeded in doing this? If so, how?
Many thanks.
neil
|
|
Chris
08-12-2002, 11:06 PM
You can do this with a script controller.
Apply your ffd to your object
Create controlling objects (or point helpers or something) for every point you wish to control. & position them where the FFD's control points are.
if you go into trackview, under modified object > FFD you should see a track called 'master'. If you open this at the moment, you probably wont see anything.
Go back to your scene & turn on the animate button. go to the last frame & move one of the ffd points. then go back to frame 1 & delete the keyframes from the last frame (so they are no-longer animated).
Now if you go back into trackview & open that 'master' you should see tracks for each of the ffd's control points.
now select one of the control points tracks. Assign a script controller. in the dialog of the script controller type this:
dependsOn $ControllingObjectName
[$ControllingObjectName.transform.position.x, $ControllingObjectName.transform.position.y, $ControllingObjectName.transform.position.z]
- change 'controllingObjectName' to the name of the corresponding
- the 'dependsOn' is so that you get real-time feedback when you move your controlling object.
you could customise this to make it a lot better, so that the controlling objects don't have to be in the correct position, but this should give you a good start!
:)
Fielding
08-12-2002, 11:09 PM
Did you tried Linked XForm?
Chris
08-12-2002, 11:16 PM
Linked xform won't link the FFD's control points. You could however link individual or a selection of vertices to another object with linked xform & acheive roughly the same thing - the stack could get quite large though & depending on the model, you may not have as easier time getting the deformations you are after. :shrug:
Fielding
08-12-2002, 11:22 PM
Hey Chris, havent you read the "React to Motion" thread?
pappy
08-12-2002, 11:28 PM
Originally posted by Chris
You can do this with a script controller.
Apply your ffd to your object
Create controlling objects (or point helpers or something) for every point you wish to control. & position them where the FFD's control points are.
if you go into trackview, under modified object > FFD you should see a track called 'master'. If you open this at the moment, you probably wont see anything.
Go back to your scene & turn on the animate button. go to the last frame & move one of the ffd points. then go back to frame 1 & delete the keyframes from the last frame (so they are no-longer animated).
Now if you go back into trackview & open that 'master' you should see tracks for each of the ffd's control points.
now select one of the control points tracks. Assign a script controller. in the dialog of the script controller type this:
dependsOn $ControllingObjectName
[$ControllingObjectName.transform.position.x, $ControllingObjectName.transform.position.y, $ControllingObjectName.transform.position.z]
- change 'controllingObjectName' to the name of the corresponding
- the 'dependsOn' is so that you get real-time feedback when you move your controlling object.
you could customise this to make it a lot better, so that the controlling objects don't have to be in the correct position, but this should give you a good start!
:)
I have tried something like this and I tried your technique, specifically. In both cases, the control vertices jumps out in space, distorting the object, while the control object remains where I made it. Do you get this? I did an attempt at resetting transforms and it still happened.
Thanks.
neil
Chris
08-12-2002, 11:49 PM
Oh bugger, I know why that is. a ffd control points co-orinates arn't worked out in world space. The transform values are based on [0,0,0] being control point 1 - and [1,1,1] being the opposite corner. Sorry about that, I'm away from Max at the moment & was going from memory.
We'll need to convert the world space co-orinates somehow... I'll go have a bit of a look - but if Toonman comes along - Help! :D
javabeans
08-13-2002, 12:45 AM
There seems to be a modifier "ffd select" can be used with
linked xform.You can have a try.
Chris
08-13-2002, 01:15 AM
thats only for ffd space warps, but that would work if a space warp will do the trick on this one... (the main problem I could see is that the ffd space warp will not move when the object moves)
Otherwise, apparently you can use getModContextTM() to return the transform in world space co-orinates, and getModContextBBoxMin() / getModContextBBoxMax() to find the dimensions of the ffd bounding box. You could convert the helper object's transforms to the local lattice space with these, without Max here though I'm almost going blind trying to work out the equation :D :surprised
pappy
08-13-2002, 06:47 AM
Originally posted by Chris
thats only for ffd space warps, but that would work if a space warp will do the trick on this one... (the main problem I could see is that the ffd space warp will not move when the object moves)
Otherwise, apparently you can use getModContextTM() to return the transform in world space co-orinates, and getModContextBBoxMin() / getModContextBBoxMax() to find the dimensions of the ffd bounding box. You could convert the helper object's transforms to the local lattice space with these, without Max here though I'm almost going blind trying to work out the equation :D :surprised
The ffd space warp does not work. I tried using it, linking the helper dummy to the parent of the ffd. It caused a "double transformation" on the control verts of the ffd.
I am trying to understand this getModContext... stuff. This is a little more than I bargained for. Maybe someone could suggest to Discreet that they create an FFD mod that allows you to link the control verts to another object. Hint! Hint! Anyone from discreet listening?
Thanks Chris for your enthusiastic responses.
neil
CGTalk Moderation
01-13-2006, 01:00 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
vBulletin v3.0.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.