SimplyMaya Forums

Welcome to the forum, feel free to ask questions here.


SM Forums / Lounges / Maya Basics & Newbie Lounge / getting a verts worldSpace coordinates

Maya Basics & Newbie Lounge Please post in this section ONLY if your question doesn't fit in anywhere else on the forum, or if you're not sure which section it's relevant to. We also have Free streaming trial available.

Join the conversation. Reply to post
 
Thread Tools
25-06-2010, 02:46 PM   #1
Falott
Registered User
 
Falott's Avatar
 
Join Date: Jan 2005
Location: vienna
Posts: 1,095
getting a verts worldSpace coordinates
Didnīt know exactly where to post that issue, so hereīs my terrible problem.

I desperately need to point constrain a locator to a vertex. the vert is part of a skinned geometry -> animated. while the vertex is now moving through space the locator should stick to it.

things I tried:

1)pointConstraint

select vertex + shiftSelect Locator
Animation > Constrain > Point

(creates a pointConstraint, but doesnt have any effect on the locator. locator stays where it is.)


2) geometryConstraint

select vertex + shiftSelect Locator
Animation > Constrain > Geometry

(create the geometryConstraint, but the locator is now floating over the geometry while it trying to maintain its original location in space)


idea:

outputCloth4.pnts[171].pntx";
outputCloth4.pnts[171].pnty";
outputCloth4.pnts[171].pntz";


my geometry is called collisionDress (because it will be animated with nCloth). my idea now was to feed the vertex xyz-coordinates into the locators xyz-coordinates. the problem but is, I will have to do this for multiple animations - ergo script it.

question:

how do I get worldspace coordinates from a vertex so I can plug its values into the locators XYZ translations?? because If Iīd select the dress, go to component mode - select vertex - CVs[click to show] it always says 0 0 0 for all vertices for all translations - I guess thats local space...


is there any way to feed my locator with world space values from a vertex?

please help
__________________
everything starts and ends in the right place at the right time.
  Reply with quote
25-06-2010, 04:06 PM   #2
Jay
Lead Modeler - Framestore
 
Jay's Avatar
 
Join Date: Feb 2003
Location: UK
Posts: 6,276
Fallot I just asked about here at work to alot of very good guys. Now without giving you a script and plugin for this from work, there is a fairly simple process.

Attach a cluster to the vert then add the locator to the cluster. See how it goes, we did it here and its fine, you'll just have to figure it out in your hierachy.

cheers
J
  Reply with quote
25-06-2010, 05:31 PM   #3
Falott
Registered User
 
Falott's Avatar
 
Join Date: Jan 2005
Location: vienna
Posts: 1,095
cool, how could I have not thought about clusters...
I am sure thatīll work just fine

today you saved my life jay!


thx a ton m8!
__________________
everything starts and ends in the right place at the right time.
  Reply with quote
26-06-2010, 02:38 AM   #4
bullet1968
Lifetime Member
 
bullet1968's Avatar
 
Join Date: Feb 2010
Location: Australia
Posts: 4,255
here mate,

found this thread on another site..see avace reply. I just tried it and it displays the co-ords.

Hope the help was useful.


Quote: Windows => General Editors => Component Editor

and then select the Polygons tab

It will list the XYZ of the vertices selected. End quote.


http://www.3dbuzz.com/vbforum/showth...coordinates...
__________________
bullet1968

"A Darkness at Sethanon", a book I aspire to model some of the charcters and scenes
  Reply with quote
28-06-2010, 08:06 AM   #5
Falott
Registered User
 
Falott's Avatar
 
Join Date: Jan 2005
Location: vienna
Posts: 1,095
ok, funny thing. either I missunderstand something here or I just dont get it..

the cluster returns exactly the same problem like with any other transform node. I can constrain the vertex to the cluster of course, but I cant constrain the Cluster to the vertex.

now for dummies. how did you put up the connection exactly from vertex to cluster?

select vertex - shiftSelect cluster - point/geometry constrain? because that doesnīt work.

I also tried to make use of the connection editor -
mesh.pntsXYZ > cluster.translateXYZ
this again sets my cluster to 0 0 0 at each frame of the animation.

I tried expressions (which works the same like connectionEditor I guess)

cluster1Handle.translateX = outputCloth1.pnts[159].pntx
cluster1Handle.translateY = outputCloth1.pnts[159].pnty
cluster1Handle.translateZ = outputCloth1.pnts[159].pntz


weird thing is if I select a vert in the componentEditor like bullet suggested and move the vertex script editor returns

move -1779 213.435852 -2118.266846 outputCloth1.vtx[159];

which makes me think there is no difference between local and worldspace.


