maya api closet location equivalent?

Forum for users who have migrated or are migrating to Maya
Post Reply
anhungxadieu
Posts: 157
Joined: 17 Apr 2014, 10:39
Skype: nguyenvuducthuy

maya api closet location equivalent?

Post by anhungxadieu » 09 Sep 2017, 10:35

Hi everyone?
Sorry to asks this? :) but if someone already know maya api, can give me some idea regarding "closet location"?
thanks in advantage!

User avatar
rray
Moderator
Posts: 1388
Joined: 26 Sep 2009, 15:51
Location: Bonn, Germany
Contact:

Re: maya api closet location equivalent?

Post by rray » 10 Sep 2017, 13:26

Maya's closest location function is inside the plugin called "nearestPointOnMesh".
It's one of the plugins that likes to turn itself off quite often and you have to go to your plugin list to enable it.
Also it only works when your scene units is meters...
All that taken care of I think you pass the function (which is also called nearestPointOnMesh same as the plugin I think) a mesh and a 3d position vector, and get back a 3d position back that's on the mesh. It's rather slow btw not being multithreaded like the ICE version.
Softimage Resources section (formerly known as rray.de/xsi) updated Oct 01 2017

anhungxadieu
Posts: 157
Joined: 17 Apr 2014, 10:39
Skype: nguyenvuducthuy

Re: maya api closet location equivalent?

Post by anhungxadieu » 11 Sep 2017, 11:39

Thank for the reply rray,
But i want to get the "location" or another attribute inside the mesh.

User avatar
rray
Moderator
Posts: 1388
Joined: 26 Sep 2009, 15:51
Location: Bonn, Germany
Contact:

Re: maya api closet location equivalent?

Post by rray » 11 Sep 2017, 11:43

I don't think that's possible without custom coding ~o)
Softimage Resources section (formerly known as rray.de/xsi) updated Oct 01 2017

anhungxadieu
Posts: 157
Joined: 17 Apr 2014, 10:39
Skype: nguyenvuducthuy

Re: maya api closet location equivalent?

Post by anhungxadieu » 11 Sep 2017, 12:59

recently, i start to learn c++ maya api. If you already familiar with it, please point me some direction! :-B

User avatar
rray
Moderator
Posts: 1388
Joined: 26 Sep 2009, 15:51
Location: Bonn, Germany
Contact:

Re: maya api closet location equivalent?

Post by rray » 11 Sep 2017, 15:13

I'm not familiar but I'm guessing there's no such concept as locations.

You might have to do actual coordinate comparisons to find the closest triangle to your point, get its 3 points, 3 attributes values from those points, and interpolate these after that, depending on the exact position of your lookup point on the triangle.

If you're not using accelerating data structures you can expect that to be like a 100 times slower than ICE.

If there's something in Maya's API to look up closest UV that would help a lot. Bake your attribute to a texture then and look that up. You could start with looking for that.
Softimage Resources section (formerly known as rray.de/xsi) updated Oct 01 2017

anhungxadieu
Posts: 157
Joined: 17 Apr 2014, 10:39
Skype: nguyenvuducthuy

Re: maya api closet location equivalent?

Post by anhungxadieu » 11 Sep 2017, 18:29

rray wrote:
11 Sep 2017, 15:13
I'm not familiar but I'm guessing there's no such concept as locations.

You might have to do actual coordinate comparisons to find the closest triangle to your point, get its 3 points, 3 attributes values from those points, and interpolate these after that, depending on the exact position of your lookup point on the triangle.

If you're not using accelerating data structures you can expect that to be like a 100 times slower than ICE.

If there's something in Maya's API to look up closest UV that would help a lot. Bake your attribute to a texture then and look that up. You could start with looking for that.
Thanks rray, i will research in that way!

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest