[Bf-python] Z selection buffer access ?

Gert De Roost paleajed at yahoo.com
Sun Mar 6 21:30:03 CET 2005


--- joeedh <joeeagar at prodigy.net> wrote:

> Gert De Roost wrote:
> 
> >Is anyone thinking along the lines of supporting
> the Z
> >selection buffer through BPython ?
> >
> >I bumped into this a few times now and don't have
> the
> >C skills (yet) to implement this myself.
> >  
> >
> Could you please elaborate?


No, I do not need to get the vertice/edge closest to
the mouse cursor or anything like that.  My KnifePro
script is perfectly able of doing this already.
What I would like to do is, WHEN I know which edge is
clicked by the user, if it is obscured by any geometry
in front of it in the 3D view.  If I am not mistaken,
I should be able to do this by reading a backbuffer
(this doesn't have to be a friendly implementation, a
raw buffer will do nicely, since my scripts will
already know the location of the edge to be checked,
so I will just check the pixels to see if it is
obscured or not.)


Where will it be used for ?  My current EdgeTune
script (http://users.telenet.be/edgeslide.html) would
welcome this very much.  It enables you to draw (well,
in fact, slide) freehand edges on your geometry.  Of
course the algorithm should only draw on the front of
geometry (not changing geometry that happens to be on
the back inside the drawn-on area).  At the moment it
discriminates through checking vertice normals
(pointing towards/ away from viewpoint).  This works
poorly.  For example you cannot use it on open meshes
when you are looking at them from the back.  Also,
often vertices on closed meshes point inwards instead
of outwards, and are mistakenly not changed by the
script. (Rcalculate normals doesn't seem to always fix
this problem, and it shouldn't be necessary to do
this).
I have also seen a script on zoo-logique doing
displacement interactively that needed this also.  The
writer of the script also uses the normal method and I
understand from his code comments he'd like to find a
proper way of checking front/back.

Still, the real reason (EdgeTune is pretty usable as
is) for my question is that I am planning of writing a
script implementing a sophisticated method of
soft-selection (proportional editing) by enclosing
vertices in gradient-filled closed curves.  It is
necessary that only vertices inside the curveshape and
on the FRONT of the mesh are selected by this.  Thus,
my asking for a backbuffer implementation.  Doing this
with the normal method is impossible, since one or two
vertices wrongly selected and the script will fail to
do what it sets out to do.

Most of my scripts are aimed at modelling directly on
the mesh, many of which should only work on the front
face of the mesh; I am sure this backbuffer would
enable me to do things previously impossible...


.gert.


	
		
__________________________________ 
Celebrate Yahoo!'s 10th Birthday! 
Yahoo! Netrospective: 100 Moments of the Web 
http://birthday.yahoo.com/netrospective/



More information about the Bf-python mailing list