[Bf-committers] Re: listener object

Martin DeMello martindemello at gmail.com
Mon May 9 07:15:11 CEST 2005


I want it for Blender - the main purpose is to allow external programs
to interact with a running Blender session. My problem with letting
anything be handled by a script is that as far as I can tell, scripts
either block the UI or remain inactive when they don't have focus.I
need some way to wake up a script, ideally by triggering when data is
written into a socket.

As an example of what I need this for, we have an "interior
decoration" program that we want to use in parallel with Blender, so
that we can design a house in Blender and then use the other program
to apply colour schemes and wallpapers to the inside. The interior
decoration app has a fairly complex wxPython UI that I don't want to
port over to Blender, and I want to keep both programs open at the
same time without either of them being blocked. I can have a redraw
scriptlink in Blender feeding information to the other app, but
there's no current way to do the reverse. A socket listener with a
scriptlink attached to it would do this nicely (of course, to make it
general we'd need a way to make it an actual Blender object,
instantiable within the UI by typing in a port number and visible when
adding scriptlinks).

martin

On 5/6/05, Ton Roosendaal <ton at blender.org> wrote:
> Hi,
> 
> It's also important to define whether you want it for Blender (i.e. the
> UI) or for running games?
> 
> I don't think an "Always scrptlink" is the way to go... we should keep
> things fully event based in Blender's UI.
> Would it be possible for Python to add callbacks instead? Meaning, it
> assigns to an external program the means to insert events in the main
> queue, which is then being handled by another script. Could also be a
> means to plugin input devices.
> 
> -Ton-
> 
> 
> On 6 May, 2005, at 13:21, Martin DeMello wrote:
> 
> > On 5/6/05, Martin DeMello <martindemello at gmail.com> wrote:
> >> I'd like to add a "listener" object to blender, to allow a script to
> >> be triggered by an external program writing to a socket. (Not
> >> necessarily proposing this be added to blender proper, but it would be
> >> very useful for my own copy.) Is this an intrinsically dangerous idea?
> >> (i.e. could it cause instability or crashes in blender?) If not, how
> >> would I go about doing it? (i.e., where in the code should I be
> >> looking to add something like this?)
> >
> > Also, antont suggested on IRC that an 'always' scriptlink that
> > activated once every timer tick would be another nice way to
> > accomplish this. The triggered python script could then poll the
> > socket.
> >
> > martin
> > _______________________________________________
> > Bf-committers mailing list
> > Bf-committers at projects.blender.org
> > http://projects.blender.org/mailman/listinfo/bf-committers
> >
> >
> ------------------------------------------------------------------------
> --
> Ton Roosendaal  Blender Foundation ton at blender.org
> http://www.blender.org
> 
>


More information about the Bf-committers mailing list