GSoC 2021 : UV Editor Improvements - Weekly Reports

Weekly reports on the UV Editor improvements project will be shared on this post.
Here’s a link to my proposal : https://wiki.blender.org/wiki/User:Sidd017/Proposal

Design task for the project can be found here : https://developer.blender.org/T88990

Community Bonding period (17 May - 7th June)

Progress so far (17th June - 31st May) :

  • Very little activity till 25th May due to college exams
  • Contacted my mentor (Campbell Barton) on blender.chat
  • Studied the code related to the pack islands operator. Specific focus on box packing - code in boxpack_2d.c and uvedit_islands.c
  • Experimenting with the pack islands operator code to understand how it works

Final week

Until 7th June I plan to :

  • Continue studying the code related to the UV editor. More focused on :
    1. Operators in uvedit_unwrap_ops.c
    2. uvedit_islands.c
    3. bmesh_query_uv.c
    4. ED_uvedit.h
    5. Boxpack_2d.c
  • Review the ideas in my proposal and update them
  • Plan a meeting with Daniel Bystedt to discuss ideas and finalize implementation details
11 Likes

Community Bonding period - Final week (31 May to 6 June)

  • Meeting with Daniel Bystedt to discuss and finalize implementation details for ideas in the proposal. Main points of discussion :
    • The original idea of packing UVs to correct/desired UDIM was limited to only work when the user had a UDIM texture present in the UV editor. It was agreed that the user should never need a UDIM sequence to dictate how the UV will pack or unwrap. Task description/design was updated accordingly.
    • It was agreed that making the increment snapping value (default : 0.0625 units) user-editable in the UV editor didn’t have many practical benefits. Use cases for this are limited and would create problems in UV workflows. Further discussion with mentor is required for this.
    • Adding an option to the new pack islands to area operator, where the user can decide if they want islands to be scaled when packing UVs.
  • Revised working order for GSoC tasks is listed below :
    • Pack UV islands to correct/specified UDIM (T78397) :
    • Pack UV islands to box area (T78398)
    • Dynamic Grid (T78389)
    • Grid snapping in the UV editor (T78391)
    • Make increment snapping value user-editable in the UV editor (No task created on d.b.o. Original idea can be found in proposal)
  • Started and completed a rough implementation for the first task - pack islands to correct/specified UDIM.
  • Experimented with the code in overlay_grid.c, mostly changing the UDIM grid density.
  • Figured out how to toggle/hide operator properties in the UI
  • Continued study of the box packing algorithm used in Boxpack_2d.c

Plans for next week - 7 June to 13 June

Official coding period for GSoC starts this week

  • Complete implementation of task - Pack islands to correct/desired UDIM
  • Start working on the implementation for next task - Pack islands to box area. Look for a new box packing algorithm that can work with different areas, similar to BLI_box_pack_2d_fixedarea() .
  • Create a new design task on phabricator for GSoC related tasks. Similar to - (T77408)
  • Discuss with mentor about the usability of idea - Make increment snapping value user-editable in the UV editor
6 Likes

Week 1 : 7 June to 13 June

  • Created a new branch - soc-2021-uv-editor-improvements
  • Created a new design task - (T88990)
  • Completed implementation of first task (Pack islands to correct/specified UDIM) - commit link (pending review)
    • 2 new options added to the pack islands operator
      Screenshot (237)
    • Closest UDIM will pack the selected islands to the UDIM they were originally placed on. If the selected islands were not placed on any UDIM tile they will be packed to the nearest UDIM tile
    • Specified UDIM will let the user define the UDIM they want to pack the selected islands to
      Screenshot (238)
    • Implementation works with UDIM grid and UDIM textures
  • Submitted a patch for a minor fix (D11582). This is implemented in the soc-2021-uv-editor-improvements branch
  • Started working on the second task - Pack islands to box area

I couldn’t work this weekend since I got vaccinated on Saturday (12 June) and was down with fever.

Plans for next week - 14 June to 20 June

  • Continue working on the second task - pack islands to box area
  • Test the implementation for the first task
    • Refactor the code and cleanup - create smaller functions to simplify logic
    • Investigate bugs or deviations from intended behavior
8 Likes

Thanks for your contribution!
I personally have several proposals:

  1. Alignment tools: can be used to manually align and arrange uv islands, works just like 2D graphic softwares adobe illustrator or inkscape etc.
  2. Average islands scale according to the active island: the way Average islands scale command currently works is to scale every selected island to match a ratio. By adding a option, to make it possible to set the active island to be the base or reference, keeping it untouched and scale others.
  3. Export UV Layout with real world units: by now, blender can exports vector file formats as SVG and EPS, consider supporting pdf format and keep it’s size and unit the same as the meshs’ size and unit. A very good reference implent is a addon comes with blender called “Export Paper Model”.

Finally, wish your project in smooth progress!

Thanks @baoyu !

Regarding your proposals

  1. For alignment tools, there’s a similar task created here : ⚓ T78408 Arrange and align selected uv islands .
  2. Average islands scale according to the active island : The idea does seem like a nice addition to the existing average islands scale operator. I’ve added it to a separate list of secondary tasks and will look into it once I’ve completed my primary deliverables.
  3. Export UV Layout with real world units : This actually falls out of scope for the summer of code project, since I’m primarily working with the UV editor.
1 Like

Indeed, your thoughts make sense. Appreciate! :grin: