View Full Version : Constrain to a vertex
The Time Serpent 09-06-2003, 08:24 PM Constrain to a vertex
yes i know its been asked already and i even actualy did a search on it, but the rivet script is not good enough so i wonder if anyone can suggest anythin else?
|
|
The Time Serpent
09-07-2003, 11:26 PM
bump
dmcgrath
09-07-2003, 11:28 PM
What do you need to do? Maybe there is a workaround that you haven't thought of.
The Time Serpent
09-07-2003, 11:44 PM
well the truth there is a workaround....
but i really want to be able to do it...
anyway i tried to play around with rivet script but all i was able to change about it is the amount of edges used for the rivet (default 2) and 4 edges work better than 2.
but cuz im a noob in scripting i wasnt able to do more than that.
antweiler
09-07-2003, 11:50 PM
another thing is to write an expression, to link the obj to the worldspace position of a vtx (dont ask me hoe to do it)
antweiler
The Time Serpent
09-08-2003, 04:18 AM
yes but how i can see/read real world position of the vertex? cuz if its moves because of a blenshape the local position aint changing..:banghead:
The Time Serpent
09-08-2003, 06:28 AM
ok i ve found the command pointPosition thats workin like i need but now a really stupid question since ive recieved this as a result //Result: 4.24685 -1.92626 3.215528//
how i can break it up? (x,y,z)
dwalden74
09-08-2003, 08:05 AM
how i can break it up? (x,y,z)
float $pos[] = `pointPosition nurbsSphere1.cv[4][1]`;
locator1.tx = $pos[0];
locator1.ty = $pos[1];
locator1.tz = $pos[2];
This won´t update until you change the timeline though.
:beer:
David
The Time Serpent
09-08-2003, 11:09 PM
what you mean by the Timeline?:curious:
dwalden74
09-09-2003, 07:35 AM
Oh, sorry, I meant the timeslider. Maya needs some kind of "refresh" in order to calculate that expression.
-david
The Time Serpent
09-09-2003, 05:41 PM
ahh now i got it workin....
but the timeslider thing is kinda annoyin..
is there any other way to update it?
The Time Serpent
09-09-2003, 08:45 PM
ok here what ive came up so far
global proc locConstrain()
{
// checks for the names of the locator and the vertex
string $sel[] = `ls -sl`;
// checks for the world space position of the vertex
float $pos[] = `pointPosition -w $sel[1]`;
// assigns the world space x,y,z values of the vertex
float $mPX = $pos[0];
float $mPY = $pos[1];
float $mPZ = $pos[2];
// assigns the locator name and x,y,z attributes
string $lPX = $sel[0] + ".translateX";
string $lPY = $sel[0] + ".translateY";
string $lPZ = $sel[0] + ".translateZ";
setAttr $lPX $mPX;
setAttr $lPY $mPY;
setAttr $lPZ $mPZ;
}
the question is how i can make it update continuously? (the constraints are doin it but how?)
kamsvag
09-09-2003, 10:26 PM
What you need is the 'rivet' script from highend3d.
http://www.highend3d.com/files/dl.3d?group=melscripts&file_loc=rivet-v1.0-.zip&file_id=976
The Time Serpent
09-09-2003, 10:46 PM
i tried rivet script already as i said in the beginning of the thread
wrend
09-10-2003, 01:53 AM
and why wasnt it 'good enough' ... maybe its too good ;)
if you want it to be on a vert, you just gotta change where the locator sits in parameter space. rivet does extra gear like normaling to the face tho, so i use a similar, skinnier, setup for just grabbing vrt location: select edge w your vrt on it, duplicate surface edge (w history), pointOnCurve -ch 1, pipe this node's position result to the thing you want constrained, set its param to 1/2 for either end.
The Time Serpent
09-10-2003, 03:07 AM
well its not that its not good enough its that at first i wasnt been able to modify it to suit my needs, now i see how to modify it, but now i want to finish my own script:p
Razvan
09-10-2003, 06:55 PM
runtime expression:
float $point[] = `xform -q -a -t -ws yourObject.cv[7][0]`;
xform -t $point[0] $point[1] $point[2] locator1;
to get the cv/vertex just select it and look in the script editor for the name.
The Time Serpent
09-11-2003, 05:01 PM
nope its not workin...:shrug:
wrend
09-12-2003, 12:49 AM
i prefer dependency networks, like the above, for just these updating reasons, but if you really want to use an expression, use something like ...
float $sog = nurbsTorusShape1.boundingBoxMaxX;
float $point[] = `xform -q -a -t -ws nurbsTorus1.cv[7][0]`;
locator1.translateX = $point[0];
locator1.translateY = $point[1];
locator1.translateZ = $point[2];
... as it has a push and a pull, and thusly will be evaluated when you change the shape, not just frame change.
Phearielord
09-12-2003, 02:11 AM
mm....not quite sure what you're trying to achieve.....but you should try the 'pointOnCurveInfo' node or the 'pointOnSurfaceInfo' node........
that should give you the location of a particular point.....and you can also parent geometry to a point, whether it get's driven my a parent/deformer or not.....
just a thought..
The Time Serpent
09-12-2003, 06:59 AM
thanx wrend :beer:
this one works perfectly, altought what you mean by i prefer dependency networks, like the above, for just these updating reasons, :curious: and if you can pls give an example
dwalden74
09-12-2003, 08:29 AM
you should try the 'pointOnCurveInfo' node or the 'pointOnSurfaceInfo' node
Yes, but if he wants an actual cv, this will not lie directly in the UV space itself.
and you can also parent geometry to a point
What?!? How would you do that???
:beer:
David
Phearielord
09-12-2003, 09:59 AM
sorry dwalden74
what I meant to say was, by using the node he could constrain geometry to the selected cv/vertex....
Razvan
09-12-2003, 01:55 PM
Originally posted by The Time Serpent
nope its not workin...:shrug:
Works fine for me ... you have to move the timeslider for update though, works with blendshape animation too (just used it for a project).
wrend
09-13-2003, 08:24 AM
time serp: i just mean a setup using a node network, rather than an expression. examples being the rivet script, and the setup i use mentioned before ...but that was for poly verts, id missed you wanted to do it for CVs, which is a simpler setup using just one node (ripped from stitch points setup). ive written a script that does it for you, called cvWrldLoc found on highend3d.
zsz98781
09-13-2003, 10:18 AM
How do it that i will add a small pictures in my profile at left???
in my profile , at "option",at "change avatar"?
The Time Serpent
09-14-2003, 12:38 AM
humm i never said its for CVs its indeed for poly verts.
also wrend i dont get it, how can you duplicate an edge?
wrend
09-14-2003, 07:59 AM
through the UI:
edit curves>dupe surface crvs
zsz98781: your question is a tad off topic/thread! but yeah, id say your right! there should be a FAQ somewhere for this ... how about just under the CG network logo, on that black bar! :)
CGTalk Moderation
01-16-2006, 01: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.
vBulletin v3.0.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.