McManning / McManning/Coherence

Add smarter change detection for bpy.type.Image syncing

Open
#22 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Blender Plugin enhancement
Dominant language
Python
Stars
30
Forks
0
PR merge metrics
No merged PRs in 30d

Description

Enhancement to #6 - right now syncing a bpy.type.Image to Unity happens under the following conditions:

  1. Whenever a SpaceImageEditor redraws (via draw_handler_add) and the draw tool is active
  2. Whenever the SpaceView3D redraws and the PAINT_TEXTURE tool is active

Unfortunately, 2 happens way too often - space is setup to redraw at 30-60 FPS to keep up with Unity viewport renders, the frequency for updating the texture has its own throttle but it's constantly running (thus doing a bunch of memcpys) and isn't running reactive to changes at all - unlike the SpaceImageEditor.

It's fine for smaller textures (1024x1024) but once you scale up you start to feel it chug.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the bpy.type.Image synchronization paths described for SpaceImageEditor and SpaceView3D, including the draw_handler_add and PAINT_TEXTURE redraw conditions. Compare their update triggers and verify that image changes update Unity without continual per-frame memcpys; the issue provides no file or test names.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, unity
Domain
computer-graphics, game-dev, performance
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.