Page 1 of 1

How can I *programatically * find the tip of the nose ?

PostPosted: Thu Jun 29, 2017 9:16 am
by dma2017
Hi All,
I am trying to automate a few things to help create characters (as a hobby project), but to go further, I would have to programatically find the coordinates of a few features on the model beeing edited, such as the tip of the nose, the corner of the mouth etc...
Any hints on how I could do that ?
Thanks

-David

Re: How can I *programatically * find the tip of the nose ?

PostPosted: Thu Jun 29, 2017 12:28 pm
by joepal
Vertices are always in the same order. So if you figure out the vertex number for the points in question, you can simply read their coordinates.

In blender we can see that an unmodified base mesh (loaded from MakeTarget) has the nose tip at 0, 6.9385, 1.6798

vertex1.png


Grepping for that in makehuman/data/3dobjs/base.obj we find:

Code: Select all
...
v -0.0334 6.9424 1.6716
v -0.0648 6.9440 1.6586
v 0.0000 6.9385 1.6798  <--- This line seems to match
...


... ie, those coordinates are on line 5083. However, the first 29 lines of text in the files are comments, so the actual vertex number is 5054.

In MHAPI (see https://github.com/makehumancommunity/c ... cs/mesh.md) you can find a call getVertexCoordinates(), which returns an array with the coordinates of all vertices. Unless my logic is wrong here somwehere, the nose tip is at position 5054 in that array.

Re: How can I *programatically * find the tip of the nose ?

PostPosted: Thu Jun 29, 2017 2:51 pm
by blindsaypatten
dma2017 wrote:Hi All,
I am trying to automate a few things to help create characters (as a hobby project), but to go further, I would have to programatically find the coordinates of a few features on the model beeing edited, such as the tip of the nose, the corner of the mouth etc...
Any hints on how I could do that ?
Thanks

-David

You don't specify whether your code will be running in Blender, in MH, or in a separate program.

Re: How can I *programatically * find the tip of the nose ?

PostPosted: Tue Jul 04, 2017 5:57 am
by dma2017
@joepal Thanks very much for taking the time to make such a detailed answer. Exactly what I needed.
-David