2003-05-08 03:06:46 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								/* 
  
						 
					
						
							
								
									
										
										
										
											2008-02-15 16:08:41 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								 *  $ Id $ 
							 
						 
					
						
							
								
									
										
										
										
											2003-05-08 03:06:46 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								 * 
							 
						 
					
						
							
								
									
										
										
										
											2008-04-16 22:40:48 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								 *  * * * * *  BEGIN  GPL  LICENSE  BLOCK  * * * * * 
							 
						 
					
						
							
								
									
										
										
										
											2003-05-08 03:06:46 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								 * 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								 *  This  program  is  free  software ;  you  can  redistribute  it  and / or 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								 *  modify  it  under  the  terms  of  the  GNU  General  Public  License 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								 *  as  published  by  the  Free  Software  Foundation ;  either  version  2 
							 
						 
					
						
							
								
									
										
										
										
											2008-04-16 22:40:48 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								 *  of  the  License ,  or  ( at  your  option )  any  later  version . 
							 
						 
					
						
							
								
									
										
										
										
											2003-05-08 03:06:46 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								 * 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								 *  This  program  is  distributed  in  the  hope  that  it  will  be  useful , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								 *  but  WITHOUT  ANY  WARRANTY ;  without  even  the  implied  warranty  of 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								 *  MERCHANTABILITY  or  FITNESS  FOR  A  PARTICULAR  PURPOSE .   See  the 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								 *  GNU  General  Public  License  for  more  details . 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								 * 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								 *  You  should  have  received  a  copy  of  the  GNU  General  Public  License 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								 *  along  with  this  program ;  if  not ,  write  to  the  Free  Software  Foundation , 
							 
						 
					
						
							
								
									
										
										
										
											2003-12-14 01:18:09 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								 *  Inc . ,  59  Temple  Place  -  Suite  330 ,  Boston ,  MA 	02111 - 1307 ,  USA . 
							 
						 
					
						
							
								
									
										
										
										
											2003-05-08 03:06:46 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								 * 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								 *  The  Original  Code  is  Copyright  ( C )  2001 - 2002  by  NaN  Holding  BV . 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								 *  All  rights  reserved . 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								 * 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								 *  This  is  a  new  part  of  Blender . 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								 * 
							 
						 
					
						
							
								
									
										
										
										
											2005-05-20 05:14:03 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								 *  Contributor ( s ) :  Willian  P .  Germano ,  Campbell  Barton ,  Ken  Hughes 
							 
						 
					
						
							
								
									
										
										
										
											2003-05-08 03:06:46 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								 * 
							 
						 
					
						
							
								
									
										
										
										
											2008-04-16 22:40:48 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								 *  * * * * *  END  GPL  LICENSE  BLOCK  * * * * * 
							 
						 
					
						
							
								
									
										
										
										
											2003-05-08 03:06:46 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								*/  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								/* This file is the Blender.Draw part of opy_draw.c, from the old
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								 *  bpython / intern  dir ,  with  minor  changes  to  adapt  it  to  the  new  Python 
							 
						 
					
						
							
								
									
										
										
										
											2003-12-14 01:18:09 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								 *  implementation . 	Non - trivial  original  comments  are  marked  with  an 
							 
						 
					
						
							
								
									
										
										
										
											2003-05-08 03:06:46 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								 *  @  symbol  at  their  beginning .  */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2005-07-18 03:50:37 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								# include  "Draw.h" /*This must come first*/ 
  
						 
					
						
							
								
									
										
										
										
											2004-03-29 08:16:18 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-06-16 01:18:57 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								# include  "BLI_blenlib.h" 
  
						 
					
						
							
								
									
										
										
										
											2004-03-29 08:16:18 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								# include  "MEM_guardedalloc.h" 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								# include  "BMF_Api.h" 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								# include  "DNA_screen_types.h" 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								# include  "BKE_global.h" 
  
						 
					
						
							
								
									
										
										
										
											2005-01-13 03:04:12 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								# include  "BKE_image.h" 
  
						 
					
						
							
								
									
										
										
										
											2004-03-29 08:16:18 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								# include  "BKE_object.h" 
  
						 
					
						
							
								
									
										
										
										
											2005-07-18 03:50:37 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								# include  "BKE_main.h" 
  
						 
					
						
							
								
									
										
										
										
											2007-04-24 17:28:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								# include  "BKE_utildefines.h" 
  
						 
					
						
							
								
									
										
										
										
											2004-03-29 08:16:18 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								# include  "BIF_gl.h" 
  
						 
					
						
							
								
									
										
										
										
											2007-04-24 17:28:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								# include  "BIF_mywindow.h" 
  
						 
					
						
							
								
									
										
										
										
											2004-03-29 08:16:18 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								# include  "BIF_screen.h" 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								# include  "BIF_space.h" 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								# include  "BIF_interface.h" 
  
						 
					
						
							
								
									
										
										
										
											2004-01-15 03:46:47 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								# include  "BIF_toolbox.h" 
  
						 
					
						
							
								
									
										
										
										
											2008-03-06 21:25:15 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								# include  "DNA_space_types.h"		/* script struct */ 
  
						 
					
						
							
								
									
										
										
										
											2005-01-13 03:04:12 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								# include  "Image.h"              /* for accessing Blender.Image objects */ 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								# include  "IMB_imbuf_types.h"    /* for the IB_rect define */ 
  
						 
					
						
							
								
									
										
										
										
											2004-03-29 08:16:18 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								# include  "interface.h" 
  
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								# include  "mydevice.h"		/*@ for all the event constants */ 
  
						 
					
						
							
								
									
										
										
										
											2005-07-18 03:50:37 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								# include  "gen_utils.h" 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								# include  "Window.h" 
  
						 
					
						
							
								
									
										
										
										
											2006-04-16 15:28:50 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								# include  "../BPY_extern.h" 
  
						 
					
						
							
								
									
										
										
										
											2004-03-29 08:16:18 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2006-05-19 15:33:23 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								/* used so we can get G.scene->r.cfra for getting the
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								current  image  frame ,  some  images  change  frame  if  they  are  a  sequence  */  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								# include  "DNA_scene_types.h" 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
											 
										
											
												BPython bug fixes:
- #2646 reported by Campbell: Python/Fileselector (moving from fileselector called by script to another space caused script to hang around open but not accessible)
http://projects.blender.org/tracker/?func=detail&atid=125&aid=2646&group_id=9
- #2676 reported by Wim Van Hoydonck: 2.37 python scripts gui: event 8 ignored (thanks Ton for discussing / pointing what to do, Ken Hughes for also working on a fix)
http://projects.blender.org/tracker/?func=detail&atid=125&aid=2676&group_id=9
- gui-less scripts with calls to progress bar inside fileselector callbacks didn't return to the previous space on exit (staying on Scripts win), requiring an event to do so (mouse movement, for example).  Quick fix for now, will rework a little after 2.37a for a better alternative, not needing to move to the Scripts win at all.
- added syntax colors access to Window.Theme module.
Scripts:
- updates by Jean-Michel Soler: svg2obj (svg paths import), tex2uvbaker, fixfromarmature;
- updates by Campbell Barton: obj import / export, console;
- tiny: converted vrml97 export to unix line endings;
- updates in ac3d exporter, help browser, save theme.
Thanks all mentioned above.
											 
										 
										
											2005-06-11 05:30:14 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								/* these delimit the free range for button events */  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								# define EXPP_BUTTON_EVENTS_OFFSET 1001 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								# define EXPP_BUTTON_EVENTS_MIN 0 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								# define EXPP_BUTTON_EVENTS_MAX 15382  /* 16384 - 1 - OFFSET */ 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2007-01-06 04:10:51 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								# define ButtonObject_Check(v) ((v)->ob_type == &Button_Type) 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2007-04-22 13:48:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								# define UI_METHOD_ERRORCHECK \ 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if  ( check_button_event ( & event )  = =  - 1 ) \
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  EXPP_ReturnPyObjError (  PyExc_AttributeError , \
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											" button event argument must be in the range [0, 16382] " ) ; \
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if  ( callback  & &  ! PyCallable_Check ( callback ) ) \
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  EXPP_ReturnPyObjError (  PyExc_ValueError , \
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											" callback is not a python function " ) ; \
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
											 
										
											
												BPython:
- Made Blender.event var (previously only used by script links) hold ascii value -- where it applies -- of current event during events callback registered with Draw.Register(gui, events, button_events).  Useful for gui scripts like Campbell's Python console. No problem using this var to hold the value, since in gui scripts it was not used (always None).
- Updated Window and Window.Theme with new theme vars and the Time space.
- Script links:
-- Added "Render" event for script links (runs twice, second time as "PostEvent", for clean-up actions). Now FrameChanged links don't run when a single pic is rendered.
-- Added "Enable Script Links" button in the script buttons tab.  Now this bit gets saved in .blends along with the rest of G.f, so users can define per .blend if they are on or off by default.  "blender -y" also disables all slinks as happened before with OnLoad ones only.
-- Other small changes in the script buttons tab:
  When a link is added (button "new"), it becomes the active one for the window, no need to press a button to reach it.
  Also, a pupmenu showing all available texts is shown when "new" is pressed, so users can choose a text w/o having to type.  Cancel the popup to leave the string button empty (link exists, but has no script assigned).  A pulldown would be better UI-wise, but it's kinda weird to show both scripts and normal texts (Blender doesn't differentiate them) in a script links pulldown.  With a popup we can show only texts ending in ".py" (not done in this commit, need opinions) and if the script has no or another extension, case of many in old and current .blend's, there's still the string box for writing its name.
-- Implemented Ton's space handler script links:
Right now only for the 3d View,  but it's trivial to add for others.  There are two types: EVENT, to receive 3d View events from a chosen window and DRAW, to draw on the window.  Ton's idea was to give scripts a controlled way to integrate better within Blender.
Here's how it works:
- scripts must have a proper header, like:
# SPACEHANDLER.VIEW3D.EVENT
and then they are shown in 3d View's View menu, "Space Handler Scripts" submenu.  Check (mark, click on it) a script to make it active.
EVENT handlers should consult the Blender.event var to get the current event, which can be compared with values from the Draw module:
import Blender
from Blender import Draw
evt = Blender.event
if evt == Draw.AKEY:
  print "a"
elif evt == Draw.LEFTMOUSE:
  print "left mouse button"
else:
  return # ignore, pass event back to Blender
Blender.event = None # tell Blender not to process itself the event
DRAW handlers are free to draw to their owner 3D View. OpenGL attributes and modelview and projection matrices are pushed before running the handler and poped when it finishes.
To communicate between EVENT and DRAW handler scripts we have the Blender.Registry module, as always.
Still need to code some nice example, which should also serve to test properly space handlers.  Simple tests went fine.
- doc updates about the additions.
=======
Note: the UI part of the space handlers and script links is of course open for changes, I just tried to make it understandable.  Probably we won't use the scriptlinks icon for "None Available" (check 3d View -> View -> Space Handler Scripts), though it hints at what space handlers are.  The tooltips may not be accepted either, since other menus don't use them.  Opinions welcomed.
											 
										 
										
											2005-05-08 21:20:34 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								/* pointer to main dictionary defined in Blender.c */  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								extern  PyObject  * g_blenderdict ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-03-29 08:16:18 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								/*@ hack to flag that window redraw has happened inside slider callback: */  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								int  EXPP_disable_force_draw  =  0 ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
											 
										
											
												BPython: cleaning some bug tracker entries:
(excuse me for doing all in a single commit, but they are tiny
fixes and it's bpython, that dark corner ...)
#1025 - FileSelector SEGV on dynamic callback Category:
  Can't reproduce with current cvs, I'd say recent changes to fix
another crash related to FileSelector in gui-less scripts solved this
one, too.
#1028 - Reserved button event number:
  Menu choices generate two events, one extra related to the menu
itself, with value=4.  Made bpython ignore this extra event.
#1068 - FileSelector No file extension support:
  As Ton wrote there, Blender itself doesn't support this yet.  But the
requester also wanted Window.File/ImageSelector to accept a pathname.  Done.  Also updated doc.
#959 - Segfault on background rendering:
  This happened in bg mode (blender -b filename -a, for example) when
a script with the line "Blender.Redraw()" was linked to FRAMECHANGED events.  As reported in the bug page, it was because curarea is NULL in bg mode.  Made Redraw() check for this and not call functions that expected curarea in Redraw, like one to swap buffers.
#1072 - Blender.Redraw() Segfault:
  Good catch : ). Scripts called from the scripts win that called
Blender.Redraw() or Blender.Window.Redraw() would crash Blender because of a dirty pointer in Spacescript->script.  Fixed.
											 
										 
										
											2004-04-11 04:41:33 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								/* forward declarations for internal functions */  
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								static  void  Button_dealloc (  PyObject  *  self  ) ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								static  PyObject  * Button_getattr (  PyObject  *  self ,  char  * name  ) ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								static  PyObject  * Button_repr (  PyObject  *  self  ) ;  
						 
					
						
							
								
									
										
										
										
											2007-01-06 04:10:51 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								static  PyObject  * Button_richcmpr ( PyObject  * objectA ,  PyObject  * objectB ,  int  comparison_type ) ;  
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								static  int  Button_setattr (  PyObject  *  self ,  char  * name ,  PyObject  *  v  ) ;  
						 
					
						
							
								
									
										
										
										
											2004-03-29 08:16:18 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								static  Button  * newbutton (  void  ) ;  
						 
					
						
							
								
									
										
										
										
											2004-03-29 08:16:18 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								/* GUI interface routines */  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								static  void  exit_pydraw (  SpaceScript  *  sc ,  short  error  ) ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								static  void  exec_callback (  SpaceScript  *  sc ,  PyObject  *  callback ,  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											   PyObject  *  args  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								static  void  spacescript_do_pywin_buttons (  SpaceScript  *  sc ,  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													  unsigned  short  event  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2007-07-12 20:49:36 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								static  PyObject  * Method_Exit (  PyObject  *  self  ) ;  
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								static  PyObject  * Method_Register (  PyObject  *  self ,  PyObject  *  args  ) ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								static  PyObject  * Method_Redraw (  PyObject  *  self ,  PyObject  *  args  ) ;  
						 
					
						
							
								
									
										
										
										
											2007-07-12 20:49:36 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								static  PyObject  * Method_Draw (  PyObject  *  self  ) ;  
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								static  PyObject  * Method_Create (  PyObject  *  self ,  PyObject  *  args  ) ;  
						 
					
						
							
								
									
										
										
										
											2007-04-22 13:48:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								static  PyObject  * Method_UIBlock (  PyObject  *  self ,  PyObject  *  args  ) ;  
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								static  PyObject  * Method_Button (  PyObject  *  self ,  PyObject  *  args  ) ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								static  PyObject  * Method_Menu (  PyObject  *  self ,  PyObject  *  args  ) ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								static  PyObject  * Method_Toggle (  PyObject  *  self ,  PyObject  *  args  ) ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								static  PyObject  * Method_Slider (  PyObject  *  self ,  PyObject  *  args  ) ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								static  PyObject  * Method_Scrollbar (  PyObject  *  self ,  PyObject  *  args  ) ;  
						 
					
						
							
								
									
										
										
										
											2006-05-20 15:44:14 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								static  PyObject  * Method_ColorPicker (  PyObject  *  self ,  PyObject  *  args  ) ;  
						 
					
						
							
								
									
										
										
										
											2006-12-27 11:58:03 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								static  PyObject  * Method_Normal (  PyObject  *  self ,  PyObject  *  args  ) ;  
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								static  PyObject  * Method_Number (  PyObject  *  self ,  PyObject  *  args  ) ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								static  PyObject  * Method_String (  PyObject  *  self ,  PyObject  *  args  ) ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								static  PyObject  * Method_GetStringWidth (  PyObject  *  self ,  PyObject  *  args  ) ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								static  PyObject  * Method_Text (  PyObject  *  self ,  PyObject  *  args  ) ;  
						 
					
						
							
								
									
										
										
										
											2007-03-27 11:37:54 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								static  PyObject  * Method_Label (  PyObject  *  self ,  PyObject  *  args  ) ;  
						 
					
						
							
								
									
										
										
										
											2007-04-22 13:48:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								/* by Campbell: */  
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								static  PyObject  * Method_PupMenu (  PyObject  *  self ,  PyObject  *  args  ) ;  
						 
					
						
							
								
									
										
										
										
											2008-02-15 16:08:41 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								static  PyObject  * Method_PupTreeMenu (  PyObject  *  self ,  PyObject  *  args  ) ;  
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								static  PyObject  * Method_PupIntInput (  PyObject  *  self ,  PyObject  *  args  ) ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								static  PyObject  * Method_PupFloatInput (  PyObject  *  self ,  PyObject  *  args  ) ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								static  PyObject  * Method_PupStrInput (  PyObject  *  self ,  PyObject  *  args  ) ;  
						 
					
						
							
								
									
										
										
										
											2007-01-06 04:10:51 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								static  PyObject  * Method_BeginAlign (  PyObject  *  self ,  PyObject  *  args   ) ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								static  PyObject  * Method_EndAlign (  PyObject  *  self ,  PyObject  *  args   ) ;  
						 
					
						
							
								
									
										
										
										
											2005-01-13 03:04:12 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								/* next by Jonathan Merritt (lancelet): */  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								static  PyObject  * Method_Image (  PyObject  *  self ,  PyObject  *  args ) ;  
						 
					
						
							
								
									
										
										
										
											2006-01-08 18:59:55 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								/* CLEVER NUMBUT */  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								static  PyObject  * Method_PupBlock (  PyObject  *  self ,  PyObject  *  args  ) ;  
						 
					
						
							
								
									
										
										
										
											2004-03-29 08:16:18 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								static  uiBlock  * Get_uiBlock (  void  ) ;  
						 
					
						
							
								
									
										
										
										
											2007-07-27 06:14:25 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								static  void  py_slider_update (  void  * butv ,  void  * data2_unused  ) ;  
						 
					
						
							
								
									
										
										
										
											2004-03-29 08:16:18 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2007-04-22 13:48:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								/* hack to get 1 block for the UIBlock, only ever 1 at a time */  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								static  uiBlock  * uiblock = NULL ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-03-29 08:16:18 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								static  char  Draw_doc [ ]  =  " The Blender.Draw submodule " ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2008-10-22 08:21:43 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								static  char  Method_UIBlock_doc [ ]  =  " (drawfunc, mouse_exit) - Popup dialog where buttons can be drawn (expemental) " ;  
						 
					
						
							
								
									
										
										
										
											2007-04-22 13:48:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-03-29 08:16:18 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								static  char  Method_Register_doc [ ]  =  
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									" (draw, event, button) - Register callbacks for windowing \n \n \
 
							 
						 
					
						
							
								
									
										
										
										
											2004-03-29 08:16:18 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								( draw )  A  function  to  draw  the  screen ,  taking  no  arguments \ n \ 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								( event )  A  function  to  handle  events ,  taking  2  arguments  ( evt ,  val ) \ n \ 
						 
					
						
							
								
									
										
											 
										
											
												BPython: cleaning some bug tracker entries:
(excuse me for doing all in a single commit, but they are tiny
fixes and it's bpython, that dark corner ...)
#1025 - FileSelector SEGV on dynamic callback Category:
  Can't reproduce with current cvs, I'd say recent changes to fix
another crash related to FileSelector in gui-less scripts solved this
one, too.
#1028 - Reserved button event number:
  Menu choices generate two events, one extra related to the menu
itself, with value=4.  Made bpython ignore this extra event.
#1068 - FileSelector No file extension support:
  As Ton wrote there, Blender itself doesn't support this yet.  But the
requester also wanted Window.File/ImageSelector to accept a pathname.  Done.  Also updated doc.
#959 - Segfault on background rendering:
  This happened in bg mode (blender -b filename -a, for example) when
a script with the line "Blender.Redraw()" was linked to FRAMECHANGED events.  As reported in the bug page, it was because curarea is NULL in bg mode.  Made Redraw() check for this and not call functions that expected curarea in Redraw, like one to swap buffers.
#1072 - Blender.Redraw() Segfault:
  Good catch : ). Scripts called from the scripts win that called
Blender.Redraw() or Blender.Window.Redraw() would crash Blender because of a dirty pointer in Spacescript->script.  Fixed.
											 
										 
										
											2004-04-11 04:41:33 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									( evt )  The  event  number \ n \
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									( val )  The  value  modifier  ( for  key  and  mouse  press / release ) \ n \
							 
						 
					
						
							
								
									
										
										
										
											2004-03-29 08:16:18 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								( button )  A  function  to  handle  button  events ,  taking  1  argument  ( evt ) \ n \ 
						 
					
						
							
								
									
										
											 
										
											
												BPython: cleaning some bug tracker entries:
(excuse me for doing all in a single commit, but they are tiny
fixes and it's bpython, that dark corner ...)
#1025 - FileSelector SEGV on dynamic callback Category:
  Can't reproduce with current cvs, I'd say recent changes to fix
another crash related to FileSelector in gui-less scripts solved this
one, too.
#1028 - Reserved button event number:
  Menu choices generate two events, one extra related to the menu
itself, with value=4.  Made bpython ignore this extra event.
#1068 - FileSelector No file extension support:
  As Ton wrote there, Blender itself doesn't support this yet.  But the
requester also wanted Window.File/ImageSelector to accept a pathname.  Done.  Also updated doc.
#959 - Segfault on background rendering:
  This happened in bg mode (blender -b filename -a, for example) when
a script with the line "Blender.Redraw()" was linked to FRAMECHANGED events.  As reported in the bug page, it was because curarea is NULL in bg mode.  Made Redraw() check for this and not call functions that expected curarea in Redraw, like one to swap buffers.
#1072 - Blender.Redraw() Segfault:
  Good catch : ). Scripts called from the scripts win that called
Blender.Redraw() or Blender.Window.Redraw() would crash Blender because of a dirty pointer in Spacescript->script.  Fixed.
											 
										 
										
											2004-04-11 04:41:33 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									( evt )  The  button  number \ n \ n \
							 
						 
					
						
							
								
									
										
										
										
											2004-03-29 08:16:18 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								A  None  object  can  be  passed  if  a  callback  is  unused . " ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								static  char  Method_Redraw_doc [ ]  =  " ([after]) - Queue a redraw event \n \n \
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								[ after = 0 ]  Determines  whether  the  redraw  is  processed  before \ n \ 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								or  after  other  input  events . \ n \ n \ 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								Redraw  events  are  buffered  so  that  regardless  of  how  many  events \ n \ 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								are  queued  the  window  only  receives  one  redraw  event . " ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								static  char  Method_Draw_doc [ ]  =  " () - Force an immediate redraw \n \n \
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								Forced  redraws  are  not  buffered ,  in  other  words  the  window  is  redrawn \ n \ 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								exactly  once  for  everytime  this  function  is  called . " ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								static  char  Method_Create_doc [ ]  =  
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									" (value) - Create a default Button object \n \n \
 
							 
						 
					
						
							
								
									
										
										
										
											2004-03-29 08:16:18 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								 ( value )  -  The  value  to  store  in  the  button \ n \ n \
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								 Valid  values  are  ints ,  floats ,  and  strings " ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								static  char  Method_Button_doc [ ]  =  
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									" (name, event, x, y, width, height, [tooltip]) - Create a new Button  \
 
							 
						 
					
						
							
								
									
										
										
										
											2004-03-29 08:16:18 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								( push )  button \ n \ n \ 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								( name )  A  string  to  display  on  the  button \ n \ 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								( event )  The  event  number  to  pass  to  the  button  event  function  when  activated \ n \ 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								( x ,  y )  The  lower  left  coordinate  of  the  button \ n \ 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								( width ,  height )  The  button  width  and  height \ n \ 
						 
					
						
							
								
									
										
										
										
											2004-06-16 01:18:57 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								[ tooltip = ]  The  button ' s  tooltip \ n \ n \ 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								This  function  can  be  called  as  Button ( )  or  PushButton ( ) . " ;  
						 
					
						
							
								
									
										
										
										
											2004-03-29 08:16:18 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2006-12-23 00:56:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								static  char  Method_BeginAlign_doc [ ]  =  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									" Buttons after this function will draw aligned (button layout only) " ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								static  char  Method_EndAlign_doc [ ]  =  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									" Use after BeginAlign() to stop aligning the buttons (button layout only). " ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-03-29 08:16:18 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								static  char  Method_Menu_doc [ ]  =  
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									" (name, event, x, y, width, height, default, [tooltip]) - Create a new Menu  \
 
							 
						 
					
						
							
								
									
										
										
										
											2004-03-29 08:16:18 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								button \ n \ n \ 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								( name )  A  string  to  display  on  the  button \ n \ 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								( event )  The  event  number  to  pass  to  the  button  event  function  when  activated \ n \ 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								( x ,  y )  The  lower  left  coordinate  of  the  button \ n \ 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								( width ,  height )  The  button  width  and  height \ n \ 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								( default )  The  number  of  the  option  to  be  selected  by  default \ n \ 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								[ tooltip = "   " ]  The  button ' s  tooltip \ n \ n \ 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								The  menu  options  are  specified  through  the  name  of  the \ n \ 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								button .  Options  are  followed  by  a  format  code  and  separated \ n \ 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								by  the  ' | '  ( pipe )  character . \ n \ 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								Valid  format  codes  are \ n \ 
						 
					
						
							
								
									
										
											 
										
											
												BPython: cleaning some bug tracker entries:
(excuse me for doing all in a single commit, but they are tiny
fixes and it's bpython, that dark corner ...)
#1025 - FileSelector SEGV on dynamic callback Category:
  Can't reproduce with current cvs, I'd say recent changes to fix
another crash related to FileSelector in gui-less scripts solved this
one, too.
#1028 - Reserved button event number:
  Menu choices generate two events, one extra related to the menu
itself, with value=4.  Made bpython ignore this extra event.
#1068 - FileSelector No file extension support:
  As Ton wrote there, Blender itself doesn't support this yet.  But the
requester also wanted Window.File/ImageSelector to accept a pathname.  Done.  Also updated doc.
#959 - Segfault on background rendering:
  This happened in bg mode (blender -b filename -a, for example) when
a script with the line "Blender.Redraw()" was linked to FRAMECHANGED events.  As reported in the bug page, it was because curarea is NULL in bg mode.  Made Redraw() check for this and not call functions that expected curarea in Redraw, like one to swap buffers.
#1072 - Blender.Redraw() Segfault:
  Good catch : ). Scripts called from the scripts win that called
Blender.Redraw() or Blender.Window.Redraw() would crash Blender because of a dirty pointer in Spacescript->script.  Fixed.
											 
										 
										
											2004-04-11 04:41:33 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									% t  -  The  option  should  be  used  as  the  title \ n \
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									% xN  -  The  option  should  set  the  integer  N  in  the  button  value . " ; 
							 
						 
					
						
							
								
									
										
										
										
											2004-03-29 08:16:18 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								static  char  Method_Toggle_doc [ ]  =  
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									" (name, event, x, y, width, height, default, [tooltip]) - Create a new Toggle  \
 
							 
						 
					
						
							
								
									
										
										
										
											2004-03-29 08:16:18 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								button \ n \ n \ 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								( name )  A  string  to  display  on  the  button \ n \ 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								( event )  The  event  number  to  pass  to  the  button  event  function  when  activated \ n \ 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								( x ,  y )  The  lower  left  coordinate  of  the  button \ n \ 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								( width ,  height )  The  button  width  and  height \ n \ 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								( default )  An  integer  ( 0  or  1 )  specifying  the  default  state \ n \ 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								[ tooltip = ]  The  button ' s  tooltip " ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								static  char  Method_Slider_doc [ ]  =  
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									" (name, event, x, y, width, height, initial, min, max, [update, tooltip]) -  \
 
							 
						 
					
						
							
								
									
										
										
										
											2004-03-29 08:16:18 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								Create  a  new  Slider  button \ n \ n \ 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								( name )  A  string  to  display  on  the  button \ n \ 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								( event )  The  event  number  to  pass  to  the  button  event  function  when  activated \ n \ 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								( x ,  y )  The  lower  left  coordinate  of  the  button \ n \ 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								( width ,  height )  The  button  width  and  height \ n \ 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								( initial ,  min ,  max )  Three  values  ( int  or  float )  specifying  the  initial  \ 
						 
					
						
							
								
									
										
											 
										
											
												BPython: cleaning some bug tracker entries:
(excuse me for doing all in a single commit, but they are tiny
fixes and it's bpython, that dark corner ...)
#1025 - FileSelector SEGV on dynamic callback Category:
  Can't reproduce with current cvs, I'd say recent changes to fix
another crash related to FileSelector in gui-less scripts solved this
one, too.
#1028 - Reserved button event number:
  Menu choices generate two events, one extra related to the menu
itself, with value=4.  Made bpython ignore this extra event.
#1068 - FileSelector No file extension support:
  As Ton wrote there, Blender itself doesn't support this yet.  But the
requester also wanted Window.File/ImageSelector to accept a pathname.  Done.  Also updated doc.
#959 - Segfault on background rendering:
  This happened in bg mode (blender -b filename -a, for example) when
a script with the line "Blender.Redraw()" was linked to FRAMECHANGED events.  As reported in the bug page, it was because curarea is NULL in bg mode.  Made Redraw() check for this and not call functions that expected curarea in Redraw, like one to swap buffers.
#1072 - Blender.Redraw() Segfault:
  Good catch : ). Scripts called from the scripts win that called
Blender.Redraw() or Blender.Window.Redraw() would crash Blender because of a dirty pointer in Spacescript->script.  Fixed.
											 
										 
										
											2004-04-11 04:41:33 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
												and  limit  values . \ n \
							 
						 
					
						
							
								
									
										
										
										
											2004-03-29 08:16:18 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								[ update = 1 ]  A  value  controlling  whether  the  slider  will  emit  events  as  it  \ 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								is  edited . \ n \ 
						 
					
						
							
								
									
										
											 
										
											
												BPython: cleaning some bug tracker entries:
(excuse me for doing all in a single commit, but they are tiny
fixes and it's bpython, that dark corner ...)
#1025 - FileSelector SEGV on dynamic callback Category:
  Can't reproduce with current cvs, I'd say recent changes to fix
another crash related to FileSelector in gui-less scripts solved this
one, too.
#1028 - Reserved button event number:
  Menu choices generate two events, one extra related to the menu
itself, with value=4.  Made bpython ignore this extra event.
#1068 - FileSelector No file extension support:
  As Ton wrote there, Blender itself doesn't support this yet.  But the
requester also wanted Window.File/ImageSelector to accept a pathname.  Done.  Also updated doc.
#959 - Segfault on background rendering:
  This happened in bg mode (blender -b filename -a, for example) when
a script with the line "Blender.Redraw()" was linked to FRAMECHANGED events.  As reported in the bug page, it was because curarea is NULL in bg mode.  Made Redraw() check for this and not call functions that expected curarea in Redraw, like one to swap buffers.
#1072 - Blender.Redraw() Segfault:
  Good catch : ). Scripts called from the scripts win that called
Blender.Redraw() or Blender.Window.Redraw() would crash Blender because of a dirty pointer in Spacescript->script.  Fixed.
											 
										 
										
											2004-04-11 04:41:33 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									A  non - zero  value  ( default )  enables  the  events .  A  zero  value  supresses  them . \ n \
							 
						 
					
						
							
								
									
										
										
										
											2004-03-29 08:16:18 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								[ tooltip = ]  The  button ' s  tooltip " ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								static  char  Method_Scrollbar_doc [ ]  =  
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									" (event, x, y, width, height, initial, min, max, [update, tooltip]) - Create a  \
 
							 
						 
					
						
							
								
									
										
										
										
											2004-03-29 08:16:18 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								new  Scrollbar \ n \ n \ 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								( event )  The  event  number  to  pass  to  the  button  event  function  when  activated \ n \ 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								( x ,  y )  The  lower  left  coordinate  of  the  button \ n \ 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								( width ,  height )  The  button  width  and  height \ n \ 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								( initial ,  min ,  max )  Three  values  ( int  or  float )  specifying  the  initial  and  limit  values . \ n \ 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								[ update = 1 ]  A  value  controlling  whether  the  slider  will  emit  events  as  it  is  edited . \ n \ 
						 
					
						
							
								
									
										
											 
										
											
												BPython: cleaning some bug tracker entries:
(excuse me for doing all in a single commit, but they are tiny
fixes and it's bpython, that dark corner ...)
#1025 - FileSelector SEGV on dynamic callback Category:
  Can't reproduce with current cvs, I'd say recent changes to fix
another crash related to FileSelector in gui-less scripts solved this
one, too.
#1028 - Reserved button event number:
  Menu choices generate two events, one extra related to the menu
itself, with value=4.  Made bpython ignore this extra event.
#1068 - FileSelector No file extension support:
  As Ton wrote there, Blender itself doesn't support this yet.  But the
requester also wanted Window.File/ImageSelector to accept a pathname.  Done.  Also updated doc.
#959 - Segfault on background rendering:
  This happened in bg mode (blender -b filename -a, for example) when
a script with the line "Blender.Redraw()" was linked to FRAMECHANGED events.  As reported in the bug page, it was because curarea is NULL in bg mode.  Made Redraw() check for this and not call functions that expected curarea in Redraw, like one to swap buffers.
#1072 - Blender.Redraw() Segfault:
  Good catch : ). Scripts called from the scripts win that called
Blender.Redraw() or Blender.Window.Redraw() would crash Blender because of a dirty pointer in Spacescript->script.  Fixed.
											 
										 
										
											2004-04-11 04:41:33 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									A  non - zero  value  ( default )  enables  the  events .  A  zero  value  supresses  them . \ n \
							 
						 
					
						
							
								
									
										
										
										
											2004-03-29 08:16:18 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								[ tooltip = ]  The  button ' s  tooltip " ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2006-05-20 15:44:14 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								static  char  Method_ColorPicker_doc [ ]  =   
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									" (event, x, y, width, height, initial, [tooltip]) - Create a new Button  \
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								Color  picker  button \ n \ n \ 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								( event )  The  event  number  to  pass  to  the  button  event  function  when  the  color  changes \ n \ 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								( x ,  y )  The  lower  left  coordinate  of  the  button \ n \ 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								( width ,  height )  The  button  width  and  height \ n \ 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								( initial )  3 - Float  tuple  of  the  color  ( values  between  0  and  1 ) \ 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								[ tooltip = ]  The  button ' s  tooltip " ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2006-12-27 11:58:03 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								static  char  Method_Normal_doc [ ]  =   
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									" (event, x, y, width, height, initial, [tooltip]) - Create a new Button  \
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								Normal  button  ( a  sphere  that  you  can  roll  to  change  the  normal ) \ n \ n \ 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								( event )  The  event  number  to  pass  to  the  button  event  function  when  the  color  changes \ n \ 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								( x ,  y )  The  lower  left  coordinate  of  the  button \ n \ 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								( width ,  height )  The  button  width  and  height  -  non  square  will  gave  odd  results \ n \ 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								( initial )  3 - Float  tuple  of  the  normal  vector  ( values  between  - 1  and  1 ) \ 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								[ tooltip = ]  The  button ' s  tooltip " ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-03-29 08:16:18 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								static  char  Method_Number_doc [ ]  =  
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									" (name, event, x, y, width, height, initial, min, max, [tooltip]) - Create a  \
 
							 
						 
					
						
							
								
									
										
										
										
											2004-03-29 08:16:18 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								new  Number  button \ n \ n \ 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								( name )  A  string  to  display  on  the  button \ n \ 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								( event )  The  event  number  to  pass  to  the  button  event  function  when  activated \ n \ 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								( x ,  y )  The  lower  left  coordinate  of  the  button \ n \ 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								( width ,  height )  The  button  width  and  height \ n \ 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								( initial ,  min ,  max )  Three  values  ( int  or  float )  specifying  the  initial  and  \ 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								limit  values . \ n \ 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								[ tooltip = ]  The  button ' s  tooltip " ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								static  char  Method_String_doc [ ]  =  
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									" (name, event, x, y, width, height, initial, length, [tooltip]) - Create a  \
 
							 
						 
					
						
							
								
									
										
										
										
											2004-03-29 08:16:18 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								new  String  button \ n \ n \ 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								( name )  A  string  to  display  on  the  button \ n \ 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								( event )  The  event  number  to  pass  to  the  button  event  function  when  activated \ n \ 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								( x ,  y )  The  lower  left  coordinate  of  the  button \ n \ 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								( width ,  height )  The  button  width  and  height \ n \ 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								( initial )  The  string  to  display  initially \ n \ 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								( length )  The  maximum  input  length \ n \ 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								[ tooltip = ]  The  button ' s  tooltip " ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								static  char  Method_GetStringWidth_doc [ ]  =  
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									" (text, font = 'normal') - Return the width in pixels of the given string \n \
 
							 
						 
					
						
							
								
									
										
										
										
											2008-02-19 10:47:29 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								( font )  The  font  size :  ' large ' , ' normal '  ( default ) ,  ' normalfix ' ,  ' small '  or  ' tiny ' . " ;  
						 
					
						
							
								
									
										
										
										
											2004-03-29 08:16:18 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								static  char  Method_Text_doc [ ]  =  
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									" (text, font = 'normal') - Draw text onscreen \n \n \
 
							 
						 
					
						
							
								
									
										
										
										
											2004-03-29 08:16:18 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								( text )  The  text  to  draw \ n \ 
						 
					
						
							
								
									
										
										
										
											2008-02-19 10:47:29 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								( font )  The  font  size :  ' large ' , ' normal '  ( default ) ,  ' normalfix ' ,  ' small '  or  ' tiny ' . \ n \ n \ 
						 
					
						
							
								
									
										
											 
										
											
												BPython: cleaning some bug tracker entries:
(excuse me for doing all in a single commit, but they are tiny
fixes and it's bpython, that dark corner ...)
#1025 - FileSelector SEGV on dynamic callback Category:
  Can't reproduce with current cvs, I'd say recent changes to fix
another crash related to FileSelector in gui-less scripts solved this
one, too.
#1028 - Reserved button event number:
  Menu choices generate two events, one extra related to the menu
itself, with value=4.  Made bpython ignore this extra event.
#1068 - FileSelector No file extension support:
  As Ton wrote there, Blender itself doesn't support this yet.  But the
requester also wanted Window.File/ImageSelector to accept a pathname.  Done.  Also updated doc.
#959 - Segfault on background rendering:
  This happened in bg mode (blender -b filename -a, for example) when
a script with the line "Blender.Redraw()" was linked to FRAMECHANGED events.  As reported in the bug page, it was because curarea is NULL in bg mode.  Made Redraw() check for this and not call functions that expected curarea in Redraw, like one to swap buffers.
#1072 - Blender.Redraw() Segfault:
  Good catch : ). Scripts called from the scripts win that called
Blender.Redraw() or Blender.Window.Redraw() would crash Blender because of a dirty pointer in Spacescript->script.  Fixed.
											 
										 
										
											2004-04-11 04:41:33 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								This  function  returns  the  width  of  the  drawn  string . " ;  
						 
					
						
							
								
									
										
										
										
											2004-03-29 08:16:18 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2007-03-27 11:37:54 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								static  char  Method_Label_doc [ ]  =  
						 
					
						
							
								
									
										
										
										
											2008-10-22 08:21:43 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									" (text, x, y, w, h, tip, callback) - Draw a text label onscreen \n \n \
 
							 
						 
					
						
							
								
									
										
										
										
											2007-03-27 11:37:54 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								( text )  The  text  to  draw \ n \ 
						 
					
						
							
								
									
										
										
										
											2008-10-22 08:21:43 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								( x ,  y ,  w ,  h )  The  lower  left  coordinate  of  the  lable ,  width  and  height " ;  
						 
					
						
							
								
									
										
										
										
											2007-03-27 11:37:54 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-03-29 08:16:18 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								static  char  Method_PupMenu_doc [ ]  =  
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									" (string, maxrow = None) - Display a pop-up menu at the screen. \n \
 
							 
						 
					
						
							
								
									
										
										
										
											2004-03-29 08:16:18 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								The  contents  of  the  pop - up  are  specified  through  the  ' string '  argument , \ n \ 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								like  with  Draw . Menu . \ n \ 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								' maxrow '  is  an  optional  int  to  control  how  many  rows  the  pop - up  should  have . \ n \ 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								Options  are  followed  by  a  format  code  and  separated \ n \ 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								by  the  ' | '  ( pipe )  character . \ n \ 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								Valid  format  codes  are \ n \ 
						 
					
						
							
								
									
										
											 
										
											
												BPython: cleaning some bug tracker entries:
(excuse me for doing all in a single commit, but they are tiny
fixes and it's bpython, that dark corner ...)
#1025 - FileSelector SEGV on dynamic callback Category:
  Can't reproduce with current cvs, I'd say recent changes to fix
another crash related to FileSelector in gui-less scripts solved this
one, too.
#1028 - Reserved button event number:
  Menu choices generate two events, one extra related to the menu
itself, with value=4.  Made bpython ignore this extra event.
#1068 - FileSelector No file extension support:
  As Ton wrote there, Blender itself doesn't support this yet.  But the
requester also wanted Window.File/ImageSelector to accept a pathname.  Done.  Also updated doc.
#959 - Segfault on background rendering:
  This happened in bg mode (blender -b filename -a, for example) when
a script with the line "Blender.Redraw()" was linked to FRAMECHANGED events.  As reported in the bug page, it was because curarea is NULL in bg mode.  Made Redraw() check for this and not call functions that expected curarea in Redraw, like one to swap buffers.
#1072 - Blender.Redraw() Segfault:
  Good catch : ). Scripts called from the scripts win that called
Blender.Redraw() or Blender.Window.Redraw() would crash Blender because of a dirty pointer in Spacescript->script.  Fixed.
											 
										 
										
											2004-04-11 04:41:33 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									% t  -  The  option  should  be  used  as  the  title \ n \
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									% xN  -  The  option  should  set  the  integer  N  in  the  button  value . \ n \ n \
							 
						 
					
						
							
								
									
										
										
										
											2004-03-29 08:16:18 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								Ex :  Draw . PupMenu ( ' OK ? % t | QUIT  BLENDER ' )  #  should  be  familiar  . . . " ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2008-02-15 16:08:41 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								static  char  Method_PupTreeMenu_doc [ ]  =  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								" each item in the menu list should be - (str, event), separator - None or submenu - (str, [...]). " ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-05-19 01:28:12 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								static  char  Method_PupIntInput_doc [ ]  =  
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									" (text, default, min, max) - Display an int pop-up input. \n \
 
							 
						 
					
						
							
								
									
										
										
										
											2004-06-16 01:18:57 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								( text )  -  text  string  to  display  on  the  button ; \ n \ 
						 
					
						
							
								
									
										
										
										
											2004-05-19 01:28:12 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								( default ,  min ,  max )  -  the  default ,  min  and  max  int  values  for  the  button ; \ n \ 
						 
					
						
							
								
									
										
										
										
											2004-06-16 01:18:57 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								Return  the  user  input  value  or  None  on  user  exit " ;  
						 
					
						
							
								
									
										
										
										
											2004-05-19 01:28:12 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								static  char  Method_PupFloatInput_doc [ ]  =  
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									" (text, default, min, max, clickStep, floatLen) - Display a float pop-up input. \n \
 
							 
						 
					
						
							
								
									
										
										
										
											2004-06-16 01:18:57 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								( text )  -  text  string  to  display  on  the  button ; \ n \ 
						 
					
						
							
								
									
										
										
										
											2004-05-19 01:28:12 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								( default ,  min ,  max )  -  the  default ,  min  and  max  float  values  for  the  button ; \ n \ 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								( clickStep )  -  float  increment / decrement  for  each  click  on  the  button  arrows ; \ n \ 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								( floatLen )  -  an  integer  defining  the  precision  ( number  of  decimal  places )  of  \ n \ 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								the  float  value  show . \ n \ 
						 
					
						
							
								
									
										
										
										
											2004-06-16 01:18:57 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								Return  the  user  input  value  or  None  on  user  exit " ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2005-01-13 03:04:12 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								static  char  Method_Image_doc [ ]  =  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									" (image, x, y, zoomx = 1.0, zoomy = 1.0, [clipx, clipy, clipw, cliph]))  \n \
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    -  Draw  an  image . \ n \
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								( image )  -  Blender . Image  to  draw . \ n \ 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								( x ,  y )  -  floats  specifying  the  location  of  the  image . \ n \ 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								( zoomx ,  zoomy )  -  float  zoom  factors  in  horizontal  and  vertical  directions . \ n \ 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								( clipx ,  clipy ,  clipw ,  cliph )  -  integers  specifying  a  clipping  rectangle  within  the  original  image . " ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-06-16 01:18:57 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								static  char  Method_PupStrInput_doc [ ]  =  
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									" (text, default, max = 20) - Display a float pop-up input. \n \
 
							 
						 
					
						
							
								
									
										
										
										
											2004-06-16 01:18:57 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								( text )  -  text  string  to  display  on  the  button ; \ n \ 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								( default )  -  the  initial  string  to  display  ( truncated  to  ' max '  chars ) ; \ n \ 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								( max  =  20 )  -  The  maximum  number  of  chars  the  user  can  input ; \ n \ 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								Return  the  user  input  value  or  None  on  user  exit " ;  
						 
					
						
							
								
									
										
										
										
											2004-05-19 01:28:12 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2006-01-08 18:59:55 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								static  char  Method_PupBlock_doc [ ]  =  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									" (title, sequence) - Display a pop-up block. \n \
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								( title )  -  The  title  of  the  block . \ n \ 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								( sequence )  -  A  sequence  defining  what  the  block  contains .  \ 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								The  order  of  the  list  is  the  order  of  appearance ,  from  top  down . \ n \ 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								Possible  format  for  sequence  items : \ n \ 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								[ value  is  an  object  created  with  Create ] \ n \ 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								\ ttext :  Defines  a  label  in  the  block \ n \ 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								\ t ( text ,  value ,  tooltip  =  ' ' ) :  Defines  a  toggle  button  \ n \ 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								\ t ( text ,  value ,  min ,  max ,  tooltip  =  ' ' ) :  Defines  a  num  or  string  button  \ n \ 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								\ t \ t \ tdepending  on  the  value . \ n \ 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								\ t \ tFor  string ,  max  is  the  maximum  length  of  the  text  and  min  is  unused . \ n \ 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								Return  1  if  the  pop - up  is  confirmed ,  0  otherwise .  \ n \ 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								Warning :  On  cancel ,  the  value  objects  are  brought  back  to  there  previous  values ,  \ 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								\ texcept  for  string  values  which  will  still  contain  the  modified  values . \ n " ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-03-29 08:16:18 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								static  char  Method_Exit_doc [ ]  =  " () - Exit the windowing interface " ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2007-07-27 06:14:25 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								/*This is needed for button callbacks.  Any button that uses a callback gets added to this list.
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  On  the  C  side  of  drawing  begin ,  this  list  should  be  cleared . 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  Each  entry  is  a  tuple  of  the  form  ( button ,  callback  py  object ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								*/  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								PyObject  * M_Button_List  =  NULL ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-03-29 08:16:18 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								static  struct  PyMethodDef  Draw_methods [ ]  =  {  
						 
					
						
							
								
									
										
										
										
											2007-12-17 20:21:06 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									{ " Create " ,  ( PyCFunction ) Method_Create ,  METH_VARARGS ,  Method_Create_doc } , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									{ " UIBlock " ,  ( PyCFunction ) Method_UIBlock ,  METH_VARARGS ,  Method_UIBlock_doc } , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									{ " Button " ,  ( PyCFunction ) Method_Button ,  METH_VARARGS ,  Method_Button_doc } , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									{ " Toggle " ,  ( PyCFunction ) Method_Toggle ,  METH_VARARGS ,  Method_Toggle_doc } , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									{ " Menu " ,  ( PyCFunction ) Method_Menu ,  METH_VARARGS ,  Method_Menu_doc } , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									{ " Slider " ,  ( PyCFunction ) Method_Slider ,  METH_VARARGS ,  Method_Slider_doc } , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									{ " Scrollbar " ,  ( PyCFunction ) Method_Scrollbar ,  METH_VARARGS ,  Method_Scrollbar_doc } , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									{ " ColorPicker " ,  ( PyCFunction ) Method_ColorPicker ,  METH_VARARGS ,  Method_ColorPicker_doc } , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									{ " Normal " ,  ( PyCFunction ) Method_Normal ,  METH_VARARGS ,  Method_Normal_doc } , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									{ " Number " ,  ( PyCFunction ) Method_Number ,  METH_VARARGS ,  Method_Number_doc } , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									{ " String " ,  ( PyCFunction ) Method_String ,  METH_VARARGS ,  Method_String_doc } , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									{ " GetStringWidth " ,  ( PyCFunction ) Method_GetStringWidth ,  METH_VARARGS ,  Method_GetStringWidth_doc } , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									{ " Text " ,  ( PyCFunction ) Method_Text ,  METH_VARARGS ,  Method_Text_doc } , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									{ " Label " ,  ( PyCFunction ) Method_Label ,  METH_VARARGS ,  Method_Label_doc } , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									{ " PupMenu " ,  ( PyCFunction ) Method_PupMenu ,  METH_VARARGS ,  Method_PupMenu_doc } , 
							 
						 
					
						
							
								
									
										
										
										
											2008-02-15 16:08:41 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									{ " PupTreeMenu " ,  ( PyCFunction ) Method_PupTreeMenu ,  METH_VARARGS ,  Method_PupTreeMenu_doc } , 
							 
						 
					
						
							
								
									
										
										
										
											2007-12-17 20:21:06 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									{ " PupIntInput " ,  ( PyCFunction ) Method_PupIntInput ,  METH_VARARGS ,  Method_PupIntInput_doc } , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									{ " PupFloatInput " ,  ( PyCFunction ) Method_PupFloatInput ,  METH_VARARGS ,  Method_PupFloatInput_doc } , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									{ " PupStrInput " ,  ( PyCFunction ) Method_PupStrInput ,  METH_VARARGS ,  Method_PupStrInput_doc } , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									{ " PupBlock " ,  ( PyCFunction ) Method_PupBlock ,  METH_VARARGS ,  Method_PupBlock_doc } , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									{ " Image " ,  ( PyCFunction ) Method_Image ,  METH_VARARGS ,  Method_Image_doc } , 
							 
						 
					
						
							
								
									
										
										
										
											2007-07-12 20:49:36 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									{ " Exit " ,  ( PyCFunction ) Method_Exit ,  METH_NOARGS ,  Method_Exit_doc } , 
							 
						 
					
						
							
								
									
										
										
										
											2007-12-17 20:21:06 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									{ " Redraw " ,  ( PyCFunction ) Method_Redraw ,  METH_VARARGS ,  Method_Redraw_doc } , 
							 
						 
					
						
							
								
									
										
										
										
											2007-07-12 20:49:36 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									{ " Draw " ,  ( PyCFunction ) Method_Draw ,  METH_NOARGS ,  Method_Draw_doc } , 
							 
						 
					
						
							
								
									
										
										
										
											2007-12-17 20:21:06 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									{ " Register " ,  ( PyCFunction ) Method_Register ,  METH_VARARGS ,  Method_Register_doc } , 
							 
						 
					
						
							
								
									
										
										
										
											2007-07-12 20:49:36 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									{ " PushButton " ,  ( PyCFunction ) Method_Button ,  METH_VARARGS ,  Method_Button_doc } , 
							 
						 
					
						
							
								
									
										
										
										
											2007-12-17 20:21:06 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									{ " BeginAlign " ,  ( PyCFunction ) Method_BeginAlign ,  METH_VARARGS ,  Method_BeginAlign_doc } , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									{ " EndAlign " ,  ( PyCFunction ) Method_EndAlign ,  METH_VARARGS ,  Method_EndAlign_doc } , 
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									{ NULL ,  NULL ,  0 ,  NULL } 
							 
						 
					
						
							
								
									
										
										
										
											2004-03-29 08:16:18 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								} ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								PyTypeObject  Button_Type  =  {  
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									PyObject_HEAD_INIT (  NULL  )  0 , 	/*ob_size */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									" Button " , 		/*tp_name */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									sizeof (  Button  ) , 	/*tp_basicsize */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									0 , 			/*tp_itemsize */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									(  destructor  )  Button_dealloc , 	/*tp_dealloc */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									(  printfunc  )  0 , 	/*tp_print */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									(  getattrfunc  )  Button_getattr , 	/*tp_getattr */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									(  setattrfunc  )  Button_setattr , 	/*tp_setattr */ 
							 
						 
					
						
							
								
									
										
										
										
											2007-01-06 04:10:51 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									NULL , 		/*tp_cmp */ 
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									(  reprfunc  )  Button_repr , 	/*tp_repr */ 
							 
						 
					
						
							
								
									
										
										
										
											2007-01-06 04:10:51 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									/* Method suites for standard classes */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									NULL ,                        /* PyNumberMethods *tp_as_number; */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									NULL ,                        /* PySequenceMethods *tp_as_sequence; */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									NULL ,                        /* PyMappingMethods *tp_as_mapping; */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									/* More standard operations (here for binary compatibility) */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									NULL ,                        /* hashfunc tp_hash; */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									NULL ,                        /* ternaryfunc tp_call; */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									NULL ,                        /* reprfunc tp_str; */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									NULL ,                        /* getattrofunc tp_getattro; */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									NULL ,                        /* setattrofunc tp_setattro; */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									/* Functions to access object as input/output buffer */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									NULL ,                        /* PyBufferProcs *tp_as_buffer; */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  /*** Flags to define presence of optional/expanded features ***/ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									Py_TPFLAGS_DEFAULT ,          /* long tp_flags; */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									NULL ,                        /*  char *tp_doc;  Documentation string */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  /*** Assigned meaning in release 2.0 ***/ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									/* call function for all accessible objects */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									NULL ,                        /* traverseproc tp_traverse; */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									/* delete references to contained objects */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									NULL ,                        /* inquiry tp_clear; */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  /***  Assigned meaning in release 2.1 ***/ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  /*** rich comparisons ***/ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									( richcmpfunc ) Button_richcmpr ,                        /* richcmpfunc tp_richcompare; */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  /***  weak reference enabler ***/ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									0 ,                           /* long tp_weaklistoffset; */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  /*** Added in release 2.2 ***/ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									/*   Iterators */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									NULL ,                        /* getiterfunc tp_iter; */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									NULL ,                        /* iternextfunc tp_iternext; */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								  /*** Attribute descriptor and subclassing stuff ***/ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									NULL ,            /* struct PyMethodDef *tp_methods; */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									NULL ,                        /* struct PyMemberDef *tp_members; */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									NULL ,          /* struct PyGetSetDef *tp_getset; */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									NULL ,                        /* struct _typeobject *tp_base; */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									NULL ,                        /* PyObject *tp_dict; */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									NULL ,                        /* descrgetfunc tp_descr_get; */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									NULL ,                        /* descrsetfunc tp_descr_set; */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									0 ,                           /* long tp_dictoffset; */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									NULL ,                        /* initproc tp_init; */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									NULL ,                        /* allocfunc tp_alloc; */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									NULL ,                        /* newfunc tp_new; */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									/*  Low-level free-memory routine */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									NULL ,                        /* freefunc tp_free;  */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									/* For PyObject_IS_GC */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									NULL ,                        /* inquiry tp_is_gc;  */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									NULL ,                        /* PyObject *tp_bases; */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									/* method resolution order */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									NULL ,                        /* PyObject *tp_mro;  */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									NULL ,                        /* PyObject *tp_cache; */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									NULL ,                        /* PyObject *tp_subclasses; */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									NULL ,                        /* PyObject *tp_weaklist; */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									NULL 
							 
						 
					
						
							
								
									
										
										
										
											2004-03-29 08:16:18 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								} ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								static  void  Button_dealloc (  PyObject  *  self  )  
						 
					
						
							
								
									
										
										
										
											2003-05-08 03:06:46 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								{  
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									Button  * but  =  (  Button  *  )  self ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-05-08 03:06:46 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2006-01-08 18:59:55 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if (  but - > type  = =  BSTRING_TYPE  )  { 
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										if (  but - > val . asstr  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											MEM_freeN (  but - > val . asstr  ) ; 
							 
						 
					
						
							
								
									
										
											 
										
											
												New scripts:
- hotkeys, obdatacopier and renameobjectbyblock, all from Jean-Michel Soler (jms);
- bevel_center by Loic Berthe, suggested for inclusion by jms;
- doc_browser, by Daniel Dunbar (Zr)
  Thanks to them for the new contributions!
  (I included doc_browser at 'Misc' because only users interested in script writing would actually use it, but it could also be under 'Help'.  Opinions?)
BPython related:
- Added scriptlink methods to object, lamp, camera and world.
- Object: added object.makeTrack and object.clearTrack (old track method).
- sys: made sys.exists(path) return 0 for not found; 1 for file, 2 for dir and -1 for neither.
- doc updates and fixes.
- made ONLOAD event work.  G.f's SCENESCRIPT bit was being zeroed in set_app_data.
- Blender: updated functions Load and Save to support the builtin importers and exporters besides .blend (dxf, videoscape, vrml 1.0, stl, ...)
- Draw: added mouse wheel events.
- Scene: added scene.play to play back animations (like ALT+A and SHIFT+ALT+A).  Makes a good counter, too, when the 'win' attribute is set to a space that doesn't "animate".
The scene.play() addition and the fix to ONLOAD scriptlinks is part of the work for a Blender demo mode.  It already works, but I'll still add support for Radiosity calculations and fix a thing in main(): it executes onload scripts too early (BIF_Init), giving funny results in alt+a animations and renderings when firing up Blender.  Loading after the program is up has no such problems.  When I finish I'll post examples of demo mode scripts.
											 
										 
										
											2004-07-03 05:17:04 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2004-03-29 08:16:18 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									PyObject_DEL (  self  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-05-08 03:06:46 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								static  PyObject  * Button_getattr (  PyObject  *  self ,  char  * name  )  
						 
					
						
							
								
									
										
										
										
											2003-05-08 03:06:46 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								{  
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									Button  * but  =  (  Button  *  )  self ; 
							 
						 
					
						
							
								
									
										
										
										
											2006-05-20 15:44:14 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if (  strcmp (  name ,  " val "  )  = =  0  )  { 
							 
						 
					
						
							
								
									
										
										
										
											2006-01-08 18:59:55 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										if (  but - > type  = =  BINT_TYPE  ) 
							 
						 
					
						
							
								
									
										
										
										
											2006-09-30 14:14:49 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											return  PyInt_FromLong (  but - > val . asint  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2006-01-08 18:59:55 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										else  if (  but - > type  = =  BFLOAT_TYPE  ) 
							 
						 
					
						
							
								
									
										
										
										
											2006-09-30 14:14:49 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											return  PyFloat_FromDouble (  but - > val . asfloat  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2006-01-08 18:59:55 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										else  if (  but - > type  = =  BSTRING_TYPE  ) 
							 
						 
					
						
							
								
									
										
										
										
											2006-09-30 14:14:49 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											return  PyString_FromString (  but - > val . asstr  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2006-05-20 15:44:14 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										else  if (  but - > type  = =  BVECTOR_TYPE  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											return  Py_BuildValue (  " fff " ,  but - > val . asvec [ 0 ] ,  but - > val . asvec [ 1 ] ,  but - > val . asvec [ 2 ]  ) ; 
							 
						 
					
						
							
								
									
										
											 
										
											
												BPython: cleaning some bug tracker entries:
(excuse me for doing all in a single commit, but they are tiny
fixes and it's bpython, that dark corner ...)
#1025 - FileSelector SEGV on dynamic callback Category:
  Can't reproduce with current cvs, I'd say recent changes to fix
another crash related to FileSelector in gui-less scripts solved this
one, too.
#1028 - Reserved button event number:
  Menu choices generate two events, one extra related to the menu
itself, with value=4.  Made bpython ignore this extra event.
#1068 - FileSelector No file extension support:
  As Ton wrote there, Blender itself doesn't support this yet.  But the
requester also wanted Window.File/ImageSelector to accept a pathname.  Done.  Also updated doc.
#959 - Segfault on background rendering:
  This happened in bg mode (blender -b filename -a, for example) when
a script with the line "Blender.Redraw()" was linked to FRAMECHANGED events.  As reported in the bug page, it was because curarea is NULL in bg mode.  Made Redraw() check for this and not call functions that expected curarea in Redraw, like one to swap buffers.
#1072 - Blender.Redraw() Segfault:
  Good catch : ). Scripts called from the scripts win that called
Blender.Redraw() or Blender.Window.Redraw() would crash Blender because of a dirty pointer in Spacescript->script.  Fixed.
											 
										 
										
											2004-04-11 04:41:33 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									PyErr_SetString (  PyExc_AttributeError ,  name  ) ; 
							 
						 
					
						
							
								
									
										
											 
										
											
												BPython: cleaning some bug tracker entries:
(excuse me for doing all in a single commit, but they are tiny
fixes and it's bpython, that dark corner ...)
#1025 - FileSelector SEGV on dynamic callback Category:
  Can't reproduce with current cvs, I'd say recent changes to fix
another crash related to FileSelector in gui-less scripts solved this
one, too.
#1028 - Reserved button event number:
  Menu choices generate two events, one extra related to the menu
itself, with value=4.  Made bpython ignore this extra event.
#1068 - FileSelector No file extension support:
  As Ton wrote there, Blender itself doesn't support this yet.  But the
requester also wanted Window.File/ImageSelector to accept a pathname.  Done.  Also updated doc.
#959 - Segfault on background rendering:
  This happened in bg mode (blender -b filename -a, for example) when
a script with the line "Blender.Redraw()" was linked to FRAMECHANGED events.  As reported in the bug page, it was because curarea is NULL in bg mode.  Made Redraw() check for this and not call functions that expected curarea in Redraw, like one to swap buffers.
#1072 - Blender.Redraw() Segfault:
  Good catch : ). Scripts called from the scripts win that called
Blender.Redraw() or Blender.Window.Redraw() would crash Blender because of a dirty pointer in Spacescript->script.  Fixed.
											 
										 
										
											2004-04-11 04:41:33 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									return  NULL ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-05-08 03:06:46 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								static  int  Button_setattr (  PyObject  *  self ,  char  * name ,  PyObject  *  v  )  
						 
					
						
							
								
									
										
										
										
											2003-05-08 03:06:46 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								{  
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									Button  * but  =  (  Button  *  )  self ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if (  strcmp (  name ,  " val "  )  = =  0  )  { 
							 
						 
					
						
							
								
									
										
										
										
											2006-05-20 15:44:14 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										if (  but - > type  = =  BINT_TYPE  & &  PyNumber_Check ( v )  )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											PyObject  * pyVal  =  PyNumber_Int (  v  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											if  ( pyVal )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												but - > val . asint  =  ( int ) PyInt_AS_LONG (  pyVal  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2006-06-27 17:51:11 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
												Py_DECREF ( pyVal ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2006-05-20 15:44:14 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
												return  0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										else  if (  but - > type  = =  BFLOAT_TYPE  & &  PyNumber_Check ( v )  )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											PyObject  * pyVal  =  PyNumber_Float (  v  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											if  ( pyVal )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												but - > val . asfloat  =  ( float ) PyFloat_AS_DOUBLE (  pyVal  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2006-06-27 17:51:11 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
												Py_DECREF ( pyVal ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2006-05-20 15:44:14 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
												return  0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										else  if (  but - > type  = =  BVECTOR_TYPE  )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											if  (  PyArg_ParseTuple (  v ,  " fff " ,  but - > val . asvec ,  but - > val . asvec + 1 ,  but - > val . asvec + 2  )  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												return  0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										else  if (  but - > type  = =  BSTRING_TYPE  & &  PyString_Check ( v )  )  { 
							 
						 
					
						
							
								
									
										
										
										
											2008-04-04 23:12:20 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											char  * newstr  =  PyString_AsString ( v ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-04-05 14:49:41 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											size_t  newlen  =  strlen ( newstr ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2006-06-20 18:31:05 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											if  ( newlen + 1 >  UI_MAX_DRAW_STR ) 
							 
						 
					
						
							
								
									
										
										
										
											2006-06-27 17:51:11 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
												return  EXPP_ReturnIntError (  PyExc_ValueError ,  " Error: button string length exceeded max limit (399 chars) . " ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
											 
										
											
												BPython: cleaning some bug tracker entries:
(excuse me for doing all in a single commit, but they are tiny
fixes and it's bpython, that dark corner ...)
#1025 - FileSelector SEGV on dynamic callback Category:
  Can't reproduce with current cvs, I'd say recent changes to fix
another crash related to FileSelector in gui-less scripts solved this
one, too.
#1028 - Reserved button event number:
  Menu choices generate two events, one extra related to the menu
itself, with value=4.  Made bpython ignore this extra event.
#1068 - FileSelector No file extension support:
  As Ton wrote there, Blender itself doesn't support this yet.  But the
requester also wanted Window.File/ImageSelector to accept a pathname.  Done.  Also updated doc.
#959 - Segfault on background rendering:
  This happened in bg mode (blender -b filename -a, for example) when
a script with the line "Blender.Redraw()" was linked to FRAMECHANGED events.  As reported in the bug page, it was because curarea is NULL in bg mode.  Made Redraw() check for this and not call functions that expected curarea in Redraw, like one to swap buffers.
#1072 - Blender.Redraw() Segfault:
  Good catch : ). Scripts called from the scripts win that called
Blender.Redraw() or Blender.Window.Redraw() would crash Blender because of a dirty pointer in Spacescript->script.  Fixed.
											 
										 
										
											2004-04-11 04:41:33 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											/* if the length of the new string is the same as */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											/* the old one, just copy, else delete and realloc. */ 
							 
						 
					
						
							
								
									
										
										
										
											2006-05-20 15:44:14 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											if (  but - > slen  = =  newlen  )  { 
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
												BLI_strncpy (  but - > val . asstr ,  newstr , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													     but - > slen  +  1  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2006-06-27 17:51:11 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												return  0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											}  else  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												MEM_freeN (  but - > val . asstr  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2006-05-20 15:44:14 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
												but - > slen  =  newlen ; 
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
												but - > val . asstr  = 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													MEM_mallocN (  but - > slen  +  1 , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
														     " button setattr "  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												BLI_strncpy (  but - > val . asstr ,  newstr , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													     but - > slen  +  1  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2006-05-20 15:44:14 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												return  0 ; 
							 
						 
					
						
							
								
									
										
											 
										
											
												BPython: cleaning some bug tracker entries:
(excuse me for doing all in a single commit, but they are tiny
fixes and it's bpython, that dark corner ...)
#1025 - FileSelector SEGV on dynamic callback Category:
  Can't reproduce with current cvs, I'd say recent changes to fix
another crash related to FileSelector in gui-less scripts solved this
one, too.
#1028 - Reserved button event number:
  Menu choices generate two events, one extra related to the menu
itself, with value=4.  Made bpython ignore this extra event.
#1068 - FileSelector No file extension support:
  As Ton wrote there, Blender itself doesn't support this yet.  But the
requester also wanted Window.File/ImageSelector to accept a pathname.  Done.  Also updated doc.
#959 - Segfault on background rendering:
  This happened in bg mode (blender -b filename -a, for example) when
a script with the line "Blender.Redraw()" was linked to FRAMECHANGED events.  As reported in the bug page, it was because curarea is NULL in bg mode.  Made Redraw() check for this and not call functions that expected curarea in Redraw, like one to swap buffers.
#1072 - Blender.Redraw() Segfault:
  Good catch : ). Scripts called from the scripts win that called
Blender.Redraw() or Blender.Window.Redraw() would crash Blender because of a dirty pointer in Spacescript->script.  Fixed.
											 
										 
										
											2004-04-11 04:41:33 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										} 
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									}  else  { 
							 
						 
					
						
							
								
									
										
										
										
											2006-05-20 15:44:14 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										/*
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										 *  Accessing  the  wrong  attribute . 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										 */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  EXPP_ReturnIntError (  PyExc_AttributeError ,  name  ) ; 
							 
						 
					
						
							
								
									
										
											 
										
											
												BPython: cleaning some bug tracker entries:
(excuse me for doing all in a single commit, but they are tiny
fixes and it's bpython, that dark corner ...)
#1025 - FileSelector SEGV on dynamic callback Category:
  Can't reproduce with current cvs, I'd say recent changes to fix
another crash related to FileSelector in gui-less scripts solved this
one, too.
#1028 - Reserved button event number:
  Menu choices generate two events, one extra related to the menu
itself, with value=4.  Made bpython ignore this extra event.
#1068 - FileSelector No file extension support:
  As Ton wrote there, Blender itself doesn't support this yet.  But the
requester also wanted Window.File/ImageSelector to accept a pathname.  Done.  Also updated doc.
#959 - Segfault on background rendering:
  This happened in bg mode (blender -b filename -a, for example) when
a script with the line "Blender.Redraw()" was linked to FRAMECHANGED events.  As reported in the bug page, it was because curarea is NULL in bg mode.  Made Redraw() check for this and not call functions that expected curarea in Redraw, like one to swap buffers.
#1072 - Blender.Redraw() Segfault:
  Good catch : ). Scripts called from the scripts win that called
Blender.Redraw() or Blender.Window.Redraw() would crash Blender because of a dirty pointer in Spacescript->script.  Fixed.
											 
										 
										
											2004-04-11 04:41:33 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2006-05-20 15:44:14 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									/*
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									 *  Correct  attribute  but  value  is  incompatible  with  current  button  value . 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									 */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									return  EXPP_ReturnIntError (  PyExc_ValueError ,  " value incompatible with current button type "  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-05-08 03:06:46 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								static  PyObject  * Button_repr (  PyObject  *  self  )  
						 
					
						
							
								
									
										
										
										
											2003-05-08 03:06:46 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								{  
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									return  PyObject_Repr (  Button_getattr (  self ,  " val "  )  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-05-08 03:06:46 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2007-01-06 04:10:51 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								static  PyObject  * Button_richcmpr ( PyObject  * objectA ,  PyObject  * objectB ,  int  comparison_type )  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								{  
						 
					
						
							
								
									
										
										
										
											2007-07-21 23:24:08 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									PyObject  * ret ,  * valA = NULL ,  * valB = NULL ; 
							 
						 
					
						
							
								
									
										
										
										
											2007-01-06 04:10:51 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if  ( ButtonObject_Check ( objectA ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2007-07-21 23:24:08 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										objectA  =  valA  =  Button_getattr (  objectA ,  " val "  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2007-01-06 04:10:51 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if  ( ButtonObject_Check ( objectB ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2007-07-21 23:24:08 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										objectB  =  valB  =  Button_getattr (  objectB ,  " val "  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									ret  =  PyObject_RichCompare ( objectA ,  objectB ,  comparison_type ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									Py_XDECREF ( valA ) ;  /* Button_getattr created with 1 ref, we dont care about them now */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									Py_XDECREF ( valB ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									return  ret ; 
							 
						 
					
						
							
								
									
										
										
										
											2007-01-06 04:10:51 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								static  Button  * newbutton (  void  )  
						 
					
						
							
								
									
										
										
										
											2003-05-08 03:06:46 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								{  
						 
					
						
							
								
									
										
										
										
											2007-07-27 06:14:25 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									Button  * but  =  NULL ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									but  =  (  Button  *  )  PyObject_NEW (  Button ,  & Button_Type  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									but - > tooltip [ 0 ]  =  0 ;  /*NULL-terminate tooltip string*/ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									but - > tooltip [ 255 ]  =  0 ;  /*necassary to insure we always have a NULL-terminated string, as
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									                         according  to  the  docs  strncpy  doesn ' t  do  this  for  us . */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									return  but ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-05-08 03:06:46 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								/* GUI interface routines */  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								static  void  exit_pydraw (  SpaceScript  *  sc ,  short  err  )  
						 
					
						
							
								
									
										
										
										
											2003-05-08 03:06:46 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								{  
						 
					
						
							
								
									
										
											 
										
											
												BPython: cleaning some bug tracker entries:
(excuse me for doing all in a single commit, but they are tiny
fixes and it's bpython, that dark corner ...)
#1025 - FileSelector SEGV on dynamic callback Category:
  Can't reproduce with current cvs, I'd say recent changes to fix
another crash related to FileSelector in gui-less scripts solved this
one, too.
#1028 - Reserved button event number:
  Menu choices generate two events, one extra related to the menu
itself, with value=4.  Made bpython ignore this extra event.
#1068 - FileSelector No file extension support:
  As Ton wrote there, Blender itself doesn't support this yet.  But the
requester also wanted Window.File/ImageSelector to accept a pathname.  Done.  Also updated doc.
#959 - Segfault on background rendering:
  This happened in bg mode (blender -b filename -a, for example) when
a script with the line "Blender.Redraw()" was linked to FRAMECHANGED events.  As reported in the bug page, it was because curarea is NULL in bg mode.  Made Redraw() check for this and not call functions that expected curarea in Redraw, like one to swap buffers.
#1072 - Blender.Redraw() Segfault:
  Good catch : ). Scripts called from the scripts win that called
Blender.Redraw() or Blender.Window.Redraw() would crash Blender because of a dirty pointer in Spacescript->script.  Fixed.
											 
										 
										
											2004-04-11 04:41:33 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									Script  * script  =  NULL ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-05-08 03:06:46 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if (  ! sc  | |  ! sc - > script  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-12-14 01:18:09 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
											 
										
											
												BPython: cleaning some bug tracker entries:
(excuse me for doing all in a single commit, but they are tiny
fixes and it's bpython, that dark corner ...)
#1025 - FileSelector SEGV on dynamic callback Category:
  Can't reproduce with current cvs, I'd say recent changes to fix
another crash related to FileSelector in gui-less scripts solved this
one, too.
#1028 - Reserved button event number:
  Menu choices generate two events, one extra related to the menu
itself, with value=4.  Made bpython ignore this extra event.
#1068 - FileSelector No file extension support:
  As Ton wrote there, Blender itself doesn't support this yet.  But the
requester also wanted Window.File/ImageSelector to accept a pathname.  Done.  Also updated doc.
#959 - Segfault on background rendering:
  This happened in bg mode (blender -b filename -a, for example) when
a script with the line "Blender.Redraw()" was linked to FRAMECHANGED events.  As reported in the bug page, it was because curarea is NULL in bg mode.  Made Redraw() check for this and not call functions that expected curarea in Redraw, like one to swap buffers.
#1072 - Blender.Redraw() Segfault:
  Good catch : ). Scripts called from the scripts win that called
Blender.Redraw() or Blender.Window.Redraw() would crash Blender because of a dirty pointer in Spacescript->script.  Fixed.
											 
										 
										
											2004-04-11 04:41:33 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									script  =  sc - > script ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-12-14 01:18:09 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if (  err  )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										PyErr_Print (   ) ; 
							 
						 
					
						
							
								
									
										
											 
										
											
												BPython: cleaning some bug tracker entries:
(excuse me for doing all in a single commit, but they are tiny
fixes and it's bpython, that dark corner ...)
#1025 - FileSelector SEGV on dynamic callback Category:
  Can't reproduce with current cvs, I'd say recent changes to fix
another crash related to FileSelector in gui-less scripts solved this
one, too.
#1028 - Reserved button event number:
  Menu choices generate two events, one extra related to the menu
itself, with value=4.  Made bpython ignore this extra event.
#1068 - FileSelector No file extension support:
  As Ton wrote there, Blender itself doesn't support this yet.  But the
requester also wanted Window.File/ImageSelector to accept a pathname.  Done.  Also updated doc.
#959 - Segfault on background rendering:
  This happened in bg mode (blender -b filename -a, for example) when
a script with the line "Blender.Redraw()" was linked to FRAMECHANGED events.  As reported in the bug page, it was because curarea is NULL in bg mode.  Made Redraw() check for this and not call functions that expected curarea in Redraw, like one to swap buffers.
#1072 - Blender.Redraw() Segfault:
  Good catch : ). Scripts called from the scripts win that called
Blender.Redraw() or Blender.Window.Redraw() would crash Blender because of a dirty pointer in Spacescript->script.  Fixed.
											 
										 
										
											2004-04-11 04:41:33 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										script - > flags  =  0 ; 	/* mark script struct for deletion */ 
							 
						 
					
						
							
								
									
										
										
										
											2008-03-15 18:53:42 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										SCRIPT_SET_NULL ( script ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-05-31 12:12:03 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										script - > scriptname [ 0 ]  =  ' \0 ' ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										script - > scriptarg [ 0 ]  =  ' \0 ' ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-03-15 18:53:42 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										error_pyscript ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										scrarea_queue_redraw (  sc - > area  ) ; 
							 
						 
					
						
							
								
									
										
											 
										
											
												BPython: cleaning some bug tracker entries:
(excuse me for doing all in a single commit, but they are tiny
fixes and it's bpython, that dark corner ...)
#1025 - FileSelector SEGV on dynamic callback Category:
  Can't reproduce with current cvs, I'd say recent changes to fix
another crash related to FileSelector in gui-less scripts solved this
one, too.
#1028 - Reserved button event number:
  Menu choices generate two events, one extra related to the menu
itself, with value=4.  Made bpython ignore this extra event.
#1068 - FileSelector No file extension support:
  As Ton wrote there, Blender itself doesn't support this yet.  But the
requester also wanted Window.File/ImageSelector to accept a pathname.  Done.  Also updated doc.
#959 - Segfault on background rendering:
  This happened in bg mode (blender -b filename -a, for example) when
a script with the line "Blender.Redraw()" was linked to FRAMECHANGED events.  As reported in the bug page, it was because curarea is NULL in bg mode.  Made Redraw() check for this and not call functions that expected curarea in Redraw, like one to swap buffers.
#1072 - Blender.Redraw() Segfault:
  Good catch : ). Scripts called from the scripts win that called
Blender.Redraw() or Blender.Window.Redraw() would crash Blender because of a dirty pointer in Spacescript->script.  Fixed.
											 
										 
										
											2004-04-11 04:41:33 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2003-06-09 20:07:43 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2007-07-27 06:14:25 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									BPy_Set_DrawButtonsList ( sc - > but_refs ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									BPy_Free_DrawButtonsList ( ) ;  /*clear all temp button references*/ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									sc - > but_refs  =  NULL ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									Py_XDECREF (  (  PyObject  *  )  script - > py_draw  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									Py_XDECREF (  (  PyObject  *  )  script - > py_event  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									Py_XDECREF (  (  PyObject  *  )  script - > py_button  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-06-09 20:07:43 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
											 
										
											
												BPython: cleaning some bug tracker entries:
(excuse me for doing all in a single commit, but they are tiny
fixes and it's bpython, that dark corner ...)
#1025 - FileSelector SEGV on dynamic callback Category:
  Can't reproduce with current cvs, I'd say recent changes to fix
another crash related to FileSelector in gui-less scripts solved this
one, too.
#1028 - Reserved button event number:
  Menu choices generate two events, one extra related to the menu
itself, with value=4.  Made bpython ignore this extra event.
#1068 - FileSelector No file extension support:
  As Ton wrote there, Blender itself doesn't support this yet.  But the
requester also wanted Window.File/ImageSelector to accept a pathname.  Done.  Also updated doc.
#959 - Segfault on background rendering:
  This happened in bg mode (blender -b filename -a, for example) when
a script with the line "Blender.Redraw()" was linked to FRAMECHANGED events.  As reported in the bug page, it was because curarea is NULL in bg mode.  Made Redraw() check for this and not call functions that expected curarea in Redraw, like one to swap buffers.
#1072 - Blender.Redraw() Segfault:
  Good catch : ). Scripts called from the scripts win that called
Blender.Redraw() or Blender.Window.Redraw() would crash Blender because of a dirty pointer in Spacescript->script.  Fixed.
											 
										 
										
											2004-04-11 04:41:33 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									script - > py_draw  =  script - > py_event  =  script - > py_button  =  NULL ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-12-14 01:18:09 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								static  void  exec_callback (  SpaceScript  *  sc ,  PyObject  *  callback ,  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											   PyObject  *  args  ) 
							 
						 
					
						
							
								
									
										
										
										
											2003-12-14 01:18:09 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								{  
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									PyObject  * result  =  PyObject_CallObject (  callback ,  args  ) ; 
							 
						 
					
						
							
								
									
										
											 
										
											
												BPython: cleaning some bug tracker entries:
(excuse me for doing all in a single commit, but they are tiny
fixes and it's bpython, that dark corner ...)
#1025 - FileSelector SEGV on dynamic callback Category:
  Can't reproduce with current cvs, I'd say recent changes to fix
another crash related to FileSelector in gui-less scripts solved this
one, too.
#1028 - Reserved button event number:
  Menu choices generate two events, one extra related to the menu
itself, with value=4.  Made bpython ignore this extra event.
#1068 - FileSelector No file extension support:
  As Ton wrote there, Blender itself doesn't support this yet.  But the
requester also wanted Window.File/ImageSelector to accept a pathname.  Done.  Also updated doc.
#959 - Segfault on background rendering:
  This happened in bg mode (blender -b filename -a, for example) when
a script with the line "Blender.Redraw()" was linked to FRAMECHANGED events.  As reported in the bug page, it was because curarea is NULL in bg mode.  Made Redraw() check for this and not call functions that expected curarea in Redraw, like one to swap buffers.
#1072 - Blender.Redraw() Segfault:
  Good catch : ). Scripts called from the scripts win that called
Blender.Redraw() or Blender.Window.Redraw() would crash Blender because of a dirty pointer in Spacescript->script.  Fixed.
											 
										 
										
											2004-04-11 04:41:33 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if (  result  = =  NULL  & &  sc - > script  )  { 	/* errors in the script */ 
							 
						 
					
						
							
								
									
										
											 
										
											
												BPython: cleaning some bug tracker entries:
(excuse me for doing all in a single commit, but they are tiny
fixes and it's bpython, that dark corner ...)
#1025 - FileSelector SEGV on dynamic callback Category:
  Can't reproduce with current cvs, I'd say recent changes to fix
another crash related to FileSelector in gui-less scripts solved this
one, too.
#1028 - Reserved button event number:
  Menu choices generate two events, one extra related to the menu
itself, with value=4.  Made bpython ignore this extra event.
#1068 - FileSelector No file extension support:
  As Ton wrote there, Blender itself doesn't support this yet.  But the
requester also wanted Window.File/ImageSelector to accept a pathname.  Done.  Also updated doc.
#959 - Segfault on background rendering:
  This happened in bg mode (blender -b filename -a, for example) when
a script with the line "Blender.Redraw()" was linked to FRAMECHANGED events.  As reported in the bug page, it was because curarea is NULL in bg mode.  Made Redraw() check for this and not call functions that expected curarea in Redraw, like one to swap buffers.
#1072 - Blender.Redraw() Segfault:
  Good catch : ). Scripts called from the scripts win that called
Blender.Redraw() or Blender.Window.Redraw() would crash Blender because of a dirty pointer in Spacescript->script.  Fixed.
											 
										 
										
											2004-04-11 04:41:33 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										if (  sc - > script - > lastspace  = =  SPACE_TEXT  )  { 	/*if it can be an ALT+P script */ 
							 
						 
					
						
							
								
									
										
											 
										
											
												BPython: cleaning some bug tracker entries:
(excuse me for doing all in a single commit, but they are tiny
fixes and it's bpython, that dark corner ...)
#1025 - FileSelector SEGV on dynamic callback Category:
  Can't reproduce with current cvs, I'd say recent changes to fix
another crash related to FileSelector in gui-less scripts solved this
one, too.
#1028 - Reserved button event number:
  Menu choices generate two events, one extra related to the menu
itself, with value=4.  Made bpython ignore this extra event.
#1068 - FileSelector No file extension support:
  As Ton wrote there, Blender itself doesn't support this yet.  But the
requester also wanted Window.File/ImageSelector to accept a pathname.  Done.  Also updated doc.
#959 - Segfault on background rendering:
  This happened in bg mode (blender -b filename -a, for example) when
a script with the line "Blender.Redraw()" was linked to FRAMECHANGED events.  As reported in the bug page, it was because curarea is NULL in bg mode.  Made Redraw() check for this and not call functions that expected curarea in Redraw, like one to swap buffers.
#1072 - Blender.Redraw() Segfault:
  Good catch : ). Scripts called from the scripts win that called
Blender.Redraw() or Blender.Window.Redraw() would crash Blender because of a dirty pointer in Spacescript->script.  Fixed.
											 
										 
										
											2004-04-11 04:41:33 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											Text  * text  =  G . main - > text . first ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											while (  text  )  { 	/* find it and free its compiled code */ 
							 
						 
					
						
							
								
									
										
											 
										
											
												BPython: cleaning some bug tracker entries:
(excuse me for doing all in a single commit, but they are tiny
fixes and it's bpython, that dark corner ...)
#1025 - FileSelector SEGV on dynamic callback Category:
  Can't reproduce with current cvs, I'd say recent changes to fix
another crash related to FileSelector in gui-less scripts solved this
one, too.
#1028 - Reserved button event number:
  Menu choices generate two events, one extra related to the menu
itself, with value=4.  Made bpython ignore this extra event.
#1068 - FileSelector No file extension support:
  As Ton wrote there, Blender itself doesn't support this yet.  But the
requester also wanted Window.File/ImageSelector to accept a pathname.  Done.  Also updated doc.
#959 - Segfault on background rendering:
  This happened in bg mode (blender -b filename -a, for example) when
a script with the line "Blender.Redraw()" was linked to FRAMECHANGED events.  As reported in the bug page, it was because curarea is NULL in bg mode.  Made Redraw() check for this and not call functions that expected curarea in Redraw, like one to swap buffers.
#1072 - Blender.Redraw() Segfault:
  Good catch : ). Scripts called from the scripts win that called
Blender.Redraw() or Blender.Window.Redraw() would crash Blender because of a dirty pointer in Spacescript->script.  Fixed.
											 
										 
										
											2004-04-11 04:41:33 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
												if (  ! strcmp 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												    (  text - > id . name  +  2 , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												      sc - > script - > id . name  +  2  )  )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													BPY_free_compiled_text (  text  ) ; 
							 
						 
					
						
							
								
									
										
											 
										
											
												BPython: cleaning some bug tracker entries:
(excuse me for doing all in a single commit, but they are tiny
fixes and it's bpython, that dark corner ...)
#1025 - FileSelector SEGV on dynamic callback Category:
  Can't reproduce with current cvs, I'd say recent changes to fix
another crash related to FileSelector in gui-less scripts solved this
one, too.
#1028 - Reserved button event number:
  Menu choices generate two events, one extra related to the menu
itself, with value=4.  Made bpython ignore this extra event.
#1068 - FileSelector No file extension support:
  As Ton wrote there, Blender itself doesn't support this yet.  But the
requester also wanted Window.File/ImageSelector to accept a pathname.  Done.  Also updated doc.
#959 - Segfault on background rendering:
  This happened in bg mode (blender -b filename -a, for example) when
a script with the line "Blender.Redraw()" was linked to FRAMECHANGED events.  As reported in the bug page, it was because curarea is NULL in bg mode.  Made Redraw() check for this and not call functions that expected curarea in Redraw, like one to swap buffers.
#1072 - Blender.Redraw() Segfault:
  Good catch : ). Scripts called from the scripts win that called
Blender.Redraw() or Blender.Window.Redraw() would crash Blender because of a dirty pointer in Spacescript->script.  Fixed.
											 
										 
										
											2004-04-11 04:41:33 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
													break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												text  =  text - > id . next ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											} 
							 
						 
					
						
							
								
									
										
										
										
											2003-12-14 01:18:09 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										} 
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										exit_pydraw (  sc ,  1  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-12-14 01:18:09 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2004-03-29 08:16:18 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									Py_XDECREF (  result  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									Py_DECREF (  args  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-05-08 03:06:46 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2003-12-14 01:18:09 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								/* BPY_spacescript_do_pywin_draw, the static spacescript_do_pywin_buttons and
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								 *  BPY_spacescript_do_pywin_event  are  the  three  functions  responsible  for 
							 
						 
					
						
							
								
									
										
										
										
											2003-05-13 01:54:28 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								 *  calling  the  draw ,  buttons  and  event  callbacks  registered  with  Draw . Register 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								 *  ( see  Method_Register  below ) .   They  are  called  ( only  the  two  BPY_  ones ) 
							 
						 
					
						
							
								
									
										
										
										
											2003-12-14 01:18:09 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								 *  from  blender / src / drawscript . c  */ 
							 
						 
					
						
							
								
									
										
										
										
											2003-05-08 03:06:46 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								void  BPY_spacescript_do_pywin_draw (  SpaceScript  *  sc  )  
						 
					
						
							
								
									
										
										
										
											2003-05-08 03:06:46 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								{  
						 
					
						
							
								
									
										
											 
										
											
												BPython: cleaning some bug tracker entries:
(excuse me for doing all in a single commit, but they are tiny
fixes and it's bpython, that dark corner ...)
#1025 - FileSelector SEGV on dynamic callback Category:
  Can't reproduce with current cvs, I'd say recent changes to fix
another crash related to FileSelector in gui-less scripts solved this
one, too.
#1028 - Reserved button event number:
  Menu choices generate two events, one extra related to the menu
itself, with value=4.  Made bpython ignore this extra event.
#1068 - FileSelector No file extension support:
  As Ton wrote there, Blender itself doesn't support this yet.  But the
requester also wanted Window.File/ImageSelector to accept a pathname.  Done.  Also updated doc.
#959 - Segfault on background rendering:
  This happened in bg mode (blender -b filename -a, for example) when
a script with the line "Blender.Redraw()" was linked to FRAMECHANGED events.  As reported in the bug page, it was because curarea is NULL in bg mode.  Made Redraw() check for this and not call functions that expected curarea in Redraw, like one to swap buffers.
#1072 - Blender.Redraw() Segfault:
  Good catch : ). Scripts called from the scripts win that called
Blender.Redraw() or Blender.Window.Redraw() would crash Blender because of a dirty pointer in Spacescript->script.  Fixed.
											 
										 
										
											2004-04-11 04:41:33 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									uiBlock  * block ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									char  butblock [ 20 ] ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									Script  * script  =  sc - > script ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-02-23 12:05:28 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									PyGILState_STATE  gilstate  =  PyGILState_Ensure ( ) ; 
							 
						 
					
						
							
								
									
										
											 
										
											
												BPython: cleaning some bug tracker entries:
(excuse me for doing all in a single commit, but they are tiny
fixes and it's bpython, that dark corner ...)
#1025 - FileSelector SEGV on dynamic callback Category:
  Can't reproduce with current cvs, I'd say recent changes to fix
another crash related to FileSelector in gui-less scripts solved this
one, too.
#1028 - Reserved button event number:
  Menu choices generate two events, one extra related to the menu
itself, with value=4.  Made bpython ignore this extra event.
#1068 - FileSelector No file extension support:
  As Ton wrote there, Blender itself doesn't support this yet.  But the
requester also wanted Window.File/ImageSelector to accept a pathname.  Done.  Also updated doc.
#959 - Segfault on background rendering:
  This happened in bg mode (blender -b filename -a, for example) when
a script with the line "Blender.Redraw()" was linked to FRAMECHANGED events.  As reported in the bug page, it was because curarea is NULL in bg mode.  Made Redraw() check for this and not call functions that expected curarea in Redraw, like one to swap buffers.
#1072 - Blender.Redraw() Segfault:
  Good catch : ). Scripts called from the scripts win that called
Blender.Redraw() or Blender.Window.Redraw() would crash Blender because of a dirty pointer in Spacescript->script.  Fixed.
											 
										 
										
											2004-04-11 04:41:33 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									sprintf (  butblock ,  " win %d " ,  curarea - > win  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									block  =  uiNewBlock (  & curarea - > uiblocks ,  butblock ,  UI_EMBOSSX , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											    UI_HELV ,  curarea - > win  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if (  script - > py_draw  )  { 
							 
						 
					
						
							
								
									
										
										
										
											2007-07-27 06:14:25 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										if  ( sc - > but_refs )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											BPy_Set_DrawButtonsList ( sc - > but_refs ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											BPy_Free_DrawButtonsList ( ) ;  /*clear all temp button references*/ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										sc - > but_refs  =  PyList_New ( 0 ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										BPy_Set_DrawButtonsList ( sc - > but_refs ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										glPushAttrib (  GL_ALL_ATTRIB_BITS  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										exec_callback (  sc ,  script - > py_draw ,  Py_BuildValue (  " () "  )  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										glPopAttrib (   ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									}  else  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										glClearColor (  0.4375 ,  0.4375 ,  0.4375 ,  0.0  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										glClear (  GL_COLOR_BUFFER_BIT  ) ; 
							 
						 
					
						
							
								
									
										
											 
										
											
												BPython: cleaning some bug tracker entries:
(excuse me for doing all in a single commit, but they are tiny
fixes and it's bpython, that dark corner ...)
#1025 - FileSelector SEGV on dynamic callback Category:
  Can't reproduce with current cvs, I'd say recent changes to fix
another crash related to FileSelector in gui-less scripts solved this
one, too.
#1028 - Reserved button event number:
  Menu choices generate two events, one extra related to the menu
itself, with value=4.  Made bpython ignore this extra event.
#1068 - FileSelector No file extension support:
  As Ton wrote there, Blender itself doesn't support this yet.  But the
requester also wanted Window.File/ImageSelector to accept a pathname.  Done.  Also updated doc.
#959 - Segfault on background rendering:
  This happened in bg mode (blender -b filename -a, for example) when
a script with the line "Blender.Redraw()" was linked to FRAMECHANGED events.  As reported in the bug page, it was because curarea is NULL in bg mode.  Made Redraw() check for this and not call functions that expected curarea in Redraw, like one to swap buffers.
#1072 - Blender.Redraw() Segfault:
  Good catch : ). Scripts called from the scripts win that called
Blender.Redraw() or Blender.Window.Redraw() would crash Blender because of a dirty pointer in Spacescript->script.  Fixed.
											 
										 
										
											2004-04-11 04:41:33 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									uiDrawBlock (  block  ) ; 
							 
						 
					
						
							
								
									
										
											 
										
											
												BPython: cleaning some bug tracker entries:
(excuse me for doing all in a single commit, but they are tiny
fixes and it's bpython, that dark corner ...)
#1025 - FileSelector SEGV on dynamic callback Category:
  Can't reproduce with current cvs, I'd say recent changes to fix
another crash related to FileSelector in gui-less scripts solved this
one, too.
#1028 - Reserved button event number:
  Menu choices generate two events, one extra related to the menu
itself, with value=4.  Made bpython ignore this extra event.
#1068 - FileSelector No file extension support:
  As Ton wrote there, Blender itself doesn't support this yet.  But the
requester also wanted Window.File/ImageSelector to accept a pathname.  Done.  Also updated doc.
#959 - Segfault on background rendering:
  This happened in bg mode (blender -b filename -a, for example) when
a script with the line "Blender.Redraw()" was linked to FRAMECHANGED events.  As reported in the bug page, it was because curarea is NULL in bg mode.  Made Redraw() check for this and not call functions that expected curarea in Redraw, like one to swap buffers.
#1072 - Blender.Redraw() Segfault:
  Good catch : ). Scripts called from the scripts win that called
Blender.Redraw() or Blender.Window.Redraw() would crash Blender because of a dirty pointer in Spacescript->script.  Fixed.
											 
										 
										
											2004-04-11 04:41:33 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									curarea - > win_swap  =  WIN_BACK_OK ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-02-23 12:05:28 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									PyGILState_Release ( gilstate ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-05-08 03:06:46 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								static  void  spacescript_do_pywin_buttons (  SpaceScript  *  sc ,  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													  unsigned  short  event  ) 
							 
						 
					
						
							
								
									
										
										
										
											2003-05-08 03:06:46 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								{  
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if (  sc - > script - > py_button  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										exec_callback (  sc ,  sc - > script - > py_button , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											       Py_BuildValue (  " (i) " ,  event  )  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-05-08 03:06:46 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								void  BPY_spacescript_do_pywin_event (  SpaceScript  *  sc ,  unsigned  short  event ,  
						 
					
						
							
								
									
										
											 
										
											
												BPython:
- Made Blender.event var (previously only used by script links) hold ascii value -- where it applies -- of current event during events callback registered with Draw.Register(gui, events, button_events).  Useful for gui scripts like Campbell's Python console. No problem using this var to hold the value, since in gui scripts it was not used (always None).
- Updated Window and Window.Theme with new theme vars and the Time space.
- Script links:
-- Added "Render" event for script links (runs twice, second time as "PostEvent", for clean-up actions). Now FrameChanged links don't run when a single pic is rendered.
-- Added "Enable Script Links" button in the script buttons tab.  Now this bit gets saved in .blends along with the rest of G.f, so users can define per .blend if they are on or off by default.  "blender -y" also disables all slinks as happened before with OnLoad ones only.
-- Other small changes in the script buttons tab:
  When a link is added (button "new"), it becomes the active one for the window, no need to press a button to reach it.
  Also, a pupmenu showing all available texts is shown when "new" is pressed, so users can choose a text w/o having to type.  Cancel the popup to leave the string button empty (link exists, but has no script assigned).  A pulldown would be better UI-wise, but it's kinda weird to show both scripts and normal texts (Blender doesn't differentiate them) in a script links pulldown.  With a popup we can show only texts ending in ".py" (not done in this commit, need opinions) and if the script has no or another extension, case of many in old and current .blend's, there's still the string box for writing its name.
-- Implemented Ton's space handler script links:
Right now only for the 3d View,  but it's trivial to add for others.  There are two types: EVENT, to receive 3d View events from a chosen window and DRAW, to draw on the window.  Ton's idea was to give scripts a controlled way to integrate better within Blender.
Here's how it works:
- scripts must have a proper header, like:
# SPACEHANDLER.VIEW3D.EVENT
and then they are shown in 3d View's View menu, "Space Handler Scripts" submenu.  Check (mark, click on it) a script to make it active.
EVENT handlers should consult the Blender.event var to get the current event, which can be compared with values from the Draw module:
import Blender
from Blender import Draw
evt = Blender.event
if evt == Draw.AKEY:
  print "a"
elif evt == Draw.LEFTMOUSE:
  print "left mouse button"
else:
  return # ignore, pass event back to Blender
Blender.event = None # tell Blender not to process itself the event
DRAW handlers are free to draw to their owner 3D View. OpenGL attributes and modelview and projection matrices are pushed before running the handler and poped when it finishes.
To communicate between EVENT and DRAW handler scripts we have the Blender.Registry module, as always.
Still need to code some nice example, which should also serve to test properly space handlers.  Simple tests went fine.
- doc updates about the additions.
=======
Note: the UI part of the space handlers and script links is of course open for changes, I just tried to make it understandable.  Probably we won't use the scriptlinks icon for "None Available" (check 3d View -> View -> Space Handler Scripts), though it hints at what space handlers are.  The tooltips may not be accepted either, since other menus don't use them.  Opinions welcomed.
											 
										 
										
											2005-05-08 21:20:34 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									short  val ,  char  ascii  ) 
							 
						 
					
						
							
								
									
										
										
										
											2003-05-08 03:06:46 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								{  
						 
					
						
							
								
									
										
										
										
											2008-02-23 12:05:28 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									PyGILState_STATE  gilstate  =  PyGILState_Ensure ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if (  event  = =  QKEY  & &  G . qual  &  (  LR_ALTKEY  |  LR_CTRLKEY  )  )  { 
							 
						 
					
						
							
								
									
										
											 
										
											
												BPython: cleaning some bug tracker entries:
(excuse me for doing all in a single commit, but they are tiny
fixes and it's bpython, that dark corner ...)
#1025 - FileSelector SEGV on dynamic callback Category:
  Can't reproduce with current cvs, I'd say recent changes to fix
another crash related to FileSelector in gui-less scripts solved this
one, too.
#1028 - Reserved button event number:
  Menu choices generate two events, one extra related to the menu
itself, with value=4.  Made bpython ignore this extra event.
#1068 - FileSelector No file extension support:
  As Ton wrote there, Blender itself doesn't support this yet.  But the
requester also wanted Window.File/ImageSelector to accept a pathname.  Done.  Also updated doc.
#959 - Segfault on background rendering:
  This happened in bg mode (blender -b filename -a, for example) when
a script with the line "Blender.Redraw()" was linked to FRAMECHANGED events.  As reported in the bug page, it was because curarea is NULL in bg mode.  Made Redraw() check for this and not call functions that expected curarea in Redraw, like one to swap buffers.
#1072 - Blender.Redraw() Segfault:
  Good catch : ). Scripts called from the scripts win that called
Blender.Redraw() or Blender.Window.Redraw() would crash Blender because of a dirty pointer in Spacescript->script.  Fixed.
											 
										 
										
											2004-04-11 04:41:33 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										/* finish script: user pressed ALT+Q or CONTROL+Q */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										Script  * script  =  sc - > script ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-12-14 01:18:09 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										exit_pydraw (  sc ,  0  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-05-08 03:06:46 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
											 
										
											
												BPython: cleaning some bug tracker entries:
(excuse me for doing all in a single commit, but they are tiny
fixes and it's bpython, that dark corner ...)
#1025 - FileSelector SEGV on dynamic callback Category:
  Can't reproduce with current cvs, I'd say recent changes to fix
another crash related to FileSelector in gui-less scripts solved this
one, too.
#1028 - Reserved button event number:
  Menu choices generate two events, one extra related to the menu
itself, with value=4.  Made bpython ignore this extra event.
#1068 - FileSelector No file extension support:
  As Ton wrote there, Blender itself doesn't support this yet.  But the
requester also wanted Window.File/ImageSelector to accept a pathname.  Done.  Also updated doc.
#959 - Segfault on background rendering:
  This happened in bg mode (blender -b filename -a, for example) when
a script with the line "Blender.Redraw()" was linked to FRAMECHANGED events.  As reported in the bug page, it was because curarea is NULL in bg mode.  Made Redraw() check for this and not call functions that expected curarea in Redraw, like one to swap buffers.
#1072 - Blender.Redraw() Segfault:
  Good catch : ). Scripts called from the scripts win that called
Blender.Redraw() or Blender.Window.Redraw() would crash Blender because of a dirty pointer in Spacescript->script.  Fixed.
											 
										 
										
											2004-04-11 04:41:33 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										script - > flags  & =  ~ SCRIPT_GUI ; 	/* we're done with this script */ 
							 
						 
					
						
							
								
									
										
										
										
											2003-12-14 01:18:09 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2008-02-23 12:05:28 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										PyGILState_Release ( gilstate ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
											 
										
											
												BPython: cleaning some bug tracker entries:
(excuse me for doing all in a single commit, but they are tiny
fixes and it's bpython, that dark corner ...)
#1025 - FileSelector SEGV on dynamic callback Category:
  Can't reproduce with current cvs, I'd say recent changes to fix
another crash related to FileSelector in gui-less scripts solved this
one, too.
#1028 - Reserved button event number:
  Menu choices generate two events, one extra related to the menu
itself, with value=4.  Made bpython ignore this extra event.
#1068 - FileSelector No file extension support:
  As Ton wrote there, Blender itself doesn't support this yet.  But the
requester also wanted Window.File/ImageSelector to accept a pathname.  Done.  Also updated doc.
#959 - Segfault on background rendering:
  This happened in bg mode (blender -b filename -a, for example) when
a script with the line "Blender.Redraw()" was linked to FRAMECHANGED events.  As reported in the bug page, it was because curarea is NULL in bg mode.  Made Redraw() check for this and not call functions that expected curarea in Redraw, like one to swap buffers.
#1072 - Blender.Redraw() Segfault:
  Good catch : ). Scripts called from the scripts win that called
Blender.Redraw() or Blender.Window.Redraw() would crash Blender because of a dirty pointer in Spacescript->script.  Fixed.
											 
										 
										
											2004-04-11 04:41:33 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										return ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
											 
										
											
												BPython bug fixes:
- #2646 reported by Campbell: Python/Fileselector (moving from fileselector called by script to another space caused script to hang around open but not accessible)
http://projects.blender.org/tracker/?func=detail&atid=125&aid=2646&group_id=9
- #2676 reported by Wim Van Hoydonck: 2.37 python scripts gui: event 8 ignored (thanks Ton for discussing / pointing what to do, Ken Hughes for also working on a fix)
http://projects.blender.org/tracker/?func=detail&atid=125&aid=2676&group_id=9
- gui-less scripts with calls to progress bar inside fileselector callbacks didn't return to the previous space on exit (staying on Scripts win), requiring an event to do so (mouse movement, for example).  Quick fix for now, will rework a little after 2.37a for a better alternative, not needing to move to the Scripts win at all.
- added syntax colors access to Window.Theme module.
Scripts:
- updates by Jean-Michel Soler: svg2obj (svg paths import), tex2uvbaker, fixfromarmature;
- updates by Campbell Barton: obj import / export, console;
- tiny: converted vrml97 export to unix line endings;
- updates in ac3d exporter, help browser, save theme.
Thanks all mentioned above.
											 
										 
										
											2005-06-11 05:30:14 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if  ( val )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2007-12-11 23:05:10 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										if  ( uiDoBlocks (  & curarea - > uiblocks ,  event ,  1  )  ! =  UI_NOTHING )  event  =  0 ; 
							 
						 
					
						
							
								
									
										
											 
										
											
												BPython: cleaning some bug tracker entries:
(excuse me for doing all in a single commit, but they are tiny
fixes and it's bpython, that dark corner ...)
#1025 - FileSelector SEGV on dynamic callback Category:
  Can't reproduce with current cvs, I'd say recent changes to fix
another crash related to FileSelector in gui-less scripts solved this
one, too.
#1028 - Reserved button event number:
  Menu choices generate two events, one extra related to the menu
itself, with value=4.  Made bpython ignore this extra event.
#1068 - FileSelector No file extension support:
  As Ton wrote there, Blender itself doesn't support this yet.  But the
requester also wanted Window.File/ImageSelector to accept a pathname.  Done.  Also updated doc.
#959 - Segfault on background rendering:
  This happened in bg mode (blender -b filename -a, for example) when
a script with the line "Blender.Redraw()" was linked to FRAMECHANGED events.  As reported in the bug page, it was because curarea is NULL in bg mode.  Made Redraw() check for this and not call functions that expected curarea in Redraw, like one to swap buffers.
#1072 - Blender.Redraw() Segfault:
  Good catch : ). Scripts called from the scripts win that called
Blender.Redraw() or Blender.Window.Redraw() would crash Blender because of a dirty pointer in Spacescript->script.  Fixed.
											 
										 
										
											2004-04-11 04:41:33 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
											 
										
											
												BPython bug fixes:
- #2646 reported by Campbell: Python/Fileselector (moving from fileselector called by script to another space caused script to hang around open but not accessible)
http://projects.blender.org/tracker/?func=detail&atid=125&aid=2646&group_id=9
- #2676 reported by Wim Van Hoydonck: 2.37 python scripts gui: event 8 ignored (thanks Ton for discussing / pointing what to do, Ken Hughes for also working on a fix)
http://projects.blender.org/tracker/?func=detail&atid=125&aid=2676&group_id=9
- gui-less scripts with calls to progress bar inside fileselector callbacks didn't return to the previous space on exit (staying on Scripts win), requiring an event to do so (mouse movement, for example).  Quick fix for now, will rework a little after 2.37a for a better alternative, not needing to move to the Scripts win at all.
- added syntax colors access to Window.Theme module.
Scripts:
- updates by Jean-Michel Soler: svg2obj (svg paths import), tex2uvbaker, fixfromarmature;
- updates by Campbell Barton: obj import / export, console;
- tiny: converted vrml97 export to unix line endings;
- updates in ac3d exporter, help browser, save theme.
Thanks all mentioned above.
											 
										 
										
											2005-06-11 05:30:14 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										if  ( event  = =  UI_BUT_EVENT )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											/* check that event is in free range for script button events;
 
							 
						 
					
						
							
								
									
										
										
										
											2007-07-27 06:14:25 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											 *  read  the  comment  before  check_button_event ( )  below  to  understand  */ 
							 
						 
					
						
							
								
									
										
											 
										
											
												BPython bug fixes:
- #2646 reported by Campbell: Python/Fileselector (moving from fileselector called by script to another space caused script to hang around open but not accessible)
http://projects.blender.org/tracker/?func=detail&atid=125&aid=2646&group_id=9
- #2676 reported by Wim Van Hoydonck: 2.37 python scripts gui: event 8 ignored (thanks Ton for discussing / pointing what to do, Ken Hughes for also working on a fix)
http://projects.blender.org/tracker/?func=detail&atid=125&aid=2676&group_id=9
- gui-less scripts with calls to progress bar inside fileselector callbacks didn't return to the previous space on exit (staying on Scripts win), requiring an event to do so (mouse movement, for example).  Quick fix for now, will rework a little after 2.37a for a better alternative, not needing to move to the Scripts win at all.
- added syntax colors access to Window.Theme module.
Scripts:
- updates by Jean-Michel Soler: svg2obj (svg paths import), tex2uvbaker, fixfromarmature;
- updates by Campbell Barton: obj import / export, console;
- tiny: converted vrml97 export to unix line endings;
- updates in ac3d exporter, help browser, save theme.
Thanks all mentioned above.
											 
										 
										
											2005-06-11 05:30:14 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											if  ( val  > =  EXPP_BUTTON_EVENTS_OFFSET  & &  val  <  0x4000 ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												spacescript_do_pywin_buttons ( sc ,  val  -  EXPP_BUTTON_EVENTS_OFFSET ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-02-23 12:05:28 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											PyGILState_Release ( gilstate ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
											 
										
											
												BPython bug fixes:
- #2646 reported by Campbell: Python/Fileselector (moving from fileselector called by script to another space caused script to hang around open but not accessible)
http://projects.blender.org/tracker/?func=detail&atid=125&aid=2646&group_id=9
- #2676 reported by Wim Van Hoydonck: 2.37 python scripts gui: event 8 ignored (thanks Ton for discussing / pointing what to do, Ken Hughes for also working on a fix)
http://projects.blender.org/tracker/?func=detail&atid=125&aid=2676&group_id=9
- gui-less scripts with calls to progress bar inside fileselector callbacks didn't return to the previous space on exit (staying on Scripts win), requiring an event to do so (mouse movement, for example).  Quick fix for now, will rework a little after 2.37a for a better alternative, not needing to move to the Scripts win at all.
- added syntax colors access to Window.Theme module.
Scripts:
- updates by Jean-Michel Soler: svg2obj (svg paths import), tex2uvbaker, fixfromarmature;
- updates by Campbell Barton: obj import / export, console;
- tiny: converted vrml97 export to unix line endings;
- updates in ac3d exporter, help browser, save theme.
Thanks all mentioned above.
											 
										 
										
											2005-06-11 05:30:14 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											return ; 
							 
						 
					
						
							
								
									
										
											 
										
											
												BPython: cleaning some bug tracker entries:
(excuse me for doing all in a single commit, but they are tiny
fixes and it's bpython, that dark corner ...)
#1025 - FileSelector SEGV on dynamic callback Category:
  Can't reproduce with current cvs, I'd say recent changes to fix
another crash related to FileSelector in gui-less scripts solved this
one, too.
#1028 - Reserved button event number:
  Menu choices generate two events, one extra related to the menu
itself, with value=4.  Made bpython ignore this extra event.
#1068 - FileSelector No file extension support:
  As Ton wrote there, Blender itself doesn't support this yet.  But the
requester also wanted Window.File/ImageSelector to accept a pathname.  Done.  Also updated doc.
#959 - Segfault on background rendering:
  This happened in bg mode (blender -b filename -a, for example) when
a script with the line "Blender.Redraw()" was linked to FRAMECHANGED events.  As reported in the bug page, it was because curarea is NULL in bg mode.  Made Redraw() check for this and not call functions that expected curarea in Redraw, like one to swap buffers.
#1072 - Blender.Redraw() Segfault:
  Good catch : ). Scripts called from the scripts win that called
Blender.Redraw() or Blender.Window.Redraw() would crash Blender because of a dirty pointer in Spacescript->script.  Fixed.
											 
										 
										
											2004-04-11 04:41:33 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
											 
										
											
												BPython bug fixes:
- #2646 reported by Campbell: Python/Fileselector (moving from fileselector called by script to another space caused script to hang around open but not accessible)
http://projects.blender.org/tracker/?func=detail&atid=125&aid=2646&group_id=9
- #2676 reported by Wim Van Hoydonck: 2.37 python scripts gui: event 8 ignored (thanks Ton for discussing / pointing what to do, Ken Hughes for also working on a fix)
http://projects.blender.org/tracker/?func=detail&atid=125&aid=2676&group_id=9
- gui-less scripts with calls to progress bar inside fileselector callbacks didn't return to the previous space on exit (staying on Scripts win), requiring an event to do so (mouse movement, for example).  Quick fix for now, will rework a little after 2.37a for a better alternative, not needing to move to the Scripts win at all.
- added syntax colors access to Window.Theme module.
Scripts:
- updates by Jean-Michel Soler: svg2obj (svg paths import), tex2uvbaker, fixfromarmature;
- updates by Campbell Barton: obj import / export, console;
- tiny: converted vrml97 export to unix line endings;
- updates in ac3d exporter, help browser, save theme.
Thanks all mentioned above.
											 
										 
										
											2005-06-11 05:30:14 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									/* We use the "event" main module var, used by scriptlinks, to pass the ascii
 
							 
						 
					
						
							
								
									
										
											 
										
											
												BPython:
- Made Blender.event var (previously only used by script links) hold ascii value -- where it applies -- of current event during events callback registered with Draw.Register(gui, events, button_events).  Useful for gui scripts like Campbell's Python console. No problem using this var to hold the value, since in gui scripts it was not used (always None).
- Updated Window and Window.Theme with new theme vars and the Time space.
- Script links:
-- Added "Render" event for script links (runs twice, second time as "PostEvent", for clean-up actions). Now FrameChanged links don't run when a single pic is rendered.
-- Added "Enable Script Links" button in the script buttons tab.  Now this bit gets saved in .blends along with the rest of G.f, so users can define per .blend if they are on or off by default.  "blender -y" also disables all slinks as happened before with OnLoad ones only.
-- Other small changes in the script buttons tab:
  When a link is added (button "new"), it becomes the active one for the window, no need to press a button to reach it.
  Also, a pupmenu showing all available texts is shown when "new" is pressed, so users can choose a text w/o having to type.  Cancel the popup to leave the string button empty (link exists, but has no script assigned).  A pulldown would be better UI-wise, but it's kinda weird to show both scripts and normal texts (Blender doesn't differentiate them) in a script links pulldown.  With a popup we can show only texts ending in ".py" (not done in this commit, need opinions) and if the script has no or another extension, case of many in old and current .blend's, there's still the string box for writing its name.
-- Implemented Ton's space handler script links:
Right now only for the 3d View,  but it's trivial to add for others.  There are two types: EVENT, to receive 3d View events from a chosen window and DRAW, to draw on the window.  Ton's idea was to give scripts a controlled way to integrate better within Blender.
Here's how it works:
- scripts must have a proper header, like:
# SPACEHANDLER.VIEW3D.EVENT
and then they are shown in 3d View's View menu, "Space Handler Scripts" submenu.  Check (mark, click on it) a script to make it active.
EVENT handlers should consult the Blender.event var to get the current event, which can be compared with values from the Draw module:
import Blender
from Blender import Draw
evt = Blender.event
if evt == Draw.AKEY:
  print "a"
elif evt == Draw.LEFTMOUSE:
  print "left mouse button"
else:
  return # ignore, pass event back to Blender
Blender.event = None # tell Blender not to process itself the event
DRAW handlers are free to draw to their owner 3D View. OpenGL attributes and modelview and projection matrices are pushed before running the handler and poped when it finishes.
To communicate between EVENT and DRAW handler scripts we have the Blender.Registry module, as always.
Still need to code some nice example, which should also serve to test properly space handlers.  Simple tests went fine.
- doc updates about the additions.
=======
Note: the UI part of the space handlers and script links is of course open for changes, I just tried to make it understandable.  Probably we won't use the scriptlinks icon for "None Available" (check 3d View -> View -> Space Handler Scripts), though it hints at what space handlers are.  The tooltips may not be accepted either, since other menus don't use them.  Opinions welcomed.
											 
										 
										
											2005-05-08 21:20:34 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									 *  value  to  event  callbacks  ( gui / event / button  callbacks  are  not  allowed 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									 *  inside  scriptlinks ,  so  this  is  ok )  */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if (  sc - > script - > py_event  )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										int  pass_ascii  =  0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										if  ( ascii  >  31  & &  ascii  ! =  127 )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											pass_ascii  =  1 ; 
							 
						 
					
						
							
								
									
										
										
										
											2005-11-30 08:18:06 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											EXPP_dict_set_item_str ( g_blenderdict ,  " event " , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													PyInt_FromLong ( ( long ) ascii ) ) ; 
							 
						 
					
						
							
								
									
										
											 
										
											
												BPython:
- Made Blender.event var (previously only used by script links) hold ascii value -- where it applies -- of current event during events callback registered with Draw.Register(gui, events, button_events).  Useful for gui scripts like Campbell's Python console. No problem using this var to hold the value, since in gui scripts it was not used (always None).
- Updated Window and Window.Theme with new theme vars and the Time space.
- Script links:
-- Added "Render" event for script links (runs twice, second time as "PostEvent", for clean-up actions). Now FrameChanged links don't run when a single pic is rendered.
-- Added "Enable Script Links" button in the script buttons tab.  Now this bit gets saved in .blends along with the rest of G.f, so users can define per .blend if they are on or off by default.  "blender -y" also disables all slinks as happened before with OnLoad ones only.
-- Other small changes in the script buttons tab:
  When a link is added (button "new"), it becomes the active one for the window, no need to press a button to reach it.
  Also, a pupmenu showing all available texts is shown when "new" is pressed, so users can choose a text w/o having to type.  Cancel the popup to leave the string button empty (link exists, but has no script assigned).  A pulldown would be better UI-wise, but it's kinda weird to show both scripts and normal texts (Blender doesn't differentiate them) in a script links pulldown.  With a popup we can show only texts ending in ".py" (not done in this commit, need opinions) and if the script has no or another extension, case of many in old and current .blend's, there's still the string box for writing its name.
-- Implemented Ton's space handler script links:
Right now only for the 3d View,  but it's trivial to add for others.  There are two types: EVENT, to receive 3d View events from a chosen window and DRAW, to draw on the window.  Ton's idea was to give scripts a controlled way to integrate better within Blender.
Here's how it works:
- scripts must have a proper header, like:
# SPACEHANDLER.VIEW3D.EVENT
and then they are shown in 3d View's View menu, "Space Handler Scripts" submenu.  Check (mark, click on it) a script to make it active.
EVENT handlers should consult the Blender.event var to get the current event, which can be compared with values from the Draw module:
import Blender
from Blender import Draw
evt = Blender.event
if evt == Draw.AKEY:
  print "a"
elif evt == Draw.LEFTMOUSE:
  print "left mouse button"
else:
  return # ignore, pass event back to Blender
Blender.event = None # tell Blender not to process itself the event
DRAW handlers are free to draw to their owner 3D View. OpenGL attributes and modelview and projection matrices are pushed before running the handler and poped when it finishes.
To communicate between EVENT and DRAW handler scripts we have the Blender.Registry module, as always.
Still need to code some nice example, which should also serve to test properly space handlers.  Simple tests went fine.
- doc updates about the additions.
=======
Note: the UI part of the space handlers and script links is of course open for changes, I just tried to make it understandable.  Probably we won't use the scriptlinks icon for "None Available" (check 3d View -> View -> Space Handler Scripts), though it hints at what space handlers are.  The tooltips may not be accepted either, since other menus don't use them.  Opinions welcomed.
											 
										 
										
											2005-05-08 21:20:34 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										} 
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										exec_callback (  sc ,  sc - > script - > py_event , 
							 
						 
					
						
							
								
									
										
											 
										
											
												BPython:
- Made Blender.event var (previously only used by script links) hold ascii value -- where it applies -- of current event during events callback registered with Draw.Register(gui, events, button_events).  Useful for gui scripts like Campbell's Python console. No problem using this var to hold the value, since in gui scripts it was not used (always None).
- Updated Window and Window.Theme with new theme vars and the Time space.
- Script links:
-- Added "Render" event for script links (runs twice, second time as "PostEvent", for clean-up actions). Now FrameChanged links don't run when a single pic is rendered.
-- Added "Enable Script Links" button in the script buttons tab.  Now this bit gets saved in .blends along with the rest of G.f, so users can define per .blend if they are on or off by default.  "blender -y" also disables all slinks as happened before with OnLoad ones only.
-- Other small changes in the script buttons tab:
  When a link is added (button "new"), it becomes the active one for the window, no need to press a button to reach it.
  Also, a pupmenu showing all available texts is shown when "new" is pressed, so users can choose a text w/o having to type.  Cancel the popup to leave the string button empty (link exists, but has no script assigned).  A pulldown would be better UI-wise, but it's kinda weird to show both scripts and normal texts (Blender doesn't differentiate them) in a script links pulldown.  With a popup we can show only texts ending in ".py" (not done in this commit, need opinions) and if the script has no or another extension, case of many in old and current .blend's, there's still the string box for writing its name.
-- Implemented Ton's space handler script links:
Right now only for the 3d View,  but it's trivial to add for others.  There are two types: EVENT, to receive 3d View events from a chosen window and DRAW, to draw on the window.  Ton's idea was to give scripts a controlled way to integrate better within Blender.
Here's how it works:
- scripts must have a proper header, like:
# SPACEHANDLER.VIEW3D.EVENT
and then they are shown in 3d View's View menu, "Space Handler Scripts" submenu.  Check (mark, click on it) a script to make it active.
EVENT handlers should consult the Blender.event var to get the current event, which can be compared with values from the Draw module:
import Blender
from Blender import Draw
evt = Blender.event
if evt == Draw.AKEY:
  print "a"
elif evt == Draw.LEFTMOUSE:
  print "left mouse button"
else:
  return # ignore, pass event back to Blender
Blender.event = None # tell Blender not to process itself the event
DRAW handlers are free to draw to their owner 3D View. OpenGL attributes and modelview and projection matrices are pushed before running the handler and poped when it finishes.
To communicate between EVENT and DRAW handler scripts we have the Blender.Registry module, as always.
Still need to code some nice example, which should also serve to test properly space handlers.  Simple tests went fine.
- doc updates about the additions.
=======
Note: the UI part of the space handlers and script links is of course open for changes, I just tried to make it understandable.  Probably we won't use the scriptlinks icon for "None Available" (check 3d View -> View -> Space Handler Scripts), though it hints at what space handlers are.  The tooltips may not be accepted either, since other menus don't use them.  Opinions welcomed.
											 
										 
										
											2005-05-08 21:20:34 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											Py_BuildValue (  " (ii) " ,  event ,  val  )  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										if  ( pass_ascii ) 
							 
						 
					
						
							
								
									
										
										
										
											2005-11-30 08:18:06 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											EXPP_dict_set_item_str ( g_blenderdict ,  " event " , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													PyString_FromString ( " " ) ) ; 
							 
						 
					
						
							
								
									
										
											 
										
											
												BPython:
- Made Blender.event var (previously only used by script links) hold ascii value -- where it applies -- of current event during events callback registered with Draw.Register(gui, events, button_events).  Useful for gui scripts like Campbell's Python console. No problem using this var to hold the value, since in gui scripts it was not used (always None).
- Updated Window and Window.Theme with new theme vars and the Time space.
- Script links:
-- Added "Render" event for script links (runs twice, second time as "PostEvent", for clean-up actions). Now FrameChanged links don't run when a single pic is rendered.
-- Added "Enable Script Links" button in the script buttons tab.  Now this bit gets saved in .blends along with the rest of G.f, so users can define per .blend if they are on or off by default.  "blender -y" also disables all slinks as happened before with OnLoad ones only.
-- Other small changes in the script buttons tab:
  When a link is added (button "new"), it becomes the active one for the window, no need to press a button to reach it.
  Also, a pupmenu showing all available texts is shown when "new" is pressed, so users can choose a text w/o having to type.  Cancel the popup to leave the string button empty (link exists, but has no script assigned).  A pulldown would be better UI-wise, but it's kinda weird to show both scripts and normal texts (Blender doesn't differentiate them) in a script links pulldown.  With a popup we can show only texts ending in ".py" (not done in this commit, need opinions) and if the script has no or another extension, case of many in old and current .blend's, there's still the string box for writing its name.
-- Implemented Ton's space handler script links:
Right now only for the 3d View,  but it's trivial to add for others.  There are two types: EVENT, to receive 3d View events from a chosen window and DRAW, to draw on the window.  Ton's idea was to give scripts a controlled way to integrate better within Blender.
Here's how it works:
- scripts must have a proper header, like:
# SPACEHANDLER.VIEW3D.EVENT
and then they are shown in 3d View's View menu, "Space Handler Scripts" submenu.  Check (mark, click on it) a script to make it active.
EVENT handlers should consult the Blender.event var to get the current event, which can be compared with values from the Draw module:
import Blender
from Blender import Draw
evt = Blender.event
if evt == Draw.AKEY:
  print "a"
elif evt == Draw.LEFTMOUSE:
  print "left mouse button"
else:
  return # ignore, pass event back to Blender
Blender.event = None # tell Blender not to process itself the event
DRAW handlers are free to draw to their owner 3D View. OpenGL attributes and modelview and projection matrices are pushed before running the handler and poped when it finishes.
To communicate between EVENT and DRAW handler scripts we have the Blender.Registry module, as always.
Still need to code some nice example, which should also serve to test properly space handlers.  Simple tests went fine.
- doc updates about the additions.
=======
Note: the UI part of the space handlers and script links is of course open for changes, I just tried to make it understandable.  Probably we won't use the scriptlinks icon for "None Available" (check 3d View -> View -> Space Handler Scripts), though it hints at what space handlers are.  The tooltips may not be accepted either, since other menus don't use them.  Opinions welcomed.
											 
										 
										
											2005-05-08 21:20:34 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2008-02-23 12:05:28 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									PyGILState_Release ( gilstate ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-12-14 01:18:09 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
									
										
										
										
											2003-05-08 03:06:46 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2007-04-28 05:09:09 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								static  void  exec_but_callback ( void  * pyobj ,  void  * data )  
						 
					
						
							
								
									
										
										
										
											2007-04-22 13:48:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								{  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									PyObject  * result ; 
							 
						 
					
						
							
								
									
										
										
										
											2007-06-21 11:24:42 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									PyObject  * pyvalue  =  NULL ; 
							 
						 
					
						
							
								
									
										
										
										
											2007-04-28 05:09:09 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									uiBut  * but  =  ( uiBut  * ) data ; 
							 
						 
					
						
							
								
									
										
										
										
											2007-06-04 08:15:27 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									PyObject  * arg ; 
							 
						 
					
						
							
								
									
										
										
										
											2007-04-28 05:09:09 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									PyObject  * callback  =  ( PyObject  * ) pyobj ; 
							 
						 
					
						
							
								
									
										
										
										
											2007-04-24 17:28:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									double  value  =  ui_get_but_val ( but ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									
							 
						 
					
						
							
								
									
										
										
										
											2007-04-22 13:48:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if  ( callback = = NULL  | |  callback  = =  Py_None ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return ; 
							 
						 
					
						
							
								
									
										
										
										
											2007-04-24 17:28:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									/* Button types support
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									case  MENU : 	
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									case  TEX : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									case  TOG : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									case  NUMSLI : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									case  NUM : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									case  COL : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									case  BUT_NORMAL : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									case  BUT  */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									switch  ( but - > type )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									case  TEX : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										/*printf("TEX\n");*/ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										pyvalue  =  PyString_FromString (  ( char  * ) but - > poin  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									case  NUM : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									case  NUMSLI : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									case  TOG : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									case  MENU : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										if  ( but - > pointype = = FLO )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											/*printf("FLO\n");*/ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											pyvalue  =  PyFloat_FromDouble (  ( float ) value  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										}  else  if  ( but - > pointype = = INT )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											/*printf("INT\n");*/ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											pyvalue  =  PyInt_FromLong (  ( int ) value  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										}  else  if  ( but - > pointype = = SHO )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											/*printf("SHO\n");*/ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											pyvalue  =  PyInt_FromLong (  ( short ) value  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										} 	
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									case  COL : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									case  BUT_NORMAL : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										float  vec [ 3 ] ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										VECCOPY ( vec ,  ( float  * ) but - > poin ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										pyvalue  =  Py_BuildValue ( " (fff) " ,  vec [ 0 ] ,  vec [ 1 ] ,  vec [ 2 ] ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									case  BUT : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										pyvalue  =  Py_None ; 
							 
						 
					
						
							
								
									
										
										
										
											2007-05-25 16:43:25 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										Py_INCREF ( pyvalue ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2007-04-24 17:28:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									default : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										pyvalue  =  Py_None ; 
							 
						 
					
						
							
								
									
										
										
										
											2007-05-25 16:43:25 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										Py_INCREF ( pyvalue ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2007-04-24 17:28:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										printf ( " Error, no button type matched. " ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									
							 
						 
					
						
							
								
									
										
										
										
											2007-06-04 08:15:27 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									arg  =  PyTuple_New (  2  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2007-04-27 23:54:30 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if  ( uiblock = = NULL ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										PyTuple_SetItem (  arg ,  0 ,  PyInt_FromLong ( but - > retval  -  EXPP_BUTTON_EVENTS_OFFSET )  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									else 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										PyTuple_SetItem (  arg ,  0 ,  PyInt_FromLong ( but - > retval )  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									
							 
						 
					
						
							
								
									
										
										
										
											2007-04-24 17:28:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									PyTuple_SetItem (  arg ,  1 ,  pyvalue  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									result  =  PyObject_CallObject (  callback ,  arg  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2007-06-04 08:15:27 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									Py_DECREF ( arg ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									
							 
						 
					
						
							
								
									
										
										
										
											2007-04-22 13:48:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if  ( ! result )  { 
							 
						 
					
						
							
								
									
										
										
										
											2007-05-25 16:43:25 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										Py_DECREF ( pyvalue ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2007-04-22 13:48:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										PyErr_Print (   ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-03-15 18:53:42 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										error_pyscript (   ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2007-04-22 13:48:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									Py_XDECREF (  result  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2007-07-27 06:14:25 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								/*note that this function populates the drawbutton ref lists.*/  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								static  void  set_pycallback ( uiBut  * ubut ,  PyObject  * callback ,  Button  * but )  
						 
					
						
							
								
									
										
										
										
											2007-07-12 20:49:36 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								{  
						 
					
						
							
								
									
										
										
										
											2007-07-27 06:14:25 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									PyObject  * tuple ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if  ( ! callback  | |  ! PyCallable_Check ( callback ) )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										if  ( M_Button_List  & &  but )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											PyList_Append ( M_Button_List ,  ( PyObject * ) but ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return ; 
							 
						 
					
						
							
								
									
										
										
										
											2007-07-12 20:49:36 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2007-07-27 06:14:25 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if  ( M_Button_List )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										if  ( but )  tuple  =  PyTuple_New ( 2 ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										else  tuple  =  PyTuple_New ( 1 ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										/*the tuple API mandates this*/ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										Py_XINCREF ( callback ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										Py_XINCREF ( but ) ;  /*this checks for NULL*/ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										PyTuple_SET_ITEM ( tuple ,  0 ,  callback ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										if  ( but )  PyTuple_SET_ITEM ( tuple ,  1 ,  ( PyObject * ) but ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										PyList_Append ( M_Button_List ,  tuple ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										Py_DECREF ( tuple ) ;  /*we have to do this to aovid double references.*/ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										uiButSetFunc ( ubut ,  exec_but_callback ,  callback ,  ubut ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								void  BPy_Set_DrawButtonsList ( void  * list )  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								{  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									M_Button_List  =  list ; 
							 
						 
					
						
							
								
									
										
										
										
											2007-07-12 20:49:36 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
									
										
										
										
											2007-07-27 06:14:25 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								/*this MUST be called after doing UI stuff.*/  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								void  BPy_Free_DrawButtonsList ( void )  
						 
					
						
							
								
									
										
										
										
											2007-04-22 13:48:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								{  
						 
					
						
							
								
									
										
										
										
											2007-07-27 06:14:25 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									/*Clear the list.*/ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if  ( M_Button_List )  { 
							 
						 
					
						
							
								
									
										
										
										
											2008-02-25 04:38:48 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										PyGILState_STATE  gilstate  =  { 0 } ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-02-25 01:35:50 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										int  py_is_on  =  Py_IsInitialized ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										if  ( py_is_on )  gilstate  =  PyGILState_Ensure ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-02-23 12:05:28 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2007-07-27 06:14:25 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										PyList_SetSlice ( M_Button_List ,  0 ,  PyList_Size ( M_Button_List ) ,  NULL ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										Py_DECREF ( M_Button_List ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										M_Button_List  =  NULL ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-02-23 12:05:28 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2008-02-25 01:35:50 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										if  ( py_is_on )  PyGILState_Release ( gilstate ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2007-07-27 06:14:25 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2007-04-22 13:48:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2007-07-12 20:49:36 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								static  PyObject  * Method_Exit (  PyObject  *  self  )  
						 
					
						
							
								
									
										
										
										
											2004-03-29 08:16:18 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								{  
						 
					
						
							
								
									
										
											 
										
											
												BPython: cleaning some bug tracker entries:
(excuse me for doing all in a single commit, but they are tiny
fixes and it's bpython, that dark corner ...)
#1025 - FileSelector SEGV on dynamic callback Category:
  Can't reproduce with current cvs, I'd say recent changes to fix
another crash related to FileSelector in gui-less scripts solved this
one, too.
#1028 - Reserved button event number:
  Menu choices generate two events, one extra related to the menu
itself, with value=4.  Made bpython ignore this extra event.
#1068 - FileSelector No file extension support:
  As Ton wrote there, Blender itself doesn't support this yet.  But the
requester also wanted Window.File/ImageSelector to accept a pathname.  Done.  Also updated doc.
#959 - Segfault on background rendering:
  This happened in bg mode (blender -b filename -a, for example) when
a script with the line "Blender.Redraw()" was linked to FRAMECHANGED events.  As reported in the bug page, it was because curarea is NULL in bg mode.  Made Redraw() check for this and not call functions that expected curarea in Redraw, like one to swap buffers.
#1072 - Blender.Redraw() Segfault:
  Good catch : ). Scripts called from the scripts win that called
Blender.Redraw() or Blender.Window.Redraw() would crash Blender because of a dirty pointer in Spacescript->script.  Fixed.
											 
										 
										
											2004-04-11 04:41:33 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									SpaceScript  * sc ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									Script  * script ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-12-14 01:18:09 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
											 
										
											
												BPython: cleaning some bug tracker entries:
(excuse me for doing all in a single commit, but they are tiny
fixes and it's bpython, that dark corner ...)
#1025 - FileSelector SEGV on dynamic callback Category:
  Can't reproduce with current cvs, I'd say recent changes to fix
another crash related to FileSelector in gui-less scripts solved this
one, too.
#1028 - Reserved button event number:
  Menu choices generate two events, one extra related to the menu
itself, with value=4.  Made bpython ignore this extra event.
#1068 - FileSelector No file extension support:
  As Ton wrote there, Blender itself doesn't support this yet.  But the
requester also wanted Window.File/ImageSelector to accept a pathname.  Done.  Also updated doc.
#959 - Segfault on background rendering:
  This happened in bg mode (blender -b filename -a, for example) when
a script with the line "Blender.Redraw()" was linked to FRAMECHANGED events.  As reported in the bug page, it was because curarea is NULL in bg mode.  Made Redraw() check for this and not call functions that expected curarea in Redraw, like one to swap buffers.
#1072 - Blender.Redraw() Segfault:
  Good catch : ). Scripts called from the scripts win that called
Blender.Redraw() or Blender.Window.Redraw() would crash Blender because of a dirty pointer in Spacescript->script.  Fixed.
											 
										 
										
											2004-04-11 04:41:33 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									/* if users call Draw.Exit when we are already out of the SPACE_SCRIPT, we
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									 *  simply  return ,  for  compatibility  */ 
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if (  curarea - > spacetype  = =  SPACE_SCRIPT  ) 
							 
						 
					
						
							
								
									
										
											 
										
											
												BPython: cleaning some bug tracker entries:
(excuse me for doing all in a single commit, but they are tiny
fixes and it's bpython, that dark corner ...)
#1025 - FileSelector SEGV on dynamic callback Category:
  Can't reproduce with current cvs, I'd say recent changes to fix
another crash related to FileSelector in gui-less scripts solved this
one, too.
#1028 - Reserved button event number:
  Menu choices generate two events, one extra related to the menu
itself, with value=4.  Made bpython ignore this extra event.
#1068 - FileSelector No file extension support:
  As Ton wrote there, Blender itself doesn't support this yet.  But the
requester also wanted Window.File/ImageSelector to accept a pathname.  Done.  Also updated doc.
#959 - Segfault on background rendering:
  This happened in bg mode (blender -b filename -a, for example) when
a script with the line "Blender.Redraw()" was linked to FRAMECHANGED events.  As reported in the bug page, it was because curarea is NULL in bg mode.  Made Redraw() check for this and not call functions that expected curarea in Redraw, like one to swap buffers.
#1072 - Blender.Redraw() Segfault:
  Good catch : ). Scripts called from the scripts win that called
Blender.Redraw() or Blender.Window.Redraw() would crash Blender because of a dirty pointer in Spacescript->script.  Fixed.
											 
										 
										
											2004-04-11 04:41:33 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										sc  =  curarea - > spacedata . first ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									else 
							 
						 
					
						
							
								
									
										
										
										
											2007-04-24 17:28:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										Py_RETURN_NONE ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-06-14 10:10:01 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									exit_pydraw (  sc ,  0  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-06-14 10:10:01 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
											 
										
											
												BPython: cleaning some bug tracker entries:
(excuse me for doing all in a single commit, but they are tiny
fixes and it's bpython, that dark corner ...)
#1025 - FileSelector SEGV on dynamic callback Category:
  Can't reproduce with current cvs, I'd say recent changes to fix
another crash related to FileSelector in gui-less scripts solved this
one, too.
#1028 - Reserved button event number:
  Menu choices generate two events, one extra related to the menu
itself, with value=4.  Made bpython ignore this extra event.
#1068 - FileSelector No file extension support:
  As Ton wrote there, Blender itself doesn't support this yet.  But the
requester also wanted Window.File/ImageSelector to accept a pathname.  Done.  Also updated doc.
#959 - Segfault on background rendering:
  This happened in bg mode (blender -b filename -a, for example) when
a script with the line "Blender.Redraw()" was linked to FRAMECHANGED events.  As reported in the bug page, it was because curarea is NULL in bg mode.  Made Redraw() check for this and not call functions that expected curarea in Redraw, like one to swap buffers.
#1072 - Blender.Redraw() Segfault:
  Good catch : ). Scripts called from the scripts win that called
Blender.Redraw() or Blender.Window.Redraw() would crash Blender because of a dirty pointer in Spacescript->script.  Fixed.
											 
										 
										
											2004-04-11 04:41:33 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									script  =  sc - > script ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-05-08 03:06:46 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
											 
										
											
												BPython: cleaning some bug tracker entries:
(excuse me for doing all in a single commit, but they are tiny
fixes and it's bpython, that dark corner ...)
#1025 - FileSelector SEGV on dynamic callback Category:
  Can't reproduce with current cvs, I'd say recent changes to fix
another crash related to FileSelector in gui-less scripts solved this
one, too.
#1028 - Reserved button event number:
  Menu choices generate two events, one extra related to the menu
itself, with value=4.  Made bpython ignore this extra event.
#1068 - FileSelector No file extension support:
  As Ton wrote there, Blender itself doesn't support this yet.  But the
requester also wanted Window.File/ImageSelector to accept a pathname.  Done.  Also updated doc.
#959 - Segfault on background rendering:
  This happened in bg mode (blender -b filename -a, for example) when
a script with the line "Blender.Redraw()" was linked to FRAMECHANGED events.  As reported in the bug page, it was because curarea is NULL in bg mode.  Made Redraw() check for this and not call functions that expected curarea in Redraw, like one to swap buffers.
#1072 - Blender.Redraw() Segfault:
  Good catch : ). Scripts called from the scripts win that called
Blender.Redraw() or Blender.Window.Redraw() would crash Blender because of a dirty pointer in Spacescript->script.  Fixed.
											 
										 
										
											2004-04-11 04:41:33 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									/* remove our lock to the current namespace */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									script - > flags  & =  ~ SCRIPT_GUI ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-03-06 21:25:15 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									script - > scriptname [ 0 ]  =  ' \0 ' ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									script - > scriptarg [ 0 ]  =  ' \0 ' ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-12-14 01:18:09 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2007-04-24 17:28:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									Py_RETURN_NONE ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-05-08 03:06:46 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2003-12-14 01:18:09 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								/* Method_Register (Draw.Register) registers callbacks for drawing, events
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								 *  and  gui  button  events ,  so  a  script  can  continue  executing  after  the 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								 *  interpreter  reached  its  end  and  returned  control  to  Blender .   Everytime 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								 *  the  SPACE_SCRIPT  window  with  this  script  is  redrawn ,  the  registered 
							 
						 
					
						
							
								
									
										
										
										
											2004-05-22 20:25:22 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								 *  callbacks  are  executed .  */ 
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								static  PyObject  * Method_Register (  PyObject  *  self ,  PyObject  *  args  )  
						 
					
						
							
								
									
										
										
										
											2003-05-08 03:06:46 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								{  
						 
					
						
							
								
									
										
											 
										
											
												BPython: cleaning some bug tracker entries:
(excuse me for doing all in a single commit, but they are tiny
fixes and it's bpython, that dark corner ...)
#1025 - FileSelector SEGV on dynamic callback Category:
  Can't reproduce with current cvs, I'd say recent changes to fix
another crash related to FileSelector in gui-less scripts solved this
one, too.
#1028 - Reserved button event number:
  Menu choices generate two events, one extra related to the menu
itself, with value=4.  Made bpython ignore this extra event.
#1068 - FileSelector No file extension support:
  As Ton wrote there, Blender itself doesn't support this yet.  But the
requester also wanted Window.File/ImageSelector to accept a pathname.  Done.  Also updated doc.
#959 - Segfault on background rendering:
  This happened in bg mode (blender -b filename -a, for example) when
a script with the line "Blender.Redraw()" was linked to FRAMECHANGED events.  As reported in the bug page, it was because curarea is NULL in bg mode.  Made Redraw() check for this and not call functions that expected curarea in Redraw, like one to swap buffers.
#1072 - Blender.Redraw() Segfault:
  Good catch : ). Scripts called from the scripts win that called
Blender.Redraw() or Blender.Window.Redraw() would crash Blender because of a dirty pointer in Spacescript->script.  Fixed.
											 
										 
										
											2004-04-11 04:41:33 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									PyObject  * newdrawc  =  NULL ,  * neweventc  =  NULL ,  * newbuttonc  =  NULL ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									SpaceScript  * sc ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									Script  * script ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									int  startspace  =  0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2008-09-14 05:10:45 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if  ( G . background )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  EXPP_ReturnPyObjError (  PyExc_RuntimeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													      " Can't run Draw.Register() in background mode. "  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if (  ! PyArg_ParseTuple 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									    (  args ,  " O|OO " ,  & newdrawc ,  & neweventc ,  & newbuttonc  )  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  EXPP_ReturnPyObjError (  PyExc_TypeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													      " expected one or three PyObjects "  ) ; 
							 
						 
					
						
							
								
									
										
											 
										
											
												BPython: cleaning some bug tracker entries:
(excuse me for doing all in a single commit, but they are tiny
fixes and it's bpython, that dark corner ...)
#1025 - FileSelector SEGV on dynamic callback Category:
  Can't reproduce with current cvs, I'd say recent changes to fix
another crash related to FileSelector in gui-less scripts solved this
one, too.
#1028 - Reserved button event number:
  Menu choices generate two events, one extra related to the menu
itself, with value=4.  Made bpython ignore this extra event.
#1068 - FileSelector No file extension support:
  As Ton wrote there, Blender itself doesn't support this yet.  But the
requester also wanted Window.File/ImageSelector to accept a pathname.  Done.  Also updated doc.
#959 - Segfault on background rendering:
  This happened in bg mode (blender -b filename -a, for example) when
a script with the line "Blender.Redraw()" was linked to FRAMECHANGED events.  As reported in the bug page, it was because curarea is NULL in bg mode.  Made Redraw() check for this and not call functions that expected curarea in Redraw, like one to swap buffers.
#1072 - Blender.Redraw() Segfault:
  Good catch : ). Scripts called from the scripts win that called
Blender.Redraw() or Blender.Window.Redraw() would crash Blender because of a dirty pointer in Spacescript->script.  Fixed.
											 
										 
										
											2004-04-11 04:41:33 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if (  ! PyCallable_Check (  newdrawc  )  ) 
							 
						 
					
						
							
								
									
										
											 
										
											
												BPython: cleaning some bug tracker entries:
(excuse me for doing all in a single commit, but they are tiny
fixes and it's bpython, that dark corner ...)
#1025 - FileSelector SEGV on dynamic callback Category:
  Can't reproduce with current cvs, I'd say recent changes to fix
another crash related to FileSelector in gui-less scripts solved this
one, too.
#1028 - Reserved button event number:
  Menu choices generate two events, one extra related to the menu
itself, with value=4.  Made bpython ignore this extra event.
#1068 - FileSelector No file extension support:
  As Ton wrote there, Blender itself doesn't support this yet.  But the
requester also wanted Window.File/ImageSelector to accept a pathname.  Done.  Also updated doc.
#959 - Segfault on background rendering:
  This happened in bg mode (blender -b filename -a, for example) when
a script with the line "Blender.Redraw()" was linked to FRAMECHANGED events.  As reported in the bug page, it was because curarea is NULL in bg mode.  Made Redraw() check for this and not call functions that expected curarea in Redraw, like one to swap buffers.
#1072 - Blender.Redraw() Segfault:
  Good catch : ). Scripts called from the scripts win that called
Blender.Redraw() or Blender.Window.Redraw() would crash Blender because of a dirty pointer in Spacescript->script.  Fixed.
											 
										 
										
											2004-04-11 04:41:33 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										newdrawc  =  NULL ; 
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if (  ! PyCallable_Check (  neweventc  )  ) 
							 
						 
					
						
							
								
									
										
											 
										
											
												BPython: cleaning some bug tracker entries:
(excuse me for doing all in a single commit, but they are tiny
fixes and it's bpython, that dark corner ...)
#1025 - FileSelector SEGV on dynamic callback Category:
  Can't reproduce with current cvs, I'd say recent changes to fix
another crash related to FileSelector in gui-less scripts solved this
one, too.
#1028 - Reserved button event number:
  Menu choices generate two events, one extra related to the menu
itself, with value=4.  Made bpython ignore this extra event.
#1068 - FileSelector No file extension support:
  As Ton wrote there, Blender itself doesn't support this yet.  But the
requester also wanted Window.File/ImageSelector to accept a pathname.  Done.  Also updated doc.
#959 - Segfault on background rendering:
  This happened in bg mode (blender -b filename -a, for example) when
a script with the line "Blender.Redraw()" was linked to FRAMECHANGED events.  As reported in the bug page, it was because curarea is NULL in bg mode.  Made Redraw() check for this and not call functions that expected curarea in Redraw, like one to swap buffers.
#1072 - Blender.Redraw() Segfault:
  Good catch : ). Scripts called from the scripts win that called
Blender.Redraw() or Blender.Window.Redraw() would crash Blender because of a dirty pointer in Spacescript->script.  Fixed.
											 
										 
										
											2004-04-11 04:41:33 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										neweventc  =  NULL ; 
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if (  ! PyCallable_Check (  newbuttonc  )  ) 
							 
						 
					
						
							
								
									
										
											 
										
											
												BPython: cleaning some bug tracker entries:
(excuse me for doing all in a single commit, but they are tiny
fixes and it's bpython, that dark corner ...)
#1025 - FileSelector SEGV on dynamic callback Category:
  Can't reproduce with current cvs, I'd say recent changes to fix
another crash related to FileSelector in gui-less scripts solved this
one, too.
#1028 - Reserved button event number:
  Menu choices generate two events, one extra related to the menu
itself, with value=4.  Made bpython ignore this extra event.
#1068 - FileSelector No file extension support:
  As Ton wrote there, Blender itself doesn't support this yet.  But the
requester also wanted Window.File/ImageSelector to accept a pathname.  Done.  Also updated doc.
#959 - Segfault on background rendering:
  This happened in bg mode (blender -b filename -a, for example) when
a script with the line "Blender.Redraw()" was linked to FRAMECHANGED events.  As reported in the bug page, it was because curarea is NULL in bg mode.  Made Redraw() check for this and not call functions that expected curarea in Redraw, like one to swap buffers.
#1072 - Blender.Redraw() Segfault:
  Good catch : ). Scripts called from the scripts win that called
Blender.Redraw() or Blender.Window.Redraw() would crash Blender because of a dirty pointer in Spacescript->script.  Fixed.
											 
										 
										
											2004-04-11 04:41:33 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										newbuttonc  =  NULL ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if (  ! (  newdrawc  | |  neweventc  | |  newbuttonc  )  ) 
							 
						 
					
						
							
								
									
										
										
										
											2007-04-24 17:28:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										Py_RETURN_NONE ; 
							 
						 
					
						
							
								
									
										
											 
										
											
												BPython: cleaning some bug tracker entries:
(excuse me for doing all in a single commit, but they are tiny
fixes and it's bpython, that dark corner ...)
#1025 - FileSelector SEGV on dynamic callback Category:
  Can't reproduce with current cvs, I'd say recent changes to fix
another crash related to FileSelector in gui-less scripts solved this
one, too.
#1028 - Reserved button event number:
  Menu choices generate two events, one extra related to the menu
itself, with value=4.  Made bpython ignore this extra event.
#1068 - FileSelector No file extension support:
  As Ton wrote there, Blender itself doesn't support this yet.  But the
requester also wanted Window.File/ImageSelector to accept a pathname.  Done.  Also updated doc.
#959 - Segfault on background rendering:
  This happened in bg mode (blender -b filename -a, for example) when
a script with the line "Blender.Redraw()" was linked to FRAMECHANGED events.  As reported in the bug page, it was because curarea is NULL in bg mode.  Made Redraw() check for this and not call functions that expected curarea in Redraw, like one to swap buffers.
#1072 - Blender.Redraw() Segfault:
  Good catch : ). Scripts called from the scripts win that called
Blender.Redraw() or Blender.Window.Redraw() would crash Blender because of a dirty pointer in Spacescript->script.  Fixed.
											 
										 
										
											2004-04-11 04:41:33 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									startspace  =  curarea - > spacetype ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									/* first make sure the current area is of type SPACE_SCRIPT */ 
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if (  startspace  ! =  SPACE_SCRIPT  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										newspace (  curarea ,  SPACE_SCRIPT  ) ; 
							 
						 
					
						
							
								
									
										
											 
										
											
												BPython: cleaning some bug tracker entries:
(excuse me for doing all in a single commit, but they are tiny
fixes and it's bpython, that dark corner ...)
#1025 - FileSelector SEGV on dynamic callback Category:
  Can't reproduce with current cvs, I'd say recent changes to fix
another crash related to FileSelector in gui-less scripts solved this
one, too.
#1028 - Reserved button event number:
  Menu choices generate two events, one extra related to the menu
itself, with value=4.  Made bpython ignore this extra event.
#1068 - FileSelector No file extension support:
  As Ton wrote there, Blender itself doesn't support this yet.  But the
requester also wanted Window.File/ImageSelector to accept a pathname.  Done.  Also updated doc.
#959 - Segfault on background rendering:
  This happened in bg mode (blender -b filename -a, for example) when
a script with the line "Blender.Redraw()" was linked to FRAMECHANGED events.  As reported in the bug page, it was because curarea is NULL in bg mode.  Made Redraw() check for this and not call functions that expected curarea in Redraw, like one to swap buffers.
#1072 - Blender.Redraw() Segfault:
  Good catch : ). Scripts called from the scripts win that called
Blender.Redraw() or Blender.Window.Redraw() would crash Blender because of a dirty pointer in Spacescript->script.  Fixed.
											 
										 
										
											2004-04-11 04:41:33 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									sc  =  curarea - > spacedata . first ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-11-09 14:07:25 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									/* There are two kinds of scripts:
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									 *  a )  those  that  simply  run ,  finish  and  return  control  to  Blender ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									 *  b )  those  that  do  like  ' a ) '  above  but  leave  callbacks  for  drawing , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									 *  events  and  button  events ,  with  this  Method_Register  ( Draw . Register 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									 *  in  Python ) .   These  callbacks  are  called  by  scriptspaces  ( Scripts  windows ) . 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									 * 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									 *  We  need  to  flag  scripts  that  leave  callbacks  so  their  namespaces  are 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									 *  not  deleted  when  they  ' finish '  execution ,  because  the  callbacks  will 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									 *  still  need  the  namespace . 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									 */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									/* Let's see if this is a new script */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									script  =  G . main - > script . first ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									while  ( script )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										if  ( script - > flags  &  SCRIPT_RUNNING )  break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										script  =  script - > id . next ; 
							 
						 
					
						
							
								
									
										
											 
										
											
												BPython: cleaning some bug tracker entries:
(excuse me for doing all in a single commit, but they are tiny
fixes and it's bpython, that dark corner ...)
#1025 - FileSelector SEGV on dynamic callback Category:
  Can't reproduce with current cvs, I'd say recent changes to fix
another crash related to FileSelector in gui-less scripts solved this
one, too.
#1028 - Reserved button event number:
  Menu choices generate two events, one extra related to the menu
itself, with value=4.  Made bpython ignore this extra event.
#1068 - FileSelector No file extension support:
  As Ton wrote there, Blender itself doesn't support this yet.  But the
requester also wanted Window.File/ImageSelector to accept a pathname.  Done.  Also updated doc.
#959 - Segfault on background rendering:
  This happened in bg mode (blender -b filename -a, for example) when
a script with the line "Blender.Redraw()" was linked to FRAMECHANGED events.  As reported in the bug page, it was because curarea is NULL in bg mode.  Made Redraw() check for this and not call functions that expected curarea in Redraw, like one to swap buffers.
#1072 - Blender.Redraw() Segfault:
  Good catch : ). Scripts called from the scripts win that called
Blender.Redraw() or Blender.Window.Redraw() would crash Blender because of a dirty pointer in Spacescript->script.  Fixed.
											 
										 
										
											2004-04-11 04:41:33 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-11-09 14:07:25 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if (  ! script  )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										/* not new, it's a left callback calling Register again */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								 		script  =  sc - > script ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										if (  ! script  )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											return  EXPP_ReturnPyObjError (  PyExc_RuntimeError , 
							 
						 
					
						
							
								
									
										
											 
										
											
												BPython:
- Made Blender.event var (previously only used by script links) hold ascii value -- where it applies -- of current event during events callback registered with Draw.Register(gui, events, button_events).  Useful for gui scripts like Campbell's Python console. No problem using this var to hold the value, since in gui scripts it was not used (always None).
- Updated Window and Window.Theme with new theme vars and the Time space.
- Script links:
-- Added "Render" event for script links (runs twice, second time as "PostEvent", for clean-up actions). Now FrameChanged links don't run when a single pic is rendered.
-- Added "Enable Script Links" button in the script buttons tab.  Now this bit gets saved in .blends along with the rest of G.f, so users can define per .blend if they are on or off by default.  "blender -y" also disables all slinks as happened before with OnLoad ones only.
-- Other small changes in the script buttons tab:
  When a link is added (button "new"), it becomes the active one for the window, no need to press a button to reach it.
  Also, a pupmenu showing all available texts is shown when "new" is pressed, so users can choose a text w/o having to type.  Cancel the popup to leave the string button empty (link exists, but has no script assigned).  A pulldown would be better UI-wise, but it's kinda weird to show both scripts and normal texts (Blender doesn't differentiate them) in a script links pulldown.  With a popup we can show only texts ending in ".py" (not done in this commit, need opinions) and if the script has no or another extension, case of many in old and current .blend's, there's still the string box for writing its name.
-- Implemented Ton's space handler script links:
Right now only for the 3d View,  but it's trivial to add for others.  There are two types: EVENT, to receive 3d View events from a chosen window and DRAW, to draw on the window.  Ton's idea was to give scripts a controlled way to integrate better within Blender.
Here's how it works:
- scripts must have a proper header, like:
# SPACEHANDLER.VIEW3D.EVENT
and then they are shown in 3d View's View menu, "Space Handler Scripts" submenu.  Check (mark, click on it) a script to make it active.
EVENT handlers should consult the Blender.event var to get the current event, which can be compared with values from the Draw module:
import Blender
from Blender import Draw
evt = Blender.event
if evt == Draw.AKEY:
  print "a"
elif evt == Draw.LEFTMOUSE:
  print "left mouse button"
else:
  return # ignore, pass event back to Blender
Blender.event = None # tell Blender not to process itself the event
DRAW handlers are free to draw to their owner 3D View. OpenGL attributes and modelview and projection matrices are pushed before running the handler and poped when it finishes.
To communicate between EVENT and DRAW handler scripts we have the Blender.Registry module, as always.
Still need to code some nice example, which should also serve to test properly space handlers.  Simple tests went fine.
- doc updates about the additions.
=======
Note: the UI part of the space handlers and script links is of course open for changes, I just tried to make it understandable.  Probably we won't use the scriptlinks icon for "None Available" (check 3d View -> View -> Space Handler Scripts), though it hints at what space handlers are.  The tooltips may not be accepted either, since other menus don't use them.  Opinions welcomed.
											 
										 
										
											2005-05-08 21:20:34 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
												" Draw.Register can't be used inside script links "  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2004-11-09 14:07:25 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										} 
							 
						 
					
						
							
								
									
										
											 
										
											
												BPython: cleaning some bug tracker entries:
(excuse me for doing all in a single commit, but they are tiny
fixes and it's bpython, that dark corner ...)
#1025 - FileSelector SEGV on dynamic callback Category:
  Can't reproduce with current cvs, I'd say recent changes to fix
another crash related to FileSelector in gui-less scripts solved this
one, too.
#1028 - Reserved button event number:
  Menu choices generate two events, one extra related to the menu
itself, with value=4.  Made bpython ignore this extra event.
#1068 - FileSelector No file extension support:
  As Ton wrote there, Blender itself doesn't support this yet.  But the
requester also wanted Window.File/ImageSelector to accept a pathname.  Done.  Also updated doc.
#959 - Segfault on background rendering:
  This happened in bg mode (blender -b filename -a, for example) when
a script with the line "Blender.Redraw()" was linked to FRAMECHANGED events.  As reported in the bug page, it was because curarea is NULL in bg mode.  Made Redraw() check for this and not call functions that expected curarea in Redraw, like one to swap buffers.
#1072 - Blender.Redraw() Segfault:
  Good catch : ). Scripts called from the scripts win that called
Blender.Redraw() or Blender.Window.Redraw() would crash Blender because of a dirty pointer in Spacescript->script.  Fixed.
											 
										 
										
											2004-04-11 04:41:33 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2004-11-09 14:07:25 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									else  sc - > script  =  script ; 
							 
						 
					
						
							
								
									
										
											 
										
											
												BPython: cleaning some bug tracker entries:
(excuse me for doing all in a single commit, but they are tiny
fixes and it's bpython, that dark corner ...)
#1025 - FileSelector SEGV on dynamic callback Category:
  Can't reproduce with current cvs, I'd say recent changes to fix
another crash related to FileSelector in gui-less scripts solved this
one, too.
#1028 - Reserved button event number:
  Menu choices generate two events, one extra related to the menu
itself, with value=4.  Made bpython ignore this extra event.
#1068 - FileSelector No file extension support:
  As Ton wrote there, Blender itself doesn't support this yet.  But the
requester also wanted Window.File/ImageSelector to accept a pathname.  Done.  Also updated doc.
#959 - Segfault on background rendering:
  This happened in bg mode (blender -b filename -a, for example) when
a script with the line "Blender.Redraw()" was linked to FRAMECHANGED events.  As reported in the bug page, it was because curarea is NULL in bg mode.  Made Redraw() check for this and not call functions that expected curarea in Redraw, like one to swap buffers.
#1072 - Blender.Redraw() Segfault:
  Good catch : ). Scripts called from the scripts win that called
Blender.Redraw() or Blender.Window.Redraw() would crash Blender because of a dirty pointer in Spacescript->script.  Fixed.
											 
										 
										
											2004-04-11 04:41:33 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									/* Now we have the right script and can set a lock so its namespace can't be
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									 *  deleted  for  as  long  as  we  need  it  */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									script - > flags  | =  SCRIPT_GUI ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									/* save the last space so we can go back to it upon finishing */ 
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if (  ! script - > lastspace  ) 
							 
						 
					
						
							
								
									
										
											 
										
											
												BPython: cleaning some bug tracker entries:
(excuse me for doing all in a single commit, but they are tiny
fixes and it's bpython, that dark corner ...)
#1025 - FileSelector SEGV on dynamic callback Category:
  Can't reproduce with current cvs, I'd say recent changes to fix
another crash related to FileSelector in gui-less scripts solved this
one, too.
#1028 - Reserved button event number:
  Menu choices generate two events, one extra related to the menu
itself, with value=4.  Made bpython ignore this extra event.
#1068 - FileSelector No file extension support:
  As Ton wrote there, Blender itself doesn't support this yet.  But the
requester also wanted Window.File/ImageSelector to accept a pathname.  Done.  Also updated doc.
#959 - Segfault on background rendering:
  This happened in bg mode (blender -b filename -a, for example) when
a script with the line "Blender.Redraw()" was linked to FRAMECHANGED events.  As reported in the bug page, it was because curarea is NULL in bg mode.  Made Redraw() check for this and not call functions that expected curarea in Redraw, like one to swap buffers.
#1072 - Blender.Redraw() Segfault:
  Good catch : ). Scripts called from the scripts win that called
Blender.Redraw() or Blender.Window.Redraw() would crash Blender because of a dirty pointer in Spacescript->script.  Fixed.
											 
										 
										
											2004-04-11 04:41:33 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										script - > lastspace  =  startspace ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									/* clean the old callbacks */ 
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									exit_pydraw (  sc ,  0  ) ; 
							 
						 
					
						
							
								
									
										
											 
										
											
												BPython: cleaning some bug tracker entries:
(excuse me for doing all in a single commit, but they are tiny
fixes and it's bpython, that dark corner ...)
#1025 - FileSelector SEGV on dynamic callback Category:
  Can't reproduce with current cvs, I'd say recent changes to fix
another crash related to FileSelector in gui-less scripts solved this
one, too.
#1028 - Reserved button event number:
  Menu choices generate two events, one extra related to the menu
itself, with value=4.  Made bpython ignore this extra event.
#1068 - FileSelector No file extension support:
  As Ton wrote there, Blender itself doesn't support this yet.  But the
requester also wanted Window.File/ImageSelector to accept a pathname.  Done.  Also updated doc.
#959 - Segfault on background rendering:
  This happened in bg mode (blender -b filename -a, for example) when
a script with the line "Blender.Redraw()" was linked to FRAMECHANGED events.  As reported in the bug page, it was because curarea is NULL in bg mode.  Made Redraw() check for this and not call functions that expected curarea in Redraw, like one to swap buffers.
#1072 - Blender.Redraw() Segfault:
  Good catch : ). Scripts called from the scripts win that called
Blender.Redraw() or Blender.Window.Redraw() would crash Blender because of a dirty pointer in Spacescript->script.  Fixed.
											 
										 
										
											2004-04-11 04:41:33 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									/* prepare the new ones and insert them */ 
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									Py_XINCREF (  newdrawc  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									Py_XINCREF (  neweventc  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									Py_XINCREF (  newbuttonc  ) ; 
							 
						 
					
						
							
								
									
										
											 
										
											
												BPython: cleaning some bug tracker entries:
(excuse me for doing all in a single commit, but they are tiny
fixes and it's bpython, that dark corner ...)
#1025 - FileSelector SEGV on dynamic callback Category:
  Can't reproduce with current cvs, I'd say recent changes to fix
another crash related to FileSelector in gui-less scripts solved this
one, too.
#1028 - Reserved button event number:
  Menu choices generate two events, one extra related to the menu
itself, with value=4.  Made bpython ignore this extra event.
#1068 - FileSelector No file extension support:
  As Ton wrote there, Blender itself doesn't support this yet.  But the
requester also wanted Window.File/ImageSelector to accept a pathname.  Done.  Also updated doc.
#959 - Segfault on background rendering:
  This happened in bg mode (blender -b filename -a, for example) when
a script with the line "Blender.Redraw()" was linked to FRAMECHANGED events.  As reported in the bug page, it was because curarea is NULL in bg mode.  Made Redraw() check for this and not call functions that expected curarea in Redraw, like one to swap buffers.
#1072 - Blender.Redraw() Segfault:
  Good catch : ). Scripts called from the scripts win that called
Blender.Redraw() or Blender.Window.Redraw() would crash Blender because of a dirty pointer in Spacescript->script.  Fixed.
											 
										 
										
											2004-04-11 04:41:33 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									script - > py_draw  =  newdrawc ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									script - > py_event  =  neweventc ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									script - > py_button  =  newbuttonc ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									scrarea_queue_redraw (  sc - > area  ) ; 
							 
						 
					
						
							
								
									
										
											 
										
											
												BPython: cleaning some bug tracker entries:
(excuse me for doing all in a single commit, but they are tiny
fixes and it's bpython, that dark corner ...)
#1025 - FileSelector SEGV on dynamic callback Category:
  Can't reproduce with current cvs, I'd say recent changes to fix
another crash related to FileSelector in gui-less scripts solved this
one, too.
#1028 - Reserved button event number:
  Menu choices generate two events, one extra related to the menu
itself, with value=4.  Made bpython ignore this extra event.
#1068 - FileSelector No file extension support:
  As Ton wrote there, Blender itself doesn't support this yet.  But the
requester also wanted Window.File/ImageSelector to accept a pathname.  Done.  Also updated doc.
#959 - Segfault on background rendering:
  This happened in bg mode (blender -b filename -a, for example) when
a script with the line "Blender.Redraw()" was linked to FRAMECHANGED events.  As reported in the bug page, it was because curarea is NULL in bg mode.  Made Redraw() check for this and not call functions that expected curarea in Redraw, like one to swap buffers.
#1072 - Blender.Redraw() Segfault:
  Good catch : ). Scripts called from the scripts win that called
Blender.Redraw() or Blender.Window.Redraw() would crash Blender because of a dirty pointer in Spacescript->script.  Fixed.
											 
										 
										
											2004-04-11 04:41:33 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2007-04-24 17:28:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									Py_RETURN_NONE ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-05-08 03:06:46 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								static  PyObject  * Method_Redraw (  PyObject  *  self ,  PyObject  *  args  )  
						 
					
						
							
								
									
										
										
										
											2003-05-08 03:06:46 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								{  
						 
					
						
							
								
									
										
											 
										
											
												BPython: cleaning some bug tracker entries:
(excuse me for doing all in a single commit, but they are tiny
fixes and it's bpython, that dark corner ...)
#1025 - FileSelector SEGV on dynamic callback Category:
  Can't reproduce with current cvs, I'd say recent changes to fix
another crash related to FileSelector in gui-less scripts solved this
one, too.
#1028 - Reserved button event number:
  Menu choices generate two events, one extra related to the menu
itself, with value=4.  Made bpython ignore this extra event.
#1068 - FileSelector No file extension support:
  As Ton wrote there, Blender itself doesn't support this yet.  But the
requester also wanted Window.File/ImageSelector to accept a pathname.  Done.  Also updated doc.
#959 - Segfault on background rendering:
  This happened in bg mode (blender -b filename -a, for example) when
a script with the line "Blender.Redraw()" was linked to FRAMECHANGED events.  As reported in the bug page, it was because curarea is NULL in bg mode.  Made Redraw() check for this and not call functions that expected curarea in Redraw, like one to swap buffers.
#1072 - Blender.Redraw() Segfault:
  Good catch : ). Scripts called from the scripts win that called
Blender.Redraw() or Blender.Window.Redraw() would crash Blender because of a dirty pointer in Spacescript->script.  Fixed.
											 
										 
										
											2004-04-11 04:41:33 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									int  after  =  0 ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-12-14 01:18:09 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2008-09-14 05:10:45 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if  ( G . background )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										Py_RETURN_NONE ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if (  ! PyArg_ParseTuple (  args ,  " |i " ,  & after  )  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  EXPP_ReturnPyObjError (  PyExc_TypeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													      " expected int argument (or nothing) "  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-12-14 01:18:09 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if (  after  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										addafterqueue (  curarea - > win ,  REDRAW ,  1  ) ; 
							 
						 
					
						
							
								
									
										
											 
										
											
												BPython: cleaning some bug tracker entries:
(excuse me for doing all in a single commit, but they are tiny
fixes and it's bpython, that dark corner ...)
#1025 - FileSelector SEGV on dynamic callback Category:
  Can't reproduce with current cvs, I'd say recent changes to fix
another crash related to FileSelector in gui-less scripts solved this
one, too.
#1028 - Reserved button event number:
  Menu choices generate two events, one extra related to the menu
itself, with value=4.  Made bpython ignore this extra event.
#1068 - FileSelector No file extension support:
  As Ton wrote there, Blender itself doesn't support this yet.  But the
requester also wanted Window.File/ImageSelector to accept a pathname.  Done.  Also updated doc.
#959 - Segfault on background rendering:
  This happened in bg mode (blender -b filename -a, for example) when
a script with the line "Blender.Redraw()" was linked to FRAMECHANGED events.  As reported in the bug page, it was because curarea is NULL in bg mode.  Made Redraw() check for this and not call functions that expected curarea in Redraw, like one to swap buffers.
#1072 - Blender.Redraw() Segfault:
  Good catch : ). Scripts called from the scripts win that called
Blender.Redraw() or Blender.Window.Redraw() would crash Blender because of a dirty pointer in Spacescript->script.  Fixed.
											 
										 
										
											2004-04-11 04:41:33 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									else 
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										scrarea_queue_winredraw (  curarea  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-12-14 01:18:09 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2007-04-24 17:28:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									Py_RETURN_NONE ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-05-08 03:06:46 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2007-07-12 20:49:36 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								static  PyObject  * Method_Draw (  PyObject  *  self  )  
						 
					
						
							
								
									
										
										
										
											2003-05-08 03:06:46 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								{  
						 
					
						
							
								
									
										
										
										
											2008-09-14 05:10:45 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if  ( G . background )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										Py_RETURN_NONE ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									
							 
						 
					
						
							
								
									
										
											 
										
											
												BPython: cleaning some bug tracker entries:
(excuse me for doing all in a single commit, but they are tiny
fixes and it's bpython, that dark corner ...)
#1025 - FileSelector SEGV on dynamic callback Category:
  Can't reproduce with current cvs, I'd say recent changes to fix
another crash related to FileSelector in gui-less scripts solved this
one, too.
#1028 - Reserved button event number:
  Menu choices generate two events, one extra related to the menu
itself, with value=4.  Made bpython ignore this extra event.
#1068 - FileSelector No file extension support:
  As Ton wrote there, Blender itself doesn't support this yet.  But the
requester also wanted Window.File/ImageSelector to accept a pathname.  Done.  Also updated doc.
#959 - Segfault on background rendering:
  This happened in bg mode (blender -b filename -a, for example) when
a script with the line "Blender.Redraw()" was linked to FRAMECHANGED events.  As reported in the bug page, it was because curarea is NULL in bg mode.  Made Redraw() check for this and not call functions that expected curarea in Redraw, like one to swap buffers.
#1072 - Blender.Redraw() Segfault:
  Good catch : ). Scripts called from the scripts win that called
Blender.Redraw() or Blender.Window.Redraw() would crash Blender because of a dirty pointer in Spacescript->script.  Fixed.
											 
										 
										
											2004-04-11 04:41:33 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									/*@ If forced drawing is disable queue a redraw event instead */ 
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if (  EXPP_disable_force_draw  )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										scrarea_queue_winredraw (  curarea  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2007-04-24 17:28:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										Py_RETURN_NONE ; 
							 
						 
					
						
							
								
									
										
											 
										
											
												BPython: cleaning some bug tracker entries:
(excuse me for doing all in a single commit, but they are tiny
fixes and it's bpython, that dark corner ...)
#1025 - FileSelector SEGV on dynamic callback Category:
  Can't reproduce with current cvs, I'd say recent changes to fix
another crash related to FileSelector in gui-less scripts solved this
one, too.
#1028 - Reserved button event number:
  Menu choices generate two events, one extra related to the menu
itself, with value=4.  Made bpython ignore this extra event.
#1068 - FileSelector No file extension support:
  As Ton wrote there, Blender itself doesn't support this yet.  But the
requester also wanted Window.File/ImageSelector to accept a pathname.  Done.  Also updated doc.
#959 - Segfault on background rendering:
  This happened in bg mode (blender -b filename -a, for example) when
a script with the line "Blender.Redraw()" was linked to FRAMECHANGED events.  As reported in the bug page, it was because curarea is NULL in bg mode.  Made Redraw() check for this and not call functions that expected curarea in Redraw, like one to swap buffers.
#1072 - Blender.Redraw() Segfault:
  Good catch : ). Scripts called from the scripts win that called
Blender.Redraw() or Blender.Window.Redraw() would crash Blender because of a dirty pointer in Spacescript->script.  Fixed.
											 
										 
										
											2004-04-11 04:41:33 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2003-05-13 01:54:28 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									scrarea_do_windraw (  curarea  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-05-08 03:06:46 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									screen_swapbuffers (   ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-05-13 01:54:28 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2007-04-24 17:28:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									Py_RETURN_NONE ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-05-08 03:06:46 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								static  PyObject  * Method_Create (  PyObject  *  self ,  PyObject  *  args  )  
						 
					
						
							
								
									
										
										
										
											2003-05-08 03:06:46 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								{  
						 
					
						
							
								
									
										
										
										
											2006-05-20 15:44:14 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									Button  * but  =  NULL ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									PyObject  * val ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									char  * newstr ; 
							 
						 
					
						
							
								
									
										
											 
										
											
												BPython: cleaning some bug tracker entries:
(excuse me for doing all in a single commit, but they are tiny
fixes and it's bpython, that dark corner ...)
#1025 - FileSelector SEGV on dynamic callback Category:
  Can't reproduce with current cvs, I'd say recent changes to fix
another crash related to FileSelector in gui-less scripts solved this
one, too.
#1028 - Reserved button event number:
  Menu choices generate two events, one extra related to the menu
itself, with value=4.  Made bpython ignore this extra event.
#1068 - FileSelector No file extension support:
  As Ton wrote there, Blender itself doesn't support this yet.  But the
requester also wanted Window.File/ImageSelector to accept a pathname.  Done.  Also updated doc.
#959 - Segfault on background rendering:
  This happened in bg mode (blender -b filename -a, for example) when
a script with the line "Blender.Redraw()" was linked to FRAMECHANGED events.  As reported in the bug page, it was because curarea is NULL in bg mode.  Made Redraw() check for this and not call functions that expected curarea in Redraw, like one to swap buffers.
#1072 - Blender.Redraw() Segfault:
  Good catch : ). Scripts called from the scripts win that called
Blender.Redraw() or Blender.Window.Redraw() would crash Blender because of a dirty pointer in Spacescript->script.  Fixed.
											 
										 
										
											2004-04-11 04:41:33 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2006-05-20 15:44:14 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									but  =  newbutton ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2007-07-21 23:24:08 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									/* If this function dosnt sucseed this will need to be deallocated,
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									 *  make  sure  the  type  is  NOT  BSTRING_TYPE  before  deallocing  - 1  is  ok . 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									 *  so  we  dont  dealloc  with  an  uninitialized  value  wich  would  be  bad !  */ 
							 
						 
					
						
							
								
									
										
										
										
											2006-05-20 15:44:14 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if  (  PyArg_ParseTuple (  args ,  " fff " ,  but - > val . asvec ,  but - > val . asvec + 1 ,  but - > val . asvec + 2  )  )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										but - > type  =  BVECTOR_TYPE ; 
							 
						 
					
						
							
								
									
										
										
										
											2007-07-21 23:24:08 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									}  else  if  (  PyArg_ParseTuple (  args ,  " O! " ,  & PyFloat_Type ,  & val  )  )  { 
							 
						 
					
						
							
								
									
										
										
										
											2006-05-20 15:44:14 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										but - > val . asfloat  =  ( float ) PyFloat_AS_DOUBLE ( val ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2006-01-08 18:59:55 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										but - > type  =  BFLOAT_TYPE ; 
							 
						 
					
						
							
								
									
										
										
										
											2007-07-21 23:24:08 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									}  else  if  (  PyArg_ParseTuple (  args ,  " O! " ,  & PyInt_Type ,  & val  )  )  { 
							 
						 
					
						
							
								
									
										
										
										
											2006-05-20 15:44:14 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										but - > val . asint  =  ( int ) PyInt_AS_LONG ( val ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2006-01-08 18:59:55 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										but - > type  =  BINT_TYPE ; 
							 
						 
					
						
							
								
									
										
										
										
											2007-07-21 23:24:08 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									}  else  if  (  PyArg_ParseTuple (  args ,  " s# " ,  & newstr ,  & but - > slen  )  )  { 
							 
						 
					
						
							
								
									
										
										
										
											2006-06-20 18:31:05 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										if  ( but - > slen  +  1  >  UI_MAX_DRAW_STR )  { 
							 
						 
					
						
							
								
									
										
										
										
											2007-07-21 23:24:08 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											but - > type  =  - 1 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											Py_DECREF ( ( PyObject  * ) but ) ;  /* will remove */ 
							 
						 
					
						
							
								
									
										
										
										
											2006-06-20 18:31:05 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											but  =  NULL ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											PyErr_SetString (  PyExc_TypeError ,  " string is longer then 399 chars " ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										}  else  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											but - > type  =  BSTRING_TYPE ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											but - > val . asstr  =  MEM_mallocN (  but - > slen  +  1 ,  " button string "  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											BLI_strncpy (  but - > val . asstr ,  newstr ,  but - > slen + 1  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										} 
							 
						 
					
						
							
								
									
										
										
										
											2007-07-21 23:24:08 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									}  else  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										but - > type  =  - 1 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										Py_DECREF ( ( PyObject  * ) but ) ;  /* will remove */ 
							 
						 
					
						
							
								
									
										
										
										
											2006-05-20 15:44:14 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										but  =  NULL ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										PyErr_SetString (  PyExc_TypeError ,  " expected string, float, int or 3-float tuple argument "  ) ; 
							 
						 
					
						
							
								
									
										
											 
										
											
												BPython: cleaning some bug tracker entries:
(excuse me for doing all in a single commit, but they are tiny
fixes and it's bpython, that dark corner ...)
#1025 - FileSelector SEGV on dynamic callback Category:
  Can't reproduce with current cvs, I'd say recent changes to fix
another crash related to FileSelector in gui-less scripts solved this
one, too.
#1028 - Reserved button event number:
  Menu choices generate two events, one extra related to the menu
itself, with value=4.  Made bpython ignore this extra event.
#1068 - FileSelector No file extension support:
  As Ton wrote there, Blender itself doesn't support this yet.  But the
requester also wanted Window.File/ImageSelector to accept a pathname.  Done.  Also updated doc.
#959 - Segfault on background rendering:
  This happened in bg mode (blender -b filename -a, for example) when
a script with the line "Blender.Redraw()" was linked to FRAMECHANGED events.  As reported in the bug page, it was because curarea is NULL in bg mode.  Made Redraw() check for this and not call functions that expected curarea in Redraw, like one to swap buffers.
#1072 - Blender.Redraw() Segfault:
  Good catch : ). Scripts called from the scripts win that called
Blender.Redraw() or Blender.Window.Redraw() would crash Blender because of a dirty pointer in Spacescript->script.  Fixed.
											 
										 
										
											2004-04-11 04:41:33 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2006-05-22 01:59:28 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if  ( but  ! =  NULL )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										PyErr_Clear ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
									
										
											 
										
											
												BPython: cleaning some bug tracker entries:
(excuse me for doing all in a single commit, but they are tiny
fixes and it's bpython, that dark corner ...)
#1025 - FileSelector SEGV on dynamic callback Category:
  Can't reproduce with current cvs, I'd say recent changes to fix
another crash related to FileSelector in gui-less scripts solved this
one, too.
#1028 - Reserved button event number:
  Menu choices generate two events, one extra related to the menu
itself, with value=4.  Made bpython ignore this extra event.
#1068 - FileSelector No file extension support:
  As Ton wrote there, Blender itself doesn't support this yet.  But the
requester also wanted Window.File/ImageSelector to accept a pathname.  Done.  Also updated doc.
#959 - Segfault on background rendering:
  This happened in bg mode (blender -b filename -a, for example) when
a script with the line "Blender.Redraw()" was linked to FRAMECHANGED events.  As reported in the bug page, it was because curarea is NULL in bg mode.  Made Redraw() check for this and not call functions that expected curarea in Redraw, like one to swap buffers.
#1072 - Blender.Redraw() Segfault:
  Good catch : ). Scripts called from the scripts win that called
Blender.Redraw() or Blender.Window.Redraw() would crash Blender because of a dirty pointer in Spacescript->script.  Fixed.
											 
										 
										
											2004-04-11 04:41:33 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2006-05-20 15:44:14 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									return  ( PyObject * )  but ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-05-08 03:06:46 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2007-07-27 06:14:25 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2007-04-22 13:48:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								static  PyObject  * Method_UIBlock (  PyObject  *  self ,  PyObject  *  args  )  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								{  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									PyObject  * val  =  NULL ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									PyObject  * result  =  NULL ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									ListBase  listb =  { NULL ,  NULL } ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-10-22 08:21:43 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									int  mouse_exit  =  1 ; 
							 
						 
					
						
							
								
									
										
										
										
											2007-04-22 13:48:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2008-09-14 05:10:45 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if  ( G . background )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  EXPP_ReturnPyObjError (  PyExc_RuntimeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													      " Can't run Draw.UIBlock() in background mode. "  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									
							 
						 
					
						
							
								
									
										
										
										
											2008-10-22 08:21:43 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if  (  ! PyArg_ParseTuple (  args ,  " O|i " ,  & val ,  & mouse_exit  )  | |  ! PyCallable_Check (  val  )  )  
							 
						 
					
						
							
								
									
										
										
										
											2007-04-22 13:48:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										return  EXPP_ReturnPyObjError (  PyExc_AttributeError , 
							 
						 
					
						
							
								
									
										
										
										
											2008-10-22 08:21:43 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
													      " expected 1 python function and an optional int "  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2007-04-22 13:48:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if  ( uiblock ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  EXPP_ReturnPyObjError (  PyExc_RuntimeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									      " cannot run more then 1 UIBlock at a time "  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2007-07-27 06:14:25 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									BPy_Set_DrawButtonsList ( PyList_New ( 0 ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2007-04-22 13:48:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									mywinset ( G . curscreen - > mainwin ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									uiblock =  uiNewBlock ( & listb ,  " numbuts " ,  UI_EMBOSS ,  UI_HELV ,  G . curscreen - > mainwin ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									uiBlockSetFlag ( uiblock ,  UI_BLOCK_LOOP | UI_BLOCK_REDRAW ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-10-22 08:21:43 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									result  =  PyObject_CallObject (  val ,  NULL  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2007-07-27 06:14:25 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									
							 
						 
					
						
							
								
									
										
										
										
											2007-04-22 13:48:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if  ( ! result )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										PyErr_Print (   ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-03-15 18:53:42 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										error_pyscript (   ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2007-04-22 13:48:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									}  else  { 
							 
						 
					
						
							
								
									
										
										
										
											2007-08-21 19:37:03 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										/* copied from do_clever_numbuts in toolbox.c */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										/* Clear all events so tooltips work, this is not ideal and
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										only  needed  because  calls  from  the  menu  still  have  some  events 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										left  over  when  do_clever_numbuts  is  called . 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										Calls  from  keyshortcuts  do  not  have  this  problem . */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										ScrArea  * sa ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										BWinEvent  temp_bevt ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										for  ( sa =  G . curscreen - > areabase . first ;  sa ;  sa =  sa - > next )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											if ( sa - > win )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												while (  bwin_qread (  sa - > win ,  & temp_bevt  )  )  { } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											if ( sa - > headwin )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												while (  bwin_qread (  sa - > headwin ,  & temp_bevt  )  )  { } 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										/* Done clearing events */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										
							 
						 
					
						
							
								
									
										
										
										
											2007-04-22 13:48:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										uiBoundsBlock ( uiblock ,  5 ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-10-22 08:21:43 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										uiDoBlocks ( & listb ,  0 ,  mouse_exit ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2007-04-22 13:48:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									uiFreeBlocks ( & listb ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									uiblock  =  NULL ; 
							 
						 
					
						
							
								
									
										
										
										
											2007-07-27 06:14:25 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									BPy_Free_DrawButtonsList ( ) ;  /*clear all temp button references*/ 
							 
						 
					
						
							
								
									
										
										
										
											2007-04-22 13:48:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									Py_XDECREF (  result  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									Py_RETURN_NONE ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2008-09-29 17:08:11 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								#if 0  /* not used yet */
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								static  void  Set_uiBlock ( uiBlock  * block )  
						 
					
						
							
								
									
										
										
										
											2007-07-27 06:14:25 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								{  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									uiblock  =  block ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
									
										
										
										
											2008-09-29 17:08:11 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								# endif 
  
						 
					
						
							
								
									
										
										
										
											2007-07-27 06:14:25 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								static  uiBlock  * Get_uiBlock (  void  )  
						 
					
						
							
								
									
										
										
										
											2003-05-08 03:06:46 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								{  
						 
					
						
							
								
									
										
											 
										
											
												BPython: cleaning some bug tracker entries:
(excuse me for doing all in a single commit, but they are tiny
fixes and it's bpython, that dark corner ...)
#1025 - FileSelector SEGV on dynamic callback Category:
  Can't reproduce with current cvs, I'd say recent changes to fix
another crash related to FileSelector in gui-less scripts solved this
one, too.
#1028 - Reserved button event number:
  Menu choices generate two events, one extra related to the menu
itself, with value=4.  Made bpython ignore this extra event.
#1068 - FileSelector No file extension support:
  As Ton wrote there, Blender itself doesn't support this yet.  But the
requester also wanted Window.File/ImageSelector to accept a pathname.  Done.  Also updated doc.
#959 - Segfault on background rendering:
  This happened in bg mode (blender -b filename -a, for example) when
a script with the line "Blender.Redraw()" was linked to FRAMECHANGED events.  As reported in the bug page, it was because curarea is NULL in bg mode.  Made Redraw() check for this and not call functions that expected curarea in Redraw, like one to swap buffers.
#1072 - Blender.Redraw() Segfault:
  Good catch : ). Scripts called from the scripts win that called
Blender.Redraw() or Blender.Window.Redraw() would crash Blender because of a dirty pointer in Spacescript->script.  Fixed.
											 
										 
										
											2004-04-11 04:41:33 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									char  butblock [ 32 ] ; 
							 
						 
					
						
							
								
									
										
										
										
											2007-04-22 13:48:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									/* Global, used now for UIBlock */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if  ( uiblock )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  uiblock ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									/* Local */ 
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									sprintf (  butblock ,  " win %d " ,  curarea - > win  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-05-08 03:06:46 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									return  uiGetBlock (  butblock ,  curarea  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-05-08 03:06:46 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2007-04-22 13:48:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
											 
										
											
												BPython bug fixes:
- #2646 reported by Campbell: Python/Fileselector (moving from fileselector called by script to another space caused script to hang around open but not accessible)
http://projects.blender.org/tracker/?func=detail&atid=125&aid=2646&group_id=9
- #2676 reported by Wim Van Hoydonck: 2.37 python scripts gui: event 8 ignored (thanks Ton for discussing / pointing what to do, Ken Hughes for also working on a fix)
http://projects.blender.org/tracker/?func=detail&atid=125&aid=2676&group_id=9
- gui-less scripts with calls to progress bar inside fileselector callbacks didn't return to the previous space on exit (staying on Scripts win), requiring an event to do so (mouse movement, for example).  Quick fix for now, will rework a little after 2.37a for a better alternative, not needing to move to the Scripts win at all.
- added syntax colors access to Window.Theme module.
Scripts:
- updates by Jean-Michel Soler: svg2obj (svg paths import), tex2uvbaker, fixfromarmature;
- updates by Campbell Barton: obj import / export, console;
- tiny: converted vrml97 export to unix line endings;
- updates in ac3d exporter, help browser, save theme.
Thanks all mentioned above.
											 
										 
										
											2005-06-11 05:30:14 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								/* We restrict the acceptable event numbers to a proper "free" range
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								 *  according  to  other  spaces  in  Blender . 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								 *  winqread * * * space ( )  ( space  events  callbacks )  use  short  for  events 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								 *  ( called  ' val '  there )  and  we  also  translate  by  EXPP_BUTTON_EVENTS_OFFSET 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								 *  to  get  rid  of  unwanted  events  ( check  BPY_do_pywin_events  above  for 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								 *  explanation ) .  This  function  takes  care  of  that  and  proper  checking :  */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								static  int  check_button_event ( int  * event )  {  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if  ( ( * event  <  EXPP_BUTTON_EVENTS_MIN )  | | 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											( * event  >  EXPP_BUTTON_EVENTS_MAX ) )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  - 1 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2007-04-22 13:48:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if  ( uiblock = = NULL )  /* For UIBlock we need non offset UI elements */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										* event  + =  EXPP_BUTTON_EVENTS_OFFSET ; 
							 
						 
					
						
							
								
									
										
											 
										
											
												BPython bug fixes:
- #2646 reported by Campbell: Python/Fileselector (moving from fileselector called by script to another space caused script to hang around open but not accessible)
http://projects.blender.org/tracker/?func=detail&atid=125&aid=2646&group_id=9
- #2676 reported by Wim Van Hoydonck: 2.37 python scripts gui: event 8 ignored (thanks Ton for discussing / pointing what to do, Ken Hughes for also working on a fix)
http://projects.blender.org/tracker/?func=detail&atid=125&aid=2676&group_id=9
- gui-less scripts with calls to progress bar inside fileselector callbacks didn't return to the previous space on exit (staying on Scripts win), requiring an event to do so (mouse movement, for example).  Quick fix for now, will rework a little after 2.37a for a better alternative, not needing to move to the Scripts win at all.
- added syntax colors access to Window.Theme module.
Scripts:
- updates by Jean-Michel Soler: svg2obj (svg paths import), tex2uvbaker, fixfromarmature;
- updates by Campbell Barton: obj import / export, console;
- tiny: converted vrml97 export to unix line endings;
- updates in ac3d exporter, help browser, save theme.
Thanks all mentioned above.
											 
										 
										
											2005-06-11 05:30:14 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									return  0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2007-01-06 04:10:51 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								static  PyObject  * Method_BeginAlign (  PyObject  *  self ,  PyObject  *  args  )  
						 
					
						
							
								
									
										
										
										
											2006-12-23 00:56:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								{  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									uiBlock  * block  =  Get_uiBlock (   ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if  ( block ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										uiBlockBeginAlign ( block ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									
							 
						 
					
						
							
								
									
										
										
										
											2007-04-24 17:28:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									Py_RETURN_NONE ; 
							 
						 
					
						
							
								
									
										
										
										
											2006-12-23 00:56:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2007-01-06 04:10:51 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								static  PyObject  * Method_EndAlign (  PyObject  *  self ,  PyObject  *  args  )  
						 
					
						
							
								
									
										
										
										
											2006-12-23 00:56:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								{  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									uiBlock  * block  =  Get_uiBlock (   ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if  ( block ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										uiBlockEndAlign ( block ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									
							 
						 
					
						
							
								
									
										
										
										
											2007-04-24 17:28:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									Py_RETURN_NONE ; 
							 
						 
					
						
							
								
									
										
										
										
											2006-12-23 00:56:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2007-04-22 13:48:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								static  PyObject  * Method_Button (  PyObject  *  self ,  PyObject  *  args  )  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								{  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									uiBlock  * block ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									char  * name ,  * tip  =  NULL ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									int  event ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									int  x ,  y ,  w ,  h ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									PyObject  * callback = NULL ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2008-09-14 05:10:45 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if  ( G . background )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  EXPP_ReturnPyObjError (  PyExc_RuntimeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													      " Can't run Draw.Button() in background mode. "  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									
							 
						 
					
						
							
								
									
										
										
										
											2007-04-22 13:48:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if (  ! PyArg_ParseTuple (  args ,  " siiiii|sO " ,  & name ,  & event , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											       & x ,  & y ,  & w ,  & h ,  & tip ,  & callback  )  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  EXPP_ReturnPyObjError (  PyExc_TypeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													      " expected a string, five ints and optionally string and callback arguments "  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									UI_METHOD_ERRORCHECK ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									block  =  Get_uiBlock (   ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if (  block  )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										uiBut  * ubut  =  uiDefBut (  block ,  BUT ,  event ,  name ,  ( short ) x ,  ( short ) y ,  ( short ) w ,  ( short ) h ,  0 ,  0 ,  0 ,  0 ,  0 ,  tip  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2007-07-27 06:14:25 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										set_pycallback ( ubut ,  callback ,  NULL ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2007-04-22 13:48:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2007-04-24 17:28:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									Py_RETURN_NONE ; 
							 
						 
					
						
							
								
									
										
										
										
											2007-04-22 13:48:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								static  PyObject  * Method_Menu (  PyObject  *  self ,  PyObject  *  args  )  
						 
					
						
							
								
									
										
										
										
											2003-05-08 03:06:46 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								{  
						 
					
						
							
								
									
										
											 
										
											
												BPython: cleaning some bug tracker entries:
(excuse me for doing all in a single commit, but they are tiny
fixes and it's bpython, that dark corner ...)
#1025 - FileSelector SEGV on dynamic callback Category:
  Can't reproduce with current cvs, I'd say recent changes to fix
another crash related to FileSelector in gui-less scripts solved this
one, too.
#1028 - Reserved button event number:
  Menu choices generate two events, one extra related to the menu
itself, with value=4.  Made bpython ignore this extra event.
#1068 - FileSelector No file extension support:
  As Ton wrote there, Blender itself doesn't support this yet.  But the
requester also wanted Window.File/ImageSelector to accept a pathname.  Done.  Also updated doc.
#959 - Segfault on background rendering:
  This happened in bg mode (blender -b filename -a, for example) when
a script with the line "Blender.Redraw()" was linked to FRAMECHANGED events.  As reported in the bug page, it was because curarea is NULL in bg mode.  Made Redraw() check for this and not call functions that expected curarea in Redraw, like one to swap buffers.
#1072 - Blender.Redraw() Segfault:
  Good catch : ). Scripts called from the scripts win that called
Blender.Redraw() or Blender.Window.Redraw() would crash Blender because of a dirty pointer in Spacescript->script.  Fixed.
											 
										 
										
											2004-04-11 04:41:33 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									uiBlock  * block ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									char  * name ,  * tip  =  NULL ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									int  event ,  def ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									int  x ,  y ,  w ,  h ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									Button  * but ; 
							 
						 
					
						
							
								
									
										
										
										
											2007-04-22 13:48:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									PyObject  * callback = NULL ; 
							 
						 
					
						
							
								
									
										
										
										
											2004-03-29 08:16:18 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2008-09-14 05:10:45 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if  ( G . background )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  EXPP_ReturnPyObjError (  PyExc_RuntimeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													      " Can't run Draw.Menu() in background mode. "  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									
							 
						 
					
						
							
								
									
										
										
										
											2007-04-22 13:48:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if (  ! PyArg_ParseTuple (  args ,  " siiiiii|sO " ,  & name ,  & event , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											       & x ,  & y ,  & w ,  & h ,  & def ,  & tip ,  & callback  )  ) 
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										return  EXPP_ReturnPyObjError (  PyExc_TypeError , 
							 
						 
					
						
							
								
									
										
										
										
											2007-04-22 13:48:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
													      " expected a string, six ints and optionally string and callback arguments "  ) ; 
							 
						 
					
						
							
								
									
										
											 
										
											
												BPython bug fixes:
- #2646 reported by Campbell: Python/Fileselector (moving from fileselector called by script to another space caused script to hang around open but not accessible)
http://projects.blender.org/tracker/?func=detail&atid=125&aid=2646&group_id=9
- #2676 reported by Wim Van Hoydonck: 2.37 python scripts gui: event 8 ignored (thanks Ton for discussing / pointing what to do, Ken Hughes for also working on a fix)
http://projects.blender.org/tracker/?func=detail&atid=125&aid=2676&group_id=9
- gui-less scripts with calls to progress bar inside fileselector callbacks didn't return to the previous space on exit (staying on Scripts win), requiring an event to do so (mouse movement, for example).  Quick fix for now, will rework a little after 2.37a for a better alternative, not needing to move to the Scripts win at all.
- added syntax colors access to Window.Theme module.
Scripts:
- updates by Jean-Michel Soler: svg2obj (svg paths import), tex2uvbaker, fixfromarmature;
- updates by Campbell Barton: obj import / export, console;
- tiny: converted vrml97 export to unix line endings;
- updates in ac3d exporter, help browser, save theme.
Thanks all mentioned above.
											 
										 
										
											2005-06-11 05:30:14 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2007-04-22 13:48:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									UI_METHOD_ERRORCHECK ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									but  =  newbutton (   ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2006-01-08 18:59:55 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									but - > type  =  BINT_TYPE ; 
							 
						 
					
						
							
								
									
										
											 
										
											
												BPython: cleaning some bug tracker entries:
(excuse me for doing all in a single commit, but they are tiny
fixes and it's bpython, that dark corner ...)
#1025 - FileSelector SEGV on dynamic callback Category:
  Can't reproduce with current cvs, I'd say recent changes to fix
another crash related to FileSelector in gui-less scripts solved this
one, too.
#1028 - Reserved button event number:
  Menu choices generate two events, one extra related to the menu
itself, with value=4.  Made bpython ignore this extra event.
#1068 - FileSelector No file extension support:
  As Ton wrote there, Blender itself doesn't support this yet.  But the
requester also wanted Window.File/ImageSelector to accept a pathname.  Done.  Also updated doc.
#959 - Segfault on background rendering:
  This happened in bg mode (blender -b filename -a, for example) when
a script with the line "Blender.Redraw()" was linked to FRAMECHANGED events.  As reported in the bug page, it was because curarea is NULL in bg mode.  Made Redraw() check for this and not call functions that expected curarea in Redraw, like one to swap buffers.
#1072 - Blender.Redraw() Segfault:
  Good catch : ). Scripts called from the scripts win that called
Blender.Redraw() or Blender.Window.Redraw() would crash Blender because of a dirty pointer in Spacescript->script.  Fixed.
											 
										 
										
											2004-04-11 04:41:33 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									but - > val . asint  =  def ; 
							 
						 
					
						
							
								
									
										
										
										
											2007-07-27 06:14:25 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if  ( tip )  strncpy ( but - > tooltip ,  tip ,  BPY_MAX_TOOLTIP ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									block  =  Get_uiBlock (   ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2007-04-22 13:48:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if (  block  )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										uiBut  * ubut  =  uiDefButI (  block ,  MENU ,  event ,  name ,  ( short ) x ,  ( short ) y ,  ( short ) w ,  ( short ) h , 
							 
						 
					
						
							
								
									
										
										
										
											2007-07-27 06:14:25 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											   & but - > val . asint ,  0 ,  0 ,  0 ,  0 ,  but - > tooltip  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										set_pycallback ( ubut ,  callback ,  but ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2007-04-22 13:48:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									return  (  PyObject  *  )  but ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-05-08 03:06:46 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								static  PyObject  * Method_Toggle (  PyObject  *  self ,  PyObject  *  args  )  
						 
					
						
							
								
									
										
										
										
											2003-05-08 03:06:46 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								{  
						 
					
						
							
								
									
										
											 
										
											
												BPython: cleaning some bug tracker entries:
(excuse me for doing all in a single commit, but they are tiny
fixes and it's bpython, that dark corner ...)
#1025 - FileSelector SEGV on dynamic callback Category:
  Can't reproduce with current cvs, I'd say recent changes to fix
another crash related to FileSelector in gui-less scripts solved this
one, too.
#1028 - Reserved button event number:
  Menu choices generate two events, one extra related to the menu
itself, with value=4.  Made bpython ignore this extra event.
#1068 - FileSelector No file extension support:
  As Ton wrote there, Blender itself doesn't support this yet.  But the
requester also wanted Window.File/ImageSelector to accept a pathname.  Done.  Also updated doc.
#959 - Segfault on background rendering:
  This happened in bg mode (blender -b filename -a, for example) when
a script with the line "Blender.Redraw()" was linked to FRAMECHANGED events.  As reported in the bug page, it was because curarea is NULL in bg mode.  Made Redraw() check for this and not call functions that expected curarea in Redraw, like one to swap buffers.
#1072 - Blender.Redraw() Segfault:
  Good catch : ). Scripts called from the scripts win that called
Blender.Redraw() or Blender.Window.Redraw() would crash Blender because of a dirty pointer in Spacescript->script.  Fixed.
											 
										 
										
											2004-04-11 04:41:33 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									uiBlock  * block ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									char  * name ,  * tip  =  NULL ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									int  event ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									int  x ,  y ,  w ,  h ,  def ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									Button  * but ; 
							 
						 
					
						
							
								
									
										
										
										
											2007-04-22 13:48:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									PyObject  * callback = NULL ; 
							 
						 
					
						
							
								
									
										
										
										
											2004-03-29 08:16:18 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2008-09-14 05:10:45 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if  ( G . background )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  EXPP_ReturnPyObjError (  PyExc_RuntimeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													      " Can't run Draw.Toggle() in background mode. "  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									
							 
						 
					
						
							
								
									
										
										
										
											2007-04-22 13:48:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if (  ! PyArg_ParseTuple (  args ,  " siiiiii|sO " ,  & name ,  & event , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											       & x ,  & y ,  & w ,  & h ,  & def ,  & tip ,  & callback  )  ) 
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										return  EXPP_ReturnPyObjError (  PyExc_TypeError , 
							 
						 
					
						
							
								
									
										
										
										
											2007-04-22 13:48:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
													      " expected a string, six ints and optionally string and callback arguments "  ) ; 
							 
						 
					
						
							
								
									
										
											 
										
											
												BPython bug fixes:
- #2646 reported by Campbell: Python/Fileselector (moving from fileselector called by script to another space caused script to hang around open but not accessible)
http://projects.blender.org/tracker/?func=detail&atid=125&aid=2646&group_id=9
- #2676 reported by Wim Van Hoydonck: 2.37 python scripts gui: event 8 ignored (thanks Ton for discussing / pointing what to do, Ken Hughes for also working on a fix)
http://projects.blender.org/tracker/?func=detail&atid=125&aid=2676&group_id=9
- gui-less scripts with calls to progress bar inside fileselector callbacks didn't return to the previous space on exit (staying on Scripts win), requiring an event to do so (mouse movement, for example).  Quick fix for now, will rework a little after 2.37a for a better alternative, not needing to move to the Scripts win at all.
- added syntax colors access to Window.Theme module.
Scripts:
- updates by Jean-Michel Soler: svg2obj (svg paths import), tex2uvbaker, fixfromarmature;
- updates by Campbell Barton: obj import / export, console;
- tiny: converted vrml97 export to unix line endings;
- updates in ac3d exporter, help browser, save theme.
Thanks all mentioned above.
											 
										 
										
											2005-06-11 05:30:14 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2007-04-22 13:48:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									UI_METHOD_ERRORCHECK ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									but  =  newbutton (   ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2006-01-08 18:59:55 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									but - > type  =  BINT_TYPE ; 
							 
						 
					
						
							
								
									
										
											 
										
											
												BPython: cleaning some bug tracker entries:
(excuse me for doing all in a single commit, but they are tiny
fixes and it's bpython, that dark corner ...)
#1025 - FileSelector SEGV on dynamic callback Category:
  Can't reproduce with current cvs, I'd say recent changes to fix
another crash related to FileSelector in gui-less scripts solved this
one, too.
#1028 - Reserved button event number:
  Menu choices generate two events, one extra related to the menu
itself, with value=4.  Made bpython ignore this extra event.
#1068 - FileSelector No file extension support:
  As Ton wrote there, Blender itself doesn't support this yet.  But the
requester also wanted Window.File/ImageSelector to accept a pathname.  Done.  Also updated doc.
#959 - Segfault on background rendering:
  This happened in bg mode (blender -b filename -a, for example) when
a script with the line "Blender.Redraw()" was linked to FRAMECHANGED events.  As reported in the bug page, it was because curarea is NULL in bg mode.  Made Redraw() check for this and not call functions that expected curarea in Redraw, like one to swap buffers.
#1072 - Blender.Redraw() Segfault:
  Good catch : ). Scripts called from the scripts win that called
Blender.Redraw() or Blender.Window.Redraw() would crash Blender because of a dirty pointer in Spacescript->script.  Fixed.
											 
										 
										
											2004-04-11 04:41:33 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									but - > val . asint  =  def ; 
							 
						 
					
						
							
								
									
										
										
										
											2007-07-27 06:14:25 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if  ( tip )  strncpy ( but - > tooltip ,  tip ,  BPY_MAX_TOOLTIP ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									block  =  Get_uiBlock (   ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2007-04-22 13:48:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if (  block  )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										uiBut  * ubut  =  uiDefButI (  block ,  TOG ,  event ,  name ,  ( short ) x ,  ( short ) y ,  ( short ) w ,  ( short ) h , 
							 
						 
					
						
							
								
									
										
										
										
											2007-07-27 06:14:25 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											   & but - > val . asint ,  0 ,  0 ,  0 ,  0 ,  but - > tooltip  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										set_pycallback ( ubut ,  callback ,  but ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2007-04-22 13:48:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									return  (  PyObject  *  )  but ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-05-08 03:06:46 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								/*@DO NOT TOUCH THIS FUNCTION !
  
						 
					
						
							
								
									
										
										
										
											2003-12-14 01:18:09 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									 Redrawing  a  slider  inside  its  own  callback  routine  is  actually  forbidden 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									 with  the  current  toolkit  architecture  ( button  routines  are  not  reentrant ) . 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									 But  it  works  anyway . 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									 XXX  This  is  condemned  to  be  dinosource  in  future  -  it ' s  a  hack . 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									 */ 
							 
						 
					
						
							
								
									
										
										
										
											2003-05-08 03:06:46 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								static  void  py_slider_update (  void  * butv ,  void  * data2_unused  )  
						 
					
						
							
								
									
										
										
										
											2003-05-08 03:06:46 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								{  
						 
					
						
							
								
									
										
											 
										
											
												BPython: cleaning some bug tracker entries:
(excuse me for doing all in a single commit, but they are tiny
fixes and it's bpython, that dark corner ...)
#1025 - FileSelector SEGV on dynamic callback Category:
  Can't reproduce with current cvs, I'd say recent changes to fix
another crash related to FileSelector in gui-less scripts solved this
one, too.
#1028 - Reserved button event number:
  Menu choices generate two events, one extra related to the menu
itself, with value=4.  Made bpython ignore this extra event.
#1068 - FileSelector No file extension support:
  As Ton wrote there, Blender itself doesn't support this yet.  But the
requester also wanted Window.File/ImageSelector to accept a pathname.  Done.  Also updated doc.
#959 - Segfault on background rendering:
  This happened in bg mode (blender -b filename -a, for example) when
a script with the line "Blender.Redraw()" was linked to FRAMECHANGED events.  As reported in the bug page, it was because curarea is NULL in bg mode.  Made Redraw() check for this and not call functions that expected curarea in Redraw, like one to swap buffers.
#1072 - Blender.Redraw() Segfault:
  Good catch : ). Scripts called from the scripts win that called
Blender.Redraw() or Blender.Window.Redraw() would crash Blender because of a dirty pointer in Spacescript->script.  Fixed.
											 
										 
										
											2004-04-11 04:41:33 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									uiBut  * but  =  butv ; 
							 
						 
					
						
							
								
									
										
										
										
											2005-06-12 05:54:15 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									PyObject  * ref  =  Py_BuildValue (  " (i) " ,  SPACE_VIEW3D  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									PyObject  * ret  =  NULL ; 
							 
						 
					
						
							
								
									
										
										
										
											2004-03-29 08:16:18 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
											 
										
											
												BPython: cleaning some bug tracker entries:
(excuse me for doing all in a single commit, but they are tiny
fixes and it's bpython, that dark corner ...)
#1025 - FileSelector SEGV on dynamic callback Category:
  Can't reproduce with current cvs, I'd say recent changes to fix
another crash related to FileSelector in gui-less scripts solved this
one, too.
#1028 - Reserved button event number:
  Menu choices generate two events, one extra related to the menu
itself, with value=4.  Made bpython ignore this extra event.
#1068 - FileSelector No file extension support:
  As Ton wrote there, Blender itself doesn't support this yet.  But the
requester also wanted Window.File/ImageSelector to accept a pathname.  Done.  Also updated doc.
#959 - Segfault on background rendering:
  This happened in bg mode (blender -b filename -a, for example) when
a script with the line "Blender.Redraw()" was linked to FRAMECHANGED events.  As reported in the bug page, it was because curarea is NULL in bg mode.  Made Redraw() check for this and not call functions that expected curarea in Redraw, like one to swap buffers.
#1072 - Blender.Redraw() Segfault:
  Good catch : ). Scripts called from the scripts win that called
Blender.Redraw() or Blender.Window.Redraw() would crash Blender because of a dirty pointer in Spacescript->script.  Fixed.
											 
										 
										
											2004-04-11 04:41:33 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									EXPP_disable_force_draw  =  1 ; 
							 
						 
					
						
							
								
									
										
										
										
											2005-02-16 03:32:57 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									/*@ Disable forced drawing, otherwise the button object which
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									 *  is  still  being  used  might  be  deleted  */ 
							 
						 
					
						
							
								
									
										
										
										
											2004-03-29 08:16:18 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
											 
										
											
												BPython: cleaning some bug tracker entries:
(excuse me for doing all in a single commit, but they are tiny
fixes and it's bpython, that dark corner ...)
#1025 - FileSelector SEGV on dynamic callback Category:
  Can't reproduce with current cvs, I'd say recent changes to fix
another crash related to FileSelector in gui-less scripts solved this
one, too.
#1028 - Reserved button event number:
  Menu choices generate two events, one extra related to the menu
itself, with value=4.  Made bpython ignore this extra event.
#1068 - FileSelector No file extension support:
  As Ton wrote there, Blender itself doesn't support this yet.  But the
requester also wanted Window.File/ImageSelector to accept a pathname.  Done.  Also updated doc.
#959 - Segfault on background rendering:
  This happened in bg mode (blender -b filename -a, for example) when
a script with the line "Blender.Redraw()" was linked to FRAMECHANGED events.  As reported in the bug page, it was because curarea is NULL in bg mode.  Made Redraw() check for this and not call functions that expected curarea in Redraw, like one to swap buffers.
#1072 - Blender.Redraw() Segfault:
  Good catch : ). Scripts called from the scripts win that called
Blender.Redraw() or Blender.Window.Redraw() would crash Blender because of a dirty pointer in Spacescript->script.  Fixed.
											 
										 
										
											2004-04-11 04:41:33 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									curarea - > win_swap  =  WIN_BACK_OK ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									/* removed global uiFrontBuf (contact ton when this goes wrong here) */ 
							 
						 
					
						
							
								
									
										
										
										
											2005-02-16 03:32:57 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									disable_where_script (  1  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									spacescript_do_pywin_buttons (  curarea - > spacedata . first , 
							 
						 
					
						
							
								
									
										
										
										
											2007-07-27 06:14:25 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										( unsigned  short ) uiButGetRetVal (  but  )  -   EXPP_BUTTON_EVENTS_OFFSET  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2005-06-12 05:54:15 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									/* XXX useless right now, investigate better before a bcon 5 */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									ret  =  M_Window_Redraw (  0 ,  ref  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2007-07-27 06:14:25 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									Py_XDECREF ( ref ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2007-07-12 20:49:36 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									Py_XDECREF ( ret ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2004-03-29 08:16:18 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2005-02-16 03:32:57 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									disable_where_script (  0  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2004-03-29 08:16:18 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
											 
										
											
												BPython: cleaning some bug tracker entries:
(excuse me for doing all in a single commit, but they are tiny
fixes and it's bpython, that dark corner ...)
#1025 - FileSelector SEGV on dynamic callback Category:
  Can't reproduce with current cvs, I'd say recent changes to fix
another crash related to FileSelector in gui-less scripts solved this
one, too.
#1028 - Reserved button event number:
  Menu choices generate two events, one extra related to the menu
itself, with value=4.  Made bpython ignore this extra event.
#1068 - FileSelector No file extension support:
  As Ton wrote there, Blender itself doesn't support this yet.  But the
requester also wanted Window.File/ImageSelector to accept a pathname.  Done.  Also updated doc.
#959 - Segfault on background rendering:
  This happened in bg mode (blender -b filename -a, for example) when
a script with the line "Blender.Redraw()" was linked to FRAMECHANGED events.  As reported in the bug page, it was because curarea is NULL in bg mode.  Made Redraw() check for this and not call functions that expected curarea in Redraw, like one to swap buffers.
#1072 - Blender.Redraw() Segfault:
  Good catch : ). Scripts called from the scripts win that called
Blender.Redraw() or Blender.Window.Redraw() would crash Blender because of a dirty pointer in Spacescript->script.  Fixed.
											 
										 
										
											2004-04-11 04:41:33 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									EXPP_disable_force_draw  =  0 ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-05-08 03:06:46 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								static  PyObject  * Method_Slider (  PyObject  *  self ,  PyObject  *  args  )  
						 
					
						
							
								
									
										
										
										
											2003-05-08 03:06:46 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								{  
						 
					
						
							
								
									
										
											 
										
											
												BPython: cleaning some bug tracker entries:
(excuse me for doing all in a single commit, but they are tiny
fixes and it's bpython, that dark corner ...)
#1025 - FileSelector SEGV on dynamic callback Category:
  Can't reproduce with current cvs, I'd say recent changes to fix
another crash related to FileSelector in gui-less scripts solved this
one, too.
#1028 - Reserved button event number:
  Menu choices generate two events, one extra related to the menu
itself, with value=4.  Made bpython ignore this extra event.
#1068 - FileSelector No file extension support:
  As Ton wrote there, Blender itself doesn't support this yet.  But the
requester also wanted Window.File/ImageSelector to accept a pathname.  Done.  Also updated doc.
#959 - Segfault on background rendering:
  This happened in bg mode (blender -b filename -a, for example) when
a script with the line "Blender.Redraw()" was linked to FRAMECHANGED events.  As reported in the bug page, it was because curarea is NULL in bg mode.  Made Redraw() check for this and not call functions that expected curarea in Redraw, like one to swap buffers.
#1072 - Blender.Redraw() Segfault:
  Good catch : ). Scripts called from the scripts win that called
Blender.Redraw() or Blender.Window.Redraw() would crash Blender because of a dirty pointer in Spacescript->script.  Fixed.
											 
										 
										
											2004-04-11 04:41:33 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									uiBlock  * block ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									char  * name ,  * tip  =  NULL ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									int  event ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									int  x ,  y ,  w ,  h ,  realtime  =  1 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									Button  * but ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									PyObject  * mino ,  * maxo ,  * inio ; 
							 
						 
					
						
							
								
									
										
										
										
											2007-04-22 13:48:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									PyObject  * callback = NULL ; 
							 
						 
					
						
							
								
									
										
											 
										
											
												BPython: cleaning some bug tracker entries:
(excuse me for doing all in a single commit, but they are tiny
fixes and it's bpython, that dark corner ...)
#1025 - FileSelector SEGV on dynamic callback Category:
  Can't reproduce with current cvs, I'd say recent changes to fix
another crash related to FileSelector in gui-less scripts solved this
one, too.
#1028 - Reserved button event number:
  Menu choices generate two events, one extra related to the menu
itself, with value=4.  Made bpython ignore this extra event.
#1068 - FileSelector No file extension support:
  As Ton wrote there, Blender itself doesn't support this yet.  But the
requester also wanted Window.File/ImageSelector to accept a pathname.  Done.  Also updated doc.
#959 - Segfault on background rendering:
  This happened in bg mode (blender -b filename -a, for example) when
a script with the line "Blender.Redraw()" was linked to FRAMECHANGED events.  As reported in the bug page, it was because curarea is NULL in bg mode.  Made Redraw() check for this and not call functions that expected curarea in Redraw, like one to swap buffers.
#1072 - Blender.Redraw() Segfault:
  Good catch : ). Scripts called from the scripts win that called
Blender.Redraw() or Blender.Window.Redraw() would crash Blender because of a dirty pointer in Spacescript->script.  Fixed.
											 
										 
										
											2004-04-11 04:41:33 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2008-09-14 05:10:45 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if  ( G . background )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  EXPP_ReturnPyObjError (  PyExc_RuntimeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													      " Can't run Draw.Sider() in background mode. "  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									
							 
						 
					
						
							
								
									
										
										
										
											2007-04-22 13:48:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if (  ! PyArg_ParseTuple (  args ,  " siiiiiOOO|isO " ,  & name ,  & event , 
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											       & x ,  & y ,  & w ,  & h ,  & inio ,  & mino ,  & maxo ,  & realtime , 
							 
						 
					
						
							
								
									
										
										
										
											2007-04-22 13:48:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											       & tip ,  & callback  )  ) 
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										return  EXPP_ReturnPyObjError (  PyExc_TypeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													      " expected a string, five ints, three PyObjects \n \
 
							 
						 
					
						
							
								
									
										
										
										
											2007-04-22 13:48:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											and  optionally  int ,  string  and  callback  arguments "  ); 
							 
						 
					
						
							
								
									
										
											 
										
											
												BPython bug fixes:
- #2646 reported by Campbell: Python/Fileselector (moving from fileselector called by script to another space caused script to hang around open but not accessible)
http://projects.blender.org/tracker/?func=detail&atid=125&aid=2646&group_id=9
- #2676 reported by Wim Van Hoydonck: 2.37 python scripts gui: event 8 ignored (thanks Ton for discussing / pointing what to do, Ken Hughes for also working on a fix)
http://projects.blender.org/tracker/?func=detail&atid=125&aid=2676&group_id=9
- gui-less scripts with calls to progress bar inside fileselector callbacks didn't return to the previous space on exit (staying on Scripts win), requiring an event to do so (mouse movement, for example).  Quick fix for now, will rework a little after 2.37a for a better alternative, not needing to move to the Scripts win at all.
- added syntax colors access to Window.Theme module.
Scripts:
- updates by Jean-Michel Soler: svg2obj (svg paths import), tex2uvbaker, fixfromarmature;
- updates by Campbell Barton: obj import / export, console;
- tiny: converted vrml97 export to unix line endings;
- updates in ac3d exporter, help browser, save theme.
Thanks all mentioned above.
											 
										 
										
											2005-06-11 05:30:14 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2007-07-12 20:49:36 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if ( realtime  & &  uiblock ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										realtime  =  0 ;  /* realtime dosnt work with UIBlock */ 
							 
						 
					
						
							
								
									
										
										
										
											2007-07-27 06:14:25 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									UI_METHOD_ERRORCHECK ; 
							 
						 
					
						
							
								
									
										
										
										
											2007-07-12 20:49:36 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									but  =  newbutton (   ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-12-14 01:18:09 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if (  PyFloat_Check (  inio  )  )  { 
							 
						 
					
						
							
								
									
										
											 
										
											
												BPython: cleaning some bug tracker entries:
(excuse me for doing all in a single commit, but they are tiny
fixes and it's bpython, that dark corner ...)
#1025 - FileSelector SEGV on dynamic callback Category:
  Can't reproduce with current cvs, I'd say recent changes to fix
another crash related to FileSelector in gui-less scripts solved this
one, too.
#1028 - Reserved button event number:
  Menu choices generate two events, one extra related to the menu
itself, with value=4.  Made bpython ignore this extra event.
#1068 - FileSelector No file extension support:
  As Ton wrote there, Blender itself doesn't support this yet.  But the
requester also wanted Window.File/ImageSelector to accept a pathname.  Done.  Also updated doc.
#959 - Segfault on background rendering:
  This happened in bg mode (blender -b filename -a, for example) when
a script with the line "Blender.Redraw()" was linked to FRAMECHANGED events.  As reported in the bug page, it was because curarea is NULL in bg mode.  Made Redraw() check for this and not call functions that expected curarea in Redraw, like one to swap buffers.
#1072 - Blender.Redraw() Segfault:
  Good catch : ). Scripts called from the scripts win that called
Blender.Redraw() or Blender.Window.Redraw() would crash Blender because of a dirty pointer in Spacescript->script.  Fixed.
											 
										 
										
											2004-04-11 04:41:33 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										float  ini ,  min ,  max ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-12-14 01:18:09 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2005-07-18 03:50:37 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										ini  =  ( float ) PyFloat_AsDouble (  inio  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										min  =  ( float ) PyFloat_AsDouble (  mino  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										max  =  ( float ) PyFloat_AsDouble (  maxo  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-12-14 01:18:09 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2006-01-08 18:59:55 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										but - > type  =  BFLOAT_TYPE ; 
							 
						 
					
						
							
								
									
										
											 
										
											
												BPython: cleaning some bug tracker entries:
(excuse me for doing all in a single commit, but they are tiny
fixes and it's bpython, that dark corner ...)
#1025 - FileSelector SEGV on dynamic callback Category:
  Can't reproduce with current cvs, I'd say recent changes to fix
another crash related to FileSelector in gui-less scripts solved this
one, too.
#1028 - Reserved button event number:
  Menu choices generate two events, one extra related to the menu
itself, with value=4.  Made bpython ignore this extra event.
#1068 - FileSelector No file extension support:
  As Ton wrote there, Blender itself doesn't support this yet.  But the
requester also wanted Window.File/ImageSelector to accept a pathname.  Done.  Also updated doc.
#959 - Segfault on background rendering:
  This happened in bg mode (blender -b filename -a, for example) when
a script with the line "Blender.Redraw()" was linked to FRAMECHANGED events.  As reported in the bug page, it was because curarea is NULL in bg mode.  Made Redraw() check for this and not call functions that expected curarea in Redraw, like one to swap buffers.
#1072 - Blender.Redraw() Segfault:
  Good catch : ). Scripts called from the scripts win that called
Blender.Redraw() or Blender.Window.Redraw() would crash Blender because of a dirty pointer in Spacescript->script.  Fixed.
											 
										 
										
											2004-04-11 04:41:33 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										but - > val . asfloat  =  ini ; 
							 
						 
					
						
							
								
									
										
										
										
											2007-07-27 06:14:25 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										if  ( tip )  strncpy ( but - > tooltip ,  tip ,  BPY_MAX_TOOLTIP ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										block  =  Get_uiBlock (   ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										if (  block  )  { 
							 
						 
					
						
							
								
									
										
											 
										
											
												BPython: cleaning some bug tracker entries:
(excuse me for doing all in a single commit, but they are tiny
fixes and it's bpython, that dark corner ...)
#1025 - FileSelector SEGV on dynamic callback Category:
  Can't reproduce with current cvs, I'd say recent changes to fix
another crash related to FileSelector in gui-less scripts solved this
one, too.
#1028 - Reserved button event number:
  Menu choices generate two events, one extra related to the menu
itself, with value=4.  Made bpython ignore this extra event.
#1068 - FileSelector No file extension support:
  As Ton wrote there, Blender itself doesn't support this yet.  But the
requester also wanted Window.File/ImageSelector to accept a pathname.  Done.  Also updated doc.
#959 - Segfault on background rendering:
  This happened in bg mode (blender -b filename -a, for example) when
a script with the line "Blender.Redraw()" was linked to FRAMECHANGED events.  As reported in the bug page, it was because curarea is NULL in bg mode.  Made Redraw() check for this and not call functions that expected curarea in Redraw, like one to swap buffers.
#1072 - Blender.Redraw() Segfault:
  Good catch : ). Scripts called from the scripts win that called
Blender.Redraw() or Blender.Window.Redraw() would crash Blender because of a dirty pointer in Spacescript->script.  Fixed.
											 
										 
										
											2004-04-11 04:41:33 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											uiBut  * ubut ; 
							 
						 
					
						
							
								
									
										
										
										
											2005-07-18 03:50:37 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											ubut  =  uiDefButF (  block ,  NUMSLI ,  event ,  name ,  ( short ) x ,  ( short ) y ,  ( short ) w , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													  ( short ) h ,  & but - > val . asfloat ,  min ,  max ,  0 ,  0 , 
							 
						 
					
						
							
								
									
										
										
										
											2007-07-27 06:14:25 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
													  but - > tooltip  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											if (  realtime  ) 
							 
						 
					
						
							
								
									
										
										
										
											2007-04-24 17:28:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
												uiButSetFunc (  ubut ,  py_slider_update ,  ubut ,  NULL  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											else 
							 
						 
					
						
							
								
									
										
										
										
											2007-07-27 06:14:25 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
												set_pycallback ( ubut ,  callback ,  but ) ; 
							 
						 
					
						
							
								
									
										
											 
										
											
												BPython: cleaning some bug tracker entries:
(excuse me for doing all in a single commit, but they are tiny
fixes and it's bpython, that dark corner ...)
#1025 - FileSelector SEGV on dynamic callback Category:
  Can't reproduce with current cvs, I'd say recent changes to fix
another crash related to FileSelector in gui-less scripts solved this
one, too.
#1028 - Reserved button event number:
  Menu choices generate two events, one extra related to the menu
itself, with value=4.  Made bpython ignore this extra event.
#1068 - FileSelector No file extension support:
  As Ton wrote there, Blender itself doesn't support this yet.  But the
requester also wanted Window.File/ImageSelector to accept a pathname.  Done.  Also updated doc.
#959 - Segfault on background rendering:
  This happened in bg mode (blender -b filename -a, for example) when
a script with the line "Blender.Redraw()" was linked to FRAMECHANGED events.  As reported in the bug page, it was because curarea is NULL in bg mode.  Made Redraw() check for this and not call functions that expected curarea in Redraw, like one to swap buffers.
#1072 - Blender.Redraw() Segfault:
  Good catch : ). Scripts called from the scripts win that called
Blender.Redraw() or Blender.Window.Redraw() would crash Blender because of a dirty pointer in Spacescript->script.  Fixed.
											 
										 
										
											2004-04-11 04:41:33 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										} 
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									}  else  { 
							 
						 
					
						
							
								
									
										
											 
										
											
												BPython: cleaning some bug tracker entries:
(excuse me for doing all in a single commit, but they are tiny
fixes and it's bpython, that dark corner ...)
#1025 - FileSelector SEGV on dynamic callback Category:
  Can't reproduce with current cvs, I'd say recent changes to fix
another crash related to FileSelector in gui-less scripts solved this
one, too.
#1028 - Reserved button event number:
  Menu choices generate two events, one extra related to the menu
itself, with value=4.  Made bpython ignore this extra event.
#1068 - FileSelector No file extension support:
  As Ton wrote there, Blender itself doesn't support this yet.  But the
requester also wanted Window.File/ImageSelector to accept a pathname.  Done.  Also updated doc.
#959 - Segfault on background rendering:
  This happened in bg mode (blender -b filename -a, for example) when
a script with the line "Blender.Redraw()" was linked to FRAMECHANGED events.  As reported in the bug page, it was because curarea is NULL in bg mode.  Made Redraw() check for this and not call functions that expected curarea in Redraw, like one to swap buffers.
#1072 - Blender.Redraw() Segfault:
  Good catch : ). Scripts called from the scripts win that called
Blender.Redraw() or Blender.Window.Redraw() would crash Blender because of a dirty pointer in Spacescript->script.  Fixed.
											 
										 
										
											2004-04-11 04:41:33 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										int  ini ,  min ,  max ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										ini  =  PyInt_AsLong (  inio  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										min  =  PyInt_AsLong (  mino  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										max  =  PyInt_AsLong (  maxo  ) ; 
							 
						 
					
						
							
								
									
										
											 
										
											
												BPython: cleaning some bug tracker entries:
(excuse me for doing all in a single commit, but they are tiny
fixes and it's bpython, that dark corner ...)
#1025 - FileSelector SEGV on dynamic callback Category:
  Can't reproduce with current cvs, I'd say recent changes to fix
another crash related to FileSelector in gui-less scripts solved this
one, too.
#1028 - Reserved button event number:
  Menu choices generate two events, one extra related to the menu
itself, with value=4.  Made bpython ignore this extra event.
#1068 - FileSelector No file extension support:
  As Ton wrote there, Blender itself doesn't support this yet.  But the
requester also wanted Window.File/ImageSelector to accept a pathname.  Done.  Also updated doc.
#959 - Segfault on background rendering:
  This happened in bg mode (blender -b filename -a, for example) when
a script with the line "Blender.Redraw()" was linked to FRAMECHANGED events.  As reported in the bug page, it was because curarea is NULL in bg mode.  Made Redraw() check for this and not call functions that expected curarea in Redraw, like one to swap buffers.
#1072 - Blender.Redraw() Segfault:
  Good catch : ). Scripts called from the scripts win that called
Blender.Redraw() or Blender.Window.Redraw() would crash Blender because of a dirty pointer in Spacescript->script.  Fixed.
											 
										 
										
											2004-04-11 04:41:33 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2006-01-08 18:59:55 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										but - > type  =  BINT_TYPE ; 
							 
						 
					
						
							
								
									
										
											 
										
											
												BPython: cleaning some bug tracker entries:
(excuse me for doing all in a single commit, but they are tiny
fixes and it's bpython, that dark corner ...)
#1025 - FileSelector SEGV on dynamic callback Category:
  Can't reproduce with current cvs, I'd say recent changes to fix
another crash related to FileSelector in gui-less scripts solved this
one, too.
#1028 - Reserved button event number:
  Menu choices generate two events, one extra related to the menu
itself, with value=4.  Made bpython ignore this extra event.
#1068 - FileSelector No file extension support:
  As Ton wrote there, Blender itself doesn't support this yet.  But the
requester also wanted Window.File/ImageSelector to accept a pathname.  Done.  Also updated doc.
#959 - Segfault on background rendering:
  This happened in bg mode (blender -b filename -a, for example) when
a script with the line "Blender.Redraw()" was linked to FRAMECHANGED events.  As reported in the bug page, it was because curarea is NULL in bg mode.  Made Redraw() check for this and not call functions that expected curarea in Redraw, like one to swap buffers.
#1072 - Blender.Redraw() Segfault:
  Good catch : ). Scripts called from the scripts win that called
Blender.Redraw() or Blender.Window.Redraw() would crash Blender because of a dirty pointer in Spacescript->script.  Fixed.
											 
										 
										
											2004-04-11 04:41:33 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										but - > val . asint  =  ini ; 
							 
						 
					
						
							
								
									
										
										
										
											2007-07-27 06:14:25 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										if  ( tip )  strncpy ( but - > tooltip ,  tip ,  BPY_MAX_TOOLTIP ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										block  =  Get_uiBlock (   ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										if (  block  )  { 
							 
						 
					
						
							
								
									
										
											 
										
											
												BPython: cleaning some bug tracker entries:
(excuse me for doing all in a single commit, but they are tiny
fixes and it's bpython, that dark corner ...)
#1025 - FileSelector SEGV on dynamic callback Category:
  Can't reproduce with current cvs, I'd say recent changes to fix
another crash related to FileSelector in gui-less scripts solved this
one, too.
#1028 - Reserved button event number:
  Menu choices generate two events, one extra related to the menu
itself, with value=4.  Made bpython ignore this extra event.
#1068 - FileSelector No file extension support:
  As Ton wrote there, Blender itself doesn't support this yet.  But the
requester also wanted Window.File/ImageSelector to accept a pathname.  Done.  Also updated doc.
#959 - Segfault on background rendering:
  This happened in bg mode (blender -b filename -a, for example) when
a script with the line "Blender.Redraw()" was linked to FRAMECHANGED events.  As reported in the bug page, it was because curarea is NULL in bg mode.  Made Redraw() check for this and not call functions that expected curarea in Redraw, like one to swap buffers.
#1072 - Blender.Redraw() Segfault:
  Good catch : ). Scripts called from the scripts win that called
Blender.Redraw() or Blender.Window.Redraw() would crash Blender because of a dirty pointer in Spacescript->script.  Fixed.
											 
										 
										
											2004-04-11 04:41:33 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											uiBut  * ubut ; 
							 
						 
					
						
							
								
									
										
										
										
											2005-07-18 03:50:37 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											ubut  =  uiDefButI (  block ,  NUMSLI ,  event ,  name ,  ( short ) x ,  ( short ) y ,  ( short ) w , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													  ( short ) h ,  & but - > val . asint ,  ( float ) min ,  ( float ) max ,  0 ,  0 , 
							 
						 
					
						
							
								
									
										
										
										
											2007-07-27 06:14:25 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
													  but - > tooltip  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											if (  realtime  ) 
							 
						 
					
						
							
								
									
										
										
										
											2007-04-22 13:48:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
												uiButSetFunc (  ubut ,  py_slider_update ,  ubut ,  NULL  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											else 
							 
						 
					
						
							
								
									
										
										
										
											2007-07-27 06:14:25 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
												set_pycallback ( ubut ,  callback ,  but ) ; 
							 
						 
					
						
							
								
									
										
											 
										
											
												BPython: cleaning some bug tracker entries:
(excuse me for doing all in a single commit, but they are tiny
fixes and it's bpython, that dark corner ...)
#1025 - FileSelector SEGV on dynamic callback Category:
  Can't reproduce with current cvs, I'd say recent changes to fix
another crash related to FileSelector in gui-less scripts solved this
one, too.
#1028 - Reserved button event number:
  Menu choices generate two events, one extra related to the menu
itself, with value=4.  Made bpython ignore this extra event.
#1068 - FileSelector No file extension support:
  As Ton wrote there, Blender itself doesn't support this yet.  But the
requester also wanted Window.File/ImageSelector to accept a pathname.  Done.  Also updated doc.
#959 - Segfault on background rendering:
  This happened in bg mode (blender -b filename -a, for example) when
a script with the line "Blender.Redraw()" was linked to FRAMECHANGED events.  As reported in the bug page, it was because curarea is NULL in bg mode.  Made Redraw() check for this and not call functions that expected curarea in Redraw, like one to swap buffers.
#1072 - Blender.Redraw() Segfault:
  Good catch : ). Scripts called from the scripts win that called
Blender.Redraw() or Blender.Window.Redraw() would crash Blender because of a dirty pointer in Spacescript->script.  Fixed.
											 
										 
										
											2004-04-11 04:41:33 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										} 
							 
						 
					
						
							
								
									
										
										
										
											2004-03-29 08:16:18 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									return  (  PyObject  *  )  but ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-05-08 03:06:46 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								static  PyObject  * Method_Scrollbar (  PyObject  *  self ,  PyObject  *  args  )  
						 
					
						
							
								
									
										
										
										
											2003-05-08 03:06:46 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								{  
						 
					
						
							
								
									
										
											 
										
											
												BPython: cleaning some bug tracker entries:
(excuse me for doing all in a single commit, but they are tiny
fixes and it's bpython, that dark corner ...)
#1025 - FileSelector SEGV on dynamic callback Category:
  Can't reproduce with current cvs, I'd say recent changes to fix
another crash related to FileSelector in gui-less scripts solved this
one, too.
#1028 - Reserved button event number:
  Menu choices generate two events, one extra related to the menu
itself, with value=4.  Made bpython ignore this extra event.
#1068 - FileSelector No file extension support:
  As Ton wrote there, Blender itself doesn't support this yet.  But the
requester also wanted Window.File/ImageSelector to accept a pathname.  Done.  Also updated doc.
#959 - Segfault on background rendering:
  This happened in bg mode (blender -b filename -a, for example) when
a script with the line "Blender.Redraw()" was linked to FRAMECHANGED events.  As reported in the bug page, it was because curarea is NULL in bg mode.  Made Redraw() check for this and not call functions that expected curarea in Redraw, like one to swap buffers.
#1072 - Blender.Redraw() Segfault:
  Good catch : ). Scripts called from the scripts win that called
Blender.Redraw() or Blender.Window.Redraw() would crash Blender because of a dirty pointer in Spacescript->script.  Fixed.
											 
										 
										
											2004-04-11 04:41:33 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									char  * tip  =  NULL ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									uiBlock  * block ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									int  event ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									int  x ,  y ,  w ,  h ,  realtime  =  1 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									Button  * but ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									PyObject  * mino ,  * maxo ,  * inio ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									float  ini ,  min ,  max ; 
							 
						 
					
						
							
								
									
										
										
										
											2007-04-22 13:48:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									uiBut  * ubut ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									
							 
						 
					
						
							
								
									
										
										
										
											2008-09-14 05:10:45 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if  ( G . background )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  EXPP_ReturnPyObjError (  PyExc_RuntimeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													      " Can't run Draw.Scrollbar() in background mode. "  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									
							 
						 
					
						
							
								
									
										
										
										
											2007-04-22 13:48:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if (  ! PyArg_ParseTuple (  args ,  " iiiiiOOO|isO " ,  & event ,  & x ,  & y ,  & w ,  & h , 
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											       & inio ,  & mino ,  & maxo ,  & realtime ,  & tip  )  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  EXPP_ReturnPyObjError (  PyExc_TypeError , 
							 
						 
					
						
							
								
									
										
											 
										
											
												BPython bug fixes:
- #2646 reported by Campbell: Python/Fileselector (moving from fileselector called by script to another space caused script to hang around open but not accessible)
http://projects.blender.org/tracker/?func=detail&atid=125&aid=2646&group_id=9
- #2676 reported by Wim Van Hoydonck: 2.37 python scripts gui: event 8 ignored (thanks Ton for discussing / pointing what to do, Ken Hughes for also working on a fix)
http://projects.blender.org/tracker/?func=detail&atid=125&aid=2676&group_id=9
- gui-less scripts with calls to progress bar inside fileselector callbacks didn't return to the previous space on exit (staying on Scripts win), requiring an event to do so (mouse movement, for example).  Quick fix for now, will rework a little after 2.37a for a better alternative, not needing to move to the Scripts win at all.
- added syntax colors access to Window.Theme module.
Scripts:
- updates by Jean-Michel Soler: svg2obj (svg paths import), tex2uvbaker, fixfromarmature;
- updates by Campbell Barton: obj import / export, console;
- tiny: converted vrml97 export to unix line endings;
- updates in ac3d exporter, help browser, save theme.
Thanks all mentioned above.
											 
										 
										
											2005-06-11 05:30:14 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											" expected five ints, three PyObjects and optionally \n \
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								another  int  and  string  as  arguments "  );  
						 
					
						
							
								
									
										
										
										
											2003-12-14 01:18:09 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if (  ! PyNumber_Check (  inio  )  | |  ! PyNumber_Check (  inio  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									    | |  ! PyNumber_Check (  inio  )  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  EXPP_ReturnPyObjError (  PyExc_AttributeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													      " expected numbers for initial, min, and max "  ) ; 
							 
						 
					
						
							
								
									
										
											 
										
											
												BPython: cleaning some bug tracker entries:
(excuse me for doing all in a single commit, but they are tiny
fixes and it's bpython, that dark corner ...)
#1025 - FileSelector SEGV on dynamic callback Category:
  Can't reproduce with current cvs, I'd say recent changes to fix
another crash related to FileSelector in gui-less scripts solved this
one, too.
#1028 - Reserved button event number:
  Menu choices generate two events, one extra related to the menu
itself, with value=4.  Made bpython ignore this extra event.
#1068 - FileSelector No file extension support:
  As Ton wrote there, Blender itself doesn't support this yet.  But the
requester also wanted Window.File/ImageSelector to accept a pathname.  Done.  Also updated doc.
#959 - Segfault on background rendering:
  This happened in bg mode (blender -b filename -a, for example) when
a script with the line "Blender.Redraw()" was linked to FRAMECHANGED events.  As reported in the bug page, it was because curarea is NULL in bg mode.  Made Redraw() check for this and not call functions that expected curarea in Redraw, like one to swap buffers.
#1072 - Blender.Redraw() Segfault:
  Good catch : ). Scripts called from the scripts win that called
Blender.Redraw() or Blender.Window.Redraw() would crash Blender because of a dirty pointer in Spacescript->script.  Fixed.
											 
										 
										
											2004-04-11 04:41:33 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
											 
										
											
												BPython bug fixes:
- #2646 reported by Campbell: Python/Fileselector (moving from fileselector called by script to another space caused script to hang around open but not accessible)
http://projects.blender.org/tracker/?func=detail&atid=125&aid=2646&group_id=9
- #2676 reported by Wim Van Hoydonck: 2.37 python scripts gui: event 8 ignored (thanks Ton for discussing / pointing what to do, Ken Hughes for also working on a fix)
http://projects.blender.org/tracker/?func=detail&atid=125&aid=2676&group_id=9
- gui-less scripts with calls to progress bar inside fileselector callbacks didn't return to the previous space on exit (staying on Scripts win), requiring an event to do so (mouse movement, for example).  Quick fix for now, will rework a little after 2.37a for a better alternative, not needing to move to the Scripts win at all.
- added syntax colors access to Window.Theme module.
Scripts:
- updates by Jean-Michel Soler: svg2obj (svg paths import), tex2uvbaker, fixfromarmature;
- updates by Campbell Barton: obj import / export, console;
- tiny: converted vrml97 export to unix line endings;
- updates in ac3d exporter, help browser, save theme.
Thanks all mentioned above.
											 
										 
										
											2005-06-11 05:30:14 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if  ( check_button_event ( & event )  = =  - 1 ) 
							 
						 
					
						
							
								
									
										
										
										
											2007-04-22 13:48:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									return  EXPP_ReturnPyObjError (  PyExc_AttributeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										" button event argument must be in the range [0, 16382] " ) ; 
							 
						 
					
						
							
								
									
										
											 
										
											
												BPython bug fixes:
- #2646 reported by Campbell: Python/Fileselector (moving from fileselector called by script to another space caused script to hang around open but not accessible)
http://projects.blender.org/tracker/?func=detail&atid=125&aid=2646&group_id=9
- #2676 reported by Wim Van Hoydonck: 2.37 python scripts gui: event 8 ignored (thanks Ton for discussing / pointing what to do, Ken Hughes for also working on a fix)
http://projects.blender.org/tracker/?func=detail&atid=125&aid=2676&group_id=9
- gui-less scripts with calls to progress bar inside fileselector callbacks didn't return to the previous space on exit (staying on Scripts win), requiring an event to do so (mouse movement, for example).  Quick fix for now, will rework a little after 2.37a for a better alternative, not needing to move to the Scripts win at all.
- added syntax colors access to Window.Theme module.
Scripts:
- updates by Jean-Michel Soler: svg2obj (svg paths import), tex2uvbaker, fixfromarmature;
- updates by Campbell Barton: obj import / export, console;
- tiny: converted vrml97 export to unix line endings;
- updates in ac3d exporter, help browser, save theme.
Thanks all mentioned above.
											 
										 
										
											2005-06-11 05:30:14 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									but  =  newbutton (   ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2007-07-27 06:14:25 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if  ( tip )  strncpy ( but - > tooltip ,  tip ,  BPY_MAX_TOOLTIP ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if (  PyFloat_Check (  inio  )  ) 
							 
						 
					
						
							
								
									
										
										
										
											2006-01-08 18:59:55 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										but - > type  =  BFLOAT_TYPE ; 
							 
						 
					
						
							
								
									
										
											 
										
											
												BPython: cleaning some bug tracker entries:
(excuse me for doing all in a single commit, but they are tiny
fixes and it's bpython, that dark corner ...)
#1025 - FileSelector SEGV on dynamic callback Category:
  Can't reproduce with current cvs, I'd say recent changes to fix
another crash related to FileSelector in gui-less scripts solved this
one, too.
#1028 - Reserved button event number:
  Menu choices generate two events, one extra related to the menu
itself, with value=4.  Made bpython ignore this extra event.
#1068 - FileSelector No file extension support:
  As Ton wrote there, Blender itself doesn't support this yet.  But the
requester also wanted Window.File/ImageSelector to accept a pathname.  Done.  Also updated doc.
#959 - Segfault on background rendering:
  This happened in bg mode (blender -b filename -a, for example) when
a script with the line "Blender.Redraw()" was linked to FRAMECHANGED events.  As reported in the bug page, it was because curarea is NULL in bg mode.  Made Redraw() check for this and not call functions that expected curarea in Redraw, like one to swap buffers.
#1072 - Blender.Redraw() Segfault:
  Good catch : ). Scripts called from the scripts win that called
Blender.Redraw() or Blender.Window.Redraw() would crash Blender because of a dirty pointer in Spacescript->script.  Fixed.
											 
										 
										
											2004-04-11 04:41:33 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									else 
							 
						 
					
						
							
								
									
										
										
										
											2006-01-08 18:59:55 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										but - > type  =  BINT_TYPE ; 
							 
						 
					
						
							
								
									
										
											 
										
											
												BPython: cleaning some bug tracker entries:
(excuse me for doing all in a single commit, but they are tiny
fixes and it's bpython, that dark corner ...)
#1025 - FileSelector SEGV on dynamic callback Category:
  Can't reproduce with current cvs, I'd say recent changes to fix
another crash related to FileSelector in gui-less scripts solved this
one, too.
#1028 - Reserved button event number:
  Menu choices generate two events, one extra related to the menu
itself, with value=4.  Made bpython ignore this extra event.
#1068 - FileSelector No file extension support:
  As Ton wrote there, Blender itself doesn't support this yet.  But the
requester also wanted Window.File/ImageSelector to accept a pathname.  Done.  Also updated doc.
#959 - Segfault on background rendering:
  This happened in bg mode (blender -b filename -a, for example) when
a script with the line "Blender.Redraw()" was linked to FRAMECHANGED events.  As reported in the bug page, it was because curarea is NULL in bg mode.  Made Redraw() check for this and not call functions that expected curarea in Redraw, like one to swap buffers.
#1072 - Blender.Redraw() Segfault:
  Good catch : ). Scripts called from the scripts win that called
Blender.Redraw() or Blender.Window.Redraw() would crash Blender because of a dirty pointer in Spacescript->script.  Fixed.
											 
										 
										
											2004-04-11 04:41:33 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2005-07-18 03:50:37 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									ini  =  ( float ) PyFloat_AsDouble (  inio  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									min  =  ( float ) PyFloat_AsDouble (  mino  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									max  =  ( float ) PyFloat_AsDouble (  maxo  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2007-04-22 13:48:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									block  =  Get_uiBlock (   ) ; 
							 
						 
					
						
							
								
									
										
											 
										
											
												BPython: cleaning some bug tracker entries:
(excuse me for doing all in a single commit, but they are tiny
fixes and it's bpython, that dark corner ...)
#1025 - FileSelector SEGV on dynamic callback Category:
  Can't reproduce with current cvs, I'd say recent changes to fix
another crash related to FileSelector in gui-less scripts solved this
one, too.
#1028 - Reserved button event number:
  Menu choices generate two events, one extra related to the menu
itself, with value=4.  Made bpython ignore this extra event.
#1068 - FileSelector No file extension support:
  As Ton wrote there, Blender itself doesn't support this yet.  But the
requester also wanted Window.File/ImageSelector to accept a pathname.  Done.  Also updated doc.
#959 - Segfault on background rendering:
  This happened in bg mode (blender -b filename -a, for example) when
a script with the line "Blender.Redraw()" was linked to FRAMECHANGED events.  As reported in the bug page, it was because curarea is NULL in bg mode.  Made Redraw() check for this and not call functions that expected curarea in Redraw, like one to swap buffers.
#1072 - Blender.Redraw() Segfault:
  Good catch : ). Scripts called from the scripts win that called
Blender.Redraw() or Blender.Window.Redraw() would crash Blender because of a dirty pointer in Spacescript->script.  Fixed.
											 
										 
										
											2004-04-11 04:41:33 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2007-04-22 13:48:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if (  block  )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										if (  but - > type  = =  BFLOAT_TYPE  )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											but - > val . asfloat  =  ini ; 
							 
						 
					
						
							
								
									
										
										
										
											2005-07-18 03:50:37 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											ubut  =  uiDefButF (  block ,  SCROLL ,  event ,  " " ,  ( short ) x ,  ( short ) y ,  ( short ) w ,  ( short ) h , 
							 
						 
					
						
							
								
									
										
										
										
											2007-07-27 06:14:25 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
													  & but - > val . asfloat ,  min ,  max ,  0 ,  0 ,  but - > tooltip  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											if (  realtime  ) 
							 
						 
					
						
							
								
									
										
										
										
											2007-04-22 13:48:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
												uiButSetFunc (  ubut ,  py_slider_update ,  ubut ,  NULL  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										}  else  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											but - > val . asint  =  ( int ) ini ; 
							 
						 
					
						
							
								
									
										
										
										
											2005-07-18 03:50:37 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											ubut  =  uiDefButI (  block ,  SCROLL ,  event ,  " " ,  ( short ) x ,  ( short ) y ,  ( short ) w ,  ( short ) h , 
							 
						 
					
						
							
								
									
										
										
										
											2007-07-27 06:14:25 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
													  & but - > val . asint ,  min ,  max ,  0 ,  0 ,  but - > tooltip  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											if (  realtime  ) 
							 
						 
					
						
							
								
									
										
										
										
											2007-04-22 13:48:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
												uiButSetFunc (  ubut ,  py_slider_update ,  ubut ,  NULL  ) ; 
							 
						 
					
						
							
								
									
										
											 
										
											
												BPython: cleaning some bug tracker entries:
(excuse me for doing all in a single commit, but they are tiny
fixes and it's bpython, that dark corner ...)
#1025 - FileSelector SEGV on dynamic callback Category:
  Can't reproduce with current cvs, I'd say recent changes to fix
another crash related to FileSelector in gui-less scripts solved this
one, too.
#1028 - Reserved button event number:
  Menu choices generate two events, one extra related to the menu
itself, with value=4.  Made bpython ignore this extra event.
#1068 - FileSelector No file extension support:
  As Ton wrote there, Blender itself doesn't support this yet.  But the
requester also wanted Window.File/ImageSelector to accept a pathname.  Done.  Also updated doc.
#959 - Segfault on background rendering:
  This happened in bg mode (blender -b filename -a, for example) when
a script with the line "Blender.Redraw()" was linked to FRAMECHANGED events.  As reported in the bug page, it was because curarea is NULL in bg mode.  Made Redraw() check for this and not call functions that expected curarea in Redraw, like one to swap buffers.
#1072 - Blender.Redraw() Segfault:
  Good catch : ). Scripts called from the scripts win that called
Blender.Redraw() or Blender.Window.Redraw() would crash Blender because of a dirty pointer in Spacescript->script.  Fixed.
											 
										 
										
											2004-04-11 04:41:33 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										} 
							 
						 
					
						
							
								
									
										
										
										
											2003-12-14 01:18:09 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									return  (  PyObject  *  )  but ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-05-08 03:06:46 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2006-05-20 15:44:14 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								static  PyObject  * Method_ColorPicker (  PyObject  *  self ,  PyObject  *  args  )  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								{  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									char  USAGE_ERROR [ ]  =  " expected a 3-float tuple of values between 0 and 1 " ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									Button  * but ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									PyObject  * inio ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									uiBlock  * block ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									char  * tip  =  NULL ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									float  col [ 3 ] ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									int  event ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									short  x ,  y ,  w ,  h ; 
							 
						 
					
						
							
								
									
										
										
										
											2007-04-22 13:48:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									PyObject  * callback = NULL ; 
							 
						 
					
						
							
								
									
										
										
										
											2006-05-20 15:44:14 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									
							 
						 
					
						
							
								
									
										
										
										
											2008-09-14 05:10:45 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if  ( G . background )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  EXPP_ReturnPyObjError (  PyExc_RuntimeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													      " Can't run Draw.ColorPicker() in background mode. "  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									
							 
						 
					
						
							
								
									
										
										
										
											2007-04-22 13:48:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if (  ! PyArg_ParseTuple (  args ,  " ihhhhO!|sO " ,  & event , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											       & x ,  & y ,  & w ,  & h ,  & PyTuple_Type ,  & inio ,  & tip ,  & callback  )  ) 
							 
						 
					
						
							
								
									
										
										
										
											2006-05-20 15:44:14 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								 		return  EXPP_ReturnPyObjError (  PyExc_TypeError , 
							 
						 
					
						
							
								
									
										
										
										
											2007-04-22 13:48:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
													      " expected five ints, one tuple and optionally string and callback arguments "  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2006-05-20 15:44:14 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								 
							 
						 
					
						
							
								
									
										
										
										
											2007-04-22 13:48:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									UI_METHOD_ERRORCHECK ; 
							 
						 
					
						
							
								
									
										
										
										
											2006-05-20 15:44:14 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if  (  ! PyArg_ParseTuple (  inio ,  " fff " ,  col ,  col + 1 ,  col + 2  )  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  EXPP_ReturnPyObjError (  PyExc_ValueError ,  USAGE_ERROR ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if 	( 	col [ 0 ]  <  0  | |  col [ 0 ]  >  1 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										| | 	col [ 1 ]  <  0  | |  col [ 1 ]  >  1 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										| | 	col [ 2 ]  <  0  | |  col [ 2 ]  >  1  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  EXPP_ReturnPyObjError (  PyExc_ValueError ,  USAGE_ERROR ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if  (  EXPP_check_sequence_consistency (  inio ,  & PyFloat_Type  )  ! =  1  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  EXPP_ReturnPyObjError (  PyExc_ValueError ,  USAGE_ERROR ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									but  =  newbutton ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									but - > type  =  BVECTOR_TYPE ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									but - > val . asvec [ 0 ]  =  col [ 0 ] ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									but - > val . asvec [ 1 ]  =  col [ 1 ] ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									but - > val . asvec [ 2 ]  =  col [ 2 ] ; 
							 
						 
					
						
							
								
									
										
										
										
											2007-07-27 06:14:25 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if  ( tip )  strncpy ( but - > tooltip ,  tip ,  BPY_MAX_TOOLTIP ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2006-05-20 15:44:14 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									block  =  Get_uiBlock (   ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if (  block  )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										uiBut  * ubut ; 
							 
						 
					
						
							
								
									
										
										
										
											2007-07-27 06:14:25 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										ubut  =  uiDefButF (  block ,  COL ,  event ,  " " ,  x ,  y ,  w ,  h ,  but - > val . asvec ,  0 ,  0 ,  0 ,  0 ,  but - > tooltip ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										set_pycallback ( ubut ,  callback ,  but ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2006-05-20 15:44:14 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								 	return  (  PyObject  *  )  but ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2006-12-27 11:58:03 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								static  PyObject  * Method_Normal (  PyObject  *  self ,  PyObject  *  args  )  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								{  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									char  USAGE_ERROR [ ]  =  " expected a 3-float tuple of values between -1 and 1 " ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									Button  * but ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									PyObject  * inio ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									uiBlock  * block ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									char  * tip  =  NULL ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									float  nor [ 3 ] ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									int  event ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									short  x ,  y ,  w ,  h ; 
							 
						 
					
						
							
								
									
										
										
										
											2007-04-22 13:48:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									PyObject  * callback = NULL ; 
							 
						 
					
						
							
								
									
										
										
										
											2006-12-27 11:58:03 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									
							 
						 
					
						
							
								
									
										
										
										
											2008-09-14 05:10:45 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if  ( G . background )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  EXPP_ReturnPyObjError (  PyExc_RuntimeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													      " Can't run Draw.Normal() in background mode. "  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									
							 
						 
					
						
							
								
									
										
										
										
											2007-04-22 13:48:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if (  ! PyArg_ParseTuple (  args ,  " ihhhhO!|sO " ,  & event , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											       & x ,  & y ,  & w ,  & h ,  & PyTuple_Type ,  & inio ,  & tip ,  & callback  )  ) 
							 
						 
					
						
							
								
									
										
										
										
											2006-12-27 11:58:03 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								 		return  EXPP_ReturnPyObjError (  PyExc_TypeError , 
							 
						 
					
						
							
								
									
										
										
										
											2007-04-22 13:48:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
													      " expected five ints, one tuple and optionally string and callback arguments "  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2006-12-27 11:58:03 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								 
							 
						 
					
						
							
								
									
										
										
										
											2007-04-22 13:48:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									UI_METHOD_ERRORCHECK ; 
							 
						 
					
						
							
								
									
										
										
										
											2006-12-27 11:58:03 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if  (  ! PyArg_ParseTuple (  inio ,  " fff " ,  nor ,  nor + 1 ,  nor + 2  )  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  EXPP_ReturnPyObjError (  PyExc_ValueError ,  USAGE_ERROR ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if  (  EXPP_check_sequence_consistency (  inio ,  & PyFloat_Type  )  ! =  1  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  EXPP_ReturnPyObjError (  PyExc_ValueError ,  USAGE_ERROR ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									but  =  newbutton ( ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2007-07-27 06:14:25 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if  ( tip )  strncpy ( but - > tooltip ,  tip ,  BPY_MAX_TOOLTIP ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									
							 
						 
					
						
							
								
									
										
										
										
											2006-12-27 11:58:03 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									but - > type  =  BVECTOR_TYPE ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									but - > val . asvec [ 0 ]  =  nor [ 0 ] ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									but - > val . asvec [ 1 ]  =  nor [ 1 ] ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									but - > val . asvec [ 2 ]  =  nor [ 2 ] ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									block  =  Get_uiBlock (   ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if (  block  )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										uiBut  * ubut ; 
							 
						 
					
						
							
								
									
										
										
										
											2007-07-27 06:14:25 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										ubut  =  uiDefButF (  block ,  BUT_NORMAL ,  event ,  " " ,  x ,  y ,  w ,  h ,  but - > val . asvec ,  0.0f ,  1.0f ,  0 ,  0 ,  but - > tooltip ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										set_pycallback ( ubut ,  callback ,  but ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2006-12-27 11:58:03 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								 	return  (  PyObject  *  )  but ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								static  PyObject  * Method_Number (  PyObject  *  self ,  PyObject  *  args  )  
						 
					
						
							
								
									
										
										
										
											2003-05-08 03:06:46 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								{  
						 
					
						
							
								
									
										
											 
										
											
												BPython: cleaning some bug tracker entries:
(excuse me for doing all in a single commit, but they are tiny
fixes and it's bpython, that dark corner ...)
#1025 - FileSelector SEGV on dynamic callback Category:
  Can't reproduce with current cvs, I'd say recent changes to fix
another crash related to FileSelector in gui-less scripts solved this
one, too.
#1028 - Reserved button event number:
  Menu choices generate two events, one extra related to the menu
itself, with value=4.  Made bpython ignore this extra event.
#1068 - FileSelector No file extension support:
  As Ton wrote there, Blender itself doesn't support this yet.  But the
requester also wanted Window.File/ImageSelector to accept a pathname.  Done.  Also updated doc.
#959 - Segfault on background rendering:
  This happened in bg mode (blender -b filename -a, for example) when
a script with the line "Blender.Redraw()" was linked to FRAMECHANGED events.  As reported in the bug page, it was because curarea is NULL in bg mode.  Made Redraw() check for this and not call functions that expected curarea in Redraw, like one to swap buffers.
#1072 - Blender.Redraw() Segfault:
  Good catch : ). Scripts called from the scripts win that called
Blender.Redraw() or Blender.Window.Redraw() would crash Blender because of a dirty pointer in Spacescript->script.  Fixed.
											 
										 
										
											2004-04-11 04:41:33 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									uiBlock  * block ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									char  * name ,  * tip  =  NULL ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									int  event ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									int  x ,  y ,  w ,  h ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									Button  * but ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									PyObject  * mino ,  * maxo ,  * inio ; 
							 
						 
					
						
							
								
									
										
										
										
											2007-04-22 13:48:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									PyObject  * callback = NULL ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									uiBut  * ubut =  NULL ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									
							 
						 
					
						
							
								
									
										
										
										
											2008-09-14 05:10:45 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if  ( G . background )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  EXPP_ReturnPyObjError (  PyExc_RuntimeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													      " Can't run Draw.Number() in background mode. "  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									
							 
						 
					
						
							
								
									
										
										
										
											2007-04-22 13:48:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if (  ! PyArg_ParseTuple (  args ,  " siiiiiOOO|sO " ,  & name ,  & event , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											       & x ,  & y ,  & w ,  & h ,  & inio ,  & mino ,  & maxo ,  & tip ,  & callback  )  ) 
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										return  EXPP_ReturnPyObjError (  PyExc_TypeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													      " expected a string, five ints, three PyObjects and \n \
 
							 
						 
					
						
							
								
									
										
										
										
											2007-04-22 13:48:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											optionally  string  and  callback  arguments "  ); 
							 
						 
					
						
							
								
									
										
										
										
											2003-12-14 01:18:09 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2007-04-22 13:48:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									UI_METHOD_ERRORCHECK ; 
							 
						 
					
						
							
								
									
										
											 
										
											
												BPython bug fixes:
- #2646 reported by Campbell: Python/Fileselector (moving from fileselector called by script to another space caused script to hang around open but not accessible)
http://projects.blender.org/tracker/?func=detail&atid=125&aid=2646&group_id=9
- #2676 reported by Wim Van Hoydonck: 2.37 python scripts gui: event 8 ignored (thanks Ton for discussing / pointing what to do, Ken Hughes for also working on a fix)
http://projects.blender.org/tracker/?func=detail&atid=125&aid=2676&group_id=9
- gui-less scripts with calls to progress bar inside fileselector callbacks didn't return to the previous space on exit (staying on Scripts win), requiring an event to do so (mouse movement, for example).  Quick fix for now, will rework a little after 2.37a for a better alternative, not needing to move to the Scripts win at all.
- added syntax colors access to Window.Theme module.
Scripts:
- updates by Jean-Michel Soler: svg2obj (svg paths import), tex2uvbaker, fixfromarmature;
- updates by Campbell Barton: obj import / export, console;
- tiny: converted vrml97 export to unix line endings;
- updates in ac3d exporter, help browser, save theme.
Thanks all mentioned above.
											 
										 
										
											2005-06-11 05:30:14 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2008-08-17 17:11:51 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if  (  ! PyNumber_Check ( inio )  | |  ! PyNumber_Check ( mino )  | | 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											! PyNumber_Check ( maxo )  )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  EXPP_ReturnPyObjError (  PyExc_TypeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												" expected ints or floats for the initial, min and max values "  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									but  =  newbutton (   ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2007-07-27 06:14:25 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if  ( tip )  strncpy ( but - > tooltip ,  tip ,  BPY_MAX_TOOLTIP ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2007-04-22 13:48:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									block  =  Get_uiBlock (   ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if (  PyFloat_Check (  inio  )  )  { 
							 
						 
					
						
							
								
									
										
										
										
											2006-06-05 01:23:56 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										float  ini ,  min ,  max ,  range ,  precission = 0 ; 
							 
						 
					
						
							
								
									
										
										
										
											2004-03-29 08:16:18 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2005-07-18 03:50:37 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										ini  =  ( float ) PyFloat_AsDouble (  inio  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										min  =  ( float ) PyFloat_AsDouble (  mino  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										max  =  ( float ) PyFloat_AsDouble (  maxo  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2006-06-05 01:23:56 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										
							 
						 
					
						
							
								
									
										
										
										
											2007-03-01 21:30:48 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										range =  ( float ) fabs ( max - min ) ;  /* Click step will be a 10th of the range. */ 
							 
						 
					
						
							
								
									
										
										
										
											2006-06-05 01:23:56 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										if  ( ! range )  range =  1.0f ;  /* avoid any odd errors */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										/* set the precission to display*/ 
							 
						 
					
						
							
								
									
										
										
										
											2007-06-19 18:40:17 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										if       ( range > = 1000.0f )  precission = 1.0f ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										else  if  ( range > = 100.0f )  precission = 2.0f ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										else  if  ( range > = 10.0f )  precission = 3.0f ; 
							 
						 
					
						
							
								
									
										
										
										
											2007-07-27 06:14:25 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								 		else  precission = 4.0f ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								 			
							 
						 
					
						
							
								
									
										
										
										
											2006-01-08 18:59:55 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										but - > type  =  BFLOAT_TYPE ; 
							 
						 
					
						
							
								
									
										
											 
										
											
												BPython: cleaning some bug tracker entries:
(excuse me for doing all in a single commit, but they are tiny
fixes and it's bpython, that dark corner ...)
#1025 - FileSelector SEGV on dynamic callback Category:
  Can't reproduce with current cvs, I'd say recent changes to fix
another crash related to FileSelector in gui-less scripts solved this
one, too.
#1028 - Reserved button event number:
  Menu choices generate two events, one extra related to the menu
itself, with value=4.  Made bpython ignore this extra event.
#1068 - FileSelector No file extension support:
  As Ton wrote there, Blender itself doesn't support this yet.  But the
requester also wanted Window.File/ImageSelector to accept a pathname.  Done.  Also updated doc.
#959 - Segfault on background rendering:
  This happened in bg mode (blender -b filename -a, for example) when
a script with the line "Blender.Redraw()" was linked to FRAMECHANGED events.  As reported in the bug page, it was because curarea is NULL in bg mode.  Made Redraw() check for this and not call functions that expected curarea in Redraw, like one to swap buffers.
#1072 - Blender.Redraw() Segfault:
  Good catch : ). Scripts called from the scripts win that called
Blender.Redraw() or Blender.Window.Redraw() would crash Blender because of a dirty pointer in Spacescript->script.  Fixed.
											 
										 
										
											2004-04-11 04:41:33 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										but - > val . asfloat  =  ini ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-06-29 14:35:49 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2007-04-22 13:48:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										if (  block  ) 
							 
						 
					
						
							
								
									
										
										
										
											2007-04-22 13:48:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											ubut =  uiDefButF (  block ,  NUM ,  event ,  name ,  ( short ) x ,  ( short ) y ,  ( short ) w ,  ( short ) h , 
							 
						 
					
						
							
								
									
										
										
										
											2007-07-27 06:14:25 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
												   & but - > val . asfloat ,  min ,  max ,  10 * range ,  precission ,  but - > tooltip  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									}  else  { 
							 
						 
					
						
							
								
									
										
											 
										
											
												BPython: cleaning some bug tracker entries:
(excuse me for doing all in a single commit, but they are tiny
fixes and it's bpython, that dark corner ...)
#1025 - FileSelector SEGV on dynamic callback Category:
  Can't reproduce with current cvs, I'd say recent changes to fix
another crash related to FileSelector in gui-less scripts solved this
one, too.
#1028 - Reserved button event number:
  Menu choices generate two events, one extra related to the menu
itself, with value=4.  Made bpython ignore this extra event.
#1068 - FileSelector No file extension support:
  As Ton wrote there, Blender itself doesn't support this yet.  But the
requester also wanted Window.File/ImageSelector to accept a pathname.  Done.  Also updated doc.
#959 - Segfault on background rendering:
  This happened in bg mode (blender -b filename -a, for example) when
a script with the line "Blender.Redraw()" was linked to FRAMECHANGED events.  As reported in the bug page, it was because curarea is NULL in bg mode.  Made Redraw() check for this and not call functions that expected curarea in Redraw, like one to swap buffers.
#1072 - Blender.Redraw() Segfault:
  Good catch : ). Scripts called from the scripts win that called
Blender.Redraw() or Blender.Window.Redraw() would crash Blender because of a dirty pointer in Spacescript->script.  Fixed.
											 
										 
										
											2004-04-11 04:41:33 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										int  ini ,  min ,  max ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-06-29 14:35:49 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										ini  =  PyInt_AsLong (  inio  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										min  =  PyInt_AsLong (  mino  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										max  =  PyInt_AsLong (  maxo  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-06-29 14:35:49 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2006-01-08 18:59:55 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										but - > type  =  BINT_TYPE ; 
							 
						 
					
						
							
								
									
										
											 
										
											
												BPython: cleaning some bug tracker entries:
(excuse me for doing all in a single commit, but they are tiny
fixes and it's bpython, that dark corner ...)
#1025 - FileSelector SEGV on dynamic callback Category:
  Can't reproduce with current cvs, I'd say recent changes to fix
another crash related to FileSelector in gui-less scripts solved this
one, too.
#1028 - Reserved button event number:
  Menu choices generate two events, one extra related to the menu
itself, with value=4.  Made bpython ignore this extra event.
#1068 - FileSelector No file extension support:
  As Ton wrote there, Blender itself doesn't support this yet.  But the
requester also wanted Window.File/ImageSelector to accept a pathname.  Done.  Also updated doc.
#959 - Segfault on background rendering:
  This happened in bg mode (blender -b filename -a, for example) when
a script with the line "Blender.Redraw()" was linked to FRAMECHANGED events.  As reported in the bug page, it was because curarea is NULL in bg mode.  Made Redraw() check for this and not call functions that expected curarea in Redraw, like one to swap buffers.
#1072 - Blender.Redraw() Segfault:
  Good catch : ). Scripts called from the scripts win that called
Blender.Redraw() or Blender.Window.Redraw() would crash Blender because of a dirty pointer in Spacescript->script.  Fixed.
											 
										 
										
											2004-04-11 04:41:33 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										but - > val . asint  =  ini ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-06-29 14:35:49 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										if (  block  ) 
							 
						 
					
						
							
								
									
										
										
										
											2007-04-22 13:48:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											ubut =  uiDefButI (  block ,  NUM ,  event ,  name ,  ( short ) x ,  ( short ) y ,  ( short ) w ,  ( short ) h , 
							 
						 
					
						
							
								
									
										
										
										
											2007-07-27 06:14:25 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
												   & but - > val . asint ,  ( float ) min ,  ( float ) max ,  0 ,  0 ,  but - > tooltip  ) ; 
							 
						 
					
						
							
								
									
										
											 
										
											
												BPython: cleaning some bug tracker entries:
(excuse me for doing all in a single commit, but they are tiny
fixes and it's bpython, that dark corner ...)
#1025 - FileSelector SEGV on dynamic callback Category:
  Can't reproduce with current cvs, I'd say recent changes to fix
another crash related to FileSelector in gui-less scripts solved this
one, too.
#1028 - Reserved button event number:
  Menu choices generate two events, one extra related to the menu
itself, with value=4.  Made bpython ignore this extra event.
#1068 - FileSelector No file extension support:
  As Ton wrote there, Blender itself doesn't support this yet.  But the
requester also wanted Window.File/ImageSelector to accept a pathname.  Done.  Also updated doc.
#959 - Segfault on background rendering:
  This happened in bg mode (blender -b filename -a, for example) when
a script with the line "Blender.Redraw()" was linked to FRAMECHANGED events.  As reported in the bug page, it was because curarea is NULL in bg mode.  Made Redraw() check for this and not call functions that expected curarea in Redraw, like one to swap buffers.
#1072 - Blender.Redraw() Segfault:
  Good catch : ). Scripts called from the scripts win that called
Blender.Redraw() or Blender.Window.Redraw() would crash Blender because of a dirty pointer in Spacescript->script.  Fixed.
											 
										 
										
											2004-04-11 04:41:33 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2007-04-22 13:48:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									
							 
						 
					
						
							
								
									
										
										
										
											2007-07-27 06:14:25 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if  ( ubut )  set_pycallback ( ubut ,  callback ,  but ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2007-04-22 13:48:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									return  (  PyObject  *  )  but ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-06-29 14:35:49 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
									
										
										
										
											2003-06-26 02:03:51 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								static  PyObject  * Method_String (  PyObject  *  self ,  PyObject  *  args  )  
						 
					
						
							
								
									
										
										
										
											2003-06-29 14:35:49 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								{  
						 
					
						
							
								
									
										
											 
										
											
												BPython: cleaning some bug tracker entries:
(excuse me for doing all in a single commit, but they are tiny
fixes and it's bpython, that dark corner ...)
#1025 - FileSelector SEGV on dynamic callback Category:
  Can't reproduce with current cvs, I'd say recent changes to fix
another crash related to FileSelector in gui-less scripts solved this
one, too.
#1028 - Reserved button event number:
  Menu choices generate two events, one extra related to the menu
itself, with value=4.  Made bpython ignore this extra event.
#1068 - FileSelector No file extension support:
  As Ton wrote there, Blender itself doesn't support this yet.  But the
requester also wanted Window.File/ImageSelector to accept a pathname.  Done.  Also updated doc.
#959 - Segfault on background rendering:
  This happened in bg mode (blender -b filename -a, for example) when
a script with the line "Blender.Redraw()" was linked to FRAMECHANGED events.  As reported in the bug page, it was because curarea is NULL in bg mode.  Made Redraw() check for this and not call functions that expected curarea in Redraw, like one to swap buffers.
#1072 - Blender.Redraw() Segfault:
  Good catch : ). Scripts called from the scripts win that called
Blender.Redraw() or Blender.Window.Redraw() would crash Blender because of a dirty pointer in Spacescript->script.  Fixed.
											 
										 
										
											2004-04-11 04:41:33 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									uiBlock  * block ; 
							 
						 
					
						
							
								
									
										
										
										
											2005-02-16 03:32:57 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									char  * info_arg  =  NULL ,  * tip  =  NULL ,  * newstr  =  NULL ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									char  * info_str  =  NULL ,  * info_str0  =  "   " ; 
							 
						 
					
						
							
								
									
										
											 
										
											
												BPython: cleaning some bug tracker entries:
(excuse me for doing all in a single commit, but they are tiny
fixes and it's bpython, that dark corner ...)
#1025 - FileSelector SEGV on dynamic callback Category:
  Can't reproduce with current cvs, I'd say recent changes to fix
another crash related to FileSelector in gui-less scripts solved this
one, too.
#1028 - Reserved button event number:
  Menu choices generate two events, one extra related to the menu
itself, with value=4.  Made bpython ignore this extra event.
#1068 - FileSelector No file extension support:
  As Ton wrote there, Blender itself doesn't support this yet.  But the
requester also wanted Window.File/ImageSelector to accept a pathname.  Done.  Also updated doc.
#959 - Segfault on background rendering:
  This happened in bg mode (blender -b filename -a, for example) when
a script with the line "Blender.Redraw()" was linked to FRAMECHANGED events.  As reported in the bug page, it was because curarea is NULL in bg mode.  Made Redraw() check for this and not call functions that expected curarea in Redraw, like one to swap buffers.
#1072 - Blender.Redraw() Segfault:
  Good catch : ). Scripts called from the scripts win that called
Blender.Redraw() or Blender.Window.Redraw() would crash Blender because of a dirty pointer in Spacescript->script.  Fixed.
											 
										 
										
											2004-04-11 04:41:33 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									int  event ; 
							 
						 
					
						
							
								
									
										
										
										
											2005-02-16 03:32:57 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									int  x ,  y ,  w ,  h ,  len ,  real_len  =  0 ; 
							 
						 
					
						
							
								
									
										
											 
										
											
												BPython: cleaning some bug tracker entries:
(excuse me for doing all in a single commit, but they are tiny
fixes and it's bpython, that dark corner ...)
#1025 - FileSelector SEGV on dynamic callback Category:
  Can't reproduce with current cvs, I'd say recent changes to fix
another crash related to FileSelector in gui-less scripts solved this
one, too.
#1028 - Reserved button event number:
  Menu choices generate two events, one extra related to the menu
itself, with value=4.  Made bpython ignore this extra event.
#1068 - FileSelector No file extension support:
  As Ton wrote there, Blender itself doesn't support this yet.  But the
requester also wanted Window.File/ImageSelector to accept a pathname.  Done.  Also updated doc.
#959 - Segfault on background rendering:
  This happened in bg mode (blender -b filename -a, for example) when
a script with the line "Blender.Redraw()" was linked to FRAMECHANGED events.  As reported in the bug page, it was because curarea is NULL in bg mode.  Made Redraw() check for this and not call functions that expected curarea in Redraw, like one to swap buffers.
#1072 - Blender.Redraw() Segfault:
  Good catch : ). Scripts called from the scripts win that called
Blender.Redraw() or Blender.Window.Redraw() would crash Blender because of a dirty pointer in Spacescript->script.  Fixed.
											 
										 
										
											2004-04-11 04:41:33 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									Button  * but ; 
							 
						 
					
						
							
								
									
										
										
										
											2007-04-22 13:48:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									PyObject  * callback = NULL ; 
							 
						 
					
						
							
								
									
										
											 
										
											
												BPython: cleaning some bug tracker entries:
(excuse me for doing all in a single commit, but they are tiny
fixes and it's bpython, that dark corner ...)
#1025 - FileSelector SEGV on dynamic callback Category:
  Can't reproduce with current cvs, I'd say recent changes to fix
another crash related to FileSelector in gui-less scripts solved this
one, too.
#1028 - Reserved button event number:
  Menu choices generate two events, one extra related to the menu
itself, with value=4.  Made bpython ignore this extra event.
#1068 - FileSelector No file extension support:
  As Ton wrote there, Blender itself doesn't support this yet.  But the
requester also wanted Window.File/ImageSelector to accept a pathname.  Done.  Also updated doc.
#959 - Segfault on background rendering:
  This happened in bg mode (blender -b filename -a, for example) when
a script with the line "Blender.Redraw()" was linked to FRAMECHANGED events.  As reported in the bug page, it was because curarea is NULL in bg mode.  Made Redraw() check for this and not call functions that expected curarea in Redraw, like one to swap buffers.
#1072 - Blender.Redraw() Segfault:
  Good catch : ). Scripts called from the scripts win that called
Blender.Redraw() or Blender.Window.Redraw() would crash Blender because of a dirty pointer in Spacescript->script.  Fixed.
											 
										 
										
											2004-04-11 04:41:33 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2008-09-14 05:10:45 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if  ( G . background )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  EXPP_ReturnPyObjError (  PyExc_RuntimeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													      " Can't run Draw.String() in background mode. "  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									
							 
						 
					
						
							
								
									
										
										
										
											2007-04-22 13:48:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if (  ! PyArg_ParseTuple (  args ,  " siiiiisi|sO " ,  & info_arg ,  & event , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											& x ,  & y ,  & w ,  & h ,  & newstr ,  & len ,  & tip ,  & callback  )  ) 
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										return  EXPP_ReturnPyObjError (  PyExc_TypeError , 
							 
						 
					
						
							
								
									
										
										
										
											2005-02-16 03:32:57 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											" expected a string, five ints, a string, an int and \n \
 
							 
						 
					
						
							
								
									
										
										
										
											2007-04-22 13:48:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									optionally  string  and  callback  arguments "  ); 
							 
						 
					
						
							
								
									
										
										
										
											2005-02-16 03:32:57 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2007-04-22 13:48:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									UI_METHOD_ERRORCHECK ; 
							 
						 
					
						
							
								
									
										
											 
										
											
												BPython bug fixes:
- #2646 reported by Campbell: Python/Fileselector (moving from fileselector called by script to another space caused script to hang around open but not accessible)
http://projects.blender.org/tracker/?func=detail&atid=125&aid=2646&group_id=9
- #2676 reported by Wim Van Hoydonck: 2.37 python scripts gui: event 8 ignored (thanks Ton for discussing / pointing what to do, Ken Hughes for also working on a fix)
http://projects.blender.org/tracker/?func=detail&atid=125&aid=2676&group_id=9
- gui-less scripts with calls to progress bar inside fileselector callbacks didn't return to the previous space on exit (staying on Scripts win), requiring an event to do so (mouse movement, for example).  Quick fix for now, will rework a little after 2.37a for a better alternative, not needing to move to the Scripts win at all.
- added syntax colors access to Window.Theme module.
Scripts:
- updates by Jean-Michel Soler: svg2obj (svg paths import), tex2uvbaker, fixfromarmature;
- updates by Campbell Barton: obj import / export, console;
- tiny: converted vrml97 export to unix line endings;
- updates in ac3d exporter, help browser, save theme.
Thanks all mentioned above.
											 
										 
										
											2005-06-11 05:30:14 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2006-06-20 18:31:05 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if  ( len  >  ( UI_MAX_DRAW_STR  -  1 ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  EXPP_ReturnPyObjError (  PyExc_ValueError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											" The maximum length of a string is 399, your value is too high. " ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2005-05-25 04:52:52 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2005-02-16 03:32:57 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									real_len  =  strlen ( newstr ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if  ( real_len  >  len )  real_len  =  len ; 
							 
						 
					
						
							
								
									
										
										
										
											2007-07-27 06:14:25 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									but  =  newbutton (   ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2006-01-08 18:59:55 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									but - > type  =  BSTRING_TYPE ; 
							 
						 
					
						
							
								
									
										
											 
										
											
												BPython: cleaning some bug tracker entries:
(excuse me for doing all in a single commit, but they are tiny
fixes and it's bpython, that dark corner ...)
#1025 - FileSelector SEGV on dynamic callback Category:
  Can't reproduce with current cvs, I'd say recent changes to fix
another crash related to FileSelector in gui-less scripts solved this
one, too.
#1028 - Reserved button event number:
  Menu choices generate two events, one extra related to the menu
itself, with value=4.  Made bpython ignore this extra event.
#1068 - FileSelector No file extension support:
  As Ton wrote there, Blender itself doesn't support this yet.  But the
requester also wanted Window.File/ImageSelector to accept a pathname.  Done.  Also updated doc.
#959 - Segfault on background rendering:
  This happened in bg mode (blender -b filename -a, for example) when
a script with the line "Blender.Redraw()" was linked to FRAMECHANGED events.  As reported in the bug page, it was because curarea is NULL in bg mode.  Made Redraw() check for this and not call functions that expected curarea in Redraw, like one to swap buffers.
#1072 - Blender.Redraw() Segfault:
  Good catch : ). Scripts called from the scripts win that called
Blender.Redraw() or Blender.Window.Redraw() would crash Blender because of a dirty pointer in Spacescript->script.  Fixed.
											 
										 
										
											2004-04-11 04:41:33 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									but - > slen  =  len ; 
							 
						 
					
						
							
								
									
										
										
										
											2005-02-16 03:32:57 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									but - > val . asstr  =  MEM_mallocN (  len  +  1 ,  " pybutton str "  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2007-07-27 06:14:25 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if  ( tip )  strncpy ( but - > tooltip ,  tip ,  BPY_MAX_TOOLTIP ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2005-02-16 03:32:57 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2005-05-25 04:52:52 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									BLI_strncpy (  but - > val . asstr ,  newstr ,  len  +  1 ) ;  /* adds '\0' */ 
							 
						 
					
						
							
								
									
										
										
										
											2005-02-16 03:32:57 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									but - > val . asstr [ real_len ]  =  ' \0 ' ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-06-26 02:03:51 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2005-02-16 03:32:57 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if  ( info_arg [ 0 ]  = =  ' \0 ' )  info_str  =  info_str0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									else  info_str  =  info_arg ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-06-26 02:03:51 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									block  =  Get_uiBlock (   ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2007-04-22 13:48:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if (  block  )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										uiBut  * ubut  =  uiDefBut (  block ,  TEX ,  event ,  info_str ,  ( short ) x ,  ( short ) y ,  ( short ) w ,  ( short ) h , 
							 
						 
					
						
							
								
									
										
										
										
											2007-07-27 06:14:25 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											  but - > val . asstr ,  0 ,  ( float ) len ,  0 ,  0 ,  but - > tooltip  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										set_pycallback ( ubut ,  callback ,  but ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2007-04-22 13:48:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									return  (  PyObject  *  )  but ; 
							 
						 
					
						
							
								
									
										
										
										
											2004-03-29 08:16:18 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								static  PyObject  * Method_GetStringWidth (  PyObject  *  self ,  PyObject  *  args  )  
						 
					
						
							
								
									
										
										
										
											2004-03-29 08:16:18 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								{  
						 
					
						
							
								
									
										
											 
										
											
												BPython: cleaning some bug tracker entries:
(excuse me for doing all in a single commit, but they are tiny
fixes and it's bpython, that dark corner ...)
#1025 - FileSelector SEGV on dynamic callback Category:
  Can't reproduce with current cvs, I'd say recent changes to fix
another crash related to FileSelector in gui-less scripts solved this
one, too.
#1028 - Reserved button event number:
  Menu choices generate two events, one extra related to the menu
itself, with value=4.  Made bpython ignore this extra event.
#1068 - FileSelector No file extension support:
  As Ton wrote there, Blender itself doesn't support this yet.  But the
requester also wanted Window.File/ImageSelector to accept a pathname.  Done.  Also updated doc.
#959 - Segfault on background rendering:
  This happened in bg mode (blender -b filename -a, for example) when
a script with the line "Blender.Redraw()" was linked to FRAMECHANGED events.  As reported in the bug page, it was because curarea is NULL in bg mode.  Made Redraw() check for this and not call functions that expected curarea in Redraw, like one to swap buffers.
#1072 - Blender.Redraw() Segfault:
  Good catch : ). Scripts called from the scripts win that called
Blender.Redraw() or Blender.Window.Redraw() would crash Blender because of a dirty pointer in Spacescript->script.  Fixed.
											 
										 
										
											2004-04-11 04:41:33 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									char  * text ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									char  * font_str  =  " normal " ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									struct  BMF_Font  * font ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									PyObject  * width ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if (  ! PyArg_ParseTuple (  args ,  " s|s " ,  & text ,  & font_str  )  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  EXPP_ReturnPyObjError (  PyExc_TypeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													      " expected one or two string arguments "  ) ; 
							 
						 
					
						
							
								
									
										
											 
										
											
												BPython: cleaning some bug tracker entries:
(excuse me for doing all in a single commit, but they are tiny
fixes and it's bpython, that dark corner ...)
#1025 - FileSelector SEGV on dynamic callback Category:
  Can't reproduce with current cvs, I'd say recent changes to fix
another crash related to FileSelector in gui-less scripts solved this
one, too.
#1028 - Reserved button event number:
  Menu choices generate two events, one extra related to the menu
itself, with value=4.  Made bpython ignore this extra event.
#1068 - FileSelector No file extension support:
  As Ton wrote there, Blender itself doesn't support this yet.  But the
requester also wanted Window.File/ImageSelector to accept a pathname.  Done.  Also updated doc.
#959 - Segfault on background rendering:
  This happened in bg mode (blender -b filename -a, for example) when
a script with the line "Blender.Redraw()" was linked to FRAMECHANGED events.  As reported in the bug page, it was because curarea is NULL in bg mode.  Made Redraw() check for this and not call functions that expected curarea in Redraw, like one to swap buffers.
#1072 - Blender.Redraw() Segfault:
  Good catch : ). Scripts called from the scripts win that called
Blender.Redraw() or Blender.Window.Redraw() would crash Blender because of a dirty pointer in Spacescript->script.  Fixed.
											 
										 
										
											2004-04-11 04:41:33 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if (  ! strcmp (  font_str ,  " normal "  )  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										font  =  (  & G  ) - > font ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-02-19 10:47:29 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									else  if (  ! strcmp (  font_str ,  " normalfix "  )  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										font  =  BMF_GetFont ( BMF_kScreen12 ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2005-05-20 05:14:03 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									else  if (  ! strcmp (  font_str ,  " large "  )  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										font  =  BMF_GetFont ( BMF_kScreen15 ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									else  if (  ! strcmp (  font_str ,  " small "  )  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										font  =  (  & G  ) - > fonts ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									else  if (  ! strcmp (  font_str ,  " tiny "  )  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										font  =  (  & G  ) - > fontss ; 
							 
						 
					
						
							
								
									
										
											 
										
											
												BPython: cleaning some bug tracker entries:
(excuse me for doing all in a single commit, but they are tiny
fixes and it's bpython, that dark corner ...)
#1025 - FileSelector SEGV on dynamic callback Category:
  Can't reproduce with current cvs, I'd say recent changes to fix
another crash related to FileSelector in gui-less scripts solved this
one, too.
#1028 - Reserved button event number:
  Menu choices generate two events, one extra related to the menu
itself, with value=4.  Made bpython ignore this extra event.
#1068 - FileSelector No file extension support:
  As Ton wrote there, Blender itself doesn't support this yet.  But the
requester also wanted Window.File/ImageSelector to accept a pathname.  Done.  Also updated doc.
#959 - Segfault on background rendering:
  This happened in bg mode (blender -b filename -a, for example) when
a script with the line "Blender.Redraw()" was linked to FRAMECHANGED events.  As reported in the bug page, it was because curarea is NULL in bg mode.  Made Redraw() check for this and not call functions that expected curarea in Redraw, like one to swap buffers.
#1072 - Blender.Redraw() Segfault:
  Good catch : ). Scripts called from the scripts win that called
Blender.Redraw() or Blender.Window.Redraw() would crash Blender because of a dirty pointer in Spacescript->script.  Fixed.
											 
										 
										
											2004-04-11 04:41:33 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									else 
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										return  EXPP_ReturnPyObjError (  PyExc_AttributeError , 
							 
						 
					
						
							
								
									
										
										
										
											2008-02-19 10:47:29 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
													      " \" font \"  must be: 'large','normal' (default), 'normalfix', 'small' or 'tiny'. "  ) ; 
							 
						 
					
						
							
								
									
										
											 
										
											
												BPython: cleaning some bug tracker entries:
(excuse me for doing all in a single commit, but they are tiny
fixes and it's bpython, that dark corner ...)
#1025 - FileSelector SEGV on dynamic callback Category:
  Can't reproduce with current cvs, I'd say recent changes to fix
another crash related to FileSelector in gui-less scripts solved this
one, too.
#1028 - Reserved button event number:
  Menu choices generate two events, one extra related to the menu
itself, with value=4.  Made bpython ignore this extra event.
#1068 - FileSelector No file extension support:
  As Ton wrote there, Blender itself doesn't support this yet.  But the
requester also wanted Window.File/ImageSelector to accept a pathname.  Done.  Also updated doc.
#959 - Segfault on background rendering:
  This happened in bg mode (blender -b filename -a, for example) when
a script with the line "Blender.Redraw()" was linked to FRAMECHANGED events.  As reported in the bug page, it was because curarea is NULL in bg mode.  Made Redraw() check for this and not call functions that expected curarea in Redraw, like one to swap buffers.
#1072 - Blender.Redraw() Segfault:
  Good catch : ). Scripts called from the scripts win that called
Blender.Redraw() or Blender.Window.Redraw() would crash Blender because of a dirty pointer in Spacescript->script.  Fixed.
											 
										 
										
											2004-04-11 04:41:33 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									width  =  PyInt_FromLong (  BMF_GetStringWidth (  font ,  text  )  ) ; 
							 
						 
					
						
							
								
									
										
											 
										
											
												BPython: cleaning some bug tracker entries:
(excuse me for doing all in a single commit, but they are tiny
fixes and it's bpython, that dark corner ...)
#1025 - FileSelector SEGV on dynamic callback Category:
  Can't reproduce with current cvs, I'd say recent changes to fix
another crash related to FileSelector in gui-less scripts solved this
one, too.
#1028 - Reserved button event number:
  Menu choices generate two events, one extra related to the menu
itself, with value=4.  Made bpython ignore this extra event.
#1068 - FileSelector No file extension support:
  As Ton wrote there, Blender itself doesn't support this yet.  But the
requester also wanted Window.File/ImageSelector to accept a pathname.  Done.  Also updated doc.
#959 - Segfault on background rendering:
  This happened in bg mode (blender -b filename -a, for example) when
a script with the line "Blender.Redraw()" was linked to FRAMECHANGED events.  As reported in the bug page, it was because curarea is NULL in bg mode.  Made Redraw() check for this and not call functions that expected curarea in Redraw, like one to swap buffers.
#1072 - Blender.Redraw() Segfault:
  Good catch : ). Scripts called from the scripts win that called
Blender.Redraw() or Blender.Window.Redraw() would crash Blender because of a dirty pointer in Spacescript->script.  Fixed.
											 
										 
										
											2004-04-11 04:41:33 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if (  ! width  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  EXPP_ReturnPyObjError (  PyExc_MemoryError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													      " couldn't create PyInt "  ) ; 
							 
						 
					
						
							
								
									
										
											 
										
											
												BPython: cleaning some bug tracker entries:
(excuse me for doing all in a single commit, but they are tiny
fixes and it's bpython, that dark corner ...)
#1025 - FileSelector SEGV on dynamic callback Category:
  Can't reproduce with current cvs, I'd say recent changes to fix
another crash related to FileSelector in gui-less scripts solved this
one, too.
#1028 - Reserved button event number:
  Menu choices generate two events, one extra related to the menu
itself, with value=4.  Made bpython ignore this extra event.
#1068 - FileSelector No file extension support:
  As Ton wrote there, Blender itself doesn't support this yet.  But the
requester also wanted Window.File/ImageSelector to accept a pathname.  Done.  Also updated doc.
#959 - Segfault on background rendering:
  This happened in bg mode (blender -b filename -a, for example) when
a script with the line "Blender.Redraw()" was linked to FRAMECHANGED events.  As reported in the bug page, it was because curarea is NULL in bg mode.  Made Redraw() check for this and not call functions that expected curarea in Redraw, like one to swap buffers.
#1072 - Blender.Redraw() Segfault:
  Good catch : ). Scripts called from the scripts win that called
Blender.Redraw() or Blender.Window.Redraw() would crash Blender because of a dirty pointer in Spacescript->script.  Fixed.
											 
										 
										
											2004-04-11 04:41:33 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									return  width ; 
							 
						 
					
						
							
								
									
										
										
										
											2004-03-29 08:16:18 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								static  PyObject  * Method_Text (  PyObject  *  self ,  PyObject  *  args  )  
						 
					
						
							
								
									
										
										
										
											2004-03-29 08:16:18 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								{  
						 
					
						
							
								
									
										
											 
										
											
												BPython: cleaning some bug tracker entries:
(excuse me for doing all in a single commit, but they are tiny
fixes and it's bpython, that dark corner ...)
#1025 - FileSelector SEGV on dynamic callback Category:
  Can't reproduce with current cvs, I'd say recent changes to fix
another crash related to FileSelector in gui-less scripts solved this
one, too.
#1028 - Reserved button event number:
  Menu choices generate two events, one extra related to the menu
itself, with value=4.  Made bpython ignore this extra event.
#1068 - FileSelector No file extension support:
  As Ton wrote there, Blender itself doesn't support this yet.  But the
requester also wanted Window.File/ImageSelector to accept a pathname.  Done.  Also updated doc.
#959 - Segfault on background rendering:
  This happened in bg mode (blender -b filename -a, for example) when
a script with the line "Blender.Redraw()" was linked to FRAMECHANGED events.  As reported in the bug page, it was because curarea is NULL in bg mode.  Made Redraw() check for this and not call functions that expected curarea in Redraw, like one to swap buffers.
#1072 - Blender.Redraw() Segfault:
  Good catch : ). Scripts called from the scripts win that called
Blender.Redraw() or Blender.Window.Redraw() would crash Blender because of a dirty pointer in Spacescript->script.  Fixed.
											 
										 
										
											2004-04-11 04:41:33 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									char  * text ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									char  * font_str  =  NULL ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									struct  BMF_Font  * font ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2008-09-14 05:10:45 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if  ( G . background )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  EXPP_ReturnPyObjError (  PyExc_RuntimeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													      " Can't run Draw.Text() in background mode. "  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if (  ! PyArg_ParseTuple (  args ,  " s|s " ,  & text ,  & font_str  )  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  EXPP_ReturnPyObjError (  PyExc_TypeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													      " expected one or two string arguments "  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if (  ! font_str  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										font  =  (  & G  ) - > font ; 
							 
						 
					
						
							
								
									
										
										
										
											2005-05-20 05:14:03 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									else  if (  ! strcmp (  font_str ,  " large "  )  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										font  =  BMF_GetFont ( BMF_kScreen15 ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-02-19 10:47:29 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									else  if (  ! strcmp (  font_str ,  " normalfix "  )  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										font  =  BMF_GetFont ( BMF_kScreen12 ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									else  if (  ! strcmp (  font_str ,  " normal "  )  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										font  =  (  & G  ) - > font ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									else  if (  ! strcmp (  font_str ,  " small "  )  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										font  =  (  & G  ) - > fonts ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									else  if (  ! strcmp (  font_str ,  " tiny "  )  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										font  =  (  & G  ) - > fontss ; 
							 
						 
					
						
							
								
									
										
											 
										
											
												BPython: cleaning some bug tracker entries:
(excuse me for doing all in a single commit, but they are tiny
fixes and it's bpython, that dark corner ...)
#1025 - FileSelector SEGV on dynamic callback Category:
  Can't reproduce with current cvs, I'd say recent changes to fix
another crash related to FileSelector in gui-less scripts solved this
one, too.
#1028 - Reserved button event number:
  Menu choices generate two events, one extra related to the menu
itself, with value=4.  Made bpython ignore this extra event.
#1068 - FileSelector No file extension support:
  As Ton wrote there, Blender itself doesn't support this yet.  But the
requester also wanted Window.File/ImageSelector to accept a pathname.  Done.  Also updated doc.
#959 - Segfault on background rendering:
  This happened in bg mode (blender -b filename -a, for example) when
a script with the line "Blender.Redraw()" was linked to FRAMECHANGED events.  As reported in the bug page, it was because curarea is NULL in bg mode.  Made Redraw() check for this and not call functions that expected curarea in Redraw, like one to swap buffers.
#1072 - Blender.Redraw() Segfault:
  Good catch : ). Scripts called from the scripts win that called
Blender.Redraw() or Blender.Window.Redraw() would crash Blender because of a dirty pointer in Spacescript->script.  Fixed.
											 
										 
										
											2004-04-11 04:41:33 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									else 
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										return  EXPP_ReturnPyObjError (  PyExc_AttributeError , 
							 
						 
					
						
							
								
									
										
										
										
											2008-02-19 10:47:29 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
													      " \" font \"  must be: 'large','normal' (default), 'normalfix', 'small' or 'tiny'. "  ) ; 
							 
						 
					
						
							
								
									
										
											 
										
											
												BPython: cleaning some bug tracker entries:
(excuse me for doing all in a single commit, but they are tiny
fixes and it's bpython, that dark corner ...)
#1025 - FileSelector SEGV on dynamic callback Category:
  Can't reproduce with current cvs, I'd say recent changes to fix
another crash related to FileSelector in gui-less scripts solved this
one, too.
#1028 - Reserved button event number:
  Menu choices generate two events, one extra related to the menu
itself, with value=4.  Made bpython ignore this extra event.
#1068 - FileSelector No file extension support:
  As Ton wrote there, Blender itself doesn't support this yet.  But the
requester also wanted Window.File/ImageSelector to accept a pathname.  Done.  Also updated doc.
#959 - Segfault on background rendering:
  This happened in bg mode (blender -b filename -a, for example) when
a script with the line "Blender.Redraw()" was linked to FRAMECHANGED events.  As reported in the bug page, it was because curarea is NULL in bg mode.  Made Redraw() check for this and not call functions that expected curarea in Redraw, like one to swap buffers.
#1072 - Blender.Redraw() Segfault:
  Good catch : ). Scripts called from the scripts win that called
Blender.Redraw() or Blender.Window.Redraw() would crash Blender because of a dirty pointer in Spacescript->script.  Fixed.
											 
										 
										
											2004-04-11 04:41:33 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									BMF_DrawString (  font ,  text  ) ; 
							 
						 
					
						
							
								
									
										
											 
										
											
												BPython: cleaning some bug tracker entries:
(excuse me for doing all in a single commit, but they are tiny
fixes and it's bpython, that dark corner ...)
#1025 - FileSelector SEGV on dynamic callback Category:
  Can't reproduce with current cvs, I'd say recent changes to fix
another crash related to FileSelector in gui-less scripts solved this
one, too.
#1028 - Reserved button event number:
  Menu choices generate two events, one extra related to the menu
itself, with value=4.  Made bpython ignore this extra event.
#1068 - FileSelector No file extension support:
  As Ton wrote there, Blender itself doesn't support this yet.  But the
requester also wanted Window.File/ImageSelector to accept a pathname.  Done.  Also updated doc.
#959 - Segfault on background rendering:
  This happened in bg mode (blender -b filename -a, for example) when
a script with the line "Blender.Redraw()" was linked to FRAMECHANGED events.  As reported in the bug page, it was because curarea is NULL in bg mode.  Made Redraw() check for this and not call functions that expected curarea in Redraw, like one to swap buffers.
#1072 - Blender.Redraw() Segfault:
  Good catch : ). Scripts called from the scripts win that called
Blender.Redraw() or Blender.Window.Redraw() would crash Blender because of a dirty pointer in Spacescript->script.  Fixed.
											 
										 
										
											2004-04-11 04:41:33 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									return  PyInt_FromLong (  BMF_GetStringWidth (  font ,  text  )  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-05-08 03:06:46 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2007-03-27 11:37:54 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								static  PyObject  * Method_Label (  PyObject  *  self ,  PyObject  *  args  )  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								{  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									uiBlock  * block ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									char  * text ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									int  x ,  y ,  w ,  h ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2008-09-14 05:10:45 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if  ( G . background )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  EXPP_ReturnPyObjError (  PyExc_RuntimeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													      " Can't run Draw.Label() in background mode. "  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									
							 
						 
					
						
							
								
									
										
										
										
											2007-03-27 11:37:54 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if (  ! PyArg_ParseTuple (  args ,  " siiii " ,  & text ,  & x ,  & y ,  & w ,  & h  )  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  EXPP_ReturnPyObjError (  PyExc_TypeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											" expected a string and four ints "  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									block  =  Get_uiBlock (   ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									uiDefBut ( block ,  LABEL ,  0 ,  text ,  x ,  y ,  w ,  h ,  0 ,  0 ,  0 ,  0 ,  0 ,  " " ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									Py_RETURN_NONE ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								static  PyObject  * Method_PupMenu (  PyObject  *  self ,  PyObject  *  args  )  
						 
					
						
							
								
									
										
										
										
											2003-09-20 03:40:16 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								{  
						 
					
						
							
								
									
										
											 
										
											
												BPython: cleaning some bug tracker entries:
(excuse me for doing all in a single commit, but they are tiny
fixes and it's bpython, that dark corner ...)
#1025 - FileSelector SEGV on dynamic callback Category:
  Can't reproduce with current cvs, I'd say recent changes to fix
another crash related to FileSelector in gui-less scripts solved this
one, too.
#1028 - Reserved button event number:
  Menu choices generate two events, one extra related to the menu
itself, with value=4.  Made bpython ignore this extra event.
#1068 - FileSelector No file extension support:
  As Ton wrote there, Blender itself doesn't support this yet.  But the
requester also wanted Window.File/ImageSelector to accept a pathname.  Done.  Also updated doc.
#959 - Segfault on background rendering:
  This happened in bg mode (blender -b filename -a, for example) when
a script with the line "Blender.Redraw()" was linked to FRAMECHANGED events.  As reported in the bug page, it was because curarea is NULL in bg mode.  Made Redraw() check for this and not call functions that expected curarea in Redraw, like one to swap buffers.
#1072 - Blender.Redraw() Segfault:
  Good catch : ). Scripts called from the scripts win that called
Blender.Redraw() or Blender.Window.Redraw() would crash Blender because of a dirty pointer in Spacescript->script.  Fixed.
											 
										 
										
											2004-04-11 04:41:33 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									char  * text ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									int  maxrow  =  - 1 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									PyObject  * ret ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-09-14 05:10:45 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if  ( G . background )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  EXPP_ReturnPyObjError (  PyExc_RuntimeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													      " Can't run Draw.PupMenu() in background mode. "  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if (  ! PyArg_ParseTuple (  args ,  " s|i " ,  & text ,  & maxrow  )  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  EXPP_ReturnPyObjError (  PyExc_TypeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													      " expected a string and optionally an int as arguments "  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-09-20 03:40:16 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if (  maxrow  > =  0  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										ret  =  PyInt_FromLong (  pupmenu_col (  text ,  maxrow  )  ) ; 
							 
						 
					
						
							
								
									
										
											 
										
											
												BPython: cleaning some bug tracker entries:
(excuse me for doing all in a single commit, but they are tiny
fixes and it's bpython, that dark corner ...)
#1025 - FileSelector SEGV on dynamic callback Category:
  Can't reproduce with current cvs, I'd say recent changes to fix
another crash related to FileSelector in gui-less scripts solved this
one, too.
#1028 - Reserved button event number:
  Menu choices generate two events, one extra related to the menu
itself, with value=4.  Made bpython ignore this extra event.
#1068 - FileSelector No file extension support:
  As Ton wrote there, Blender itself doesn't support this yet.  But the
requester also wanted Window.File/ImageSelector to accept a pathname.  Done.  Also updated doc.
#959 - Segfault on background rendering:
  This happened in bg mode (blender -b filename -a, for example) when
a script with the line "Blender.Redraw()" was linked to FRAMECHANGED events.  As reported in the bug page, it was because curarea is NULL in bg mode.  Made Redraw() check for this and not call functions that expected curarea in Redraw, like one to swap buffers.
#1072 - Blender.Redraw() Segfault:
  Good catch : ). Scripts called from the scripts win that called
Blender.Redraw() or Blender.Window.Redraw() would crash Blender because of a dirty pointer in Spacescript->script.  Fixed.
											 
										 
										
											2004-04-11 04:41:33 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									else 
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										ret  =  PyInt_FromLong (  pupmenu (  text  )  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-09-20 03:40:16 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if (  ret  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  ret ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-09-20 03:40:16 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									return  EXPP_ReturnPyObjError (  PyExc_MemoryError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												      " couldn't create a PyInt "  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-09-20 03:40:16 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2008-02-15 16:08:41 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								static  int  current_menu_ret ;  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								static  void  toolbox_event ( void  * arg ,  int  event )  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								{  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									current_menu_ret  =  event ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								static  TBitem  *  menu_from_pylist (  PyObject  *  current_menu ,  ListBase  * storage  )  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								{  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									TBitem  * tbarray ,  * tbitem ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									Link  * link ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									PyObject  * item ,  * submenu ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									int  size ,  i ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									char  * menutext ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									int  event ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									size  =  PyList_Size (  current_menu  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									link =  MEM_callocN ( sizeof ( Link )  +  sizeof ( TBitem ) * ( size + 1 ) ,  " python menu " ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if  ( link = = NULL )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										PyErr_SetString (  PyExc_MemoryError ,  " Could not allocate enough memory for the menu "  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										BLI_freelistN ( storage ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  NULL ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									BLI_addtail ( storage ,  link ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									tbarray  =  tbitem  =  ( TBitem  * ) ( link + 1 ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									for  ( i = 0 ;  i < size ;  i + + ,  tbitem + + )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										/* need to get these in */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										item  =  PyList_GET_ITEM (  current_menu ,  i ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										if  ( item  = =  Py_None )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											tbitem - > name  =  " SEPR " ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										}  else  if (  PyArg_ParseTuple (  item ,  " si " ,  & menutext ,  & event  )  )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											tbitem - > name  =  menutext ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											tbitem - > retval  =  event ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											//current_menu_index
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										}  else  if (  PyArg_ParseTuple (  item ,  " sO! " ,  & menutext ,  & PyList_Type ,  & submenu  )  )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											PyErr_Clear ( ) ;  /* from PyArg_ParseTuple above */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											tbitem - > name  =  menutext ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											tbitem - > poin  =  menu_from_pylist ( submenu ,  storage ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											if  ( tbitem - > poin  = =  NULL )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												BLI_freelistN ( storage ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												return  NULL ;  /* error should be set */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										}  else  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											PyErr_Clear ( ) ;  /* from PyArg_ParseTuple above */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											PyErr_SetString (  PyExc_TypeError ,  " Expected a list of name,event tuples, None, or lists for submenus "  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											BLI_freelistN ( storage ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											return  NULL ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									tbitem - > icon =  - 1 ; 	/* end signal */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									tbitem - > name =  " " ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									tbitem - > retval =  0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									tbitem - > poin =  toolbox_event ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									return  tbarray ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								static  PyObject  * Method_PupTreeMenu (  PyObject  *  self ,  PyObject  *  args  )  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								{  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									PyObject  *  current_menu ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									ListBase  storage  =  { NULL ,  NULL } ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									TBitem  * tb ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									
							 
						 
					
						
							
								
									
										
										
										
											2008-09-14 05:10:45 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if  ( G . background )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  EXPP_ReturnPyObjError (  PyExc_RuntimeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													      " Can't run Draw.PupMenuTree() in background mode. "  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									
							 
						 
					
						
							
								
									
										
										
										
											2008-02-15 16:08:41 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if (  ! PyArg_ParseTuple (  args ,  " O! " ,  & PyList_Type ,  & current_menu  )  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  EXPP_ReturnPyObjError (  PyExc_TypeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											" Expected a list "  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									mywinset ( G . curscreen - > mainwin ) ;  // we go to screenspace
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									tb  =  menu_from_pylist ( current_menu ,  & storage ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if  ( ! tb )  {  
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										/* Error is set */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  NULL ;  
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									current_menu_ret  =  - 1 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									toolbox_generic ( tb ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									/* free all dynamic entries... */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									BLI_freelistN ( & storage ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									mywinset ( curarea - > win ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									return  PyInt_FromLong (  current_menu_ret  ) ;  /* current_menu_ret is set by toolbox_event callback */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								static  PyObject  * Method_PupIntInput (  PyObject  *  self ,  PyObject  *  args  )  
						 
					
						
							
								
									
										
										
										
											2004-05-19 01:28:12 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								{  
						 
					
						
							
								
									
										
										
										
											2004-06-16 01:18:57 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									char  * text  =  NULL ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									int  min  =  0 ,  max  =  1 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									short  var  =  0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									PyObject  * ret  =  NULL ; 
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2008-09-14 05:10:45 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if  ( G . background )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  EXPP_ReturnPyObjError (  PyExc_RuntimeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													      " Can't run Draw.PupIntInput() in background mode. "  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if (  ! PyArg_ParseTuple (  args ,  " s|hii " ,  & text ,  & var ,  & min ,  & max  )  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  EXPP_ReturnPyObjError (  PyExc_TypeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													      " expected 1 string and 3 int arguments "  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2005-07-18 03:50:37 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if (  button (  & var ,  ( short ) min ,  ( short ) max ,  text  )  = =  0  )  { 
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										Py_INCREF (  Py_None  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2004-05-19 01:28:12 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										return  Py_None ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									ret  =  PyInt_FromLong (  var  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if (  ret  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  ret ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									return  EXPP_ReturnPyObjError (  PyExc_MemoryError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												      " couldn't create a PyInt "  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2004-05-19 01:28:12 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								static  PyObject  * Method_PupFloatInput (  PyObject  *  self ,  PyObject  *  args  )  
						 
					
						
							
								
									
										
										
										
											2004-05-19 01:28:12 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								{  
						 
					
						
							
								
									
										
										
										
											2004-06-16 01:18:57 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									char  * text  =  NULL ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									float  min  =  0 ,  max  =  1 ,  var  =  0 ,  a1  =  10 ,  a2  =  2 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									PyObject  * ret  =  NULL ; 
							 
						 
					
						
							
								
									
										
										
										
											2004-05-19 01:28:12 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2008-09-14 05:10:45 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if  ( G . background )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  EXPP_ReturnPyObjError (  PyExc_RuntimeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													      " Can't run Draw.PupFloatInput() in background mode. "  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if (  ! PyArg_ParseTuple 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									    (  args ,  " s|fffff " ,  & text ,  & var ,  & min ,  & max ,  & a1 ,  & a2  )  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  EXPP_ReturnPyObjError (  PyExc_TypeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													      " expected 1 string and 5 float arguments "  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2004-05-19 01:28:12 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if (  fbutton (  & var ,  min ,  max ,  a1 ,  a2 ,  text  )  = =  0  )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										Py_INCREF (  Py_None  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2004-05-19 01:28:12 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										return  Py_None ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									ret  =  PyFloat_FromDouble (  var  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if (  ret  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  ret ; 
							 
						 
					
						
							
								
									
										
										
										
											2004-05-19 01:28:12 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									return  EXPP_ReturnPyObjError (  PyExc_MemoryError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												      " couldn't create a PyFloat "  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2004-05-19 01:28:12 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								static  PyObject  * Method_PupStrInput (  PyObject  *  self ,  PyObject  *  args  )  
						 
					
						
							
								
									
										
										
										
											2004-06-16 01:18:57 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								{  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									char  * text  =  NULL ,  * textMsg  =  NULL ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									char  tmp [ 101 ] ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									char  max  =  20 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									PyObject  * ret  =  NULL ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2008-09-14 05:10:45 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if  ( G . background )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  EXPP_ReturnPyObjError (  PyExc_RuntimeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													      " Can't run Draw.PupStrInput() in background mode. "  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if (  ! PyArg_ParseTuple (  args ,  " ss|b " ,  & textMsg ,  & text ,  & max  )  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  EXPP_ReturnPyObjError (  PyExc_TypeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													      " expected 2 strings and 1 int "  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2004-06-16 01:18:57 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if (  (  max  < =  0  )  | |  (  max  >  100  )  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  EXPP_ReturnPyObjError (  PyExc_AttributeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													      " max string length value must be in the range [1, 100]. "  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2004-06-16 01:18:57 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									/* copying the text string handles both cases:
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									 *  max  <  strlen ( text )  ( by  truncating )  and 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									 *  max  >  strlen ( text )  ( by  expanding  to  strlen ( tmp ) )  */ 
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									BLI_strncpy (  tmp ,  text ,  max  +  1  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2004-06-16 01:18:57 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if (  sbutton (  tmp ,  0 ,  max ,  textMsg  )  = =  0  )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										Py_INCREF (  Py_None  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2004-06-16 01:18:57 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										return  Py_None ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2006-09-30 14:14:49 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									ret  =  PyString_FromString (  tmp  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if (  ret  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  ret ; 
							 
						 
					
						
							
								
									
										
										
										
											2004-06-16 01:18:57 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									return  EXPP_ReturnPyObjError (  PyExc_MemoryError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												      " couldn't create a PyString "  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2004-06-16 01:18:57 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2006-01-08 18:59:55 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								static  PyObject  * Method_PupBlock (  PyObject  *  self ,  PyObject  *  args  )  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								{  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									PyObject  * pyList ,  * pyItem ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									float  min ,  max ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									int  len ,  i ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									char  * title ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2008-09-14 05:10:45 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if  ( G . background )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  EXPP_ReturnPyObjError (  PyExc_RuntimeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													      " Can't run Draw.PupBlock() in background mode. "  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									
							 
						 
					
						
							
								
									
										
										
										
											2006-01-08 18:59:55 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if  ( ! PyArg_ParseTuple (  args ,  " sO " ,  & title ,  & pyList  )  | |  ! PySequence_Check (  pyList  ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  EXPP_ReturnPyObjError (  PyExc_TypeError ,  " expected a string and a sequence "  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									len  =  PySequence_Length ( pyList ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if  ( len  = =  0 ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  EXPP_ReturnPyObjError (  PyExc_ValueError ,  " expected a string and a non-empty sequence. "  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2006-12-16 03:36:54 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if  ( len  >  120 )  /* LIMIT DEFINED IN toolbox.c	*/ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  EXPP_ReturnPyObjError (  PyExc_ValueError ,  " sequence cannot have more than 120 elements "  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2006-01-08 18:59:55 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									for  (  i = 0  ;  i < len  ;  i + +  )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										PyObject  * pyMin  =  NULL ,  * pyMax  =  NULL ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										PyObject  * f1 ,  * f2 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										Button  * but  =  NULL ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										int  tlen ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										char  * text ,  * tip  =  NULL ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										pyItem  =  PySequence_GetItem (  pyList ,  i  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										if  ( ! pyItem ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											return  NULL ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										if  ( PyString_Check (  pyItem  ) )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											tlen  =  - 2 ; 	/* single string for label, giving it a special len for later */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										else  if  ( PyTuple_Check (  pyItem  ) )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											/* tuple for other button, get the length for later */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											tlen  =  PyTuple_Size (  pyItem  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										else  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											/* Neither a string or a tuple, error */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											Py_DECREF (  pyItem  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											return  EXPP_ReturnPyObjError (  PyExc_ValueError ,  " expected a string or a tuple containing 2 to 5 values. "  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										switch  ( tlen )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										case  - 2 : 		/*	LABEL	*/ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											text  =  PyString_AsString (  pyItem  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											add_numbut ( i ,  LABEL ,  text ,  0 ,  0 ,  NULL ,  NULL ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										case  2 : 		/*	TOGGLE	(no tooltip)	*/ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										case  3 : 		/*	TOGGLE	*/ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											if  ( ! PyArg_ParseTuple (  pyItem ,  " sO!|s " ,  & text ,  & Button_Type ,  & but ,  & tip  ) )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												Py_DECREF (  pyItem  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												return  EXPP_ReturnPyObjError (  PyExc_ValueError ,  " expected a tuple containing a string, a Button object and optionally a string for toggles "  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											if  ( but - > type  ! =  BINT_TYPE )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												Py_DECREF (  pyItem  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												return  EXPP_ReturnPyObjError (  PyExc_ValueError ,  " Button object for toggles should hold an integer "  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											add_numbut ( i ,  TOG | INT ,  text ,  0 ,  0 ,  & but - > val . asint ,  tip ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										case  4 : 		/*	TEX and NUM (no tooltip)	*/ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										case  5 : 		/*	TEX and NUM	*/ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											if  ( ! PyArg_ParseTuple (  pyItem ,  " sO!OO|s " ,  & text ,  & Button_Type ,  & but ,  & pyMin ,  & pyMax ,  & tip  ) )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												Py_DECREF (  pyItem  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												return  EXPP_ReturnPyObjError (  PyExc_ValueError ,  " expected a tuple containing a string, a Button object, two numerical values and optionally a string for Text and Num buttons "  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											f1  =  PyNumber_Float ( pyMin ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											f2  =  PyNumber_Float ( pyMax ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											if  ( ! f1  | |  ! f2 )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												Py_DECREF (  pyItem  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												return  EXPP_ReturnPyObjError (  PyExc_ValueError ,  " expected a tuple containing a string, a Button object, two numerical values and optionally a string for Text and Num buttons "  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											min  =  ( float ) PyFloat_AS_DOUBLE ( f1 ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											max  =  ( float ) PyFloat_AS_DOUBLE ( f2 ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											Py_DECREF (  f1  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											Py_DECREF (  f2  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											switch  (  but - > type  )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											case  BINT_TYPE : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												add_numbut ( i ,  NUM | INT ,  text ,  min ,  max ,  & but - > val . asint ,  tip ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											case  BFLOAT_TYPE : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												add_numbut ( i ,  NUM | FLO ,  text ,  min ,  max ,  & but - > val . asfloat ,  tip ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											case  BSTRING_TYPE : 
							 
						 
					
						
							
								
									
										
										
										
											2006-06-23 23:58:50 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
												if  ( max + 1 > UI_MAX_DRAW_STR )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													Py_DECREF (  pyItem  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													return  EXPP_ReturnPyObjError (  PyExc_ValueError ,  " length of a string buttons must be less then 400 "  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												} 
							 
						 
					
						
							
								
									
										
										
										
											2006-01-08 18:59:55 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
												max  =  ( float ) floor ( max ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												if  ( max  >  but - > slen )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													int  old_len  =  but - > slen ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													char  * old_str  =  but - > val . asstr ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													but - > slen  =  ( int ) max ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													but - > val . asstr  =  MEM_callocN (  but - > slen  +  1 ,  " button pupblock " ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													BLI_strncpy (  but - > val . asstr ,  old_str ,  old_len  +  1  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													MEM_freeN ( old_str ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
												add_numbut ( i ,  TEX ,  text ,  0.0f ,  max ,  but - > val . asstr ,  tip ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										default : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											Py_DECREF (  pyItem  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											return  EXPP_ReturnPyObjError (  PyExc_ValueError ,  " expected a string or a tuple containing 2 to 5 values. "  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										Py_DECREF (  pyItem  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if  ( do_clever_numbuts ( title ,  len ,  REDRAW ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  EXPP_incr_ret_True ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									else 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  EXPP_incr_ret_False ( ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2005-01-13 03:04:12 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								/*****************************************************************************
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								 *  Function :             Method_Image                                          * 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								 *  Python  equivalent :    Blender . Draw . Image                                    * 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								 *                                                                            * 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								 *  @ author  Jonathan  Merritt  < j . merritt @ pgrad . unimelb . edu . au >                  * 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								static  PyObject  * Method_Image (  PyObject  *  self ,  PyObject  *  args  )  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								{  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									PyObject  * pyObjImage ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									BPy_Image  * py_img ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									Image  * image ; 
							 
						 
					
						
							
								
									
										
										
										
											2006-12-20 17:57:56 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									ImBuf  * ibuf ; 
							 
						 
					
						
							
								
									
										
										
										
											2005-01-13 03:04:12 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									float  originX ,  originY ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									float  zoomX  =  1.0 ,  zoomY  =  1.0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									int  clipX  =  0 ,  clipY  =  0 ,  clipW  =  - 1 ,  clipH  =  - 1 ; 
							 
						 
					
						
							
								
									
										
										
										
											2005-05-25 04:52:52 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									/*GLfloat scissorBox[4];*/ 
							 
						 
					
						
							
								
									
										
										
										
											2005-01-13 03:04:12 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2008-09-14 05:10:45 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if  ( G . background )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  EXPP_ReturnPyObjError (  PyExc_RuntimeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
													      " Can't run Draw.Image() in background mode. "  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									
							 
						 
					
						
							
								
									
										
										
										
											2005-01-13 03:04:12 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									/* parse the arguments passed-in from Python */ 
							 
						 
					
						
							
								
									
										
										
										
											2008-05-25 16:39:57 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if (  ! PyArg_ParseTuple (  args ,  " O!ff|ffiiii " ,  & Image_Type ,  & pyObjImage ,  
							 
						 
					
						
							
								
									
										
										
										
											2005-01-13 03:04:12 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										& originX ,  & originY ,  & zoomX ,  & zoomY ,  
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										& clipX ,  & clipY ,  & clipW ,  & clipH  )  ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  EXPP_ReturnPyObjError (  PyExc_TypeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											" expected a Blender.Image and 2 floats, and  "  \
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
											" optionally 2 floats and 4 ints as arguments "  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									/* check that the zoom factors are valid */ 
							 
						 
					
						
							
								
									
										
										
										
											2008-05-25 16:39:57 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if (  (  zoomX  <  0.0  )  | |  (  zoomY  <  0.0  )  ) 
							 
						 
					
						
							
								
									
										
										
										
											2005-01-13 03:04:12 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										return  EXPP_ReturnPyObjError (  PyExc_TypeError , 
							 
						 
					
						
							
								
									
										
										
										
											2008-05-25 16:39:57 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
											" invalid zoom factors - they must be > 0.0 "  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if  ( ( zoomX  = =  0.0  )  | |  (  zoomY  = =  0.0  ) )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										/* sometimes python doubles can be converted from small values to a zero float, in this case just dont draw */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										Py_RETURN_NONE ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									
							 
						 
					
						
							
								
									
										
										
										
											2005-01-13 03:04:12 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									/* fetch a C Image pointer from the passed-in Python object */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									py_img  =  (  BPy_Image  *  )  pyObjImage ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									image  =  py_img - > image ; 
							 
						 
					
						
							
								
									
										
										
										
											2006-12-20 17:57:56 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									ibuf  =  BKE_image_get_ibuf (  image ,  NULL  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if (  ! ibuf  )       /* if failed to load the image */ 
							 
						 
					
						
							
								
									
										
										
										
											2005-01-13 03:04:12 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										return  EXPP_ReturnPyObjError (  PyExc_RuntimeError , 
							 
						 
					
						
							
								
									
										
										
										
											2006-12-20 17:57:56 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
																	  " couldn't load image data in Blender "  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									if (  ! ibuf - > rect  )       /* no float yet */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										return  EXPP_ReturnPyObjError (  PyExc_RuntimeError , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
																	  " Image has no byte rect "  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									
							 
						 
					
						
							
								
									
										
											 
										
											
												3D view orbit option: Around Active
	This fixes the active object in place when orbiting the view.
	Choppy 15fps demo can be seen there: http://www.elysiun.com/~theeth/bf/around_active.html
Image Memory Grabage Collection
	This adds memory handling to the image code. An image is tagged each time it is used.
	During a collection cycle (frequency of cycles is user defined), if an image is older
	than a user defined limit, its buffer gets deallocated. This also applies to gl memory buffers.
	Images that are loading in GL memory needs to go through two time outs before being fully deallocated: the first time out deallocated the gl memorry, the second the buffer in ram.
	Notes:
		Image buffer loaded from python gets tagged as permanent upon load. That tag is removed when python stops using the image.
		I might have missed some tagging spots, especially in the rendering pipeline. Someone with more knowledge about this code should check to be careful.
		Tagging is done on every access, for rendering, this will probably be a performance hit. A scheme should be developped to only tag when the rendering is completed.
		Collecting is called in draw_object, most likely not the best place to do it.
		Safe from undo, since using undo deallocates memory anyway (like when loading a blend file with one currently opened)
Userpref DNA changes:
	I've changed a couple of flagging variables from short to int. Some because they needed more space, others to keep SDNA happy.
Info window changes:
	I've grouped a couple of buttons in aligned blocks and changed the color of mutually exclusive options to make them clearer.
	Matt didn't do any changes on that in tuhopuu, so hopefully I'm not stepping on anyone's feet with this.
Also changed double constants into floats with f in a couple of places (mostly space.c) to make compiler happier.
											 
										 
										
											2005-07-06 00:33:41 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									/* Update the time tag of the image */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									tag_image_time ( image ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2005-01-13 03:04:12 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									/* set up a valid clipping rectangle.  if no clip rectangle was
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									 *  given ,  this  results  in  inclusion  of  the  entire  image .   otherwise , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									 *  the  clipping  is  just  checked  against  the  bounds  of  the  image . 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									 *  if  clipW  or  clipH  are  less  than  zero  then  they  include  as  much  of 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									 *  the  image  as  they  can .  */ 
							 
						 
					
						
							
								
									
										
										
										
											2006-12-20 17:57:56 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									clipX  =  EXPP_ClampInt (  clipX ,  0 ,  ibuf - > x  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									clipY  =  EXPP_ClampInt (  clipY ,  0 ,  ibuf - > y  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-05-25 16:39:57 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if (  (  clipW  <  0  )  | |  (  clipX + clipW  >  ibuf - > x  )  ) 
							 
						 
					
						
							
								
									
										
										
										
											2006-12-20 17:57:56 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										clipW  =  ibuf - > x  -  clipX ; 
							 
						 
					
						
							
								
									
										
										
										
											2008-05-25 16:39:57 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if (  (  clipH  <  0  )  | |  (  clipY + clipH  >  ibuf - > y  )  ) 
							 
						 
					
						
							
								
									
										
										
										
											2006-12-20 17:57:56 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										clipH  =  ibuf - > y  -  clipY ; 
							 
						 
					
						
							
								
									
										
										
										
											2005-01-13 03:04:12 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									/* -- we are "Go" to Draw! -- */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									/* set the raster position.
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									 * 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									 *  If  the  raster  position  is  negative ,  then  using  glRasterPos2i ( )  
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									 *  directly  would  cause  it  to  be  clipped .   Instead ,  we  first  establish  
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									 *  a  valid  raster  position  within  the  clipping  rectangle  of  the  
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									 *  window  and  then  use  glBitmap ( )  with  a  NULL  image  pointer  to  offset  
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									 *  it  to  the  true  position  we  require .   To  pick  an  initial  valid  
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									 *  raster  position  within  the  viewport ,  we  query  the  clipping  rectangle 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									 *  and  use  its  lower - left  pixel . 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									 * 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									 *  This  particular  technique  is  documented  in  the  glRasterPos ( )  man 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									 *  page ,  although  I  haven ' t  seen  it  used  elsewhere  in  Blender . 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									 */ 
							 
						 
					
						
							
								
									
										
										
										
											2005-05-25 04:52:52 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									/* update (W): to fix a bug where images wouldn't get drawn if the bottom
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									 *  left  corner  of  the  Scripts  win  were  above  a  given  height  or  to  the  right 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									 *  of  a  given  width ,  the  code  below  is  being  commented  out .   It  should  not 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									 *  be  needed  anyway ,  because  spaces  in  Blender  are  projected  to  lie  inside 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									 *  their  areas ,  see  src / drawscript . c  for  example .   Note :  the 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									 *  glaRasterPosSafe2i  function  in  src / glutil . c  does  use  the  commented  out 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									 *  technique ,  but  with  0 , 0  instead  of  scissorBox .   This  function  can  be 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									 *  a  little  optimized ,  based  on  glaDrawPixelsSafe  in  that  same  fine ,  but 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									 *  we ' re  too  close  to  release  2.37  right  now .  */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									/*
 
							 
						 
					
						
							
								
									
										
										
										
											2005-01-13 03:04:12 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									glGetFloatv (  GL_SCISSOR_BOX ,  scissorBox  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									glRasterPos2i (  scissorBox [ 0 ] ,  scissorBox [ 1 ]  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									glBitmap (  0 ,  0 ,  0.0 ,  0.0 ,  
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										originX - scissorBox [ 0 ] ,  originY - scissorBox [ 1 ] ,  NULL  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2005-05-25 04:52:52 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									*/ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									/* update (cont.): using these two lines instead:
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									 *  ( based  on  glaRasterPosSafe2i ,  but  Ken  Hughes  deserves  credit 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									 *  for  suggesting  this  exact  fix  in  the  bug  tracker )  */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									glRasterPos2i ( 0 ,  0 ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									glBitmap (  0 ,  0 ,  0.0 ,  0.0 ,  originX ,  originY ,  NULL  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2005-01-13 03:04:12 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									/* set the zoom */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									glPixelZoom (  zoomX ,  zoomY  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									/* set the width of the image (ROW_LENGTH), and the offset to the
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									 *  clip  origin  within  the  image  in  x  ( SKIP_PIXELS )  and  
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									 *  y  ( SKIP_ROWS )  */ 
							 
						 
					
						
							
								
									
										
										
										
											2006-12-20 17:57:56 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									glPixelStorei (  GL_UNPACK_ROW_LENGTH ,   ibuf - > x  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2005-01-13 03:04:12 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									glPixelStorei (  GL_UNPACK_SKIP_PIXELS ,  clipX  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									glPixelStorei (  GL_UNPACK_SKIP_ROWS ,    clipY  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									/* draw the image */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									glDrawPixels (  clipW ,  clipH ,  GL_RGBA ,  GL_UNSIGNED_BYTE ,  
							 
						 
					
						
							
								
									
										
										
										
											2006-12-20 17:57:56 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
										ibuf - > rect  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2005-01-13 03:04:12 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									/* restore the defaults for some parameters (we could also use a
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									 *  glPushClientAttrib ( )  and  glPopClientAttrib ( )  pair ) .  */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									glPixelZoom (  1.0 ,  1.0  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									glPixelStorei (  GL_UNPACK_SKIP_ROWS ,    0  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									glPixelStorei (  GL_UNPACK_SKIP_PIXELS ,  0  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									glPixelStorei (  GL_UNPACK_ROW_LENGTH ,   0  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2008-05-25 16:39:57 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									Py_RETURN_NONE ; 
							 
						 
					
						
							
								
									
										
										
										
											2005-01-13 03:04:12 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								}  
						 
					
						
							
								
									
										
										
										
											2004-06-16 01:18:57 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								PyObject  * Draw_Init (  void  )  
						 
					
						
							
								
									
										
										
										
											2003-05-08 03:06:46 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								{  
						 
					
						
							
								
									
										
											 
										
											
												BPython: cleaning some bug tracker entries:
(excuse me for doing all in a single commit, but they are tiny
fixes and it's bpython, that dark corner ...)
#1025 - FileSelector SEGV on dynamic callback Category:
  Can't reproduce with current cvs, I'd say recent changes to fix
another crash related to FileSelector in gui-less scripts solved this
one, too.
#1028 - Reserved button event number:
  Menu choices generate two events, one extra related to the menu
itself, with value=4.  Made bpython ignore this extra event.
#1068 - FileSelector No file extension support:
  As Ton wrote there, Blender itself doesn't support this yet.  But the
requester also wanted Window.File/ImageSelector to accept a pathname.  Done.  Also updated doc.
#959 - Segfault on background rendering:
  This happened in bg mode (blender -b filename -a, for example) when
a script with the line "Blender.Redraw()" was linked to FRAMECHANGED events.  As reported in the bug page, it was because curarea is NULL in bg mode.  Made Redraw() check for this and not call functions that expected curarea in Redraw, like one to swap buffers.
#1072 - Blender.Redraw() Segfault:
  Good catch : ). Scripts called from the scripts win that called
Blender.Redraw() or Blender.Window.Redraw() would crash Blender because of a dirty pointer in Spacescript->script.  Fixed.
											 
										 
										
											2004-04-11 04:41:33 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									PyObject  * submodule ,  * dict ; 
							 
						 
					
						
							
								
									
										
										
										
											2007-07-27 06:14:25 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2007-03-16 11:38:02 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									if (  PyType_Ready (  & Button_Type )  <  0 ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
										Py_RETURN_NONE ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-06-02 20:15:50 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									submodule  =  Py_InitModule3 (  " Blender.Draw " ,  Draw_methods ,  Draw_doc  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-05-08 03:06:46 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									dict  =  PyModule_GetDict (  submodule  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2007-07-27 06:14:25 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2003-05-08 03:06:46 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								# define EXPP_ADDCONST(x) \ 
  
						 
					
						
							
								
									
										
										
										
											2005-11-30 08:18:06 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									EXPP_dict_set_item_str ( dict ,  # x ,  PyInt_FromLong ( x ) ) 
							 
						 
					
						
							
								
									
										
										
										
											2003-05-08 03:06:46 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
											 
										
											
												BPython: cleaning some bug tracker entries:
(excuse me for doing all in a single commit, but they are tiny
fixes and it's bpython, that dark corner ...)
#1025 - FileSelector SEGV on dynamic callback Category:
  Can't reproduce with current cvs, I'd say recent changes to fix
another crash related to FileSelector in gui-less scripts solved this
one, too.
#1028 - Reserved button event number:
  Menu choices generate two events, one extra related to the menu
itself, with value=4.  Made bpython ignore this extra event.
#1068 - FileSelector No file extension support:
  As Ton wrote there, Blender itself doesn't support this yet.  But the
requester also wanted Window.File/ImageSelector to accept a pathname.  Done.  Also updated doc.
#959 - Segfault on background rendering:
  This happened in bg mode (blender -b filename -a, for example) when
a script with the line "Blender.Redraw()" was linked to FRAMECHANGED events.  As reported in the bug page, it was because curarea is NULL in bg mode.  Made Redraw() check for this and not call functions that expected curarea in Redraw, like one to swap buffers.
#1072 - Blender.Redraw() Segfault:
  Good catch : ). Scripts called from the scripts win that called
Blender.Redraw() or Blender.Window.Redraw() would crash Blender because of a dirty pointer in Spacescript->script.  Fixed.
											 
										 
										
											2004-04-11 04:41:33 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									/* So, for example:
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									 *  EXPP_ADDCONST ( LEFTMOUSE )  becomes 
							 
						 
					
						
							
								
									
										
										
										
											2005-11-30 08:18:06 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									 *  EXPP_dict_set_item_str ( dict ,  " LEFTMOUSE " ,  PyInt_FromLong ( LEFTMOUSE ) )  
							 
						 
					
						
							
								
									
										
											 
										
											
												BPython: cleaning some bug tracker entries:
(excuse me for doing all in a single commit, but they are tiny
fixes and it's bpython, that dark corner ...)
#1025 - FileSelector SEGV on dynamic callback Category:
  Can't reproduce with current cvs, I'd say recent changes to fix
another crash related to FileSelector in gui-less scripts solved this
one, too.
#1028 - Reserved button event number:
  Menu choices generate two events, one extra related to the menu
itself, with value=4.  Made bpython ignore this extra event.
#1068 - FileSelector No file extension support:
  As Ton wrote there, Blender itself doesn't support this yet.  But the
requester also wanted Window.File/ImageSelector to accept a pathname.  Done.  Also updated doc.
#959 - Segfault on background rendering:
  This happened in bg mode (blender -b filename -a, for example) when
a script with the line "Blender.Redraw()" was linked to FRAMECHANGED events.  As reported in the bug page, it was because curarea is NULL in bg mode.  Made Redraw() check for this and not call functions that expected curarea in Redraw, like one to swap buffers.
#1072 - Blender.Redraw() Segfault:
  Good catch : ). Scripts called from the scripts win that called
Blender.Redraw() or Blender.Window.Redraw() would crash Blender because of a dirty pointer in Spacescript->script.  Fixed.
											 
										 
										
											2004-04-11 04:41:33 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									 */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									EXPP_ADDCONST (  LEFTMOUSE  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									EXPP_ADDCONST (  MIDDLEMOUSE  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									EXPP_ADDCONST (  RIGHTMOUSE  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									EXPP_ADDCONST (  WHEELUPMOUSE  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									EXPP_ADDCONST (  WHEELDOWNMOUSE  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									EXPP_ADDCONST (  MOUSEX  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									EXPP_ADDCONST (  MOUSEY  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									EXPP_ADDCONST (  TIMER0  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									EXPP_ADDCONST (  TIMER1  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									EXPP_ADDCONST (  TIMER2  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									EXPP_ADDCONST (  TIMER3  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									EXPP_ADDCONST (  KEYBD  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									EXPP_ADDCONST (  RAWKEYBD  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									EXPP_ADDCONST (  REDRAW  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									EXPP_ADDCONST (  INPUTCHANGE  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									EXPP_ADDCONST (  QFULL  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									EXPP_ADDCONST (  WINFREEZE  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									EXPP_ADDCONST (  WINTHAW  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									EXPP_ADDCONST (  WINCLOSE  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									EXPP_ADDCONST (  WINQUIT  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-05-08 03:06:46 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								# ifndef IRISGL 
  
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									EXPP_ADDCONST (  Q_FIRSTTIME  ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-05-08 03:06:46 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								# endif 
  
						 
					
						
							
								
									
										
										
										
											2004-09-25 20:30:40 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
									EXPP_ADDCONST (  AKEY  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									EXPP_ADDCONST (  BKEY  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									EXPP_ADDCONST (  CKEY  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									EXPP_ADDCONST (  DKEY  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									EXPP_ADDCONST (  EKEY  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									EXPP_ADDCONST (  FKEY  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									EXPP_ADDCONST (  GKEY  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									EXPP_ADDCONST (  HKEY  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									EXPP_ADDCONST (  IKEY  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									EXPP_ADDCONST (  JKEY  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									EXPP_ADDCONST (  KKEY  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									EXPP_ADDCONST (  LKEY  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									EXPP_ADDCONST (  MKEY  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									EXPP_ADDCONST (  NKEY  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									EXPP_ADDCONST (  OKEY  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									EXPP_ADDCONST (  PKEY  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									EXPP_ADDCONST (  QKEY  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									EXPP_ADDCONST (  RKEY  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									EXPP_ADDCONST (  SKEY  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									EXPP_ADDCONST (  TKEY  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									EXPP_ADDCONST (  UKEY  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									EXPP_ADDCONST (  VKEY  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									EXPP_ADDCONST (  WKEY  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									EXPP_ADDCONST (  XKEY  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									EXPP_ADDCONST (  YKEY  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									EXPP_ADDCONST (  ZKEY  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									EXPP_ADDCONST (  ZEROKEY  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									EXPP_ADDCONST (  ONEKEY  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									EXPP_ADDCONST (  TWOKEY  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									EXPP_ADDCONST (  THREEKEY  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									EXPP_ADDCONST (  FOURKEY  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									EXPP_ADDCONST (  FIVEKEY  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									EXPP_ADDCONST (  SIXKEY  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									EXPP_ADDCONST (  SEVENKEY  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									EXPP_ADDCONST (  EIGHTKEY  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									EXPP_ADDCONST (  NINEKEY  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									EXPP_ADDCONST (  CAPSLOCKKEY  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									EXPP_ADDCONST (  LEFTCTRLKEY  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									EXPP_ADDCONST (  LEFTALTKEY  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									EXPP_ADDCONST (  RIGHTALTKEY  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									EXPP_ADDCONST (  RIGHTCTRLKEY  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									EXPP_ADDCONST (  RIGHTSHIFTKEY  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									EXPP_ADDCONST (  LEFTSHIFTKEY  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									EXPP_ADDCONST (  ESCKEY  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									EXPP_ADDCONST (  TABKEY  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									EXPP_ADDCONST (  RETKEY  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									EXPP_ADDCONST (  SPACEKEY  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									EXPP_ADDCONST (  LINEFEEDKEY  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									EXPP_ADDCONST (  BACKSPACEKEY  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									EXPP_ADDCONST (  DELKEY  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									EXPP_ADDCONST (  SEMICOLONKEY  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									EXPP_ADDCONST (  PERIODKEY  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									EXPP_ADDCONST (  COMMAKEY  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									EXPP_ADDCONST (  QUOTEKEY  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									EXPP_ADDCONST (  ACCENTGRAVEKEY  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									EXPP_ADDCONST (  MINUSKEY  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									EXPP_ADDCONST (  SLASHKEY  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									EXPP_ADDCONST (  BACKSLASHKEY  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									EXPP_ADDCONST (  EQUALKEY  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									EXPP_ADDCONST (  LEFTBRACKETKEY  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									EXPP_ADDCONST (  RIGHTBRACKETKEY  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									EXPP_ADDCONST (  LEFTARROWKEY  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									EXPP_ADDCONST (  DOWNARROWKEY  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									EXPP_ADDCONST (  RIGHTARROWKEY  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									EXPP_ADDCONST (  UPARROWKEY  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									EXPP_ADDCONST (  PAD2  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									EXPP_ADDCONST (  PAD4  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									EXPP_ADDCONST (  PAD6  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									EXPP_ADDCONST (  PAD8  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									EXPP_ADDCONST (  PAD1  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									EXPP_ADDCONST (  PAD3  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									EXPP_ADDCONST (  PAD5  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									EXPP_ADDCONST (  PAD7  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									EXPP_ADDCONST (  PAD9  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									EXPP_ADDCONST (  PADPERIOD  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									EXPP_ADDCONST (  PADSLASHKEY  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									EXPP_ADDCONST (  PADASTERKEY  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									EXPP_ADDCONST (  PAD0  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									EXPP_ADDCONST (  PADMINUS  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									EXPP_ADDCONST (  PADENTER  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									EXPP_ADDCONST (  PADPLUSKEY  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									EXPP_ADDCONST (  F1KEY  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									EXPP_ADDCONST (  F2KEY  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									EXPP_ADDCONST (  F3KEY  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									EXPP_ADDCONST (  F4KEY  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									EXPP_ADDCONST (  F5KEY  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									EXPP_ADDCONST (  F6KEY  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									EXPP_ADDCONST (  F7KEY  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									EXPP_ADDCONST (  F8KEY  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									EXPP_ADDCONST (  F9KEY  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									EXPP_ADDCONST (  F10KEY  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									EXPP_ADDCONST (  F11KEY  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									EXPP_ADDCONST (  F12KEY  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									EXPP_ADDCONST (  PAUSEKEY  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									EXPP_ADDCONST (  INSERTKEY  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									EXPP_ADDCONST (  HOMEKEY  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									EXPP_ADDCONST (  PAGEUPKEY  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									EXPP_ADDCONST (  PAGEDOWNKEY  ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									EXPP_ADDCONST (  ENDKEY  ) ; 
							 
						 
					
						
							
								
									
										
											 
										
											
												BPython: cleaning some bug tracker entries:
(excuse me for doing all in a single commit, but they are tiny
fixes and it's bpython, that dark corner ...)
#1025 - FileSelector SEGV on dynamic callback Category:
  Can't reproduce with current cvs, I'd say recent changes to fix
another crash related to FileSelector in gui-less scripts solved this
one, too.
#1028 - Reserved button event number:
  Menu choices generate two events, one extra related to the menu
itself, with value=4.  Made bpython ignore this extra event.
#1068 - FileSelector No file extension support:
  As Ton wrote there, Blender itself doesn't support this yet.  But the
requester also wanted Window.File/ImageSelector to accept a pathname.  Done.  Also updated doc.
#959 - Segfault on background rendering:
  This happened in bg mode (blender -b filename -a, for example) when
a script with the line "Blender.Redraw()" was linked to FRAMECHANGED events.  As reported in the bug page, it was because curarea is NULL in bg mode.  Made Redraw() check for this and not call functions that expected curarea in Redraw, like one to swap buffers.
#1072 - Blender.Redraw() Segfault:
  Good catch : ). Scripts called from the scripts win that called
Blender.Redraw() or Blender.Window.Redraw() would crash Blender because of a dirty pointer in Spacescript->script.  Fixed.
											 
										 
										
											2004-04-11 04:41:33 +00:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
									return  submodule ; 
							 
						 
					
						
							
								
									
										
										
										
											2003-05-08 03:06:46 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								}