Maniphest T76532

Improve performance of "Smart UV Project"
Closed, ResolvedTO DO

Assigned To
Campbell Barton (campbellbarton)
Authored By
Campbell Barton (campbellbarton)
May 8 2020, 5:20 AM
Tags
  • BF Blender
  • Good First Issue
  • UV Editing
  • Papercut
Subscribers
Andreas Terrius (andreasterrius)
Campbell Barton (campbellbarton)
Chris Kohl (ckohl_art)
Daniel Calderón (xdanic)
Habib Gahbiche (zazizizou)
Kevin Tan (Jmantastic)
Tokens
"Love" token, awarded by ReinhardK.

Description

Currently smart uv projection is written in Python which has poor performance for multi-million polygon meshes (see T76527: Smart UV Project).

Note that a direct port of this to C may still have performance issues, it may be necessary to re-consider the exact method used, however that doesn't have to be part of the initial version.

Event Timeline

Campbell Barton (campbellbarton) changed the task status from Needs Triage to Confirmed.May 8 2020, 5:20 AM
Campbell Barton (campbellbarton) created this task.
Campbell Barton (campbellbarton) mentioned this in T63731: Modeling Module.
Campbell Barton (campbellbarton) renamed this task from Rewrite "Smart UV Project" in C to Improve performance of "Smart UV Project".May 8 2020, 5:23 AM
Campbell Barton (campbellbarton) mentioned this in T76527: Smart UV Project.
Campbell Barton (campbellbarton) added projects: BF Blender, Modeling.May 8 2020, 9:28 AM
Campbell Barton (campbellbarton) changed the subtype of this task from "Report" to "To Do".May 8 2020, 10:04 AM
Kevin Tan (Jmantastic) added a subscriber: Kevin Tan (Jmantastic).May 8 2020, 7:23 PM

Do you recommend other ways to handle large uv mapping tasks with little manual work? In cases like lidar scans I definitely wouldn't be going for best quality, but just something to get the task done in a decent amount of time.

Chris Kohl (ckohl_art) added a subscriber: Chris Kohl (ckohl_art).May 9 2020, 9:53 AM
Habib Gahbiche (zazizizou) added a subscriber: Habib Gahbiche (zazizizou).May 9 2020, 11:50 AM
Campbell Barton (campbellbarton) moved this task from Backlog to Medium Term on the Modeling board.Jun 17 2020, 4:40 AM
Campbell Barton (campbellbarton) added a project: Good First Issue.Jun 17 2020, 4:43 AM
Campbell Barton (campbellbarton) moved this task from Medium Term to Todo (Transform) on the Modeling board.Jun 17 2020, 11:28 AM
Campbell Barton (campbellbarton) edited projects, added UV Editing; removed Modeling.Jun 17 2020, 1:58 PM
Campbell Barton (campbellbarton) moved this task from Backlog to Papercuts on the UV Editing board.Jun 17 2020, 2:00 PM
Campbell Barton (campbellbarton) added a project: Papercut.
Andreas Terrius (andreasterrius) added a subscriber: Andreas Terrius (andreasterrius).Jul 5 2020, 3:54 PM

I will try doing this as my first issue, seems like a good way to familiarize myself with blender's C codebase. My plan is to port it straight to C and use the appropriate data structure to try and speed the process up.

I'll give an update in a couple of days on the progress.

Andreas Terrius (andreasterrius) added a comment.EditedJul 7 2020, 1:58 PM

Do we have any example of using 2d dynamic arrays using blender's BLI data structure libraries ?

I need it in order to port getUvIslands and packIslands

Daniel Calderón (xdanic) added a subscriber: Daniel Calderón (xdanic).Jul 10 2020, 6:27 PM

Meshroom uses different algorithms for UVing and it's open source. Maybe we could port those methods.

Andreas Terrius (andreasterrius) added a comment.EditedJul 13 2020, 2:56 PM

I think I managed to port most of the existing python algorithm to C. Just need to find a way to use existing functions to pack the UV islands and try out some edge cases.

I'll open up a diff once it's done

Reinhard Kepplinger (ReinhardK) awarded a token.Jul 14 2020, 5:30 PM
Andreas Terrius (andreasterrius) added a comment.EditedJul 16 2020, 3:27 PM

Here is the diff,
https://developer.blender.org/D8311

I'm still retaining the old operator in case someone wants to do an arc patch and compare. If you find any bugs or edge cases feel free to notify me

Campbell Barton (campbellbarton) closed this task as Resolved.Jul 26 2020, 1:41 PM
Campbell Barton (campbellbarton) claimed this task.