Introduction to Maya - Modeling Fundamentals Vol 1
This course will look at the fundamentals of modeling in Maya with an emphasis on creating good topology. We'll look at what makes a good model in Maya and why objects are modeled in the way they are.
# 1 25-06-2010 , 02:46 PM
Falott's Avatar
Registered User
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.
# 2 25-06-2010 , 04:06 PM
Jay's Avatar
Lead Modeler - Framestore
Join Date: Feb 2003
Location: UK
Posts: 6,287
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

# 3 25-06-2010 , 05:31 PM
Falott's Avatar
Registered User
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.
# 4 26-06-2010 , 02:38 AM
bullet1968's Avatar
Lifetime Member
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.


https://www.3dbuzz.com/vbforum/showth...coordinates...


bullet1968

"A Darkness at Sethanon", a book I aspire to model some of the charcters and scenes
# 5 28-06-2010 , 08:06 AM
Falott's Avatar
Registered User
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.
# 6 28-06-2010 , 08:19 AM
Falott's Avatar
Registered User
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. user added image


everything starts and ends in the right place at the right time.

Last edited by Falott; 28-06-2010 at 08:44 AM.
# 7 28-06-2010 , 08:54 AM
Falott's Avatar
Registered User
Join Date: Jan 2005
Location: vienna
Posts: 1,095


everything starts and ends in the right place at the right time.
# 8 02-07-2010 , 01:48 PM
Falott's Avatar
Registered User
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

everything starts and ends in the right place at the right time.

Last edited by Falott; 02-07-2010 at 01:50 PM.
# 9 02-07-2010 , 02:41 PM
Falott's Avatar
Registered User
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.
# 10 05-07-2010 , 12:25 AM
NextDesign's Avatar
Technical Director
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.
Posting Rules Forum Rules
You may not post new threads | You may not post replies | You may not post attachments | You may not edit your posts | BB code is On | Smilies are On | [IMG] code is On | HTML code is Off

Similar Threads