I guess I just need an expression like this

cluster1Handle.translateX = outputCloth1.pnts[159].pntx(world)


but how?
__________________
everything starts and ends in the right place at the right time.
  Reply with quote
28-06-2010, 08:19 AM   #6
Falott
Registered User
 
Falott's Avatar
 
Join Date: Jan 2005
Location: vienna
Posts: 1,095
hereīs another idea

float $vtxPosA1[1] = `xform -q -ws -t outputCloth1.vtx[159]`;
print $vtxPosA1;

-1779.823486
213.435852
-2118.266846


this seems to work fine



question:

how do I feed those values into a transform node with the help of an expression?

transformNode.translateX = $vtxPosA1; ??
transformNode.translateY = $vtxPosA1; ??
transformNode.translateZ = $vtxPosA1; ??



_____edit_____
oh man...

i just realised that I canīt use $scripts because I need an update at each frame of the animation.

so how do I feed transformNode with an expression?
there must be a very simple line of mel code for it.
__________________
everything starts and ends in the right place at the right time.

Last edited by Falott; 28-06-2010 at 08:44 AM.
  Reply with quote
28-06-2010, 08:54 AM   #7
Falott
Registered User
 
Falott's Avatar
 
Join Date: Jan 2005
Location: vienna
Posts: 1,095
guess I just found the answer here ->

http://home.comcast.net/~tstoeger/ti...onstaints.html

method 2
__________________
everything starts and ends in the right place at the right time.
  Reply with quote
02-07-2010, 01:48 PM   #8
Falott
Registered User
 
Falott's Avatar
 
Join Date: Jan 2005
Location: vienna
Posts: 1,095
still not quite what I need. another problem showed up during the process.


the last step which made my rig work was an expression in the locators.translation


float $vertA1[] = `xform -q -t -ws outputDress.vtx[159]`;
AimA1.translateX = $vertA1[0];
AimA1.translateY = $vertA1[1];
AimA1.translateZ = $vertA1[2];


that made them stick to surface while it animated.

next step was laying my dress rig on top of that structure by feeding spine rotation values from mocap_spines to dress_spines and let the dressBones (selected one in the pic) aim towards the vertex constrained AimLocators.

the goddamn thing now really moves finally. the bones follow the cloth simulation.

BUT

for all 6 jointChains (2 bones each) I would now have to make corrections to the offsetX rotation values. which would be a tedious work for 7 times 4000 frame walking animations.


SOLUTION (how I have in mind..)


is there a way to connect the

"dressBoneB1_aimConstraint1.offsetX"

with the help of of a normal or geometry similar constraint so the bone (Xrotation) follows the flow of the surface below?

I guess all that sounds pretty confusing, and I am sorry for my lack of explaining things carefully enough.

thing is - if that last step finally works, I could bake a cloth simulation to a boneanimated dress for exporting it to a realtime application with some mouse clicks

Iīd be happy to provide further informations if anyone has an idea.

thx!
Attached Thumbnails
Click image for larger version

Name:	dressrig.jpg
Views:	1378
Size:	96.6 KB
ID:	44396  
__________________
everything starts and ends in the right place at the right time.

Last edited by Falott; 02-07-2010 at 01:50 PM.
  Reply with quote
02-07-2010, 02:41 PM   #9
Falott
Registered User
 
Falott's Avatar
 
Join Date: Jan 2005
Location: vienna
Posts: 1,095
ok, dont waste your time. I just broke the connection of the ainConstrain in X. still needs a little bit of tweaking but compared to what I hade before it should be a piece of cake.

thx for your helps
__________________
everything starts and ends in the right place at the right time.
  Reply with quote
05-07-2010, 12:25 AM   #10
NextDesign
Technical Director
 
NextDesign's Avatar
 
Join Date: Feb 2004
Posts: 2,988
You can use the xform command.

Select the object/component. Then type "xform -q -ws -t" to get the selected objects/component's worldspace position.
__________________
Imagination is more important than knowledge.
  Reply with quote
Reply

Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
Things In General Verts, Polys PenPixels Maya Basics & Newbie Lounge 1 17-11-2011 05:58 PM
Translate coordinates confusion GarrettVD Maya Basics & Newbie Lounge 1 01-09-2011 06:51 AM
Determining the 3D coordinates on a polygon's surface Moox09 Maya Basics & Newbie Lounge 1 28-05-2009 08:19 AM
Pick up local coordinates barbe_bleue Maya Basics & Newbie Lounge 1 24-07-2008 02:55 AM
Moving verts with "Insert" Tristanartform Maya Basics & Newbie Lounge 2 26-04-2008 12:15 PM