[Bf-python] Re: on event: Selected object change

Germán Alonso german at sistrans.com
Wed Dec 6 01:40:11 CET 2006


Hi, i've been dealing with that problem some time ago, to show different
GUI if an object is active or is other different.

My solution is:
* Spacehandler to control the events at the 3Dwindow With a
Window.RedrawAll() for the events that change the selection
        if Blender.event ==Blender.Draw.RIGHTMOUSE:
           Blender.Window.RedrawAll()

* A GUI script running that analyzes the active object of the scene each
time the GUI is drawn and shows certain parts if some conditions are true.
        draw():
           active = Blender.Scene.GetCurrent().getActiveObject()
           if active.type() == MESH: MyMeshGUIButtons()
           else: MyAlternativeGUI()


I hope it to be useful, if any doubt just ask me :)


Germán



Joel Leineweber escribió:
>
> Asunto:
> [Bf-python] on event: Selected object change
> De:
> "Joel Leineweber" <jleineweber at gmail.com>
> Fecha:
> Sun, 3 Dec 2006 14:16:03 -0500
> Para:
> bf-python at projects.blender.org
>
> Para:
> bf-python at projects.blender.org
>
> Precedence:
> list
> MIME-Version:
> 1.0
> Referencias:
> <9b0048750612031059ke1cb83bq9500d7f772669ab0 at mail.gmail.com>
> In-Reply-To:
> <9b0048750612031059ke1cb83bq9500d7f772669ab0 at mail.gmail.com>
> Responder a:
> Blender Foundation Python list <bf-python at projects.blender.org>
> Message-ID:
> <9b0048750612031116o7e325f62w815c5dc521c1cab0 at mail.gmail.com>
> Content-Type:
> multipart/alternative; boundary="----=_Part_22464_1165676.1165173363215"
> Message:
> 1
>
>
> I recently brought this up here on blenderartists
> <http://blenderartists.org/forum/showthread.php?t=83542> , and
> ideasman42 <http://blenderartists.org/forum/member.php?u=6112>
> suggested I email this list for a request.
>
> I basically want a way to redraw my script gui every time the user
> changes the selected object. Even if scriptlinks had this event, they
> don't allow Draw.Register and neither do the (very cool btw)
> spacehandler scripts. Instead it would be useful to have an event
> handler for object selection change (or even other things such as
> enter/exit editmode, etc.) This will allow gui's to become much more
> responsive to the user and thereby much more user-friendly.
>
> thanks for your help & suggestions,
> bydesign




More information about the Bf-python mailing list