2009-02-10 15:38:00 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								/**
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								 *  $ Id : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								 * 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								 *  * * * * *  BEGIN  GPL  LICENSE  BLOCK  * * * * * 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								 * 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								 *  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 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								 *  of  the  License ,  or  ( at  your  option )  any  later  version .  
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								 * 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								 *  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 , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								 *  Inc . ,  59  Temple  Place  -  Suite  330 ,  Boston ,  MA   02111 - 1307 ,  USA . 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								 * 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								 *  The  Original  Code  is  Copyright  ( C )  2009  Blender  Foundation . 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								 *  All  rights  reserved . 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								 * 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								 *  
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								 *  Contributor ( s ) :  Blender  Foundation 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								 * 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								 *  * * * * *  END  GPL  LICENSE  BLOCK  * * * * * 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								 */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								# include  <string.h> 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								# include  <stdio.h> 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								# include  <math.h> 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								# include  <float.h> 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-04-15 17:53:12 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								# include  "DNA_ID.h" 
 
							 
						 
					
						
							
								
									
										
										
										
											2009-02-10 15:38:00 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								# include  "DNA_action_types.h" 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								# include  "DNA_armature_types.h" 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								# include  "DNA_curve_types.h" 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								# include  "DNA_camera_types.h" 
 
							 
						 
					
						
							
								
									
										
										
										
											2009-08-29 06:50:32 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								# include  "DNA_gpencil_types.h" 
 
							 
						 
					
						
							
								
									
										
										
										
											2009-02-10 15:38:00 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								# include  "DNA_lamp_types.h" 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								# include  "DNA_lattice_types.h" 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								# include  "DNA_meta_types.h" 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								# include  "DNA_mesh_types.h" 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								# include  "DNA_meshdata_types.h" 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								# include  "DNA_object_types.h" 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								# include  "DNA_space_types.h" 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								# include  "DNA_scene_types.h" 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								# include  "DNA_screen_types.h" 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								# include  "DNA_userdef_types.h" 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								# include  "DNA_view3d_types.h" 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								# include  "DNA_world_types.h" 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								# include  "MEM_guardedalloc.h" 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-11-10 20:43:45 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								# include  "BLI_math.h" 
 
							 
						 
					
						
							
								
									
										
										
										
											2009-02-10 15:38:00 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								# include  "BLI_blenlib.h" 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								# include  "BLI_editVert.h" 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								# include  "BLI_rand.h" 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								# include  "BKE_action.h" 
 
							 
						 
					
						
							
								
									
										
										
										
											2009-03-10 23:38:16 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								# include  "BKE_brush.h" 
 
							 
						 
					
						
							
								
									
										
										
										
											2009-02-10 15:38:00 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								# include  "BKE_context.h" 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								# include  "BKE_curve.h" 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								# include  "BKE_customdata.h" 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								# include  "BKE_depsgraph.h" 
 
							 
						 
					
						
							
								
									
										
										
										
											2009-04-15 17:53:12 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								# include  "BKE_idprop.h" 
 
							 
						 
					
						
							
								
									
										
										
										
											2009-04-20 15:06:46 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								# include  "BKE_mesh.h" 
 
							 
						 
					
						
							
								
									
										
										
										
											2009-02-10 15:38:00 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								# include  "BKE_object.h" 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								# include  "BKE_global.h" 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								# include  "BKE_scene.h" 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								# include  "BKE_screen.h" 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								# include  "BKE_utildefines.h" 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								# include  "BIF_gl.h" 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								# include  "WM_api.h" 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								# include  "WM_types.h" 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								# include  "RNA_access.h" 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								# include  "RNA_define.h" 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								# include  "ED_armature.h" 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								# include  "ED_curve.h" 
 
							 
						 
					
						
							
								
									
										
										
										
											2009-02-21 19:17:31 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								# include  "ED_image.h" 
 
							 
						 
					
						
							
								
									
										
										
										
											2009-08-29 06:50:32 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								# include  "ED_gpencil.h" 
 
							 
						 
					
						
							
								
									
										
										
										
											2009-02-11 12:19:42 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								# include  "ED_keyframing.h" 
 
							 
						 
					
						
							
								
									
										
										
										
											2009-02-10 15:38:00 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								# include  "ED_mesh.h" 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								# include  "ED_object.h" 
 
							 
						 
					
						
							
								
									
										
										
										
											2009-02-21 19:17:31 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								# include  "ED_particle.h" 
 
							 
						 
					
						
							
								
									
										
										
										
											2009-02-10 15:38:00 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								# include  "ED_screen.h" 
 
							 
						 
					
						
							
								
									
										
										
										
											2009-07-08 16:17:47 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								# include  "ED_transform.h" 
 
							 
						 
					
						
							
								
									
										
										
										
											2009-02-10 15:38:00 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								# include  "ED_types.h" 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								# include  "ED_util.h" 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								# include  "UI_interface.h" 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								# include  "UI_resources.h" 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								# include  "UI_view2d.h" 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								# include  "view3d_intern.h"	// own include 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								/* ******************* view3d space & buttons ************** */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								# define B_NOP		1 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								# define B_REDR		2 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								# define B_OBJECTPANELROT 	1007 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								# define B_OBJECTPANELMEDIAN 1008 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								# define B_ARMATUREPANEL1 	1009 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								# define B_ARMATUREPANEL2 	1010 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								# define B_OBJECTPANELPARENT 1011 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								# define B_OBJECTPANEL		1012 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								# define B_ARMATUREPANEL3 	1013 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								# define B_OBJECTPANELSCALE 	1014 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								# define B_OBJECTPANELDIMS 	1015 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								# define B_TRANSFORMSPACEADD	1016 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								# define B_TRANSFORMSPACECLEAR	1017 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								# define B_SETPT_AUTO	2125 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								# define B_SETPT_VECTOR	2126 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								# define B_SETPT_ALIGN	2127 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								# define B_SETPT_FREE	2128 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								# define B_RECALCMBALL	2501 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								# define B_WEIGHT0_0		2840 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								# define B_WEIGHT1_4		2841 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								# define B_WEIGHT1_2		2842 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								# define B_WEIGHT3_4		2843 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								# define B_WEIGHT1_0		2844 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								# define B_OPA1_8		2845 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								# define B_OPA1_4		2846 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								# define B_OPA1_2		2847 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								# define B_OPA3_4		2848 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								# define B_OPA1_0		2849 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								# define B_CLR_WPAINT	2850 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
											
												2.5
Smaller jobs, all in one commit!
- Moved object_do_update out of view3d drawing, into
  the event system (currently after notifiers).
  Depsgraph calls for setting update flags will have to
  keep track of each Screen's needs, so a UI showing only
  a Sequencer doesn't do objects.
- Added button in "Properties region" in 3D window to set
  or disable 4-split, including the 3 options it has.
  (lock, box, clip)
- Restored legacy code for UI, to make things work like
  bone rename, autocomplete. 
- Node editor now shows Curves widgets again
- Bugfix: composite job increased Viewer user id count
- Bugfix: Node editor, not "Enable nodes" still called
  a Job, which didn't do anything
