question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

how to make vertex ids the same over multiple meshes

See original GitHub issue

Hi,

is there a way to make sure that the vertex ids of multiple meshes are the same. I use trimesh to load multiple person into a tool, e.g. Screenshot 2020-07-09 at 13 13 58

After having marked every mesh with a new point (the black dot) I try to brute force find the closest point given the set of meshes and vertices.

So far I am trying following:

        joints = np.concatenate(scenes['joints'])
        search_candidate = True
        i = 3
        while search_candidate:
            vert_ids = []
            for mesh in scenes['meshes']:
                distances, ids = mesh.kdtree.query(joints, i)
                vert_ids.append(ids)

            vert_ids = np.concatenate(vert_ids)
            vert_id = self.search_common_vertex_id(vert_ids)
            if vert_id is not None:
                search_candidate = False

            i += 1

        for scene in self.scene_chache.values():
            mesh = scene.geometry['geometry_0']
            mesh.visual.vertex_colors[vert_id] = [0, 255, 255, 255]

But the resulting vertex id at the end sometimes marks the ear or the other knee. Is there a way to come around this?

Edit: Currently I’m storing multiple scenes per mesh and point in a dictionary. So I think the more precise question would be how can I make sure the different scene objects are in the same coordinate system?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
mikedhcommented, Jul 12, 2020

Oh you may just need to disable vertex merging with process=False passed to either the loader or constructor: trimesh.Trimesh(**kwargs, process=False)

0reactions
russoalecommented, Jul 13, 2020

Awesome, that did the fix! Thank you @mikedh

Read more comments on GitHub >

github_iconTop Results From Across the Web

Can vertex indices be transferred between identical meshes?
1 Answer 1 · In Object mode first select Red object then select the Green one. Object menu > Make Links > Object...
Read more >
Solved: Transfer vertex order between combined objects - Maya
Solved: I'm working on a blendshape script, and for it to work, I need the two objects to have exactly the same vertex...
Read more >
polygon vertex ID with same topology issue - CGTalk
The other option if the two meshes are identical is to use Modify > Snap Align Objects > 3 Points to 3 Points....
Read more >
3DQuickTips 017 - Maya - Get Your Vertices In Order - YouTube
What if your vertex number have changed? ... In this video I'll show you how to fix a vertex order on meshes with...
Read more >
Reordering vertex ids - Maya - Tech-Artists.Org
The only thing different is the vertex ids which I have displayed. The two meshes are placed side by side. In my transfer...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found