SimplyMaya Forums

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

Home / forum / Lounges / Maya Basics & Newbie Lounge / getting a verts worldSpace coordinates
Register FAQ Members List Calendar Mark Forums Read

New Thread
 
Thread Tools
Old 25-06-2010, 02:46 PM   #1
Falott
Registered User
 
Falott's Avatar
 
Join Date: Jan 2005
Location: vienna
Posts: 1,095
Thanks: 3
Thanked 20 Times in 18 Posts
Default 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.
Falott is offline   Reply With Quote
Old 25-06-2010, 04:06 PM   #2
Jay
Lead Modeler - Framestore
 
Jay's Avatar
 
Join Date: Feb 2003
Location: UK
Posts: 6,276
Thanks: 41
Thanked 428 Times in 384 Posts
Default

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
Jay is offline   Reply With Quote
Old 25-06-2010, 05:31 PM   #3
Falott
Registered User
 
Falott's Avatar
 
Join Date: Jan 2005
Location: vienna
Posts: 1,095
Thanks: 3
Thanked 20 Times in 18 Posts
Default

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.
Falott is offline   Reply With Quote
Old 26-06-2010, 02:38 AM   #4
bullet1968
Lifetime Member
 
bullet1968's Avatar
 
Join Date: Feb 2010
Location: Australia
Posts: 4,255
Thanks: 158
Thanked 651 Times in 621 Posts
Default

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
bullet1968 is offline   Reply With Quote
Old 28-06-2010, 08:06 AM   #5
Falott
Registered User
 
Falott's Avatar
 
Join Date: Jan 2005
Location: vienna
Posts: 1,095
Thanks: 3
Thanked 20 Times in 18 Posts
Default

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.
Falott is offline   Reply With Quote
Old 28-06-2010, 08:19 AM   #6
Falott
Registered User
 
Falott's Avatar
 
Join Date: Jan 2005
Location: vienna
Posts: 1,095
Thanks: 3
Thanked 20 Times in 18 Posts
Default

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.
Falott is offline   Reply With Quote
Old 28-06-2010, 08:54 AM   #7
Falott
Registered User
 
Falott's Avatar
 
Join Date: Jan 2005
Location: vienna
Posts: 1,095
Thanks: 3
Thanked 20 Times in 18 Posts
Default

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.
Falott is offline   Reply With Quote
Old 02-07-2010, 01:48 PM   #8
Falott
Registered User
 
Falott's Avatar
 
Join Date: Jan 2005
Location: vienna
Posts: 1,095
Thanks: 3
Thanked 20 Times in 18 Posts
Default

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:	1369
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.
Falott is offline   Reply With Quote
Old 02-07-2010, 02:41 PM   #9
Falott
Registered User
 
Falott's Avatar
 
Join Date: Jan 2005
Location: vienna
Posts: 1,095
Thanks: 3
Thanked 20 Times in 18 Posts
Default

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.
Falott is offline   Reply With Quote
Old 05-07-2010, 12:25 AM   #10
NextDesign
Technical Director
 
NextDesign's Avatar
 
Join Date: Feb 2004
Posts: 2,988
Thanks: 33
Thanked 532 Times in 471 Posts
Default

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.
NextDesign is offline   Reply With Quote
New Thread

« Previous Thread | Next Thread »

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off

1 Month

$34

Month-to-month billing
$34/month
Unlimited access to all videos
Project files to download
Easy to cancel at anytime
 
 

3 months

$87

Billing every 3 months
$29/month
Unlimited access to all videos
Project files to download
Easy to cancel at anytime
Save $5 per month or $15 in total compared to monthly billing with this package.

12 months

$288

Billing every 12 months
$24/month
Unlimited access to all videos
Project files to download
Easy to cancel at anytime
Save $10 per month or $120 in total compared to monthly billing with this package.

Your plan will automatically renew. You can cancel at any time via your PayPal account to avoid being charged again.

You can view the FAQ on our video plans here. You can contact us directly here. By clicking one of the buttons above, you agree to our Terms and Privacy Policy.