I asked this question about a year ago - and the answer then
was "Not Yet"...so I'm back again!

  I'm working with the PrettyPoly team on building a GPL'ed
3D modeller for Linux (and others OS's) - and one thing we
are frequently asked is to implement a facility to paint
onto texture maps as they are applied to a 3D model.

  Since we are basically lazy people and *know* how much work
it is to write a halfway decent paint program, we'd like to
avoid that and build a 'bridge' between GIMP and PrettyPoly
so GIMP gets to do all the hard work.

  I use GIMP a lot bit I have very little knowledge of it's
internals - and I've never even written a plugin - so please
forgive my ignorance.

  What I want to do is to write some kind of a plugin for GIMP
that interfaces to a PrettyPoly plugin via a shared memory buffer.
The idea would be to have the GIMP plugin write the current image
into a shared memory area that PrettyPoly reads and downloads
into the texture memory of our 3D graphics card...then as the
mouse is moved around the 3D image in PrettyPoly, to convert
that 3D position into a coordinate relative to the texture
map and send that back to the GIMP plugin (also via shared
memory).  The plugin would then either apply paint at that
location - or (preferably) simply convey the image coordinate
to GIMP and let it do the painting using whatever tool is
currently selected.

  Hence, as you drag the mouse over the 3D model, you'd
cause GIMP to apply paint at the appropriate location in
the 2D image - which would then appear a little later on
the 3D viewer.  You'd also be able to do the simpler thing
of painting conventionally onto the GIMP image window and
seeing the 3D effect immediately in the PrettyPoly window.

  Better still would be if ALL mouse input from the 3D tool
were to appear to GIMP as non-GUI-directed mouse input - so
we could even rubberband selection areas and such in 3D.

  The latency through that process is of course a concern - but
the benefits of 3D painting to our users is large and we can
perhaps work to at least minimise the delay.  I know GIMP uses
small image 'tiles' - so probably only the changed tiles need
to be passed from GIMP to PrettyPoly.

  It seems to me that *if* this is possible, it shouldn't actually
be too hard to implement.  What I don't know is:

  * In what form can a plugin access the GIMP image? (eg Are
    layers pre-composited?)
  * Can we really drive the mouse coordinate within the
    GIMP core from inside a plugin?
  * If not, how hard would it be to make a plugin do basic
    airbrush/clone/pencil/brush functionality from coordinates
    stored in shared memory?

  What is your expert take on this?   Is it possible?

Steve Baker                      (817)619-2657 (Vox/Vox-Mail)
L3Com/Link Simulation & Training (817)619-2466 (Fax)
Work: [EMAIL PROTECTED]           http://www.link.com
Home: [EMAIL PROTECTED]       http://web2.airmail.net/sjbaker1

Gimp-developer mailing list

Reply via email to