- Various code cleaning, unused vars and prototypes.
											 
										 
										
											2009-02-11 16:54:55 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								# define B_RV3D_LOCKED	2900 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								# define B_RV3D_BOXVIEW	2901 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								# define B_RV3D_BOXCLIP	2902 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-02-10 15:38:00 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								# define B_IDNAME		3000 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								/* temporary struct for storing transform properties */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								typedef  struct  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									float  ob_eul [ 4 ] ; 	// used for quat too....
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									float  ob_scale [ 3 ] ;  // need temp space due to linked values
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									float  ob_dims [ 3 ] ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									short  link_scale ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									float  ve_median [ 5 ] ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									int  curdef ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									float  * defweightp ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								}  TransformProperties ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								/* is used for both read and write... */ 
							 
						 
					
						
							
								
									
										
										
										
											2009-10-09 10:45:11 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								static  void  v3d_editvertex_buts ( const  bContext  * C ,  uiLayout  * layout ,  View3D  * v3d ,  Object  * ob ,  float  lim ) 
							 
						 
					
						
							
								
									
										
										
										
											2009-02-10 15:38:00 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
									
										
										
										
											2009-10-09 10:45:11 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									uiBlock  * block =  ( layout ) ?  uiLayoutAbsoluteBlock ( layout ) :  NULL ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-02-10 15:38:00 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
									MDeformVert  * dvert = NULL ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									TransformProperties  * tfp =  v3d - > properties_storage ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									float  median [ 5 ] ,  ve_median [ 5 ] ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									int  tot ,  totw ,  totweight ,  totedge ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									char  defstr [ 320 ] ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									median [ 0 ] =  median [ 1 ] =  median [ 2 ] =  median [ 3 ] =  median [ 4 ] =  0.0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									tot =  totw =  totweight =  totedge =  0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									defstr [ 0 ] =  0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									if ( ob - > type = = OB_MESH )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										Mesh  * me =  ob - > data ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-04-11 08:26:51 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										EditMesh  * em  =  BKE_mesh_get_editmesh ( me ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-02-10 15:38:00 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
										EditVert  * eve ,  * evedef = NULL ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										EditEdge  * eed ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										eve =  em - > verts . first ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										while ( eve )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											if ( eve - > f  &  SELECT )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												evedef =  eve ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												tot + + ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-11-10 20:43:45 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												add_v3_v3v3 ( median ,  median ,  eve - > co ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-02-10 15:38:00 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
											} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											eve =  eve - > next ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										eed =  em - > edges . first ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										while ( eed )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											if ( ( eed - > f  &  SELECT ) )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												totedge + + ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												median [ 3 ] + =  eed - > crease ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											eed =  eed - > next ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										/* check for defgroups */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										if ( evedef ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											dvert =  CustomData_em_get ( & em - > vdata ,  evedef - > data ,  CD_MDEFORMVERT ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										if ( tot = = 1  & &  dvert  & &  dvert - > totweight )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											bDeformGroup  * dg ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											int  i ,  max = 1 ,  init = 1 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											char  str [ 320 ] ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											for  ( i = 0 ;  i < dvert - > totweight ;  i + + ) { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												dg  =  BLI_findlink  ( & ob - > defbase ,  dvert - > dw [ i ] . def_nr ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												if ( dg )  { 
							 
						 
					
						
							
								
									
										
										
										
											2009-02-10 18:33:32 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
													max + =  BLI_snprintf ( str ,  sizeof ( str ) ,  " %s %%x%d| " ,  dg - > name ,  dvert - > dw [ i ] . def_nr ) ;  
							 
						 
					
						
							
								
									
										
										
										
											2009-02-10 15:38:00 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
													if ( max < 320 )  strcat ( defstr ,  str ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												else  printf ( " oh no! \n " ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												if ( tfp - > curdef = = dvert - > dw [ i ] . def_nr )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													init =  0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													tfp - > defweightp =  & dvert - > dw [ i ] . weight ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											if ( init )  { 	// needs new initialized 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												tfp - > curdef =  dvert - > dw [ 0 ] . def_nr ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												tfp - > defweightp =  & dvert - > dw [ 0 ] . weight ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										} 
							 
						 
					
						
							
								
									
										
										
										
											2009-03-30 07:28:37 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-04-11 08:26:51 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										BKE_mesh_end_editmesh ( me ,  em ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-02-10 15:38:00 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									else  if ( ob - > type = = OB_CURVE  | |  ob - > type = = OB_SURF )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										Curve  * cu =  ob - > data ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										Nurb  * nu ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										BPoint  * bp ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										BezTriple  * bezt ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										int  a ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										nu =  cu - > editnurb - > first ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										while ( nu )  { 
							 
						 
					
						
							
								
									
										
										
										
											2009-09-08 00:23:33 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											if ( nu - > type  = =  CU_BEZIER )  { 
							 
						 
					
						
							
								
									
										
										
										
											2009-02-10 15:38:00 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
												bezt =  nu - > bezt ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												a =  nu - > pntsu ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												while ( a - - )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													if ( bezt - > f2  &  SELECT )  { 
							 
						 
					
						
							
								
									
										
										
										
											2009-11-10 20:43:45 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
														add_v3_v3v3 ( median ,  median ,  bezt - > vec [ 1 ] ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-02-10 15:38:00 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
														tot + + ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
														median [ 4 ] + =  bezt - > weight ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
														totweight + + ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													else  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
														if ( bezt - > f1  &  SELECT )  { 
							 
						 
					
						
							
								
									
										
										
										
											2009-11-10 20:43:45 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
															add_v3_v3v3 ( median ,  median ,  bezt - > vec [ 0 ] ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-02-10 15:38:00 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
															tot + + ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
														} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
														if ( bezt - > f3  &  SELECT )  { 
							 
						 
					
						
							
								
									
										
										
										
											2009-11-10 20:43:45 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
															add_v3_v3v3 ( median ,  median ,  bezt - > vec [ 2 ] ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-02-10 15:38:00 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
															tot + + ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
														} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													bezt + + ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											else  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												bp =  nu - > bp ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												a =  nu - > pntsu * nu - > pntsv ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												while ( a - - )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													if ( bp - > f1  &  SELECT )  { 
							 
						 
					
						
							
								
									
										
										
										
											2009-11-10 20:43:45 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
														add_v3_v3v3 ( median ,  median ,  bp - > vec ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-02-10 15:38:00 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
														median [ 3 ] + =  bp - > vec [ 3 ] ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
														totw + + ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
														tot + + ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
														median [ 4 ] + =  bp - > weight ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
														totweight + + ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													bp + + ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											nu =  nu - > next ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									else  if ( ob - > type = = OB_LATTICE )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										Lattice  * lt =  ob - > data ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										BPoint  * bp ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										int  a ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										a =  lt - > editlatt - > pntsu * lt - > editlatt - > pntsv * lt - > editlatt - > pntsw ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										bp =  lt - > editlatt - > def ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										while ( a - - )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											if ( bp - > f1  &  SELECT )  { 
							 
						 
					
						
							
								
									
										
										
										
											2009-11-10 20:43:45 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												add_v3_v3v3 ( median ,  median ,  bp - > vec ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-02-10 15:38:00 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
												tot + + ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												median [ 4 ] + =  bp - > weight ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												totweight + + ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											bp + + ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									if ( tot = = 0 )  return ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									median [ 0 ]  / =  ( float ) tot ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									median [ 1 ]  / =  ( float ) tot ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									median [ 2 ]  / =  ( float ) tot ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									if ( totedge )  median [ 3 ]  / =  ( float ) totedge ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									else  if ( totw )  median [ 3 ]  / =  ( float ) totw ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									if ( totweight )  median [ 4 ]  / =  ( float ) totweight ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									if ( v3d - > flag  &  V3D_GLOBAL_STATS ) 
							 
						 
					
						
							
								
									
										
										
										
											2009-11-10 20:43:45 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										mul_m4_v3 ( ob - > obmat ,  median ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-02-10 15:38:00 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
									
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									if ( block )  { 	// buttons
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										int  but_y ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										if ( ( ob - > parent )  & &  ( ob - > partype  = =  PARBONE ) ) 	but_y  =  135 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										else 											but_y  =  150 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										
							 
						 
					
						
							
								
									
										
										
										
											2009-09-15 12:45:05 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										
							 
						 
					
						
							
								
									
										
										
										
											2009-02-10 15:38:00 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
										
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										memcpy ( tfp - > ve_median ,  median ,  sizeof ( tfp - > ve_median ) ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										uiBlockBeginAlign ( block ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										if ( tot = = 1 )  { 
							 
						 
					
						
							
								
									
										
										
										
											2009-07-14 12:32:19 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											uiDefBut ( block ,  LABEL ,  0 ,  " Vertex: " , 					0 ,  130 ,  200 ,  20 ,  0 ,  0 ,  0 ,  0 ,  0 ,  " " ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-09-15 12:45:05 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											uiBlockBeginAlign ( block ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-07-14 12:32:19 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											uiDefButF ( block ,  NUM ,  B_OBJECTPANELMEDIAN ,  " X: " , 		0 ,  110 ,  200 ,  20 ,  & ( tfp - > ve_median [ 0 ] ) ,  - lim ,  lim ,  10 ,  3 ,  " " ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											uiDefButF ( block ,  NUM ,  B_OBJECTPANELMEDIAN ,  " Y: " , 		0 ,  90 ,  200 ,  20 ,  & ( tfp - > ve_median [ 1 ] ) ,  - lim ,  lim ,  10 ,  3 ,  " " ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											uiDefButF ( block ,  NUM ,  B_OBJECTPANELMEDIAN ,  " Z: " , 		0 ,  70 ,  200 ,  20 ,  & ( tfp - > ve_median [ 2 ] ) ,  - lim ,  lim ,  10 ,  3 ,  " " ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-09-15 12:45:05 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											if ( totw = = 1 )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												uiDefButF ( block ,  NUM ,  B_OBJECTPANELMEDIAN ,  " W: " , 	0 ,  50 ,  200 ,  20 ,  & ( tfp - > ve_median [ 3 ] ) ,  0.01 ,  100.0 ,  10 ,  3 ,  " " ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-02-10 15:38:00 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
												uiBlockBeginAlign ( block ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-09-15 12:45:05 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												uiDefButBitS ( block ,  TOG ,  V3D_GLOBAL_STATS ,  B_REDR ,  " Global " , 		0 ,  25 ,  100 ,  20 ,  & v3d - > flag ,  0 ,  0 ,  0 ,  0 ,  " Displays global values " ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												uiDefButBitS ( block ,  TOGN ,  V3D_GLOBAL_STATS ,  B_REDR ,  " Local " , 		100 ,  25 ,  100 ,  20 ,  & v3d - > flag ,  0 ,  0 ,  0 ,  0 ,  " Displays local values " ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-02-10 15:38:00 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
												uiBlockEndAlign ( block ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-09-15 12:45:05 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												if ( totweight ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													uiDefButF ( block ,  NUM ,  B_OBJECTPANELMEDIAN ,  " Weight: " , 	0 ,  0 ,  200 ,  20 ,  & ( tfp - > ve_median [ 4 ] ) ,  0.0 ,  1.0 ,  10 ,  3 ,  " " ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											else  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												uiBlockBeginAlign ( block ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												uiDefButBitS ( block ,  TOG ,  V3D_GLOBAL_STATS ,  B_REDR ,  " Global " , 		0 ,  45 ,  100 ,  20 ,  & v3d - > flag ,  0 ,  0 ,  0 ,  0 ,  " Displays global values " ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												uiDefButBitS ( block ,  TOGN ,  V3D_GLOBAL_STATS ,  B_REDR ,  " Local " , 		100 ,  45 ,  100 ,  20 ,  & v3d - > flag ,  0 ,  0 ,  0 ,  0 ,  " Displays local values " ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												uiBlockEndAlign ( block ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												if ( totweight ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													uiDefButF ( block ,  NUM ,  B_OBJECTPANELMEDIAN ,  " Weight: " , 	0 ,  20 ,  200 ,  20 ,  & ( tfp - > ve_median [ 4 ] ) ,  0.0 ,  1.0 ,  10 ,  3 ,  " " ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-02-10 15:38:00 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
											} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										else  { 
							 
						 
					
						
							
								
									
										
										
										
											2009-09-15 12:45:05 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											uiDefBut ( block ,  LABEL ,  0 ,  " Median: " , 					0 ,  130 ,  200 ,  20 ,  0 ,  0 ,  0 ,  0 ,  0 ,  " " ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											uiBlockBeginAlign ( block ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-07-14 12:32:19 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											uiDefButF ( block ,  NUM ,  B_OBJECTPANELMEDIAN ,  " X: " , 		0 ,  110 ,  200 ,  20 ,  & ( tfp - > ve_median [ 0 ] ) ,  - lim ,  lim ,  10 ,  3 ,  " " ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											uiDefButF ( block ,  NUM ,  B_OBJECTPANELMEDIAN ,  " Y: " , 		0 ,  90 ,  200 ,  20 ,  & ( tfp - > ve_median [ 1 ] ) ,  - lim ,  lim ,  10 ,  3 ,  " " ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											uiDefButF ( block ,  NUM ,  B_OBJECTPANELMEDIAN ,  " Z: " , 		0 ,  70 ,  200 ,  20 ,  & ( tfp - > ve_median [ 2 ] ) ,  - lim ,  lim ,  10 ,  3 ,  " " ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-09-15 12:45:05 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											if ( totw = = tot )  { 
							 
						 
					
						
							
								
									
										
										
										
											2009-07-14 12:32:19 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												uiDefButF ( block ,  NUM ,  B_OBJECTPANELMEDIAN ,  " W: " , 	0 ,  50 ,  200 ,  20 ,  & ( tfp - > ve_median [ 3 ] ) ,  0.01 ,  100.0 ,  10 ,  3 ,  " " ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-09-15 12:45:05 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												uiBlockEndAlign ( block ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												uiBlockBeginAlign ( block ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												uiDefButBitS ( block ,  TOG ,  V3D_GLOBAL_STATS ,  B_REDR ,  " Global " , 		0 ,  25 ,  100 ,  20 ,  & v3d - > flag ,  0 ,  0 ,  0 ,  0 ,  " Displays global values " ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												uiDefButBitS ( block ,  TOGN ,  V3D_GLOBAL_STATS ,  B_REDR ,  " Local " , 		100 ,  25 ,  100 ,  20 ,  & v3d - > flag ,  0 ,  0 ,  0 ,  0 ,  " Displays local values " ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												uiBlockEndAlign ( block ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												if ( totweight ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													uiDefButF ( block ,  NUM ,  B_OBJECTPANELMEDIAN ,  " Weight: " , 	0 ,  0 ,  200 ,  20 ,  & ( tfp - > ve_median [ 4 ] ) ,  0.0 ,  1.0 ,  10 ,  3 ,  " Weight is used for SoftBody Goal " ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												uiBlockEndAlign ( block ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											else  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												uiBlockBeginAlign ( block ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												uiDefButBitS ( block ,  TOG ,  V3D_GLOBAL_STATS ,  B_REDR ,  " Global " , 		0 ,  45 ,  100 ,  20 ,  & v3d - > flag ,  0 ,  0 ,  0 ,  0 ,  " Displays global values " ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												uiDefButBitS ( block ,  TOGN ,  V3D_GLOBAL_STATS ,  B_REDR ,  " Local " , 		100 ,  45 ,  100 ,  20 ,  & v3d - > flag ,  0 ,  0 ,  0 ,  0 ,  " Displays local values " ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												uiBlockEndAlign ( block ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												if ( totweight ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													uiDefButF ( block ,  NUM ,  B_OBJECTPANELMEDIAN ,  " Weight: " , 	0 ,  20 ,  200 ,  20 ,  & ( tfp - > ve_median [ 4 ] ) ,  0.0 ,  1.0 ,  10 ,  3 ,  " Weight is used for SoftBody Goal " ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												uiBlockEndAlign ( block ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											} 
							 
						 
					
						
							
								
									
										
										
										
											2009-02-10 15:38:00 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
										} 
							 
						 
					
						
							
								
									
										
										
										
											2009-09-15 12:45:05 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												
							 
						 
					
						
							
								
									
										
										
										
											2009-02-10 15:38:00 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
										if ( totedge = = 1 ) 
							 
						 
					
						
							
								
									
										
										
										
											2009-09-15 12:45:05 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											uiDefButF ( block ,  NUM ,  B_OBJECTPANELMEDIAN ,  " Crease: " , 	0 ,  20 ,  200 ,  20 ,  & ( tfp - > ve_median [ 3 ] ) ,  0.0 ,  1.0 ,  10 ,  3 ,  " " ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-02-10 15:38:00 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
										else  if ( totedge > 1 ) 
							 
						 
					
						
							
								
									
										
										
										
											2009-09-15 12:45:05 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											uiDefButF ( block ,  NUM ,  B_OBJECTPANELMEDIAN ,  " Median Crease: " , 	0 ,  20 ,  200 ,  20 ,  & ( tfp - > ve_median [ 3 ] ) ,  0.0 ,  1.0 ,  10 ,  3 ,  " " ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-02-10 15:38:00 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
										
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									else  { 	// apply
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										memcpy ( ve_median ,  tfp - > ve_median ,  sizeof ( tfp - > ve_median ) ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										if ( v3d - > flag  &  V3D_GLOBAL_STATS )  { 
							 
						 
					
						
							
								
									
										
										
										
											2009-11-10 20:43:45 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											invert_m4_m4 ( ob - > imat ,  ob - > obmat ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											mul_m4_v3 ( ob - > imat ,  median ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											mul_m4_v3 ( ob - > imat ,  ve_median ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-02-10 15:38:00 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
										} 
							 
						 
					
						
							
								
									
										
										
										
											2009-11-10 20:43:45 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										sub_v3_v3v3 ( median ,  ve_median ,  median ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-02-10 15:38:00 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
										median [ 3 ] =  ve_median [ 3 ] - median [ 3 ] ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										median [ 4 ] =  ve_median [ 4 ] - median [ 4 ] ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										if ( ob - > type = = OB_MESH )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											Mesh  * me =  ob - > data ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-04-11 08:26:51 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											EditMesh  * em  =  BKE_mesh_get_editmesh ( me ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-02-10 15:38:00 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
											EditVert  * eve ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											EditEdge  * eed ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											eve =  em - > verts . first ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											while ( eve )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												if ( eve - > f  &  SELECT )  { 
							 
						 
					
						
							
								
									
										
										
										
											2009-11-10 20:43:45 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
													add_v3_v3v3 ( eve - > co ,  eve - > co ,  median ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-02-10 15:38:00 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
												} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												eve =  eve - > next ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											for ( eed =  em - > edges . first ;  eed ;  eed =  eed - > next )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												if ( eed - > f  &  SELECT )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													/* ensure the median can be set to zero or one */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													if ( ve_median [ 3 ] = = 0.0f )  eed - > crease =  0.0f ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													else  if ( ve_median [ 3 ] = = 1.0f )  eed - > crease =  1.0f ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													else  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
														eed - > crease + =  median [ 3 ] ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
														CLAMP ( eed - > crease ,  0.0 ,  1.0 ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											recalc_editnormals ( em ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-03-30 07:28:37 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-04-11 08:26:51 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											BKE_mesh_end_editmesh ( me ,  em ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-02-10 15:38:00 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										else  if ( ob - > type = = OB_CURVE  | |  ob - > type = = OB_SURF )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											Curve  * cu =  ob - > data ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											Nurb  * nu ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											BPoint  * bp ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											BezTriple  * bezt ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											int  a ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											nu =  cu - > editnurb - > first ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											while ( nu )  { 
							 
						 
					
						
							
								
									
										
										
										
											2009-09-08 00:23:33 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												if ( nu - > type  = =  CU_BEZIER )  { 
							 
						 
					
						
							
								
									
										
										
										
											2009-02-10 15:38:00 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
													bezt =  nu - > bezt ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													a =  nu - > pntsu ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													while ( a - - )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
														if ( bezt - > f2  &  SELECT )  { 
							 
						 
					
						
							
								
									
										
										
										
											2009-11-10 20:43:45 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
															add_v3_v3v3 ( bezt - > vec [ 0 ] ,  bezt - > vec [ 0 ] ,  median ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
															add_v3_v3v3 ( bezt - > vec [ 1 ] ,  bezt - > vec [ 1 ] ,  median ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
															add_v3_v3v3 ( bezt - > vec [ 2 ] ,  bezt - > vec [ 2 ] ,  median ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-02-10 15:38:00 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
															bezt - > weight + =  median [ 4 ] ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
														} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
														else  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
															if ( bezt - > f1  &  SELECT )  { 
							 
						 
					
						
							
								
									
										
										
										
											2009-11-10 20:43:45 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
																add_v3_v3v3 ( bezt - > vec [ 0 ] ,  bezt - > vec [ 0 ] ,  median ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-02-10 15:38:00 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
															} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
															if ( bezt - > f3  &  SELECT )  { 
							 
						 
					
						
							
								
									
										
										
										
											2009-11-10 20:43:45 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
																add_v3_v3v3 ( bezt - > vec [ 2 ] ,  bezt - > vec [ 2 ] ,  median ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-02-10 15:38:00 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
															} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
														} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
														bezt + + ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												else  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													bp =  nu - > bp ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													a =  nu - > pntsu * nu - > pntsv ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													while ( a - - )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
														if ( bp - > f1  &  SELECT )  { 
							 
						 
					
						
							
								
									
										
										
										
											2009-11-10 20:43:45 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
															add_v3_v3v3 ( bp - > vec ,  bp - > vec ,  median ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-02-10 15:38:00 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
															bp - > vec [ 3 ] + =  median [ 3 ] ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
															bp - > weight + =  median [ 4 ] ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
														} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
														bp + + ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												test2DNurb ( nu ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												testhandlesNurb ( nu ) ;  /* test for bezier too */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												nu =  nu - > next ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										else  if ( ob - > type = = OB_LATTICE )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											Lattice  * lt =  ob - > data ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											BPoint  * bp ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											int  a ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											a =  lt - > editlatt - > pntsu * lt - > editlatt - > pntsv * lt - > editlatt - > pntsw ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											bp =  lt - > editlatt - > def ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											while ( a - - )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												if ( bp - > f1  &  SELECT )  { 
							 
						 
					
						
							
								
									
										
										
										
											2009-11-10 20:43:45 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
													add_v3_v3v3 ( bp - > vec ,  bp - > vec ,  median ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-02-10 15:38:00 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
													bp - > weight + =  median [ 4 ] ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												bp + + ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								//		ED_undo_push(C, "Transform properties");
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-09-17 14:46:22 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								#if 0 
 
							 
						 
					
						
							
								
									
										
										
										
											2009-02-10 15:38:00 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								/* assumes armature active */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								static  void  validate_bonebutton_cb ( bContext  * C ,  void  * bonev ,  void  * namev ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									Object  * ob =  CTX_data_active_object ( C ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									if ( ob  & &  ob - > type = = OB_ARMATURE )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										Bone  * bone =  bonev ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										char  oldname [ 32 ] ,  newname [ 32 ] ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										/* need to be on the stack */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										BLI_strncpy ( newname ,  bone - > name ,  32 ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										BLI_strncpy ( oldname ,  ( char  * ) namev ,  32 ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										/* restore */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										BLI_strncpy ( bone - > name ,  oldname ,  32 ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										
							 
						 
					
						
							
								
									
										
										
										
											2009-07-14 17:59:26 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										ED_armature_bone_rename ( ob - > data ,  oldname ,  newname ) ;  // editarmature.c
 
							 
						 
					
						
							
								
									
										
										
										
											2009-02-10 15:38:00 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
									
										
										
										
											2009-09-17 14:46:22 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								# endif 
 
							 
						 
					
						
							
								
									
										
										
										
											2009-02-10 15:38:00 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-11-05 01:00:17 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								static  void  v3d_transform_butsR ( uiLayout  * layout ,  PointerRNA  * ptr ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									uiLayout  * split ,  * colsub ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									split  =  uiLayoutSplit ( layout ,  0.8 ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									if  ( ptr - > type  = =  & RNA_PoseChannel )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										PointerRNA  boneptr ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										Bone  * bone ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										boneptr  =  RNA_pointer_get ( ptr ,  " bone " ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										bone  =  boneptr . data ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										uiLayoutSetActive ( split ,  ! ( bone - > parent  & &  bone - > flag  &  BONE_CONNECTED ) ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									colsub  =  uiLayoutColumn ( split ,  1 ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									uiItemR ( colsub ,  " Location " ,  0 ,  ptr ,  " location " ,  0 ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									colsub  =  uiLayoutColumn ( split ,  1 ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									uiItemL ( colsub ,  " " ,  0 ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									uiItemR ( colsub ,  " " ,  ICON_LOCKED ,  ptr ,  " lock_location " ,  UI_ITEM_R_TOGGLE + UI_ITEM_R_ICON_ONLY ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									split  =  uiLayoutSplit ( layout ,  0.8 ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									switch ( RNA_enum_get ( ptr ,  " rotation_mode " ) )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										case  ROT_MODE_XYZ : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										case  ROT_MODE_XZY : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										case  ROT_MODE_YXZ : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										case  ROT_MODE_YZX : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										case  ROT_MODE_ZXY : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										case  ROT_MODE_ZYX : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											colsub  =  uiLayoutColumn ( split ,  1 ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											uiItemR ( colsub ,  " Rotation " ,  0 ,  ptr ,  " rotation_euler " ,  0 ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											colsub  =  uiLayoutColumn ( split ,  1 ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											uiItemL ( colsub ,  " " ,  0 ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											uiItemR ( colsub ,  " " ,  ICON_LOCKED ,  ptr ,  " lock_rotation " ,  UI_ITEM_R_TOGGLE + UI_ITEM_R_ICON_ONLY ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										case  ROT_MODE_QUAT : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											colsub  =  uiLayoutColumn ( split ,  1 ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											uiItemR ( colsub ,  " Rotation " ,  0 ,  ptr ,  " rotation_quaternion " ,  0 ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											colsub  =  uiLayoutColumn ( split ,  1 ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											uiItemR ( colsub ,  " W " ,  0 ,  ptr ,  " lock_rotations_4d " ,  UI_ITEM_R_TOGGLE ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											if  ( RNA_boolean_get ( ptr ,  " lock_rotations_4d " ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												uiItemR ( colsub ,  " " ,  ICON_LOCKED ,  ptr ,  " lock_rotation_w " ,  UI_ITEM_R_TOGGLE + UI_ITEM_R_ICON_ONLY ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											else 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												uiItemL ( colsub ,  " " ,  0 ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											uiItemR ( colsub ,  " " ,  ICON_LOCKED ,  ptr ,  " lock_rotation " ,  UI_ITEM_R_TOGGLE + UI_ITEM_R_ICON_ONLY ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										case  ROT_MODE_AXISANGLE : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											colsub  =  uiLayoutColumn ( split ,  1 ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											uiItemR ( colsub ,  " Rotation " ,  0 ,  ptr ,  " rotation_axis_angle " ,  0 ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											colsub  =  uiLayoutColumn ( split ,  1 ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											uiItemR ( colsub ,  " W " ,  0 ,  ptr ,  " lock_rotations_4d " ,  UI_ITEM_R_TOGGLE ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											if  ( RNA_boolean_get ( ptr ,  " lock_rotations_4d " ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												uiItemR ( colsub ,  " " ,  ICON_LOCKED ,  ptr ,  " lock_rotation_w " ,  UI_ITEM_R_TOGGLE + UI_ITEM_R_ICON_ONLY ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											else 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												uiItemL ( colsub ,  " " ,  0 ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											uiItemR ( colsub ,  " " ,  ICON_LOCKED ,  ptr ,  " lock_rotation " ,  UI_ITEM_R_TOGGLE + UI_ITEM_R_ICON_ONLY ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									uiItemR ( layout ,  " " ,  0 ,  ptr ,  " rotation_mode " ,  0 ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									split  =  uiLayoutSplit ( layout ,  0.8 ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									colsub  =  uiLayoutColumn ( split ,  1 ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									uiItemR ( colsub ,  " Scale " ,  0 ,  ptr ,  " scale " ,  0 ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									colsub  =  uiLayoutColumn ( split ,  1 ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									uiItemL ( colsub ,  " " ,  0 ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									uiItemR ( colsub ,  " " ,  ICON_LOCKED ,  ptr ,  " lock_scale " ,  UI_ITEM_R_TOGGLE + UI_ITEM_R_ICON_ONLY ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									if  ( ptr - > type  = =  & RNA_Object )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										Object  * ob  =  ptr - > data ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										if  ( ELEM5 ( ob - > type ,  OB_MESH ,  OB_CURVE ,  OB_SURF ,  OB_FONT ,  OB_MBALL ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											uiItemR ( layout ,  " Dimensions " ,  0 ,  ptr ,  " dimensions " ,  0 ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-10-09 10:45:11 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								static  void  v3d_posearmature_buts ( uiLayout  * layout ,  View3D  * v3d ,  Object  * ob ,  float  lim ) 
							 
						 
					
						
							
								
									
										
										
										
											2009-02-10 15:38:00 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
									
										
										
										
											2009-11-06 22:51:08 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								//	uiBlock *block= uiLayoutGetBlock(layout);
 
							 
						 
					
						
							
								
									
										
										
										
											2009-11-09 21:03:54 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								//	bArmature *arm;
 
							 
						 
					
						
							
								
									
										
										
										
											2009-02-10 15:38:00 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
									bPoseChannel  * pchan ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-11-06 22:51:08 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								//	TransformProperties *tfp= v3d->properties_storage;
 
							 
						 
					
						
							
								
									
										
										
										
											2009-10-09 10:45:11 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									PointerRNA  pchanptr ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-11-06 22:51:08 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									uiLayout  * col ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								//	uiLayout *row;
 
							 
						 
					
						
							
								
									
										
										
										
											2009-02-10 15:38:00 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-11-09 21:03:54 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									pchan =  get_active_posechannel ( ob ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-02-10 15:38:00 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-11-05 17:22:11 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								//	row= uiLayoutRow(layout, 0);
 
							 
						 
					
						
							
								
									
										
										
										
											2009-11-05 01:00:17 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									
							 
						 
					
						
							
								
									
										
										
										
											2009-11-06 21:41:07 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									if  ( ! pchan ) 	{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										uiItemL ( layout ,  " No Bone Active " ,  0 ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										return ;  
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-11-05 01:00:17 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									RNA_pointer_create ( & ob - > id ,  & RNA_PoseChannel ,  pchan ,  & pchanptr ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									col =  uiLayoutColumn ( layout ,  0 ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-09-11 12:44:09 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									
							 
						 
					
						
							
								
									
										
										
										
											2009-11-05 01:00:17 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									/* XXX: RNA buts show data in native types (i.e. quats, 4-component axis/angle, etc.)
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									 *  but  oldskool  UI  shows  in  eulers  always .  Do  we  want  to  be  able  to  still  display  in  Eulers ? 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									 *  Maybe  needs  RNA / ui  options  to  display  rotations  as  different  types . . .  */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									v3d_transform_butsR ( col ,  & pchanptr ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								#if 0 
 
							 
						 
					
						
							
								
									
										
										
										
											2009-10-09 10:45:11 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									uiLayoutAbsoluteBlock ( layout ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-09-28 10:19:20 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									if  ( pchan - > rotmode  = =  ROT_MODE_AXISANGLE )  { 
							 
						 
					
						
							
								
									
										
										
										
											2009-09-11 12:44:09 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										float  quat [ 4 ] ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										/* convert to euler, passing through quats... */ 
							 
						 
					
						
							
								
									
										
										
										
											2009-11-10 20:43:45 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										axis_angle_to_quat ( quat ,  pchan - > rotAxis ,  pchan - > rotAngle ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										quat_to_eul (  tfp - > ob_eul , quat ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-09-11 12:44:09 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2009-09-28 10:19:20 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									else  if  ( pchan - > rotmode  = =  ROT_MODE_QUAT ) 
							 
						 
					
						
							
								
									
										
										
										
											2009-11-10 20:43:45 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										quat_to_eul (  tfp - > ob_eul , pchan - > quat ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-09-11 12:44:09 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									else 
							 
						 
					
						
							
								
									
										
										
										
											2009-11-10 20:43:45 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										copy_v3_v3 ( tfp - > ob_eul ,  pchan - > eul ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-02-10 15:38:00 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
									tfp - > ob_eul [ 0 ] * =  180.0 / M_PI ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									tfp - > ob_eul [ 1 ] * =  180.0 / M_PI ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									tfp - > ob_eul [ 2 ] * =  180.0 / M_PI ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									
							 
						 
					
						
							
								
									
										
										
										
											2009-09-15 12:45:05 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									uiDefBut ( block ,  LABEL ,  0 ,  " Location: " , 			0 ,  240 ,  100 ,  20 ,  0 ,  0 ,  0 ,  0 ,  0 ,  " " ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-02-10 15:38:00 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
									uiBlockBeginAlign ( block ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-09-15 12:45:05 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									uiDefButF ( block ,  NUM ,  B_ARMATUREPANEL2 ,  " X: " , 	0 ,  220 ,  120 ,  19 ,  pchan - > loc ,  - lim ,  lim ,  100 ,  3 ,  " " ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									uiDefButF ( block ,  NUM ,  B_ARMATUREPANEL2 ,  " Y: " , 	0 ,  200 ,  120 ,  19 ,  pchan - > loc + 1 ,  - lim ,  lim ,  100 ,  3 ,  " " ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									uiDefButF ( block ,  NUM ,  B_ARMATUREPANEL2 ,  " Z: " , 	0 ,  180 ,  120 ,  19 ,  pchan - > loc + 2 ,  - lim ,  lim ,  100 ,  3 ,  " " ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									uiBlockEndAlign ( block ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									
							 
						 
					
						
							
								
									
										
										
										
											2009-02-10 15:38:00 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
									uiBlockBeginAlign ( block ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-09-15 12:45:05 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									uiDefIconButBitS ( block ,  ICONTOG ,  OB_LOCK_LOCX ,  B_REDR ,  ICON_UNLOCKED , 	125 ,  220 ,  25 ,  19 ,  & ( pchan - > protectflag ) ,  0 ,  0 ,  0 ,  0 ,  " Protects X Location value from being Transformed " ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									uiDefIconButBitS ( block ,  ICONTOG ,  OB_LOCK_LOCY ,  B_REDR ,  ICON_UNLOCKED , 	125 ,  200 ,  25 ,  19 ,  & ( pchan - > protectflag ) ,  0 ,  0 ,  0 ,  0 ,  " Protects Y Location value from being Transformed " ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									uiDefIconButBitS ( block ,  ICONTOG ,  OB_LOCK_LOCZ ,  B_REDR ,  ICON_UNLOCKED , 	125 ,  180 ,  25 ,  19 ,  & ( pchan - > protectflag ) ,  0 ,  0 ,  0 ,  0 ,  " Protects Z Location value from being Transformed " ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									uiBlockEndAlign ( block ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									uiDefBut ( block ,  LABEL ,  0 ,  " Rotation: " , 			0 ,  160 ,  100 ,  20 ,  0 ,  0 ,  0 ,  0 ,  0 ,  " " ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									uiBlockBeginAlign ( block ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									uiDefButF ( block ,  NUM ,  B_ARMATUREPANEL3 ,  " X: " , 	0 ,  140 ,  120 ,  19 ,  tfp - > ob_eul ,  - 1000.0 ,  1000.0 ,  100 ,  3 ,  " " ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									uiDefButF ( block ,  NUM ,  B_ARMATUREPANEL3 ,  " Y: " , 	0 ,  120 ,  120 ,  19 ,  tfp - > ob_eul + 1 ,  - 1000.0 ,  1000.0 ,  100 ,  3 ,  " " ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									uiDefButF ( block ,  NUM ,  B_ARMATUREPANEL3 ,  " Z: " , 	0 ,  100 ,  120 ,  19 ,  tfp - > ob_eul + 2 ,  - 1000.0 ,  1000.0 ,  100 ,  3 ,  " " ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									uiBlockEndAlign ( block ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-02-10 15:38:00 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
									
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									uiBlockBeginAlign ( block ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-09-15 12:45:05 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									uiDefIconButBitS ( block ,  ICONTOG ,  OB_LOCK_ROTX ,  B_REDR ,  ICON_UNLOCKED , 	125 ,  140 ,  25 ,  19 ,  & ( pchan - > protectflag ) ,  0 ,  0 ,  0 ,  0 ,  " Protects X Rotation value from being Transformed " ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									uiDefIconButBitS ( block ,  ICONTOG ,  OB_LOCK_ROTY ,  B_REDR ,  ICON_UNLOCKED , 	125 ,  120 ,  25 ,  19 ,  & ( pchan - > protectflag ) ,  0 ,  0 ,  0 ,  0 ,  " Protects Y Rotation value from being Transformed " ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									uiDefIconButBitS ( block ,  ICONTOG ,  OB_LOCK_ROTZ ,  B_REDR ,  ICON_UNLOCKED , 	125 ,  100 ,  25 ,  19 ,  & ( pchan - > protectflag ) ,  0 ,  0 ,  0 ,  0 ,  " Protects Z Rotation value from being Transformed " ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									uiBlockEndAlign ( block ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									uiDefBut ( block ,  LABEL ,  0 ,  " Scale: " , 				0 ,  80 ,  100 ,  20 ,  0 ,  0 ,  0 ,  0 ,  0 ,  " " ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									uiBlockBeginAlign ( block ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									uiDefButF ( block ,  NUM ,  B_ARMATUREPANEL2 ,  " X: " , 	0 ,  60 ,  120 ,  19 ,  pchan - > size ,  - lim ,  lim ,  10 ,  3 ,  " " ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									uiDefButF ( block ,  NUM ,  B_ARMATUREPANEL2 ,  " Y: " , 	0 ,  40 ,  120 ,  19 ,  pchan - > size + 1 ,  - lim ,  lim ,  10 ,  3 ,  " " ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									uiDefButF ( block ,  NUM ,  B_ARMATUREPANEL2 ,  " Z: " , 	0 ,  20 ,  120 ,  19 ,  pchan - > size + 2 ,  - lim ,  lim ,  10 ,  3 ,  " " ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									uiBlockEndAlign ( block ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									uiBlockBeginAlign ( block ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									uiDefIconButBitS ( block ,  ICONTOG ,  OB_LOCK_SCALEX ,  B_REDR ,  ICON_UNLOCKED , 	125 ,  60 ,  25 ,  19 ,  & ( pchan - > protectflag ) ,  0 ,  0 ,  0 ,  0 ,  " Protects X Scale value from being Transformed " ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									uiDefIconButBitS ( block ,  ICONTOG ,  OB_LOCK_SCALEY ,  B_REDR ,  ICON_UNLOCKED , 	125 ,  40 ,  25 ,  19 ,  & ( pchan - > protectflag ) ,  0 ,  0 ,  0 ,  0 ,  " Protects Y Scale value from being Transformed " ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									uiDefIconButBitS ( block ,  ICONTOG ,  OB_LOCK_SCALEZ ,  B_REDR ,  ICON_UNLOCKED , 	125 ,  20 ,  25 ,  19 ,  & ( pchan - > protectflag ) ,  0 ,  0 ,  0 ,  0 ,  " Protects z Scale value from being Transformed " ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-02-10 15:38:00 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
									uiBlockEndAlign ( block ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-11-05 01:00:17 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								# endif 
 
							 
						 
					
						
							
								
									
										
										
										
											2009-02-10 15:38:00 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
											
												2.5
Smaller jobs, all in one commit!
- Moved object_do_update out of view3d drawing, into
  the event system (currently after notifiers).
  Depsgraph calls for setting update flags will have to
  keep track of each Screen's needs, so a UI showing only
  a Sequencer doesn't do objects.
- Added button in "Properties region" in 3D window to set
  or disable 4-split, including the 3 options it has.
  (lock, box, clip)
- Restored legacy code for UI, to make things work like
  bone rename, autocomplete. 
- Node editor now shows Curves widgets again
- Bugfix: composite job increased Viewer user id count
- Bugfix: Node editor, not "Enable nodes" still called
  a Job, which didn't do anything
- Various code cleaning, unused vars and prototypes.
											 
										 
										
											2009-02-11 16:54:55 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								/* assumes armature editmode */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								void  validate_editbonebutton_cb ( bContext  * C ,  void  * bonev ,  void  * namev ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									EditBone  * eBone =  bonev ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									char  oldname [ 32 ] ,  newname [ 32 ] ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									/* need to be on the stack */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									BLI_strncpy ( newname ,  eBone - > name ,  32 ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									BLI_strncpy ( oldname ,  ( char  * ) namev ,  32 ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									/* restore */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									BLI_strncpy ( eBone - > name ,  oldname ,  32 ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									
							 
						 
					
						
							
								
									
										
										
										
											2009-07-14 17:59:26 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									ED_armature_bone_rename ( CTX_data_edit_object ( C ) - > data ,  oldname ,  newname ) ;  // editarmature.c
 
							 
						 
					
						
							
								
									
										
										
											
												2.5
Smaller jobs, all in one commit!
- Moved object_do_update out of view3d drawing, into
  the event system (currently after notifiers).
  Depsgraph calls for setting update flags will have to
  keep track of each Screen's needs, so a UI showing only
  a Sequencer doesn't do objects.
- Added button in "Properties region" in 3D window to set
  or disable 4-split, including the 3 options it has.
  (lock, box, clip)
- Restored legacy code for UI, to make things work like
  bone rename, autocomplete. 
- Node editor now shows Curves widgets again
- Bugfix: composite job increased Viewer user id count
- Bugfix: Node editor, not "Enable nodes" still called
  a Job, which didn't do anything
- Various code cleaning, unused vars and prototypes.
											 
										 
										
											2009-02-11 16:54:55 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									WM_event_add_notifier ( C ,  NC_OBJECT | ND_BONE_SELECT ,  CTX_data_edit_object ( C ) ) ;  // XXX fix
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-10-09 10:45:11 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								static  void  v3d_editarmature_buts ( uiLayout  * layout ,  View3D  * v3d ,  Object  * ob ,  float  lim ) 
							 
						 
					
						
							
								
									
										
										
										
											2009-02-10 15:38:00 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
									
										
										
										
											2009-11-06 22:51:08 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								//	uiBlock *block= uiLayoutGetBlock(layout);
 
							 
						 
					
						
							
								
									
										
										
										
											2009-02-10 15:38:00 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
									bArmature  * arm =  ob - > data ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									EditBone  * ebone ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-11-06 22:51:08 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								//	TransformProperties *tfp= v3d->properties_storage;
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								//	uiLayout *row;
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									uiLayout  * col ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-10-09 10:45:11 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									PointerRNA  eboneptr ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-02-10 15:38:00 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
									
							 
						 
					
						
							
								
									
										
										
										
											2009-11-09 21:03:54 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									ebone =  arm - > act_edbone ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-02-10 15:38:00 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-11-09 21:03:54 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									if  ( ! ebone  | |  ( ebone - > layer  &  arm - > layer ) = = 0 ) 
							 
						 
					
						
							
								
									
										
										
										
											2009-02-10 15:38:00 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
										return ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									
							 
						 
					
						
							
								
									
										
										
										
											2009-11-05 17:22:11 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								//	row= uiLayoutRow(layout, 0);
 
							 
						 
					
						
							
								
									
										
										
										
											2009-10-09 10:45:11 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									RNA_pointer_create ( & arm - > id ,  & RNA_EditBone ,  ebone ,  & eboneptr ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-11-05 17:22:11 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-10-09 10:45:11 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-11-05 02:21:04 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									col =  uiLayoutColumn ( layout ,  0 ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									uiItemR ( col ,  " Head " ,  0 ,  & eboneptr ,  " head " ,  0 ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									if  ( ebone - > parent  & &  ebone - > flag  &  BONE_CONNECTED  )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										PointerRNA  parptr  =  RNA_pointer_get ( & eboneptr ,  " parent " ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										uiItemR ( col ,  " Radius " ,  0 ,  & parptr ,  " tail_radius " ,  0 ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									}  else  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										uiItemR ( col ,  " Radius " ,  0 ,  & eboneptr ,  " head_radius " ,  0 ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2009-09-15 12:45:05 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									
							 
						 
					
						
							
								
									
										
										
										
											2009-11-05 02:21:04 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									uiItemR ( col ,  " Tail " ,  0 ,  & eboneptr ,  " tail " ,  0 ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									uiItemR ( col ,  " Radius " ,  0 ,  & eboneptr ,  " tail_radius " ,  0 ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-09-15 12:45:05 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									
							 
						 
					
						
							
								
									
										
										
										
											2009-11-05 02:21:04 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									uiItemR ( col ,  " Roll " ,  0 ,  & eboneptr ,  " roll " ,  0 ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-02-10 15:38:00 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-10-09 10:45:11 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								static  void  v3d_editmetaball_buts ( uiLayout  * layout ,  Object  * ob ,  float  lim ) 
							 
						 
					
						
							
								
									
										
										
										
											2009-02-10 15:38:00 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
									
										
										
										
											2009-11-05 02:21:04 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									PointerRNA  mbptr ,  ptr ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									MetaBall  * mball =  ob - > data ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-11-06 22:51:08 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								//	uiLayout *row;
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									uiLayout  * col ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-11-05 02:21:04 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									if  ( ! mball  | |  ! ( mball - > lastelem ) )  return ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									RNA_pointer_create ( & mball - > id ,  & RNA_MetaBall ,  mball ,  & mbptr ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									
							 
						 
					
						
							
								
									
										
										
										
											2009-11-05 17:22:11 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								//	row= uiLayoutRow(layout, 0);
 
							 
						 
					
						
							
								
									
										
										
										
											2009-02-10 15:38:00 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-11-05 02:21:04 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									RNA_pointer_create ( & mball - > id ,  & RNA_MetaElement ,  mball - > lastelem ,  & ptr ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									col =  uiLayoutColumn ( layout ,  0 ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									uiItemR ( col ,  " Location " ,  0 ,  & ptr ,  " location " ,  0 ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									uiItemR ( col ,  " Radius " ,  0 ,  & ptr ,  " radius " ,  0 ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									uiItemR ( col ,  " Stiffness " ,  0 ,  & ptr ,  " stiffness " ,  0 ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									uiItemR ( col ,  " Type " ,  0 ,  & ptr ,  " type " ,  0 ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									col =  uiLayoutColumn ( layout ,  1 ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									switch  ( RNA_enum_get ( & ptr ,  " type " ) )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										case  MB_BALL : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										case  MB_CUBE : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											uiItemL ( col ,  " Size: " ,  0 ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											uiItemR ( col ,  " X " ,  0 ,  & ptr ,  " size_x " ,  0 ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											uiItemR ( col ,  " Y " ,  0 ,  & ptr ,  " size_y " ,  0 ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											uiItemR ( col ,  " Z " ,  0 ,  & ptr ,  " size_z " ,  0 ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										case  MB_TUBE : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											uiItemL ( col ,  " Size: " ,  0 ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											uiItemR ( col ,  " X " ,  0 ,  & ptr ,  " size_x " ,  0 ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										case  MB_PLANE : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											uiItemL ( col ,  " Size: " ,  0 ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											uiItemR ( col ,  " X " ,  0 ,  & ptr ,  " size_x " ,  0 ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											uiItemR ( col ,  " Y " ,  0 ,  & ptr ,  " size_y " ,  0 ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										case  MB_ELIPSOID : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											uiItemL ( col ,  " Size: " ,  0 ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											uiItemR ( col ,  " X " ,  0 ,  & ptr ,  " size_x " ,  0 ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											uiItemR ( col ,  " Y " ,  0 ,  & ptr ,  " size_y " ,  0 ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											uiItemR ( col ,  " Z " ,  0 ,  & ptr ,  " size_z " ,  0 ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											break ; 		   
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 	
							 
						 
					
						
							
								
									
										
										
										
											2009-02-10 15:38:00 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								/* test if 'ob' is a parent somewhere in par's parents */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								static  int  test_parent_loop ( Object  * par ,  Object  * ob ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									if ( par  = =  NULL )  return  0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									if ( ob  = =  par )  return  1 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									return  test_parent_loop ( par - > parent ,  ob ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								static  void  do_view3d_region_buttons ( bContext  * C ,  void  * arg ,  int  event ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									Scene  * scene =  CTX_data_scene ( C ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-11-06 22:51:08 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								//	Object *obedit= CTX_data_edit_object(C);
 
							 
						 
					
						
							
								
									
										
										
										
											2009-02-10 15:38:00 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
									View3D  * v3d =  CTX_wm_view3d ( C ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-11-06 22:51:08 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								//	BoundBox *bb;
 
							 
						 
					
						
							
								
									
										
										
										
											2009-02-10 15:38:00 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
									Object  * ob =  OBACT ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									TransformProperties  * tfp =  v3d - > properties_storage ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									switch ( event )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									case  B_REDR : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										ED_area_tag_redraw ( CTX_wm_area ( C ) ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										return ;  /* no notifier! */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									case  B_OBJECTPANEL : 
							 
						 
					
						
							
								
									
										
											 
										 
										
											
												2.5
Notifiers
---------
Various fixes for wrong use of notifiers, and some new notifiers
to make things a bit more clear and consistent, with two notable
changes:
* Geometry changes are now done with NC_GEOM, rather than
  NC_OBJECT|ND_GEOM_, so an object does need to be available.
* Space data now use NC_SPACE|ND_SPACE_*, instead of data
  notifiers or even NC_WINDOW in some cases. Note that NC_SPACE
  should only be used for notifying about changes in space data,
  we don't want to go back to allqueue(REDRAW..).
Depsgraph
---------
The dependency graph now has a different flush call:
DAG_object_flush_update(scene, ob, flag)
is replaced by:
DAG_id_flush_update(id, flag)
It still works basically the same, one difference is that it now
also accepts object data (e.g. Mesh), again to avoid requiring an
Object to be available. Other ID types will simply do nothing at
the moment.
Docs
----
I made some guidelines for how/when to do which kinds of updates
and notifiers. I can't specify totally exact how to make these
decisions, but these are basically the guidelines I use. So, new
and updated docs are here:
http://wiki.blender.org/index.php/BlenderDev/Blender2.5/NotifiersUpdates
http://wiki.blender.org/index.php/BlenderDev/Blender2.5/DataNotifiers
											 
										 
										
											2009-09-04 20:51:09 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										DAG_id_flush_update ( & ob - > id ,  OB_RECALC_OB ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-02-10 15:38:00 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
										break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									case  B_OBJECTPANELMEDIAN : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										if ( ob )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											v3d_editvertex_buts ( C ,  NULL ,  v3d ,  ob ,  1.0 ) ; 
							 
						 
					
						
							
								
									
										
											 
										 
										
											
												2.5
Notifiers
---------
Various fixes for wrong use of notifiers, and some new notifiers
to make things a bit more clear and consistent, with two notable
changes:
* Geometry changes are now done with NC_GEOM, rather than
  NC_OBJECT|ND_GEOM_, so an object does need to be available.
* Space data now use NC_SPACE|ND_SPACE_*, instead of data
  notifiers or even NC_WINDOW in some cases. Note that NC_SPACE
  should only be used for notifying about changes in space data,
  we don't want to go back to allqueue(REDRAW..).
Depsgraph
---------
The dependency graph now has a different flush call:
DAG_object_flush_update(scene, ob, flag)
is replaced by:
DAG_id_flush_update(id, flag)
It still works basically the same, one difference is that it now
also accepts object data (e.g. Mesh), again to avoid requiring an
Object to be available. Other ID types will simply do nothing at
the moment.
Docs
----
I made some guidelines for how/when to do which kinds of updates
and notifiers. I can't specify totally exact how to make these
decisions, but these are basically the guidelines I use. So, new
and updated docs are here:
http://wiki.blender.org/index.php/BlenderDev/Blender2.5/NotifiersUpdates
http://wiki.blender.org/index.php/BlenderDev/Blender2.5/DataNotifiers
											 
										 
										
											2009-09-04 20:51:09 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											DAG_id_flush_update ( & ob - > id ,  OB_RECALC_DATA ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-02-10 15:38:00 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										/* note; this case also used for parbone */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									case  B_OBJECTPANELPARENT : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										if ( ob )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											if ( ob - > id . lib  | |  test_parent_loop ( ob - > parent ,  ob )  )  
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												ob - > parent =  NULL ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											else  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												DAG_scene_sort ( scene ) ; 
							 
						 
					
						
							
								
									
										
											 
										 
										
											
												2.5
Notifiers
---------
Various fixes for wrong use of notifiers, and some new notifiers
to make things a bit more clear and consistent, with two notable
changes:
* Geometry changes are now done with NC_GEOM, rather than
  NC_OBJECT|ND_GEOM_, so an object does need to be available.
* Space data now use NC_SPACE|ND_SPACE_*, instead of data
  notifiers or even NC_WINDOW in some cases. Note that NC_SPACE
  should only be used for notifying about changes in space data,
  we don't want to go back to allqueue(REDRAW..).
Depsgraph
---------
The dependency graph now has a different flush call:
DAG_object_flush_update(scene, ob, flag)
is replaced by:
DAG_id_flush_update(id, flag)
It still works basically the same, one difference is that it now
also accepts object data (e.g. Mesh), again to avoid requiring an
Object to be available. Other ID types will simply do nothing at
the moment.
Docs
----
I made some guidelines for how/when to do which kinds of updates
and notifiers. I can't specify totally exact how to make these
decisions, but these are basically the guidelines I use. So, new
and updated docs are here:
http://wiki.blender.org/index.php/BlenderDev/Blender2.5/NotifiersUpdates
http://wiki.blender.org/index.php/BlenderDev/Blender2.5/DataNotifiers
											 
										 
										
											2009-09-04 20:51:09 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												DAG_id_flush_update ( & ob - > id ,  OB_RECALC_OB ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-02-10 15:38:00 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
											} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										
							 
						 
					
						
							
								
									
										
										
										
											2009-11-05 02:21:04 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-02-10 15:38:00 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
									case  B_ARMATUREPANEL3 :   // rotate button on channel
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											bPoseChannel  * pchan ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											float  eul [ 3 ] ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											
							 
						 
					
						
							
								
									
										
										
										
											2009-11-09 21:03:54 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											pchan =  get_active_posechannel ( ob ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-02-10 15:38:00 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
											if  ( ! pchan )  return ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											/* make a copy to eul[3], to allow TAB on buttons to work */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											eul [ 0 ] =  M_PI * tfp - > ob_eul [ 0 ] / 180.0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											eul [ 1 ] =  M_PI * tfp - > ob_eul [ 1 ] / 180.0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											eul [ 2 ] =  M_PI * tfp - > ob_eul [ 2 ] / 180.0 ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-09-11 12:44:09 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											
							 
						 
					
						
							
								
									
										
										
										
											2009-09-28 10:19:20 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											if  ( pchan - > rotmode  = =  ROT_MODE_AXISANGLE )  { 
							 
						 
					
						
							
								
									
										
										
										
											2009-09-11 12:44:09 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												float  quat [ 4 ] ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												/* convert to axis-angle, passing through quats  */ 
							 
						 
					
						
							
								
									
										
										
										
											2009-11-10 20:43:45 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												eul_to_quat (  quat , eul ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												quat_to_axis_angle (  pchan - > rotAxis ,  & pchan - > rotAngle , quat ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-09-11 12:44:09 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											} 
							 
						 
					
						
							
								
									
										
										
										
											2009-09-28 10:19:20 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											else  if  ( pchan - > rotmode  = =  ROT_MODE_QUAT ) 
							 
						 
					
						
							
								
									
										
										
										
											2009-11-10 20:43:45 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												eul_to_quat (  pchan - > quat , eul ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-09-11 12:44:09 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											else 
							 
						 
					
						
							
								
									
										
										
										
											2009-11-10 20:43:45 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												copy_v3_v3 ( pchan - > eul ,  eul ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-02-10 15:38:00 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										/* no break, pass on */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									case  B_ARMATUREPANEL2 : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											ob - > pose - > flag  | =  ( POSE_LOCKED | POSE_DO_UNLOCK ) ; 
							 
						 
					
						
							
								
									
										
											 
										 
										
											
												2.5
Notifiers
---------
Various fixes for wrong use of notifiers, and some new notifiers
to make things a bit more clear and consistent, with two notable
changes:
* Geometry changes are now done with NC_GEOM, rather than
  NC_OBJECT|ND_GEOM_, so an object does need to be available.
* Space data now use NC_SPACE|ND_SPACE_*, instead of data
  notifiers or even NC_WINDOW in some cases. Note that NC_SPACE
  should only be used for notifying about changes in space data,
  we don't want to go back to allqueue(REDRAW..).
Depsgraph
---------
The dependency graph now has a different flush call:
DAG_object_flush_update(scene, ob, flag)
is replaced by:
DAG_id_flush_update(id, flag)
It still works basically the same, one difference is that it now
also accepts object data (e.g. Mesh), again to avoid requiring an
Object to be available. Other ID types will simply do nothing at
the moment.
Docs
----
I made some guidelines for how/when to do which kinds of updates
and notifiers. I can't specify totally exact how to make these
decisions, but these are basically the guidelines I use. So, new
and updated docs are here:
http://wiki.blender.org/index.php/BlenderDev/Blender2.5/NotifiersUpdates
http://wiki.blender.org/index.php/BlenderDev/Blender2.5/DataNotifiers
											 
										 
										
											2009-09-04 20:51:09 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											DAG_id_flush_update ( & ob - > id ,  OB_RECALC_DATA ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-02-10 15:38:00 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									case  B_TRANSFORMSPACEADD : 
							 
						 
					
						
							
								
									
										
										
										
											2009-09-28 19:49:36 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										BIF_createTransformOrientation ( C ,  NULL ,  " " ,  1 ,  0 ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-02-10 15:38:00 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
										break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									case  B_TRANSFORMSPACECLEAR : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										BIF_clearTransformOrientation ( C ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										
							 
						 
					
						
							
								
									
										
										
										
											2009-03-11 00:43:08 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								#if 0  // XXX
 
							 
						 
					
						
							
								
									
										
										
										
											2009-02-10 15:38:00 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
									case  B_WEIGHT0_0 : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										wpaint - > weight  =  0.0f ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									case  B_WEIGHT1_4 : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										wpaint - > weight  =  0.25f ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									case  B_WEIGHT1_2 : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										wpaint - > weight  =  0.5f ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									case  B_WEIGHT3_4 : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										wpaint - > weight  =  0.75f ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									case  B_WEIGHT1_0 : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										wpaint - > weight  =  1.0f ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									case  B_OPA1_8 : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										wpaint - > a  =  0.125f ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									case  B_OPA1_4 : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										wpaint - > a  =  0.25f ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									case  B_OPA1_2 : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										wpaint - > a  =  0.5f ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									case  B_OPA3_4 : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										wpaint - > a  =  0.75f ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									case  B_OPA1_0 : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										wpaint - > a  =  1.0f ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										break ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-03-11 00:43:08 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								# endif 
 
							 
						 
					
						
							
								
									
										
										
										
											2009-02-10 15:38:00 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
									case  B_CLR_WPAINT : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								//		if(!multires_level1_test()) {
 
							 
						 
					
						
							
								
									
										
										
											
												2.5
Smaller jobs, all in one commit!
- Moved object_do_update out of view3d drawing, into
  the event system (currently after notifiers).
  Depsgraph calls for setting update flags will have to
  keep track of each Screen's needs, so a UI showing only
  a Sequencer doesn't do objects.
- Added button in "Properties region" in 3D window to set
  or disable 4-split, including the 3 options it has.
  (lock, box, clip)
- Restored legacy code for UI, to make things work like
  bone rename, autocomplete. 
- Node editor now shows Curves widgets again
- Bugfix: composite job increased Viewer user id count
- Bugfix: Node editor, not "Enable nodes" still called
  a Job, which didn't do anything
- Various code cleaning, unused vars and prototypes.
											 
										 
										
											2009-02-11 16:54:55 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										{ 
							 
						 
					
						
							
								
									
										
										
										
											2009-02-10 15:38:00 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
											bDeformGroup  * defGroup  =  BLI_findlink ( & ob - > defbase ,  ob - > actdef - 1 ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											if ( defGroup )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												Mesh  * me =  ob - > data ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												int  a ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												for ( a = 0 ;  a < me - > totvert ;  a + + ) 
							 
						 
					
						
							
								
									
										
										
											
												2.5: Object module
* Split object_edit.c into multiple files:
  object_add.c, object_edit.c, object_hook.c, object_relations.c,
  object_select.c, object_transform.c.
* Rename files to have consistent object_ and mball_ prefix:
  object_shapekey.c, object_lattice.c, object_vgroup.c, mball_edit.c.
* Added operators:
  * vertex group menu and set active
  * apply location, rotation, scale, visual transform (location is new)
  * make local
  * make vertex parent
  * move to layer
  * convert to curve/mesh (not finished yet)
* Many small fixes for marked issues, but still much code to be cleaned
  up here...
											 
										 
										
											2009-09-09 11:52:56 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
													ED_vgroup_vert_remove  ( ob ,  defGroup ,  a ) ; 
							 
						 
					
						
							
								
									
										
											 
										 
										
											
												2.5
Notifiers
---------
Various fixes for wrong use of notifiers, and some new notifiers
to make things a bit more clear and consistent, with two notable
changes:
* Geometry changes are now done with NC_GEOM, rather than
  NC_OBJECT|ND_GEOM_, so an object does need to be available.
* Space data now use NC_SPACE|ND_SPACE_*, instead of data
  notifiers or even NC_WINDOW in some cases. Note that NC_SPACE
  should only be used for notifying about changes in space data,
  we don't want to go back to allqueue(REDRAW..).
Depsgraph
---------
The dependency graph now has a different flush call:
DAG_object_flush_update(scene, ob, flag)
is replaced by:
DAG_id_flush_update(id, flag)
It still works basically the same, one difference is that it now
also accepts object data (e.g. Mesh), again to avoid requiring an
Object to be available. Other ID types will simply do nothing at
the moment.
Docs
----
I made some guidelines for how/when to do which kinds of updates
and notifiers. I can't specify totally exact how to make these
decisions, but these are basically the guidelines I use. So, new
and updated docs are here:
http://wiki.blender.org/index.php/BlenderDev/Blender2.5/NotifiersUpdates
http://wiki.blender.org/index.php/BlenderDev/Blender2.5/DataNotifiers
											 
										 
										
											2009-09-04 20:51:09 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
												DAG_id_flush_update ( & ob - > id ,  OB_RECALC_DATA ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-02-10 15:38:00 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
											} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										break ; 
							 
						 
					
						
							
								
									
										
										
											
												2.5
Smaller jobs, all in one commit!
- Moved object_do_update out of view3d drawing, into
  the event system (currently after notifiers).
  Depsgraph calls for setting update flags will have to
  keep track of each Screen's needs, so a UI showing only
  a Sequencer doesn't do objects.
- Added button in "Properties region" in 3D window to set
  or disable 4-split, including the 3 options it has.
  (lock, box, clip)
- Restored legacy code for UI, to make things work like
  bone rename, autocomplete. 
- Node editor now shows Curves widgets again
- Bugfix: composite job increased Viewer user id count
- Bugfix: Node editor, not "Enable nodes" still called
  a Job, which didn't do anything
- Various code cleaning, unused vars and prototypes.
											 
										 
										
											2009-02-11 16:54:55 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									case  B_RV3D_LOCKED : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									case  B_RV3D_BOXVIEW : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									case  B_RV3D_BOXCLIP : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											ScrArea  * sa =  CTX_wm_area ( C ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											ARegion  * ar =  sa - > regionbase . last ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											RegionView3D  * rv3d ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											short  viewlock ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											ar =  ar - > prev ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											rv3d =  ar - > regiondata ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											viewlock =  rv3d - > viewlock ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											if ( ( viewlock  &  RV3D_LOCKED ) = = 0 ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												viewlock =  0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											else  if ( ( viewlock  &  RV3D_BOXVIEW ) = = 0 ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												viewlock  & =  ~ RV3D_BOXCLIP ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											for ( ;  ar ;  ar =  ar - > prev )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												if ( ar - > alignment = = RGN_ALIGN_QSPLIT )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													rv3d =  ar - > regiondata ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
													rv3d - > viewlock =  viewlock ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											if ( rv3d - > viewlock  &  RV3D_BOXVIEW ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
												view3d_boxview_copy ( sa ,  sa - > regionbase . last ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											ED_area_tag_redraw ( sa ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										break ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-02-10 15:38:00 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									/* default for now */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									WM_event_add_notifier ( C ,  NC_OBJECT | ND_TRANSFORM ,  ob ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								void  removeTransformOrientation_func ( bContext  * C ,  void  * target ,  void  * unused ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									BIF_removeTransformOrientation ( C ,  ( TransformOrientation  * )  target ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								void  selectTransformOrientation_func ( bContext  * C ,  void  * target ,  void  * unused ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									BIF_selectTransformOrientation ( C ,  ( TransformOrientation  * )  target ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-07-16 04:45:52 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								#if 0  // XXX not used
 
							 
						 
					
						
							
								
									
										
										
										
											2009-05-19 17:13:33 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								static  void  view3d_panel_transform_spaces ( const  bContext  * C ,  Panel  * pa ) 
							 
						 
					
						
							
								
									
										
										
										
											2009-02-10 15:38:00 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									Scene  * scene =  CTX_data_scene ( C ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									Object  * obedit =  CTX_data_edit_object ( C ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									View3D  * v3d =  CTX_wm_view3d ( C ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									ListBase  * transform_spaces  =  & scene - > transform_spaces ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									TransformOrientation  * ts  =  transform_spaces - > first ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									uiBlock  * block ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									uiBut  * but ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-05-19 17:13:33 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									int  xco  =  20 ,  yco  =  70 ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-02-10 15:38:00 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
									int  index ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-10-09 10:45:11 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									block =  uiLayoutAbsoluteBlock ( pa - > layout ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-02-10 15:38:00 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									uiBlockBeginAlign ( block ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									if  ( obedit ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										uiDefBut ( block ,  BUT ,  B_TRANSFORMSPACEADD ,  " Add " ,  xco , 120 , 80 , 20 ,  0 ,  0 ,  0 ,  0 ,  0 ,  " Add the selected element as a Transform Orientation " ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									else 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										uiDefBut ( block ,  BUT ,  B_TRANSFORMSPACEADD ,  " Add " ,  xco , 120 , 80 , 20 ,  0 ,  0 ,  0 ,  0 ,  0 ,  " Add the active object as a Transform Orientation " ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									uiDefBut ( block ,  BUT ,  B_TRANSFORMSPACECLEAR ,  " Clear " ,  xco  +  80 , 120 , 80 , 20 ,  0 ,  0 ,  0 ,  0 ,  0 ,  " Removal all Transform Orientations " ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									uiBlockEndAlign ( block ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									uiBlockBeginAlign ( block ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									
							 
						 
					
						
							
								
									
										
										
										
											2009-02-16 14:28:33 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									uiDefButS ( block ,  ROW ,  B_REDR ,  " Global " , 	xco ,  		90 ,  40 , 20 ,  & v3d - > twmode ,  5.0 ,  ( float ) V3D_MANIP_GLOBAL , 0 ,  0 ,  " Global Transform Orientation " ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									uiDefButS ( block ,  ROW ,  B_REDR ,  " Local " , 	xco  +  40 , 	90 ,  40 , 20 ,  & v3d - > twmode ,  5.0 ,  ( float ) V3D_MANIP_LOCAL ,  0 ,  0 ,  " Local Transform Orientation " ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									uiDefButS ( block ,  ROW ,  B_REDR ,  " Normal " , 	xco  +  80 , 	90 ,  40 , 20 ,  & v3d - > twmode ,  5.0 ,  ( float ) V3D_MANIP_NORMAL , 0 ,  0 ,  " Normal Transform Orientation " ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									uiDefButS ( block ,  ROW ,  B_REDR ,  " View " , 		xco  +  120 , 	90 ,  40 , 20 ,  & v3d - > twmode ,  5.0 ,  ( float ) V3D_MANIP_VIEW , 	0 ,  0 ,  " View Transform Orientation " ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-02-10 15:38:00 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
									
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									for  ( index  =  V3D_MANIP_CUSTOM ,  ts  =  transform_spaces - > first  ;  ts  ;  ts  =  ts - > next ,  index + + )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										if  ( v3d - > twmode  = =  index )  { 
							 
						 
					
						
							
								
									
										
										
										
											2009-02-16 14:28:33 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											but  =  uiDefIconButS ( block , ROW ,  B_REDR ,  ICON_CHECKBOX_HLT ,  xco , yco , XIC , YIC ,  & v3d - > twmode ,  5.0 ,  ( float ) index ,  0 ,  0 ,  " Use this Custom Transform Orientation " ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-02-10 15:38:00 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										else  { 
							 
						 
					
						
							
								
									
										
										
										
											2009-02-16 14:28:33 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											but  =  uiDefIconButS ( block , ROW ,  B_REDR ,  ICON_CHECKBOX_DEHLT ,  xco , yco , XIC , YIC ,  & v3d - > twmode ,  5.0 ,  ( float ) index ,  0 ,  0 ,  " Use this Custom Transform Orientation " ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-02-10 15:38:00 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										uiButSetFunc ( but ,  selectTransformOrientation_func ,  ts ,  NULL ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										uiDefBut ( block ,  TEX ,  0 ,  " " ,  xco + = XIC ,  yco , 100 + XIC , 20 ,  & ts - > name ,  0 ,  30 ,  0 ,  0 ,  " Edits the name of this Transform Orientation " ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										but  =  uiDefIconBut ( block ,  BUT ,  B_REDR ,  ICON_X ,  xco + = 100 + XIC , yco , XIC , YIC ,  0 ,  0 ,  0 ,  0 ,  0 ,  " Deletes this Transform Orientation " ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										uiButSetFunc ( but ,  removeTransformOrientation_func ,  ts ,  NULL ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										xco  =  20 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										yco  - =  25 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									uiBlockEndAlign ( block ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
									
										
										
										
											2009-07-16 04:45:52 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								# endif  // XXX not used
 
							 
						 
					
						
							
								
									
										
										
										
											2009-02-10 15:38:00 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-08-15 16:36:25 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								#if 0 
 
							 
						 
					
						
							
								
									
										
										
										
											2009-03-10 23:38:16 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								static  void  brush_idpoin_handle ( bContext  * C ,  ID  * id ,  int  event ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
									
										
										
										
											2009-03-11 00:43:08 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									Brush  * * br  =  current_brush_source ( CTX_data_scene ( C ) ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-03-10 23:38:16 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									if ( ! br ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										return ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									switch ( event )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									case  UI_ID_BROWSE : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										( * br )  =  ( Brush * ) id ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									case  UI_ID_DELETE : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										brush_delete ( br ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									case  UI_ID_RENAME : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										/* XXX ? */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									case  UI_ID_ADD_NEW : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										if ( id )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											( * br )  =  copy_brush ( ( Brush * ) id ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											id - > us - - ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										else 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											( * br )  =  add_brush ( " Brush " ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									case  UI_ID_OPEN : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										/* XXX not implemented */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
									
										
										
										
											2009-08-15 16:36:25 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								# endif 
 
							 
						 
					
						
							
								
									
										
										
										
											2009-03-10 23:38:16 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-05-19 17:13:33 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								static  void  view3d_panel_object ( const  bContext  * C ,  Panel  * pa ) 
							 
						 
					
						
							
								
									
										
										
										
											2009-02-10 15:38:00 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
									
										
										
										
											2009-05-19 17:13:33 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									uiBlock  * block ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-02-10 15:38:00 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
									Scene  * scene =  CTX_data_scene ( C ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									Object  * obedit =  CTX_data_edit_object ( C ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									View3D  * v3d =  CTX_wm_view3d ( C ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-07-14 17:59:26 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									//uiBut *bt;
 
							 
						 
					
						
							
								
									
										
										
										
											2009-02-10 15:38:00 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
									Object  * ob =  OBACT ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									TransformProperties  * tfp ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-10-09 10:45:11 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									PointerRNA  obptr ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-11-05 01:00:17 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									uiLayout  * col ,  * row ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-02-10 15:38:00 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
									float  lim ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									if ( ob = = NULL )  return ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									/* make sure we got storage */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									if ( v3d - > properties_storage = = NULL ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										v3d - > properties_storage =  MEM_callocN ( sizeof ( TransformProperties ) ,  " TransformProperties " ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									tfp =  v3d - > properties_storage ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								// XXX	uiSetButLock(object_is_libdata(ob), ERROR_LIBDATA_MESSAGE);
 
							 
						 
					
						
							
								
									
										
										
										
											2009-10-09 13:34:24 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									/*
 
							 
						 
					
						
							
								
									
										
										
										
											2009-08-16 01:25:53 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									if ( ob - > mode  &  ( OB_MODE_VERTEX_PAINT | OB_MODE_WEIGHT_PAINT | OB_MODE_TEXTURE_PAINT ) )  { 
							 
						 
					
						
							
								
									
										
										
										
											2009-02-10 15:38:00 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									else  { 
							 
						 
					
						
							
								
									
										
										
										
											2009-08-16 02:35:44 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										if ( ( ob - > mode  &  OB_MODE_PARTICLE_EDIT ) = = 0 )  { 
							 
						 
					
						
							
								
									
										
										
										
											2009-02-10 15:38:00 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
											uiBlockEndAlign ( block ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2009-10-09 13:34:24 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									*/ 
							 
						 
					
						
							
								
									
										
										
										
											2009-02-10 15:38:00 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									lim =  10000.0f * MAX2 ( 1.0 ,  v3d - > grid ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-10-09 10:45:11 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									block =  uiLayoutGetBlock ( pa - > layout ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									uiBlockSetHandleFunc ( block ,  do_view3d_region_buttons ,  NULL ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									col =  uiLayoutColumn ( pa - > layout ,  0 ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									row =  uiLayoutRow ( col ,  0 ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									RNA_id_pointer_create ( & ob - > id ,  & obptr ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-02-10 15:38:00 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
									if ( ob = = obedit )  { 
							 
						 
					
						
							
								
									
										
										
										
											2009-10-09 10:45:11 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										if ( ob - > type = = OB_ARMATURE )  v3d_editarmature_buts ( col ,  v3d ,  ob ,  lim ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										if ( ob - > type = = OB_MBALL )  v3d_editmetaball_buts ( col ,  ob ,  lim ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										else  v3d_editvertex_buts ( C ,  col ,  v3d ,  ob ,  lim ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-02-10 15:38:00 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2009-08-16 03:24:23 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									else  if ( ob - > mode  &  OB_MODE_POSE )  { 
							 
						 
					
						
							
								
									
										
										
										
											2009-10-09 10:45:11 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										v3d_posearmature_buts ( col ,  v3d ,  ob ,  lim ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-02-10 15:38:00 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									else  { 
							 
						 
					
						
							
								
									
										
										
										
											2009-11-05 01:00:17 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										v3d_transform_butsR ( col ,  & obptr ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-02-10 15:38:00 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								#if 0 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								static  void  view3d_panel_preview ( bContext  * C ,  ARegion  * ar ,  short  cntrl ) 	// VIEW3D_HANDLER_PREVIEW
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									uiBlock  * block ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									View3D  * v3d =  sa - > spacedata . first ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									int  ofsx ,  ofsy ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									
							 
						 
					
						
							
								
									
										
										
											
												2.5
More cleanup!
- removed old UI font completely, including from uiBeginBlock
- emboss hints for uiBlock only have three types now;
  Regular, Pulldown, or "Nothing" (only icon/text)
- removed old font path from Userdef
- removed all old button theme hinting
- removed old "auto block" to merge buttons in groups
  (was only in use for radiosity buttons)
And went over all warnings. One hooray for make giving clean output :)
Well, we need uniform definitions for warnings, so people at least fix
them... here's the real bad bugs I found:
- in mesh code, a call to editmesh mixed *em and *me
- in armature, ED_util.h was not included, so no warnings for wrong call
  to ED_undo_push()
- The extern Py api .h was not included in the bpy_interface.c, showing
  a several calls using different args.
Further just added the missing includes, and removed unused vars.
											 
										 
										
											2009-04-14 15:59:52 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									block =  uiBeginBlock ( C ,  ar ,  " view3d_panel_preview " ,  UI_EMBOSS ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-02-10 15:38:00 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
									uiPanelControl ( UI_PNL_SOLID  |  UI_PNL_CLOSE  |  UI_PNL_SCALE  |  cntrl ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									uiSetPanelHandler ( VIEW3D_HANDLER_PREVIEW ) ;   // for close and esc
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									ofsx =  - 150 + ( sa - > winx / 2 ) / v3d - > blockscale ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									ofsy =  - 100 + ( sa - > winy / 2 ) / v3d - > blockscale ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									if ( uiNewPanel ( C ,  ar ,  block ,  " Preview " ,  " View3d " ,  ofsx ,  ofsy ,  300 ,  200 ) = = 0 )  return ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									uiBlockSetDrawExtraFunc ( block ,  BIF_view3d_previewdraw ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									if ( scene - > recalc  &  SCE_PRV_CHANGED )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										scene - > recalc  & =  ~ SCE_PRV_CHANGED ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										//printf("found recalc\n");
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										BIF_view3d_previewrender_free ( sa - > spacedata . first ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										BIF_preview_changed ( 0 ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								# endif 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-10-21 10:56:31 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								#if 0  // XXX not used
 
							 
						 
					
						
							
								
									
										
										
										
											2009-03-20 18:00:51 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								static  void  delete_sketch_armature ( bContext  * C ,  void  * arg1 ,  void  * arg2 ) 
							 
						 
					
						
							
								
									
										
										
										
											2009-03-17 21:44:58 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
									
										
										
										
											2009-03-20 18:00:51 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									BIF_deleteSketch ( C ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-03-17 21:44:58 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-03-20 18:00:51 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								static  void  convert_sketch_armature ( bContext  * C ,  void  * arg1 ,  void  * arg2 ) 
							 
						 
					
						
							
								
									
										
										
										
											2009-03-17 21:44:58 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
									
										
										
										
											2009-03-20 18:00:51 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									BIF_convertSketch ( C ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-03-17 21:44:58 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-03-20 18:00:51 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								static  void  assign_template_sketch_armature ( bContext  * C ,  void  * arg1 ,  void  * arg2 ) 
							 
						 
					
						
							
								
									
										
										
										
											2009-03-17 21:44:58 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									int  index  =  * ( int * ) arg1 ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-03-20 18:00:51 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									BIF_setTemplate ( C ,  index ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-03-17 21:44:58 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
									
										
										
										
											2009-05-19 17:13:33 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-10-21 10:56:31 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-05-19 17:13:33 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								static  int  view3d_panel_bonesketch_spaces_poll ( const  bContext  * C ,  PanelType  * pt ) 
							 
						 
					
						
							
								
									
										
										
										
											2009-03-17 21:44:58 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
									
										
										
										
											2009-03-20 18:00:51 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									Object  * obedit  =  CTX_data_edit_object ( C ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-05-19 17:13:33 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									/* replace with check call to sketching lib */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									return  ( obedit  & &  obedit - > type  = =  OB_ARMATURE ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								static  void  view3d_panel_bonesketch_spaces ( const  bContext  * C ,  Panel  * pa ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
									
										
										
										
											2009-03-20 18:00:51 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									Scene  * scene  =  CTX_data_scene ( C ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-03-17 21:44:58 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									static  int  template_index ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									static  char  joint_label [ 128 ] ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									uiBlock  * block ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									uiBut  * but ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									char  * bone_name ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-05-19 17:13:33 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									int  yco  =  130 ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-03-17 21:44:58 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									int  nb_joints ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-05-19 17:13:33 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									static  char  subdiv_tooltip [ 4 ] [ 64 ]  =  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										" Subdivide arcs based on a fixed number of bones " , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										" Subdivide arcs in bones of equal length " , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										" Subdivide arcs based on correlation " , 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										" Retarget template to stroke " 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										} ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-03-17 21:44:58 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-05-19 17:13:33 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									
							 
						 
					
						
							
								
									
										
										
										
											2009-10-09 10:45:11 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									block =  uiLayoutAbsoluteBlock ( pa - > layout ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-05-19 17:13:33 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									uiBlockSetHandleFunc ( block ,  do_view3d_region_buttons ,  NULL ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-03-17 21:44:58 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-05-19 17:13:33 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									uiBlockBeginAlign ( block ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									/* use real flag instead of 1 */ 
							 
						 
					
						
							
								
									
										
										
										
											2009-06-08 20:08:19 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									uiDefButBitC ( block ,  TOG ,  BONE_SKETCHING ,  B_REDR ,  " Use Bone Sketching " ,  10 ,  yco ,  160 ,  20 ,  & scene - > toolsettings - > bone_sketching ,  0 ,  0 ,  0 ,  0 ,  " Use sketching to create and edit bones, (Ctrl snaps to mesh volume) " ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-05-19 17:13:33 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									uiDefButBitC ( block ,  TOG ,  BONE_SKETCHING_ADJUST ,  B_REDR ,  " A " ,  170 ,  yco ,  20 ,  20 ,  & scene - > toolsettings - > bone_sketching ,  0 ,  0 ,  0 ,  0 ,  " Adjust strokes by drawing near them " ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									uiDefButBitC ( block ,  TOG ,  BONE_SKETCHING_QUICK ,  B_REDR ,  " Q " ,  190 ,  yco ,  20 ,  20 ,  & scene - > toolsettings - > bone_sketching ,  0 ,  0 ,  0 ,  0 ,  " Automatically convert and delete on stroke end " ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									yco  - =  20 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									but  =  uiDefBut ( block ,  BUT ,  B_REDR ,  " Convert " ,  10 , yco , 100 , 20 ,  0 ,  0 ,  0 ,  0 ,  0 ,  " Convert sketch to armature " ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									uiButSetFunc ( but ,  convert_sketch_armature ,  NULL ,  NULL ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									but  =  uiDefBut ( block ,  BUT ,  B_REDR ,  " Delete " ,  110 , yco , 100 , 20 ,  0 ,  0 ,  0 ,  0 ,  0 ,  " Delete sketch " ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									uiButSetFunc ( but ,  delete_sketch_armature ,  NULL ,  NULL ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									yco  - =  20 ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-03-17 21:44:58 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									
							 
						 
					
						
							
								
									
										
										
										
											2009-05-19 17:13:33 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									uiBlockEndAlign ( block ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									uiBlockBeginAlign ( block ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-03-17 21:44:58 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									
							 
						 
					
						
							
								
									
										
										
										
											2009-05-19 17:13:33 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									uiDefButC ( block ,  MENU ,  B_REDR ,  " Subdivision Method%t|Length%x1|Adaptative%x2|Fixed%x0|Template%x3 " ,  10 , yco , 60 , 19 ,  & scene - > toolsettings - > bone_sketching_convert ,  0 ,  0 ,  0 ,  0 ,  subdiv_tooltip [ ( unsigned  char ) scene - > toolsettings - > bone_sketching_convert ] ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									switch ( scene - > toolsettings - > bone_sketching_convert ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									case  SK_CONVERT_CUT_LENGTH : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										uiDefButF ( block ,  NUM ,  B_REDR ,  					" Lim: " , 		70 ,  yco ,  140 ,  19 ,  & scene - > toolsettings - > skgen_length_limit , 0.1 , 50.0 ,  10 ,  0 , 		" Maximum length of the subdivided bones " ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										yco  - =  20 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									case  SK_CONVERT_CUT_ADAPTATIVE : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										uiDefButF ( block ,  NUM ,  B_REDR ,  					" Thres: " , 			70 ,  yco ,  140 ,  19 ,  & scene - > toolsettings - > skgen_correlation_limit , 0.0 ,  1.0 ,  0.01 ,  0 , 	" Correlation threshold for subdivision " ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										yco  - =  20 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									default : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									case  SK_CONVERT_CUT_FIXED : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										uiDefButC ( block ,  NUM ,  B_REDR ,  					" Num: " , 		70 ,  yco ,  140 ,  19 ,  & scene - > toolsettings - > skgen_subdivision_number , 1 ,  100 ,  1 ,  5 , 	" Number of subdivided bones " ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										yco  - =  20 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									case  SK_CONVERT_RETARGET : 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										uiDefButC ( block ,  ROW ,  B_NOP ,  " No " , 			70 ,   yco ,  40 , 19 ,  & scene - > toolsettings - > skgen_retarget_roll ,  0 ,  0 ,  0 ,  0 , 									" No special roll treatment " ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										uiDefButC ( block ,  ROW ,  B_NOP ,  " View " , 		110 ,   yco ,  50 , 19 ,  & scene - > toolsettings - > skgen_retarget_roll ,  0 ,  SK_RETARGET_ROLL_VIEW ,  0 ,  0 , 				" Roll bones perpendicular to view " ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										uiDefButC ( block ,  ROW ,  B_NOP ,  " Joint " , 		160 ,  yco ,  50 , 19 ,  & scene - > toolsettings - > skgen_retarget_roll ,  0 ,  SK_RETARGET_ROLL_JOINT ,  0 ,  0 , 				" Roll bones relative to joint bend " ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										yco  - =  30 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										uiBlockEndAlign ( block ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-03-17 21:44:58 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										uiBlockBeginAlign ( block ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-05-19 17:13:33 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										/* button here to select what to do (copy or not), template, ...*/ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										BIF_makeListTemplates ( C ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										template_index  =  BIF_currentTemplate ( C ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										but  =  uiDefButI ( block ,  MENU ,  B_REDR ,  BIF_listTemplates ( C ) ,  10 , yco , 200 , 19 ,  & template_index ,  0 ,  0 ,  0 ,  0 ,  " Template " ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										uiButSetFunc ( but ,  assign_template_sketch_armature ,  & template_index ,  NULL ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-03-17 21:44:58 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										yco  - =  20 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										
							 
						 
					
						
							
								
									
										
										
										
											2009-05-19 17:13:33 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										uiDefButF ( block ,  NUM ,  B_NOP ,  							" A: " , 			10 ,  yco ,  66 , 19 ,  & scene - > toolsettings - > skgen_retarget_angle_weight ,  0 ,  10 ,  1 ,  0 , 		" Angle Weight " ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										uiDefButF ( block ,  NUM ,  B_NOP ,  							" L: " , 			76 ,  yco ,  67 , 19 ,  & scene - > toolsettings - > skgen_retarget_length_weight ,  0 ,  10 ,  1 ,  0 , 		" Length Weight " ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										uiDefButF ( block ,  NUM ,  B_NOP ,  							" D: " , 		143 , yco ,  67 , 19 ,  & scene - > toolsettings - > skgen_retarget_distance_weight ,  0 ,  10 ,  1 ,  0 , 		" Distance Weight " ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-03-17 21:44:58 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										yco  - =  20 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										
							 
						 
					
						
							
								
									
										
										
										
											2009-05-19 17:13:33 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										uiDefBut ( block ,  TEX , B_REDR , " S: " , 							10 ,   yco ,  90 ,  20 ,  scene - > toolsettings - > skgen_side_string ,  0.0 ,  8.0 ,  0 ,  0 ,  " Text to replace &S with " ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										uiDefBut ( block ,  TEX , B_REDR , " N: " , 							100 ,  yco ,  90 ,  20 ,  scene - > toolsettings - > skgen_num_string ,  0.0 ,  8.0 ,  0 ,  0 ,  " Text to replace &N with " ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										uiDefIconButBitC ( block ,  TOG ,  SK_RETARGET_AUTONAME ,  B_NOP ,  ICON_AUTO , 190 , yco , 20 , 20 ,  & scene - > toolsettings - > skgen_retarget_options ,  0 ,  0 ,  0 ,  0 ,  " Use Auto Naming " ) ; 	
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										yco  - =  20 ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-03-17 21:44:58 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-05-19 17:13:33 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										/* auto renaming magic */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										uiBlockEndAlign ( block ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-03-17 21:44:58 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										
							 
						 
					
						
							
								
									
										
										
										
											2009-05-19 17:13:33 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										nb_joints  =  BIF_nbJointsTemplate ( C ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-03-17 21:44:58 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-05-19 17:13:33 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										if  ( nb_joints  = =  - 1 ) 
							 
						 
					
						
							
								
									
										
										
										
											2009-03-17 21:44:58 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										{ 
							 
						 
					
						
							
								
									
										
										
										
											2009-05-19 17:13:33 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
											//XXX
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											//nb_joints = G.totvertsel;
 
							 
						 
					
						
							
								
									
										
										
										
											2009-03-17 21:44:58 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										
							 
						 
					
						
							
								
									
										
										
										
											2009-05-19 17:13:33 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
										bone_name  =  BIF_nameBoneTemplate ( C ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										BLI_snprintf ( joint_label ,  32 ,  " %i joints: %s " ,  nb_joints ,  bone_name ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										uiDefBut ( block ,  LABEL ,  1 ,  joint_label , 					10 ,  yco ,  200 ,  20 ,  NULL ,  0.0 ,  0.0 ,  0 ,  0 ,  " " ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										yco  - =  20 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										break ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-03-17 21:44:58 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
									
										
										
										
											2009-05-19 17:13:33 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									uiBlockEndAlign ( block ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-03-17 21:44:58 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
									
										
										
										
											2009-02-10 15:38:00 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-04-15 17:53:12 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								/* op->invoke */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								static  void  redo_cb ( bContext  * C ,  void  * arg_op ,  void  * arg2 ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									wmOperator  * lastop =  arg_op ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									if ( lastop )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										int  retval ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										printf ( " operator redo %s \n " ,  lastop - > type - > name ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										ED_undo_pop ( C ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										retval =  WM_operator_repeat ( C ,  lastop ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										if ( ( retval  &  OPERATOR_FINISHED ) = = 0 )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											printf ( " operator redo failed %s \n " ,  lastop - > type - > name ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											ED_undo_redo ( C ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-05-19 17:13:33 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								static  void  view3d_panel_operator_redo ( const  bContext  * C ,  Panel  * pa ) 
							 
						 
					
						
							
								
									
										
										
										
											2009-04-15 17:53:12 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									wmWindowManager  * wm =  CTX_wm_manager ( C ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									wmOperator  * op ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									PointerRNA  ptr ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									uiBlock  * block ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									
							 
						 
					
						
							
								
									
										
										
										
											2009-05-28 23:37:55 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									block =  uiLayoutGetBlock ( pa - > layout ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-04-15 17:53:12 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									/* only for operators that are registered and did an undo push */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									for ( op =  wm - > operators . last ;  op ;  op =  op - > prev ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										if ( ( op - > type - > flag  &  OPTYPE_REGISTER )  & &  ( op - > type - > flag  &  OPTYPE_UNDO ) ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
											break ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									if ( op = = NULL ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										return ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									uiBlockSetFunc ( block ,  redo_cb ,  op ,  NULL ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									if ( ! op - > properties )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										IDPropertyTemplate  val  =  { 0 } ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										op - > properties =  IDP_New ( IDP_GROUP ,  val ,  " wmOperatorProperties " ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									RNA_pointer_create ( & wm - > id ,  op - > type - > srna ,  op - > properties ,  & ptr ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-06-24 21:27:10 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									uiDefAutoButsRNA ( C ,  pa - > layout ,  & ptr ,  2 ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-04-15 17:53:12 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
									
										
										
										
											2009-07-16 04:45:52 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								# endif  // XXX not used
 
							 
						 
					
						
							
								
									
										
										
										
											2009-04-15 17:53:12 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-05-19 17:13:33 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								void  view3d_buttons_register ( ARegionType  * art ) 
							 
						 
					
						
							
								
									
										
										
										
											2009-02-10 15:38:00 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
									
										
										
										
											2009-05-19 17:13:33 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									PanelType  * pt ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									pt =  MEM_callocN ( sizeof ( PanelType ) ,  " spacetype view3d panel object " ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									strcpy ( pt - > idname ,  " VIEW3D_PT_object " ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-07-14 12:32:19 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									strcpy ( pt - > label ,  " Transform " ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-05-19 17:13:33 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									pt - > draw =  view3d_panel_object ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									BLI_addtail ( & art - > paneltypes ,  pt ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-08-29 06:50:32 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									pt =  MEM_callocN ( sizeof ( PanelType ) ,  " spacetype view3d panel gpencil " ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									strcpy ( pt - > idname ,  " VIEW3D_PT_gpencil " ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									strcpy ( pt - > label ,  " Grease Pencil " ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									pt - > draw =  gpencil_panel_standard ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									BLI_addtail ( & art - > paneltypes ,  pt ) ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-10-21 10:56:31 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									
							 
						 
					
						
							
								
									
										
										
										
											2009-02-10 15:38:00 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
									// XXX view3d_panel_preview(C, ar, 0);
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								static  int  view3d_properties ( bContext  * C ,  wmOperator  * op ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									ScrArea  * sa =  CTX_wm_area ( C ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									ARegion  * ar =  view3d_has_buttons_region ( sa ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									
							 
						 
					
						
							
								
									
										
										
										
											2009-09-14 19:12:29 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									if ( ar ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
										ED_region_toggle_hidden ( C ,  ar ) ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2009-02-10 15:38:00 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
									return  OPERATOR_FINISHED ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								void  VIEW3D_OT_properties ( wmOperatorType  * ot ) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									ot - > name =  " Properties " ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-09-12 17:16:12 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
									ot - > description =  " Toggles the properties panel display. " ; 
							 
						 
					
						
							
								
									
										
										
										
											2009-02-10 15:38:00 +00:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
									ot - > idname =  " VIEW3D_OT_properties " ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									ot - > exec =  view3d_properties ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									ot - > poll =  ED_operator_view3d_active ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									/* flags */ 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
									ot - > flag =  0 ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								}