[Soc-2010-dev] Status Report (fancy input devices)

Mike Erwin significant.bit at gmail.com
Sat May 29 03:49:14 CEST 2010


This week was mostly spent digging through the code, with a few very
minor fixes. Some not-so-minor fixes and improvements are in the
works! Before hacking into my branch, I'm going to re-sync with the
trunk and commit that, so that my actual changes come out clean.

First I investigated how input events are routed through the system.
>From the low level, I traced tablet events from the OS into ghost's
handling and queueing. Wrote some tests with CGEvent and NSEvent
regarding tablets, to see if there's anything "extra" that blender
isn't using. There's not much, as tilt is recorded and available for
tools, but largely (completely?) unused by them.

>From the high level, I learned how operators register for event
notifcation, using the grease pencil as a reference. I'll be working
with this tool quite a bit, as it's simple and needs some polish.

I examined grease pencil in depth: how strokes are built from input
events, how they're processed, stored, drawn on screen, and erased. I
wrote a simplified version of its input event filter, ready to
integrate.

Toggled event coalescing on Macintosh, and boy what a difference it
makes! Lots of data points, very smooth strokes. This was tested
outside of blender. Handling of tablet/mouse events will need to be
streamlined, so I'm keeping an eye on that.

Got sidetracked looking through tuple/vector/point code in MoTo. Noted
several minor improvements, but this doesn't exactly fall within my
project. Fix anyway, or revisit after summer?


Next week:

Use what I've learned so far to fix erasure for gpencil. Someone else
left a note for this in the code, so I'll find a nice way to determine
draw vs erase that works with either pen or mouse.

Improve and accelerate stroke smoothing. Two approaches were obvious
on first reading, and more may come to me while coding.

Rework either stroke painting code (OpenGL, pixels on the screen) or
stroke erasing code (altering, splitting, deleting stroke data). The
erase functions beg for help, and I have a good idea how to start.

Learn more about NDOF events, and how existing SpaceNav plugins pass
these in to blender.

Study event routing "middle" section: how events make it from the
queue to interested tools.


Problems so far:

I don't know how to not coalesce events on Windows or X11. Found a
Win32 call that says *whether* events are coalesced, but nothing more.
Plan on applying this later in the summer, but first need to know if
it can be done on all platforms.

FFMPEG from MacPorts would not install on my machine (PowerBook G4
running Leopard). So I set WITH_BF_FFMPEG = False in user-config.py.
Blender builds and runs fine, and my project doesn't deal with AV
stuff, so it's no big deal. Just puzzling.


Ok, that's it for now! The first week was more reading than writing,
as this is my first dive into the blender code base. Overall, I think
I'm on track and making good progress.

Mike Erwin
musician, naturalist, pixel pusher, hacker extraordinaire


More information about the Soc-2010-dev mailing list