Maya Training

Introduction to Hard Surface Modeling

Maya Training

Interiors and Furniture Vol 1 & 2 - Modeling & Cloth

Maya Training

Shading, Lighting and Rendering the Bedroom in MR

Maya Training

Robot volume one - Modeling with animation in mind

Maya Training

Spach-Alspaugh House the complete courseware

Maya Training

Burt The Cartoon Dinosaur Vol 01 - Modeling

New Maya Training

Robot Volume 02 - Hybrid Rigging
You are here > Home > SimplyMaya Community Forums
Loading

Welcome to Simply Maya

Please Sign in or Sign up for an account

Member Login

Lost your password?

Not a member yet? Sign Up!

Old 25-06-2010, 03: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, 05:06 PM   #2
Jay
Senior Modeler - Framestore
 
Jay's Avatar
 
Join Date: Feb 2003
Location: UK
Posts: 6,234
Thanks: 39
Thanked 425 Times in 381 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, 06: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, 03: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, 09: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, 09: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 09:44 AM.
Falott is offline   Reply With Quote
Old 28-06-2010, 09: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, 02: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
 
__________________
everything starts and ends in the right place at the right time.

Last edited by Falott : 02-07-2010 at 02:50 PM.
Falott is offline   Reply With Quote
Old 02-07-2010, 03: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, 01:25 AM   #10
NextDesign
Technical Director
 
NextDesign's Avatar
 
Join Date: Feb 2004
Posts: 2,982
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

A little bit about who we are
Links you might find useful
Catch up with SimplyMaya
SimplyMaya specialises in Maya tutorials. We offer over 1,000 individual Maya training videos, ranging from basic Maya tutorials through to intermediate Maya tutorials. Our tutorials are created by instructors with industry experience and are designed to get you up and running in Maya quickly without making it seem like hard work.

Copyright © 1999-2015 SimplyMaya - vBulletin® Copyright © 2000-2015, Jelsoft Enterprises Ltd.