PDA

View Full Version : matching spring constraint to flex modifier


snot_nose
02-11-2003, 12:47 AM
I have a big fat character that i want to apply a flex modifier to his belly when he moves.
but my problem is that his suit's buttons are a seperate linked object and i need to make them move together with his belly.
i tried to apply them also the flex modifier but it didn't worked out.
i thought maybe i should apply them the spring constraint and to try to match them with the belly.

does any1 know if it's possible?
do u have a better solution?

Reality3D
02-11-2003, 01:12 AM
Try with attachment constraint

snot_nose
02-11-2003, 01:46 AM
tried that
and surface constraint
didn't really worked out

isn't there away to attach an object to a vertex (not xform wich do the opposite).

phil
02-11-2003, 02:23 AM
that's what the attatchment constraint does, only on faces rather than vertices

snot_nose
02-11-2003, 07:20 AM
hmm
maybe i should keep playing with it, even though it gave me really strange results, and also the suit's button are located between faces and not on them.

maybe it's also possible to write an expression for that?

phil
02-11-2003, 07:39 AM
hmm,
you could write a script controller which gets the position of a belly vertex and makes the buttons position equal to that but it really is just doing what the attatchment controller does. What sort of probs are you having with it?

cheers,
phil

gaggle
02-11-2003, 07:41 AM
Would the point-constraint-thingies from Reactor be of use? It sounds like overkill to actually rigid-body simulate them, I know.. but.. well I don't know.. just offering up thoughts :)

snot_nose
02-11-2003, 07:55 AM
Phil: when i apply the attachment controller to the mesh's face then my buttons are getting far away from the mesh, i tried to add a bezier constraint to them so i can locate them where the mesh is but then they don't move.
well, maybe i need to keep playing around because i have never used this constraint before till now.

gaggle: is this point thingie available on max 4? because i don't know what is it. (i do know how to use reactor but can't remeber i saw any point constraint over there)

phil
02-11-2003, 08:22 AM
just messed around with a script controller for this. if you put this in the position slot of your button as a script controller it will lock your button to vertice 69. change the 69 to what ever vertice number you need. and change the 'Box01' to the name of your characters mesh.

----------------------------------

dependson $Box01.pos.controller

$Box01.verts[69].pos

-------------------------------------

doesn't affect the rotation though.

hope it gives u some ideas, your best bet is still the attatchment though:)

phil
02-11-2003, 08:29 AM
hey snot_nose,
posted at the same time, i hate that :)

anyway, attatchment controller....

use a position list controller, then in the available slot apply the attatchment controller. You can now set one of these to be active from the motion panel. if you set the attatchment to be active and choose your face then set the bezier controller active and you can move the button around while the attatchment still works underneath.

make sense?

cheers,
phil

snot_nose
02-11-2003, 07:37 PM
AHA!
now it's working!
i think my problem was that i didn't detach the buttons into different objects.
like all the buttons together were one single object.
dumb me!

this is so grate, now i can make my jelly belly with the buttons still connected :beer:

i think i will try also your script just because of curiosity
anyway tanx alot
:thumbsup:

snot_nose
02-11-2003, 07:56 PM
cool even your script worked, only that it doesn't rotate (as you said)
but isn't it possible to align the pivot to the body mesh pivot and to apply a rotation script like the pos one?
something like:

dependson $Box01.rot.controller

$Box01.verts[69].rot

ok i have no idea in scripting but i'm curios if it would work.

do u know where can i learn about scripting on the net?
i learned some C in highschool so i guess it could make it easy on me, right? even though i haven't touched it for years.

phil
02-11-2003, 11:44 PM
hey snot,
unfortunately vertices don't have rot values.

the maxscript help in max is the best place to learn really. just look at peoples scripts and go through the help to find out what is doing what. there's also simple tutes in there.
C will help a lot, even though you haven't touched it for ages, it'll help you get into the headspace.

good luck
phil

snot_nose
02-13-2003, 05:48 PM
DAMN, i was sure that everything is ok and now when i turn my character i see that the problems are not over because the buttons don't really turn with him (they turn but then they are on a different position of my character's mesh.
I think it might be something with the fact that i attached them to a "skinned" mesh, because i tried to attach them the same way to a NOT skinned mesh and everything was ok.
any ideas on how to solve it?

will it ever end?? :cry:

Reality3D
02-13-2003, 06:53 PM
One thing to note is that if you put meshmooth at the top of the stack, the face number that attachment constraint uses as reference change(and you should then use the meshmoothed face corresponding to his bell. If you make this and go to the base of the mesh you will see again that buttons go crazy. I would change the face only at renderer time

snot_nose
02-15-2003, 11:33 AM
i tried to delete each of the modifiers applied to my character and to see if they have an affect on my problem. but even when i deleted all of them my buttons still got messed up when my character's mesh was being rotated.

the only thing i could think is that it happens because of the bezeir constraint (or tcb or linear) that i added to the controllers list. but then again i need this controller for locating the buttons on my character.

:shrug:

snot_nose
02-16-2003, 08:57 PM
weeeee
i just found the solution. :buttrock:
ok this is one of the strangest:
apparantly when i want to attach a button to a face i need to write in the attachment controller my face number - 1.
for example if i want to attach it to number 1082 then i need to write face 1081 in the attachment controller.

i have no idea what coused this, maybe it's something that i did with my character's mesh, or maybe it's just a bug (this is always my comfortable excuse)

CGTalk Moderation
01-14-2006, 09:00 AM
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.