Merged 2.5
authorChingiz Dyussenov <chingiz.ds@gmail.com>
Sun, 24 May 2009 11:26:01 +0000 (11:26 +0000)
committerChingiz Dyussenov <chingiz.ds@gmail.com>
Sun, 24 May 2009 11:26:01 +0000 (11:26 +0000)
-r 19845:20124

183 files changed:
1  2 
intern/ghost/intern/GHOST_SystemWin32.cpp
intern/ghost/intern/GHOST_SystemX11.cpp
intern/ghost/intern/GHOST_SystemX11.h
projectfiles_vc9/blender/editors/ED_editors.vcproj
release/datafiles/blenderbuttons
release/ui/buttons_data_armature.py
release/ui/buttons_data_bone.py
release/ui/buttons_data_camera.py
release/ui/buttons_data_curve.py
release/ui/buttons_data_empty.py
release/ui/buttons_data_lamp.py
release/ui/buttons_data_lattice.py
release/ui/buttons_data_mesh.py
release/ui/buttons_data_modifier.py
release/ui/buttons_data_text.py
release/ui/buttons_material.py
release/ui/buttons_objects.py
release/ui/buttons_scene.py
release/ui/buttons_texture.py
release/ui/buttons_world.py
release/ui/space_text.py
source/blender/blenfont/intern/blf.c
source/blender/blenkernel/BKE_colortools.h
source/blender/blenkernel/BKE_multires.h
source/blender/blenkernel/BKE_object.h
source/blender/blenkernel/BKE_screen.h
source/blender/blenkernel/SConscript
source/blender/blenkernel/intern/colortools.c
source/blender/blenkernel/intern/fcurve.c
source/blender/blenkernel/intern/ipo.c
source/blender/blenkernel/intern/modifier.c
source/blender/blenkernel/intern/multires.c
source/blender/blenkernel/intern/object.c
source/blender/blenlib/intern/fileops.c
source/blender/blenloader/intern/readfile.c
source/blender/blenloader/intern/writefile.c
source/blender/editors/animation/anim_filter.c
source/blender/editors/animation/anim_ipo_utils.c
source/blender/editors/animation/keyframing.c
source/blender/editors/armature/editarmature.c
source/blender/editors/armature/poselib.c
source/blender/editors/curve/curve_ops.c
source/blender/editors/curve/editcurve.c
source/blender/editors/datafiles/blenderbuttons.c
source/blender/editors/include/BIF_glutil.h
source/blender/editors/include/ED_fileselect.h
source/blender/editors/include/ED_object.h
source/blender/editors/include/ED_screen.h
source/blender/editors/include/ED_screen_types.h
source/blender/editors/include/ED_view3d.h
source/blender/editors/include/UI_interface.h
source/blender/editors/include/UI_resources.h
source/blender/editors/include/UI_view2d.h
source/blender/editors/interface/interface.c
source/blender/editors/interface/interface_anim.c
source/blender/editors/interface/interface_api.c
source/blender/editors/interface/interface_draw.c
source/blender/editors/interface/interface_handlers.c
source/blender/editors/interface/interface_icons.c
source/blender/editors/interface/interface_intern.h
source/blender/editors/interface/interface_layout.c
source/blender/editors/interface/interface_panel.c
source/blender/editors/interface/interface_regions.c
source/blender/editors/interface/interface_style.c
source/blender/editors/interface/interface_templates.c
source/blender/editors/interface/interface_utils.c
source/blender/editors/interface/interface_widgets.c
source/blender/editors/interface/resources.c
source/blender/editors/interface/view2d.c
source/blender/editors/interface/view2d_ops.c
source/blender/editors/mesh/editmesh_tools.c
source/blender/editors/object/object_edit.c
source/blender/editors/object/object_intern.h
source/blender/editors/object/object_modifier.c
source/blender/editors/object/object_ops.c
source/blender/editors/physics/editparticle.c
source/blender/editors/preview/previewrender.c
source/blender/editors/screen/area.c
source/blender/editors/screen/glutil.c
source/blender/editors/screen/screen_edit.c
source/blender/editors/screen/screen_ops.c
source/blender/editors/sculpt_paint/paint_image.c
source/blender/editors/space_buttons/buttons_header.c
source/blender/editors/space_buttons/buttons_intern.h
source/blender/editors/space_buttons/space_buttons.c
source/blender/editors/space_file/Makefile
source/blender/editors/space_file/SConscript
source/blender/editors/space_file/file_draw.c
source/blender/editors/space_file/file_header.c
source/blender/editors/space_file/file_intern.h
source/blender/editors/space_file/file_ops.c
source/blender/editors/space_file/filelist.c
source/blender/editors/space_file/filelist.h
source/blender/editors/space_file/filesel.c
source/blender/editors/space_graph/graph_buttons.c
source/blender/editors/space_graph/graph_draw.c
source/blender/editors/space_graph/graph_edit.c
source/blender/editors/space_graph/graph_intern.h
source/blender/editors/space_graph/graph_select.c
source/blender/editors/space_graph/space_graph.c
source/blender/editors/space_image/SConscript
source/blender/editors/space_image/image_buttons.c
source/blender/editors/space_image/image_draw.c
source/blender/editors/space_image/image_header.c
source/blender/editors/space_image/image_intern.h
source/blender/editors/space_image/image_ops.c
source/blender/editors/space_image/space_image.c
source/blender/editors/space_info/info_header.c
source/blender/editors/space_info/space_info.c
source/blender/editors/space_node/drawnode.c
source/blender/editors/space_node/node_edit.c
source/blender/editors/space_node/node_header.c
source/blender/editors/space_outliner/outliner.c
source/blender/editors/space_text/space_text.c
source/blender/editors/space_text/text_header.c
source/blender/editors/space_text/text_ops.c
source/blender/editors/space_time/space_time.c
source/blender/editors/space_time/time_header.c
source/blender/editors/space_view3d/drawarmature.c
source/blender/editors/space_view3d/drawobject.c
source/blender/editors/space_view3d/space_view3d.c
source/blender/editors/space_view3d/view3d_buttons.c
source/blender/editors/space_view3d/view3d_header.c
source/blender/editors/space_view3d/view3d_intern.h
source/blender/editors/space_view3d/view3d_snap.c
source/blender/editors/space_view3d/view3d_toolbar.c
source/blender/editors/space_view3d/view3d_view.c
source/blender/editors/transform/transform.c
source/blender/editors/transform/transform_ops.c
source/blender/editors/uvedit/uvedit_unwrap_ops.c
source/blender/imbuf/IMB_imbuf_types.h
source/blender/imbuf/intern/allocimbuf.c
source/blender/makesdna/DNA_action_types.h
source/blender/makesdna/DNA_material_types.h
source/blender/makesdna/DNA_screen_types.h
source/blender/makesdna/DNA_space_types.h
source/blender/makesdna/DNA_userdef_types.h
source/blender/makesdna/DNA_view3d_types.h
source/blender/makesrna/RNA_access.h
source/blender/makesrna/RNA_define.h
source/blender/makesrna/RNA_types.h
source/blender/makesrna/intern/makesrna.c
source/blender/makesrna/intern/rna_ID.c
source/blender/makesrna/intern/rna_access.c
source/blender/makesrna/intern/rna_armature.c
source/blender/makesrna/intern/rna_camera.c
source/blender/makesrna/intern/rna_context.c
source/blender/makesrna/intern/rna_curve.c
source/blender/makesrna/intern/rna_define.c
source/blender/makesrna/intern/rna_internal.h
source/blender/makesrna/intern/rna_internal_types.h
source/blender/makesrna/intern/rna_lamp.c
source/blender/makesrna/intern/rna_material.c
source/blender/makesrna/intern/rna_modifier.c
source/blender/makesrna/intern/rna_object.c
source/blender/makesrna/intern/rna_pose.c
source/blender/makesrna/intern/rna_rna.c
source/blender/makesrna/intern/rna_scene.c
source/blender/makesrna/intern/rna_screen.c
source/blender/makesrna/intern/rna_space.c
source/blender/makesrna/intern/rna_texture.c
source/blender/makesrna/intern/rna_ui.c
source/blender/makesrna/intern/rna_wm.c
source/blender/makesrna/intern/rna_world.c
source/blender/python/epy_doc_gen.py
source/blender/python/intern/bpy_interface.c
source/blender/python/intern/bpy_operator_wrap.c
source/blender/python/intern/bpy_rna.c
source/blender/python/intern/bpy_ui.c
source/blender/render/intern/source/convertblender.c
source/blender/render/intern/source/rendercore.c
source/blender/windowmanager/WM_types.h
source/blender/windowmanager/intern/wm_operators.c
source/blender/windowmanager/intern/wm_window.c
source/darwin/blender.app/Contents/Resources/blender file icon.icns
source/darwin/blender.app/Contents/Resources/blender icon.icns
source/darwin/blendercreator.app/Contents/Resources/blender creator icon.icns
source/darwin/blendercreator.app/Contents/Resources/blender file icon.icns
source/darwin/blenderplayer.app/Contents/Resources/blender file icon.icns
source/darwin/blenderplayer.app/Contents/Resources/blender player icon.icns
source/gameengine/GamePlayer/common/GPC_RenderTools.cpp
tools/Blender.py
tools/btools.py

index e79a075ff2c9b8880c6bc08d03963c4ed57fea26,e79a075ff2c9b8880c6bc08d03963c4ed57fea26..8513d056795bed2cbc96eb70a2c88f5e4d0fc942
@@@ -39,6 -39,6 +39,7 @@@
  #endif
  
  #include "GHOST_SystemWin32.h"
++//#include <stdio.h> //for printf()
  
  // win64 doesn't define GWL_USERDATA
  #ifdef WIN32
@@@ -536,7 -536,7 +537,7 @@@ GHOST_Event* GHOST_SystemWin32::process
  LRESULT WINAPI GHOST_SystemWin32::s_wndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
  {
        GHOST_Event* event = 0;
--      LRESULT lResult;
++      LRESULT lResult = 0;
        GHOST_SystemWin32* system = ((GHOST_SystemWin32*)getSystem());
        GHOST_ASSERT(system, "GHOST_SystemWin32::s_wndProc(): system not initialized")
  
                                         * the message is sent asynchronously, so the window is activated immediately. 
                                         */
                                        event = processWindowEvent(LOWORD(wParam) ? GHOST_kEventWindowActivate : GHOST_kEventWindowDeactivate, window);
++                                      /* WARNING: Let DefWindowProc handle WM_ACTIVATE, otherwise WM_MOUSEWHEEL
++                                      will not be dispatched to OUR active window if we minimize one of OUR windows. */
++                                      lResult = ::DefWindowProc(hwnd, msg, wParam, lParam);
                                        break;
                                case WM_PAINT:
                                        /* An application sends the WM_PAINT message when the system or another application 
  
        if (event) {
                system->pushEvent(event);
--              lResult = 0;
        }
        else {
                lResult = ::DefWindowProc(hwnd, msg, wParam, lParam);
index c6ce7b628e96b4af046de8fd6f66f5de481f5353,c6ce7b628e96b4af046de8fd6f66f5de481f5353..a975322e9cef1b5a286f17e7368bccf8d67c2655
@@@ -117,7 -117,7 +117,15 @@@ GHOST_SystemX11
        m_net_fullscreen= XInternAtom(m_display,
                                        "_NET_WM_STATE_FULLSCREEN", False);
        m_motif= XInternAtom(m_display, "_MOTIF_WM_HINTS", False);
--
++      m_targets= XInternAtom(m_display, "TARGETS", False);
++      m_string= XInternAtom(m_display, "STRING", False);
++      m_compound_text= XInternAtom(m_display, "COMPOUND_TEXT", False);
++      m_text= XInternAtom(m_display, "TEXT", False);
++      m_clipboard= XInternAtom(m_display, "CLIPBOARD", False);
++      m_primary= XInternAtom(m_display, "PRIMARY", False);
++      m_xclip_out= XInternAtom(m_display, "XCLIP_OUT", False);
++      m_incr= XInternAtom(m_display, "INCR", False);
++      m_utf8_string= XInternAtom(m_display, "UTF8_STRING", False);
  
        // compute the initial time
        timeval tv;
@@@ -1004,144 -1004,144 +1012,298 @@@ convertXKey
  
  #undef GXMAP
  
--      GHOST_TUns8*
--GHOST_SystemX11::
--getClipboard(bool selection
--) const {
--      //Flag 
--      //0 = Regular clipboard 1 = selection
--      static Atom Primary_atom, clip_String, compound_text, a_text, a_string;
--      Atom rtype;
--      Window m_window, owner;
--      unsigned char *data, *tmp_data;
--      int bits, count;
--      unsigned long len, bytes;
--      XEvent xevent;
--      
++/* from xclip.c xcout() v0.11 */
++
++#define XCLIB_XCOUT_NONE              0 /* no context */
++#define XCLIB_XCOUT_SENTCONVSEL               1 /* sent a request */
++#define XCLIB_XCOUT_INCR              2 /* in an incr loop */
++#define XCLIB_XCOUT_FALLBACK          3 /* STRING failed, need fallback to UTF8 */
++#define XCLIB_XCOUT_FALLBACK_UTF8     4 /* UTF8 failed, move to compouned */
++#define XCLIB_XCOUT_FALLBACK_COMP     5 /* compouned failed, move to text. */
++#define XCLIB_XCOUT_FALLBACK_TEXT     6
++
++// Retrieves the contents of a selections.
++void GHOST_SystemX11::getClipboard_xcout(XEvent evt,
++      Atom sel, Atom target, unsigned char **txt,
++      unsigned long *len, unsigned int *context) const
++{
++      Atom pty_type;
++      int pty_format;
++      unsigned char *buffer;
++      unsigned long pty_size, pty_items;
++      unsigned char *ltxt= *txt;
++
        vector<GHOST_IWindow *> & win_vec = m_windowManager->getWindows();
        vector<GHOST_IWindow *>::iterator win_it = win_vec.begin();
        GHOST_WindowX11 * window = static_cast<GHOST_WindowX11 *>(*win_it);
--      m_window = window->getXWindow();
++      Window win = window->getXWindow();
++
++      switch (*context) {
++              // There is no context, do an XConvertSelection()
++              case XCLIB_XCOUT_NONE:
++                      // Initialise return length to 0
++                      if (*len > 0) {
++                              free(*txt);
++                              *len = 0;
++                      }
  
--      clip_String = XInternAtom(m_display, "_BLENDER_STRING", False);
--      compound_text = XInternAtom(m_display, "COMPOUND_TEXT", False);
--      a_text= XInternAtom(m_display, "TEXT", False);
--      a_string= XInternAtom(m_display, "STRING", False);
--
--      //lets check the owner and if it is us then return the static buffer
--      if(!selection) {
--              Primary_atom = XInternAtom(m_display, "CLIPBOARD", False);
--              owner = XGetSelectionOwner(m_display, Primary_atom);
--              if (owner == m_window) {
--                      data = (unsigned char*) malloc(strlen(txt_cut_buffer)+1);
--                      strcpy((char*)data, txt_cut_buffer);
--                      return (GHOST_TUns8*)data;
--              } else if (owner == None) {
--                      return NULL;
--              }
--      } else {
--              Primary_atom = XInternAtom(m_display, "PRIMARY", False);
--              owner = XGetSelectionOwner(m_display, Primary_atom);
--              if (owner == m_window) {
--                      data = (unsigned char*) malloc(strlen(txt_select_buffer)+1);
--                      strcpy((char*)data, txt_select_buffer);
--                      return (GHOST_TUns8*)data;
--              } else if (owner == None) {
--                      return NULL;
--              }
--      }
++                      // Send a selection request
++                      XConvertSelection(m_display, sel, target, m_xclip_out, win, CurrentTime);
++                      *context = XCLIB_XCOUT_SENTCONVSEL;
++                      return;
  
--      if(!Primary_atom) {
--              return NULL;
--      }
--      
--      XDeleteProperty(m_display, m_window, Primary_atom);
--      XConvertSelection(m_display, Primary_atom, compound_text, clip_String, m_window, CurrentTime); //XA_STRING
--      XFlush(m_display);
++              case XCLIB_XCOUT_SENTCONVSEL:
++                      if (evt.type != SelectionNotify)
++                              return;
  
--      //This needs to change so we do not wait for ever or check owner first
--      count= 1;
--      while(1) {
--              XNextEvent(m_display, &xevent);
--              if(xevent.type == SelectionNotify) {
--                      if (xevent.xselection.property == None) {
--                              /* Ok, the client can't convert the property
--                               * to some that we can handle, try other types..
--                               */
--                              if (count == 1) {
--                                      XConvertSelection(m_display, Primary_atom, a_text, clip_String, m_window, CurrentTime);
--                                      count++;
--                              }
--                              else if (count == 2) {
--                                      XConvertSelection(m_display, Primary_atom, a_string, clip_String, m_window, CurrentTime);
--                                      count++;
--                              }
--                              else {
--                                      /* Ok, the owner of the selection can't 
--                                       * convert the data to something that we can
--                                       * handle.
--                                       */
--                                      return(NULL);
--                              }
++                      if (target == m_utf8_string && evt.xselection.property == None) {
++                              *context= XCLIB_XCOUT_FALLBACK_UTF8;
++                              return;
++                      }
++                      else if (target == m_compound_text && evt.xselection.property == None) {
++                              *context= XCLIB_XCOUT_FALLBACK_COMP;
++                              return;
++                      }
++                      else if (target == m_text && evt.xselection.property == None) {
++                              *context= XCLIB_XCOUT_FALLBACK_TEXT;
++                              return;
++                      }
++
++                      // find the size and format of the data in property
++                      XGetWindowProperty(m_display, win, m_xclip_out, 0, 0, False,
++                              AnyPropertyType, &pty_type, &pty_format,
++                              &pty_items, &pty_size, &buffer);
++                      XFree(buffer);
++
++                      if (pty_type == m_incr) {
++                              // start INCR mechanism by deleting property
++                              XDeleteProperty(m_display, win, m_xclip_out);
++                              XFlush(m_display);
++                              *context = XCLIB_XCOUT_INCR;
++                              return;
++                      }
++
++                      // if it's not incr, and not format == 8, then there's
++                      // nothing in the selection (that xclip understands, anyway)
++
++                      if (pty_format != 8) {
++                              *context = XCLIB_XCOUT_NONE;
++                              return;
++                      }
++
++                      // not using INCR mechanism, just read the property
++                      XGetWindowProperty(m_display, win, m_xclip_out, 0, (long) pty_size,
++                                      False, AnyPropertyType, &pty_type,
++                                      &pty_format, &pty_items, &pty_size, &buffer);
++
++                      // finished with property, delete it
++                      XDeleteProperty(m_display, win, m_xclip_out);
++
++                      // copy the buffer to the pointer for returned data
++                      ltxt = (unsigned char *) malloc(pty_items);
++                      memcpy(ltxt, buffer, pty_items);
++
++                      // set the length of the returned data
++                      *len = pty_items;
++                      *txt = ltxt;
++
++                      // free the buffer
++                      XFree(buffer);
++
++                      *context = XCLIB_XCOUT_NONE;
++
++                      // complete contents of selection fetched, return 1
++                      return;
++
++              case XCLIB_XCOUT_INCR:
++                      // To use the INCR method, we basically delete the
++                      // property with the selection in it, wait for an
++                      // event indicating that the property has been created,
++                      // then read it, delete it, etc.
++
++                      // make sure that the event is relevant
++                      if (evt.type != PropertyNotify)
++                              return;
++
++                      // skip unless the property has a new value
++                      if (evt.xproperty.state != PropertyNewValue)
++                              return;
++
++                      // check size and format of the property
++                      XGetWindowProperty(m_display, win, m_xclip_out, 0, 0, False,
++                              AnyPropertyType, &pty_type, &pty_format,
++                              &pty_items, &pty_size, (unsigned char **) &buffer);
++
++                      if (pty_format != 8) {
++                              // property does not contain text, delete it
++                              // to tell the other X client that we have read 
++                              // it and to send the next property
++                              XFree(buffer);
++                              XDeleteProperty(m_display, win, m_xclip_out);
++                              return;
++                      }
++
++                      if (pty_size == 0) {
++                              // no more data, exit from loop
++                              XFree(buffer);
++                              XDeleteProperty(m_display, win, m_xclip_out);
++                              *context = XCLIB_XCOUT_NONE;
++
++                              // this means that an INCR transfer is now
++                              // complete, return 1
++                              return;
++                      }
++
++                      XFree(buffer);
++
++                      // if we have come this far, the propery contains
++                      // text, we know the size.
++                      XGetWindowProperty(m_display, win, m_xclip_out, 0, (long) pty_size,
++                              False, AnyPropertyType, &pty_type, &pty_format,
++                              &pty_items, &pty_size, (unsigned char **) &buffer);
++
++                      // allocate memory to accommodate data in *txt
++                      if (*len == 0) {
++                              *len = pty_items;
++                              ltxt = (unsigned char *) malloc(*len);
                        }
                        else {
--                              if(XGetWindowProperty(m_display, m_window, xevent.xselection.property , 0L, 4096L, False, AnyPropertyType, &rtype, &bits, &len, &bytes, &data) == Success) {
--                                      if (data) {
--                                              if (bits == 8 && (rtype == compound_text || rtype == a_text || rtype == a_string)) {
--                                                      tmp_data = (unsigned char*) malloc(strlen((char*)data)+1);
--                                                      strcpy((char*)tmp_data, (char*)data);
--                                              }
--                                              else
--                                                      tmp_data= NULL;
--
--                                              XFree(data);
--                                              return (GHOST_TUns8*)tmp_data;
--                                      }
--                              }
--                              return(NULL);
++                              *len += pty_items;
++                              ltxt = (unsigned char *) realloc(ltxt, *len);
                        }
--              }
++
++                      // add data to ltxt
++                      memcpy(&ltxt[*len - pty_items], buffer, pty_items);
++
++                      *txt = ltxt;
++                      XFree(buffer);
++
++                      // delete property to get the next item
++                      XDeleteProperty(m_display, win, m_xclip_out);
++                      XFlush(m_display);
++                      return;
        }
++      return;
  }
  
--      void
--GHOST_SystemX11::
--putClipboard(
--GHOST_TInt8 *buffer, bool selection) const
++GHOST_TUns8 *GHOST_SystemX11::getClipboard(bool selection) const
  {
--      static Atom Primary_atom;
--      Window m_window, owner;
--      
--      if(!buffer) {return;}
--      
--      if(!selection) {
--              Primary_atom = XInternAtom(m_display, "CLIPBOARD", False);
--              if(txt_cut_buffer) { free((void*)txt_cut_buffer); }
++      Atom sseln;
++      Atom target= m_string;
++      Window owner;
++
++      // from xclip.c doOut() v0.11
++      unsigned char *sel_buf;
++      unsigned long sel_len= 0;
++      XEvent evt;
++      unsigned int context= XCLIB_XCOUT_NONE;
++
++      if (selection == True)
++              sseln= m_primary;
++      else
++              sseln= m_clipboard;
++
++      vector<GHOST_IWindow *> & win_vec = m_windowManager->getWindows();
++      vector<GHOST_IWindow *>::iterator win_it = win_vec.begin();
++      GHOST_WindowX11 * window = static_cast<GHOST_WindowX11 *>(*win_it);
++      Window win = window->getXWindow();
++
++      /* check if we are the owner. */
++      owner= XGetSelectionOwner(m_display, sseln);
++      if (owner == win) {
++              if (sseln == m_clipboard) {
++                      sel_buf= (unsigned char *)malloc(strlen(txt_cut_buffer)+1);
++                      strcpy((char *)sel_buf, txt_cut_buffer);
++                      return((GHOST_TUns8*)sel_buf);
++              }
++              else {
++                      sel_buf= (unsigned char *)malloc(strlen(txt_select_buffer)+1);
++                      strcpy((char *)sel_buf, txt_select_buffer);
++                      return((GHOST_TUns8*)sel_buf);
++              }
++      }
++      else if (owner == None)
++              return(NULL);
++
++      while (1) {
++              /* only get an event if xcout() is doing something */
++              if (context != XCLIB_XCOUT_NONE)
++                      XNextEvent(m_display, &evt);
++
++              /* fetch the selection, or part of it */
++              getClipboard_xcout(evt, sseln, target, &sel_buf, &sel_len, &context);
++
++              /* fallback is needed. set XA_STRING to target and restart the loop. */
++              if (context == XCLIB_XCOUT_FALLBACK) {
++                      context= XCLIB_XCOUT_NONE;
++                      target= m_string;
++                      continue;
++              }
++              else if (context == XCLIB_XCOUT_FALLBACK_UTF8) {
++                      /* utf8 fail, move to compouned text. */
++                      context= XCLIB_XCOUT_NONE;
++                      target= m_compound_text;
++                      continue;
++              }
++              else if (context == XCLIB_XCOUT_FALLBACK_COMP) {
++                      /* compouned text faile, move to text. */
++                      context= XCLIB_XCOUT_NONE;
++                      target= m_text;
++                      continue;
++              }
++
++              /* only continue if xcout() is doing something */
++              if (context == XCLIB_XCOUT_NONE)
++                      break;
++      }
++
++      if (sel_len) {
++              /* only print the buffer out, and free it, if it's not
++               * empty
++               */
++              unsigned char *tmp_data = (unsigned char*) malloc(sel_len+1);
++              memcpy((char*)tmp_data, (char*)sel_buf, sel_len);
++              tmp_data[sel_len] = '\0';
                
--              txt_cut_buffer = (char*) malloc(strlen(buffer)+1);
--              strcpy(txt_cut_buffer, buffer);
--      } else {
--              Primary_atom = XInternAtom(m_display, "PRIMARY", False);
--              if(txt_select_buffer) { free((void*)txt_select_buffer); }
++              if (sseln == m_string)
++                      XFree(sel_buf);
++              else
++                      free(sel_buf);
                
--              txt_select_buffer = (char*) malloc(strlen(buffer)+1);
--              strcpy(txt_select_buffer, buffer);
++              return (GHOST_TUns8*)tmp_data;
        }
--      
--      vector<GHOST_IWindow *> & win_vec = m_windowManager->getWindows();
++      return(NULL);
++}
++
++void GHOST_SystemX11::putClipboard(GHOST_TInt8 *buffer, bool selection) const
++{
++      Window m_window, owner;
++
++      vector<GHOST_IWindow *> & win_vec = m_windowManager->getWindows();      
        vector<GHOST_IWindow *>::iterator win_it = win_vec.begin();
        GHOST_WindowX11 * window = static_cast<GHOST_WindowX11 *>(*win_it);
        m_window = window->getXWindow();
  
--      if(!Primary_atom) {
--              return;
--      }
--      
--      XSetSelectionOwner(m_display, Primary_atom, m_window, CurrentTime);
--      owner = XGetSelectionOwner(m_display, Primary_atom);
--      if (owner != m_window)
--              fprintf(stderr, "failed to own primary\n");
++      if (buffer) {
++              if (selection == False) {
++                      XSetSelectionOwner(m_display, m_clipboard, m_window, CurrentTime);
++                      owner= XGetSelectionOwner(m_display, m_clipboard);
++                      if (txt_cut_buffer)
++                              free((void*)txt_cut_buffer);
++
++                      txt_cut_buffer = (char*) malloc(strlen(buffer)+1);
++                      strcpy(txt_cut_buffer, buffer);
++              } else {
++                      XSetSelectionOwner(m_display, m_primary, m_window, CurrentTime);
++                      owner= XGetSelectionOwner(m_display, m_primary);
++                      if (txt_select_buffer)
++                              free((void*)txt_select_buffer);
++
++                      txt_select_buffer = (char*) malloc(strlen(buffer)+1);
++                      strcpy(txt_select_buffer, buffer);
++              }
        
--      return;
++              if (owner != m_window)
++                      fprintf(stderr, "failed to own primary\n");
++      }
  }
--
index 6eacd88b8c202a26f5691580ab9e8b00d1f4b4c7,6eacd88b8c202a26f5691580ab9e8b00d1f4b4c7..711a188ffe94e8f665837d75602317ba0df62096
@@@ -199,20 -199,20 +199,25 @@@ public
        prepareNdofInfo(
                volatile GHOST_TEventNDOFData *current_values
        );
--              
++
++      /* Helped function for get data from the clipboard. */
++      void getClipboard_xcout(XEvent evt, Atom sel, Atom target,
++                       unsigned char **txt, unsigned long *len,
++                       unsigned int *context) const;
++
        /**
         * Returns unsinged char from CUT_BUFFER0
         * @param selection             Get selection, X11 only feature
         * @return                              Returns the Clipboard indicated by Flag
         */
--      GHOST_TUns8getClipboard(bool selection) const;
++      GHOST_TUns8 *getClipboard(bool selection) const;
        
        /**
         * Puts buffer to system clipboard
         * @param buffer        The buffer to copy to the clipboard     
         * @param selection     Set the selection into the clipboard, X11 only feature
         */
--      virtual void putClipboard(GHOST_TInt8 *buffer, bool selection) const;
++      void putClipboard(GHOST_TInt8 *buffer, bool selection) const;
  
        /**
         * Atom used for ICCCM, WM-spec and Motif.
        Atom m_wm_protocols;
        Atom m_delete_window_atom;
  
++      /* Atoms for Selection, copy & paste. */
++      Atom m_targets;
++      Atom m_string;
++      Atom m_compound_text;
++      Atom m_text;
++      Atom m_clipboard;
++      Atom m_primary;
++      Atom m_xclip_out;
++      Atom m_incr;
++      Atom m_utf8_string;
++
  private :
  
        Display * m_display;
index a7deb22555ef4823ed862c0b805af20ca6450103,a7deb22555ef4823ed862c0b805af20ca6450103..7f3cac8df2a69610a57bbbbdb2b810ed739ab83a
@@@ -44,7 -44,7 +44,7 @@@
                                Name="VCCLCompilerTool"\r
                                InlineFunctionExpansion="1"\r
                                AdditionalIncludeDirectories="..\..\..\..\lib\windows\QTDevWin\CIncludes;..\..\..\..\lib\windows\sdl\include;..\..\..\..\lib\windows\python\include\python2.5;..\..\..\..\build\msvc_9\intern\bsp\include;..\..\..\..\build\msvc_9\intern\ghost\include;..\..\..\..\build\msvc_9\intern\elbeem\include;..\..\..\..\build\msvc_9\intern\opennl\include;..\..\..\..\build\msvc_9\intern\bmfont\include;..\..\..\..\build\msvc_9\intern\blenkey\include;..\..\..\..\build\msvc_9\intern\decimation\include;..\..\..\..\build\msvc_9\intern\memutil\include;..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\build\msvc_9\intern\soundsystem\include;..\..\..\source\blender;..\..\..\source\blender\img;..\..\..\source\blender\verify;..\..\..\source\blender\ftfont;..\..\..\source\blender\misc;..\..\..\source\blender\imbuf;..\..\..\source\blender\blenlib;..\..\..\source\blender\python;..\..\..\source\blender\editors\include;..\..\..\source\blender\renderui;..\..\..\source\blender\blenloader;..\..\..\source\blender\quicktime;..\..\..\source\blender\blenkernel;..\..\..\source\blender\blenfont;..\..\..\source\blender\makesdna;..\..\..\source\blender\makesrna;..\..\..\source\blender\nodes;..\..\..\source\blender\windowmanager;..\..\..\source\blender\blenpluginapi;..\..\..\source\blender\renderconverter;..\..\..\source\blender\readstreamglue;..\..\..\source\blender\render\extern\include;..\..\..\source\blender\radiosity\extern\include;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\network;..\..\..\source\gameengine\soundsystem\snd_openal;..\..\..\..\build\msvc_9\extern\verse\include;..\..\..\..\lib\windows\pthreads\include;..\..\..\..\lib\windows\ffmpeg\include;..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\source\blender\gpu"\r
--                              PreprocessorDefinitions="NDEBUG;WIN32;_LIB;_CONSOLE;GAMEBLENDER=1;WITH_QUICKTIME;INTERNATIONAL;WITH_OPENEXR;WITH_DDS;WITH_BULLET=1;WITH_FFMPEG"\r
++                              PreprocessorDefinitions="NDEBUG;WIN32;_LIB;_CONSOLE;GAMEBLENDER=1;WITH_QUICKTIME;INTERNATIONAL;WITH_FREETYPE2;WITH_INTERNATIONAL;WITH_OPENEXR;WITH_DDS;WITH_BULLET=1;WITH_FFMPEG"\r
                                StringPooling="true"\r
                                RuntimeLibrary="0"\r
                                EnableFunctionLevelLinking="true"\r
                                Name="VCCLCompilerTool"\r
                                Optimization="0"\r
                                AdditionalIncludeDirectories="..\..\..\..\lib\windows\QTDevWin\CIncludes;..\..\..\..\lib\windows\sdl\include;..\..\..\..\lib\windows\python\include\python2.5;..\..\..\..\build\msvc_9\intern\bsp\include;..\..\..\..\build\msvc_9\intern\ghost\include;..\..\..\..\build\msvc_9\intern\elbeem\include;..\..\..\..\build\msvc_9\intern\opennl\include;..\..\..\..\build\msvc_9\intern\bmfont\include;..\..\..\..\build\msvc_9\intern\blenkey\include;..\..\..\..\build\msvc_9\intern\decimation\include;..\..\..\..\build\msvc_9\intern\memutil\include;..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\build\msvc_9\intern\soundsystem\include;..\..\..\source\blender;..\..\..\source\blender\img;..\..\..\source\blender\verify;..\..\..\source\blender\ftfont;..\..\..\source\blender\misc;..\..\..\source\blender\imbuf;..\..\..\source\blender\blenlib;..\..\..\source\blender\python;..\..\..\source\blender\editors\include;..\..\..\source\blender\renderui;..\..\..\source\blender\blenloader;..\..\..\source\blender\quicktime;..\..\..\source\blender\blenkernel;..\..\..\source\blender\blenfont;..\..\..\source\blender\makesdna;..\..\..\source\blender\makesrna;..\..\..\source\blender\nodes;..\..\..\source\blender\windowmanager;..\..\..\source\blender\blenpluginapi;..\..\..\source\blender\renderconverter;..\..\..\source\blender\readstreamglue;..\..\..\source\blender\render\extern\include;..\..\..\source\blender\radiosity\extern\include;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\network;..\..\..\source\gameengine\soundsystem\snd_openal;..\..\..\..\build\msvc_9\extern\verse\include;..\..\..\..\lib\windows\pthreads\include;..\..\..\..\lib\windows\ffmpeg\include;..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\source\blender\gpu"\r
--                              PreprocessorDefinitions="_DEBUG;WIN32;_LIB;_CONSOLE;GAMEBLENDER;WITH_QUICKTIME;INTERNATIONAL;WITH_OPENEXR;WITH_DDS;WITH_BULLET = 1;WITH_FFMPEG"\r
++                              PreprocessorDefinitions="_DEBUG;WIN32;_LIB;_CONSOLE;GAMEBLENDER;WITH_QUICKTIME;INTERNATIONAL;WITH_BF_INTERNATIONAL;WITH_FREETYPE2;WITH_OPENEXR;WITH_DDS;WITH_BULLET = 1;WITH_FFMPEG"\r
                                BasicRuntimeChecks="3"\r
                                RuntimeLibrary="1"\r
                                DefaultCharIsUnsigned="true"\r
index 219dacd887064ffe61413ae716dd03c061f20a97,219dacd887064ffe61413ae716dd03c061f20a97..460067112d3dff5333fc444445ee5e7900c8820b
Binary files differ
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..2982ad52a6d0a8353ba67e59f7fb249a3cd12e4b
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,121 @@@
++import bpy
++ 
++class DataButtonsPanel(bpy.types.Panel):
++      __space_type__ = "BUTTONS_WINDOW"
++      __region_type__ = "WINDOW"
++      __context__ = "data"
++      
++      def poll(self, context):
++              ob = context.active_object
++              return (ob and ob.type == 'ARMATURE')
++
++class DATA_PT_skeleton(DataButtonsPanel):
++      __idname__ = "DATA_PT_skeleton"
++      __label__ = "Skeleton"
++
++      def draw(self, context):
++              arm = context.active_object.data
++              layout = self.layout
++              
++              row = layout.row()
++              row.itemR(arm, "rest_position")
++
++              split = layout.split()
++
++              sub = split.column()
++
++              sub.itemL(text="Deform:")
++              sub.itemR(arm, "deform_vertexgroups", text="Vertes Groups")
++              sub.itemR(arm, "deform_envelope", text="Envelopes")
++              sub.itemR(arm, "deform_quaternion", text="Quaternion")
++              sub.itemR(arm, "deform_bbone_rest", text="B-Bones Rest")
++              #sub.itemR(arm, "x_axis_mirror")
++              #sub.itemR(arm, "auto_ik")
++              
++              sub = split.column()
++              sub.itemL(text="Layers:")
++              sub.itemL(text="LAYERS")
++              #sub.itemR(arm, "layer")
++              #sub.itemR(arm, "layer_protection")
++
++
++class DATA_PT_display(DataButtonsPanel):
++      __idname__ = "DATA_PT_display"
++      __label__ = "Display"
++      
++      def draw(self, context):
++              arm = context.active_object.data
++              layout = self.layout
++
++              split = layout.split()
++
++              sub = split.column()
++              sub.itemR(arm, "drawtype", text="Style")
++              sub.itemR(arm, "delay_deform", text="Delay Refresh")
++
++              sub = split.column()
++              sub.itemR(arm, "draw_names", text="Names")
++              sub.itemR(arm, "draw_axes", text="Axes")
++              sub.itemR(arm, "draw_custom_bone_shapes", text="Shapes")
++              sub.itemR(arm, "draw_group_colors", text="Colors")
++
++
++class DATA_PT_paths(DataButtonsPanel):
++      __idname__ = "DATA_PT_paths"
++      __label__ = "Paths"
++
++      def draw(self, context):
++              arm = context.active_object.data
++              layout = self.layout
++
++              split = layout.split()
++              
++              sub = split.column()
++
++              sub.itemR(arm, "paths_show_around_current_frame", text="Around Frame")
++              if (arm.paths_show_around_current_frame):
++                              sub.itemR(arm, "path_before_current", text="Before")
++                              sub.itemR(arm, "path_after_current", text="After")
++              else:
++                      sub.itemR(arm, "path_start_frame", text="Start")
++                      sub.itemR(arm, "path_end_frame", text="End")
++
++              sub.itemR(arm, "path_size", text="Step")        
++              sub.itemR(arm, "paths_calculate_head_positions", text="Head")
++              
++              sub = split.column()
++              sub.itemL(text="Show:")
++              sub.itemR(arm, "paths_show_frame_numbers", text="Frame Numbers")
++              sub.itemR(arm, "paths_highlight_keyframes", text="Keyframes")
++              sub.itemR(arm, "paths_show_keyframe_numbers", text="Keyframe Numbers")
++
++              
++class DATA_PT_ghost(DataButtonsPanel):
++      __idname__ = "DATA_PT_ghost"
++      __label__ = "Ghost"
++
++      def draw(self, context):
++              arm = context.active_object.data
++              layout = self.layout
++
++              split = layout.split()
++
++              sub = split.column()
++
++              sub.itemR(arm, "ghost_type", text="Scope")
++              if arm.ghost_type == 'RANGE':
++                      sub.itemR(arm, "ghost_start_frame", text="Start")
++                      sub.itemR(arm, "ghost_end_frame", text="End")
++                      sub.itemR(arm, "ghost_size", text="Step")
++              elif arm.ghost_type == 'CURRENT_FRAME':
++                      sub.itemR(arm, "ghost_step", text="Range")
++                      sub.itemR(arm, "ghost_size", text="Step")
++
++              sub = split.column()
++
++              sub.itemR(arm, "ghost_only_selected", text="Selected Only")
++
++bpy.types.register(DATA_PT_skeleton)
++bpy.types.register(DATA_PT_display)
++bpy.types.register(DATA_PT_paths)
++bpy.types.register(DATA_PT_ghost)
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..6982b9beecbb5f02c031068c907b44795a89cc10
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,67 @@@
++
++import bpy
++ 
++class DataButtonsPanel(bpy.types.Panel):
++      __space_type__ = "BUTTONS_WINDOW"
++      __region_type__ = "WINDOW"
++      __context__ = "bone"
++      
++      def poll(self, context):
++              ob = context.active_object
++              return (ob and ob.type == 'ARMATURE')
++
++class DATA_PT_bone(DataButtonsPanel):
++      __idname__ = "DATA_PT_bone"
++      __label__ = "Bone"
++
++      def draw(self, context):
++              bone = context.main.armatures[0].bones[0]
++              layout = self.layout
++
++              split = layout.split()
++
++              sub = split.column()
++              sub.itemR(bone, "name")
++              sub.itemR(bone, "parent")
++              sub.itemR(bone, "connected")
++              sub.itemR(bone, "deform")
++
++                              
++              sub.itemL(text="Inherit:")
++              sub.itemR(bone, "hinge")
++              sub.itemR(bone, "inherit_scale")
++
++              sub.itemL(text="Envelope:")
++              sub.itemR(bone, "envelope_distance", text="Distance")
++              sub.itemR(bone, "envelope_weight", text="Weight")
++              sub.itemR(bone, "multiply_vertexgroup_with_envelope", text="Multiply")
++
++              sub = split.column()
++              #sub.itemR(bone, "layer")
++              sub.itemL(text="Display:")
++              sub.itemR(bone, "draw_wire", text="Wireframe")
++              sub.itemR(bone, "editmode_hidden", text="Hide (EditMode)")
++              sub.itemR(bone, "pose_channel_hidden", text="Hide (PoseMode)")
++
++              sub.itemL(text="Curved Bones:")
++              sub.itemR(bone, "bbone_segments", text="Segments")
++              sub.itemR(bone, "bbone_in", text="Ease In")
++              sub.itemR(bone, "bbone_out", text="Ease Out")
++              
++              
++              sub.itemR(bone, "cyclic_offset")
++
++
++class DATA_PT_constraints(DataButtonsPanel):
++      __idname__ = "DATA_PT_constraints"
++      __label__ = "Constraints"
++      
++      def draw(self, context):
++              bone = context.main.armatures[0].bones[0]
++              layout = self.layout
++              split = layout.split()
++              
++              sub = split.column()
++
++bpy.types.register(DATA_PT_bone)
++bpy.types.register(DATA_PT_constraints)
index 0f852216a87690e6331df23b809a4c39a20d4f4d,0f852216a87690e6331df23b809a4c39a20d4f4d..b41293758eaba6c787fc5be1e4219c541d0fd3f5
@@@ -15,64 -15,64 +15,64 @@@ class DATA_PT_cameralens(DataButtonsPan
        __label__ = "Lens"
  
        def draw(self, context):
--              cam = context.main.cameras[0]
++              cam = context.active_object.data
                layout = self.layout
  
                if not cam:
                        return
                
--              layout.row()
                layout.itemR(cam, "type", expand=True)
                
--              layout.row()
--              if (cam.type == 'PERSP'):
--                      layout.itemR(cam, "lens_unit")
--                      if (cam.lens_unit == 'MILLIMETERS'):
--                              layout.itemR(cam, "lens", text="Angle")
--                      if (cam.lens_unit == 'DEGREES'):
--                              layout.itemR(cam, "angle")
--              if (cam.type == 'ORTHO'):
--                      layout.itemR(cam, "ortho_scale")
++              row = layout.row(align=True)
++              if cam.type == 'PERSP':
++                      if cam.lens_unit == 'MILLIMETERS':
++                              row.itemR(cam, "lens", text="Angle")
++                      elif cam.lens_unit == 'DEGREES':
++                              row.itemR(cam, "angle")
++
++                      row.itemR(cam, "lens_unit", text="")
++              elif cam.type == 'ORTHO':
++                      row.itemR(cam, "ortho_scale")
++                      
++              split = layout.split()
++              
++              sub = split.column(align=True)
++              sub.itemL(text="Shift:")
++              sub.itemR(cam, "shift_x", text="X")
++              sub.itemR(cam, "shift_y", text="Y")
                
--              layout.column_flow()
--              layout.itemL(text="Shift:")
--              layout.itemR(cam, "shift_x", text="X")
--              layout.itemR(cam, "shift_y", text="Y")
--              layout.itemL(text="Clipping:")
--              layout.itemR(cam, "clip_start", text="Start")
--              layout.itemR(cam, "clip_end", text="End")
++              sub = split.column(align=True)
++              sub.itemL(text="Clipping:")
++              sub.itemR(cam, "clip_start", text="Start")
++              sub.itemR(cam, "clip_end", text="End")
                
--              layout.row()
--              layout.itemR(cam, "dof_object")
--              layout.itemR(cam, "dof_distance")
++              row = layout.row()
++              row.itemR(cam, "dof_object")
++              row.itemR(cam, "dof_distance")
                
  class DATA_PT_cameradisplay(DataButtonsPanel):
        __idname__ = "DATA_PT_cameradisplay"
        __label__ = "Display"
        
        def draw(self, context):
--              cam = context.main.cameras[0]
++              cam = context.active_object.data
                layout = self.layout
  
                if not cam:
                        return
                        
--              layout.split(number=2)
++              split = layout.split()
                
--              sub = layout.sub(0)
--              sub.column()
++              sub = split.column()
                sub.itemR(cam, "show_limits", text="Limits")
                sub.itemR(cam, "show_mist", text="Mist")
                sub.itemR(cam, "show_title_safe", text="Title Safe")
                sub.itemR(cam, "show_name", text="Name")
--              
--              sub = layout.sub(1)
--              subsub = sub.box()
--              subsub.column()
--              subsub.itemR(cam, "show_passepartout", text="Passepartout")
++                      
++              sub = split.column()
++              sub.itemR(cam, "show_passepartout", text="Passepartout")
                if (cam.show_passepartout):
--                      subsub.itemR(cam, "passepartout_alpha", text="Alpha")
--              sub.row()
++                      sub.itemR(cam, "passepartout_alpha", text="Alpha", slider=True)
                sub.itemR(cam, "draw_size", text="Size")
                
  bpy.types.register(DATA_PT_cameralens)
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..a51ce50b047eee5962337b0f18f3a20ed70f7868
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,147 @@@
++
++import bpy
++
++class DataButtonsPanel(bpy.types.Panel):
++      __space_type__ = "BUTTONS_WINDOW"
++      __region_type__ = "WINDOW"
++      __context__ = "data"
++      
++      def poll(self, context):
++              ob = context.active_object
++              return (ob and ob.type == 'CURVE')
++      
++
++class DATA_PT_shape_curve(DataButtonsPanel):
++              __idname__ = "DATA_PT_shape_curve"
++              __label__ = "Shape"
++
++              def draw(self, context):
++                      curve = context.main.curves[0]
++                      layout = self.layout
++
++                      if not curve:
++                              return
++                      row = layout.row()
++                      row.itemR(curve, "curve_2d")                    
++                                                      
++                      split = layout.split()
++              
++                      sub = split.column()
++                      sub.itemL(text="Caps:")
++                      sub.itemR(curve, "front")
++                      sub.itemR(curve, "back")
++                      
++                      sub.itemL(text="Textures:")
++                      sub.itemR(curve, "uv_orco")
++                      sub.itemR(curve, "auto_texspace")
++                      
++                      sub = split.column()    
++                      sub.itemL(text="Resolution:")
++                      sub.itemR(curve, "resolution_u", text="Preview U")
++                      sub.itemR(curve, "resolution_v", text="Preview V")
++                      sub.itemR(curve, "render_resolution_u", text="Render U")
++                      sub.itemR(curve, "render_resolution_v", text="Render V")
++
++                      sub.itemL(text="Display:")
++                      sub.itemL(text="HANDLES")
++                      sub.itemL(text="NORMALS")
++                      sub.itemR(curve, "vertex_normal_flip")
++
++
++class DATA_PT_geometry(DataButtonsPanel):
++              __idname__ = "DATA_PT_geometry"
++              __label__ = "Geometry"
++
++              def draw(self, context):
++                      curve = context.main.curves[0]
++                      layout = self.layout
++
++                      if not curve:
++                              return
++                              
++                              
++                      split = layout.split()
++              
++                      sub = split.column()
++                      sub.itemL(text="Modification:")
++                      sub.itemR(curve, "width")
++                      sub.itemR(curve, "extrude")
++                      sub.itemR(curve, "taper_object")
++                      sub = split.column()
++                      sub.itemL(text="Bevel:")
++                      sub.itemR(curve, "bevel_depth", text="Depth")
++                      sub.itemR(curve, "bevel_resolution", text="Resolution")
++                      sub.itemR(curve, "bevel_object")
++
++
++
++      
++class DATA_PT_pathanim(DataButtonsPanel):
++              __idname__ = "DATA_PT_pathanim"
++              __label__ = "Path Animation"
++
++              def draw(self, context):
++                      curve = context.main.curves[0]
++                      layout = self.layout
++
++                      if not curve:
++                              return
++                              
++                              
++                      split = layout.split()          
++                      sub = split.column(1)
++                      sub.itemR(curve, "path", text="Enable")
++
++                      
++                      split = layout.split()          
++                      sub = split.column()
++                      sub.itemR(curve, "path_length", text="Frames")
++                      sub.itemR(curve, "follow")
++
++                      sub = split.column()
++                      sub.itemR(curve, "stretch")
++                      sub.itemR(curve, "offset_path_distance", text="Offset Children")
++
++                      
++class DATA_PT_current_curve(DataButtonsPanel):
++              __idname__ = "DATA_PT_current_curve"
++              __label__ = "Current Curve"
++
++              def draw(self, context):
++                      currentcurve = context.main.curves[0].curves[0]
++                      layout = self.layout
++
++                      if not currentcurve:
++                              return
++                              
++                      split = layout.split()
++              
++                      sub = split.column()
++                      sub.itemL(text="Cyclic:")
++                      sub.itemR(currentcurve, "cyclic_u", text="U")
++                      sub.itemR(currentcurve, "cyclic_v", text="V")
++                      sub.itemL(text="Order:")
++                      sub.itemR(currentcurve, "order_u", text="U")
++                      sub.itemR(currentcurve, "order_v", text="V")
++                      sub.itemL(text="Point Count:")                  
++                      sub.itemR(currentcurve, "point_count_u", text="U")
++                      sub.itemR(currentcurve, "point_count_v", text="V")
++                      sub.itemL(text="Endpoints:")
++                      sub.itemR(currentcurve, "endpoint_u", text="U")
++                      sub.itemR(currentcurve, "endpoint_v", text="V")
++                      sub = split.column()
++                      sub.itemL(text="Bezier:")
++                      sub.itemR(currentcurve, "bezier_u", text="U")
++                      sub.itemR(currentcurve, "bezier_v", text="V")
++                      sub.itemL(text="Resolution:")
++                      sub.itemR(currentcurve, "resolution_u", text="U")
++                      sub.itemR(currentcurve, "resolution_v", text="V")
++                      sub.itemL(text="Interpolation:")
++                      sub.itemR(currentcurve, "tilt_interpolation", text="Tilt")
++                      sub.itemR(currentcurve, "radius_interpolation", text="Tilt")
++                      sub.itemR(currentcurve, "smooth")
++                      
++bpy.types.register(DATA_PT_shape_curve)
++bpy.types.register(DATA_PT_geometry)
++bpy.types.register(DATA_PT_pathanim)
++bpy.types.register(DATA_PT_current_curve)
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..5fe1e943f1f790714a66f5d980b4ae5e218c721e
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,27 @@@
++
++import bpy
++
++class DataButtonsPanel(bpy.types.Panel):
++      __space_type__ = "BUTTONS_WINDOW"
++      __region_type__ = "WINDOW"
++      __context__ = "data"
++      
++      def poll(self, context):
++              ob = context.active_object
++              return (ob and ob.type == 'EMPTY')
++      
++class DATA_PT_empty(DataButtonsPanel):
++      __idname__ = "DATA_PT_empty"
++      __label__ = "Empty"
++
++      def draw(self, context):
++              ob = context.active_object
++              layout = self.layout
++
++              if not ob:
++                      return
++                      
++              layout.itemR(ob, "empty_draw_type")
++              layout.itemR(ob, "empty_draw_size")
++              
++bpy.types.register(DATA_PT_empty)
index f71e0f8868f2e6d6a0518bf2db28eebf10f33d4e,f71e0f8868f2e6d6a0518bf2db28eebf10f33d4e..e23215da9316131ee9108da8dfe05dbca06a7c4e
@@@ -15,26 -15,26 +15,29 @@@ class DATA_PT_lamp(DataButtonsPanel)
        __label__ = "Lamp"
  
        def draw(self, context):
--              lamp = context.main.lamps[0]
++              lamp = context.active_object.data
                layout = self.layout
  
                if not lamp:
                        return
                
--              layout.row()
--              layout.itemR(lamp, "type", expand=True)
++              row = layout.row()
++              row.itemR(lamp, "type", expand=True)
                
--              layout.split(number=2)
++              split = layout.split()
                
--              sub = layout.sub(0)
--              sub.column()
--              sub.itemL(text="LAMP DATABLOCKS")
++              sub = split.column()
++              sub.itemR(lamp, "color")
                sub.itemR(lamp, "energy")
                sub.itemR(lamp, "distance")
++              sub.itemR(lamp, "negative")
        
--              sub = layout.sub(1)
--              if (lamp.type in ('LOCAL', 'SPOT')):
--                      sub.column()
++              sub = split.column()
++              sub.itemR(lamp, "layer", text="This Layer Only")
++              sub.itemR(lamp, "specular")
++              sub.itemR(lamp, "diffuse")
++              
++              if lamp.type in ('POINT', 'SPOT'):
                        sub.itemR(lamp, "falloff_type")
                        sub.itemR(lamp, "sphere")
                        
@@@ -42,7 -42,7 +45,7 @@@
                                sub.itemR(lamp, "linear_attenuation")
                                sub.itemR(lamp, "quadratic_attenuation")
                        
--              if (lamp.type == 'AREA'):
++              if lamp.type == 'AREA':
                        sub.column()
                        sub.itemR(lamp, "gamma")
                        sub.itemR(lamp, "shape")
                        if (lamp.shape == 'RECTANGLE'):
                                sub.itemR(lamp, "size", text="Size X")
                                sub.itemR(lamp, "size_y")
--              
--              layout.split(number=2)  
--              
--              sub = layout.sub(0)
--              sub.column()
--              sub.itemL(text="Illumination:")
--              sub.itemR(lamp, "layer")
--              sub.itemR(lamp, "negative")
--              sub.itemR(lamp, "specular")
--              sub.itemR(lamp, "diffuse")
--              
--              sub = layout.sub(1)
--              sub.column()
--              sub.itemR(lamp, "color")
                                
  class DATA_PT_sunsky(DataButtonsPanel):
        __idname__ = "DATA_PT_sunsky"
        
        def poll(self, context):
                ob = context.active_object
--              lamp = context.main.lamps[0]
--              return (ob.type == 'LAMP' and lamp.type == 'SUN')
++              return (ob.type == 'LAMP' and ob.data.type == 'SUN')
  
        def draw(self, context):
--              lamp = context.main.lamps[0].sky
++              lamp = context.active_object.data
                layout = self.layout
  
                if not lamp:
                        return
                
--              layout.row()
--              layout.itemR(lamp, "sky")
--              layout.itemR(lamp, "atmosphere")
++              row = layout.row()
++              row.itemR(lamp, "sky")
++              row.itemR(lamp, "atmosphere")
                
--              if (lamp.sky or lamp.atmosphere):
--                      layout.row()
++              if lamp.sky or lamp.atmosphere:
                        layout.itemR(lamp, "atmosphere_turbidity", text="Turbidity")
                        
--                      layout.split(number=2)
++                      split = layout.split()
                        
--                      if (lamp.sky):
--                              sub = layout.sub(0)
--                              sub.column()
++                      col = split.column()
++                      if lamp.sky:
++                              sub = col.column()
++                              sub.itemR(lamp, "sky_blend_type", text="Blend Type")
++                              sub.itemR(lamp, "sky_blend")
++                              sub.itemR(lamp, "sky_color_space", text="Color Space")
++                              sub.itemR(lamp, "sky_exposure")
++                              sub = col.column()
                                sub.itemR(lamp, "horizon_brightness", text="Hor Bright")
                                sub.itemR(lamp, "spread", text="Hor Spread")
                                sub.itemR(lamp, "sun_brightness", text="Sun Bright")
                                sub.itemR(lamp, "sun_size")
                                sub.itemR(lamp, "backscattered_light", text="Back Light")
--                              sub.column()
--                              sub.itemR(lamp, "sky_blend_type", text="Blend Type")
--                              sub.itemR(lamp, "sky_blend")
--                              sub.itemR(lamp, "sky_color_space", text="Color Space")
--                              sub.itemR(lamp, "sky_exposure")
--                      
--                      if (lamp.atmosphere):
--                              sub = layout.sub(1)
--                              sub.column()
++                              
++                      sub = split.column()
++                      if lamp.atmosphere:
                                sub.itemR(lamp, "sun_intensity", text="Sun Intens")
                                sub.itemR(lamp, "atmosphere_inscattering", text="Inscattering")
                                sub.itemR(lamp, "atmosphere_extinction", text="Extinction")
@@@ -120,116 -120,116 +106,110 @@@ class DATA_PT_shadow(DataButtonsPanel)
        
        def poll(self, context):
                ob = context.active_object
--              lamp = context.main.lamps[0]
--              return (ob.type == 'LAMP' and lamp.type in ('LOCAL','SUN', 'SPOT', 'AREA'))
++              return (ob.type == 'LAMP' and ob.data.type in ('POINT','SUN', 'SPOT', 'AREA'))
  
        def draw(self, context):
--              lamp = context.main.lamps[0]
++              lamp = context.active_object.data
                layout = self.layout
  
                if not lamp:
                        return
                
--              layout.row()
                layout.itemR(lamp, "shadow_method", expand=True)
                
--              if (lamp.shadow_method == 'RAY_SHADOW'):
++              if lamp.shadow_method in ('BUFFER_SHADOW', 'RAY_SHADOW'):
++              
++                      split = layout.split()
++                      
++                      sub = split.column()
++                      sub.itemR(lamp, "shadow_color")
++                      
++                      sub = split.column()
++                      sub.itemR(lamp, "shadow_layer", text="This Layer Only")
++                      sub.itemR(lamp, "only_shadow")
                
--                      layout.column()
--                      layout.itemL(text="Sampling:")
--                      layout.itemR(lamp, "shadow_ray_sampling_method", expand=True)
++              if lamp.shadow_method == 'RAY_SHADOW':
++              
++                      col = layout.column()
++                      col.itemL(text="Sampling:")
++                      col.row().itemR(lamp, "shadow_ray_sampling_method", expand=True)
                                
--                      if (lamp.type in ('LOCAL', 'SUN', 'SPOT') and lamp.shadow_ray_sampling_method in ('CONSTANT_QMC', 'ADAPTIVE_QMC')):
--                              layout.column_flow()
--                              layout.itemR(lamp, "shadow_soft_size", text="Soft Size")
--                              layout.itemR(lamp, "shadow_ray_samples", text="Samples")
--                              if (lamp.shadow_ray_sampling_method == 'ADAPTIVE_QMC'):
--                                      layout.itemR(lamp, "shadow_adaptive_threshold", text="Threshold")
++                      if lamp.type in ('POINT', 'SUN', 'SPOT'):
++                              flow = layout.column_flow()
++                              flow.itemR(lamp, "shadow_soft_size", text="Soft Size")
++                              flow.itemR(lamp, "shadow_ray_samples", text="Samples")
++                              if lamp.shadow_ray_sampling_method == 'ADAPTIVE_QMC':
++                                      flow.itemR(lamp, "shadow_adaptive_threshold", text="Threshold")
                                                
--                      if (lamp.type == 'AREA'):
--                              layout.column_flow()
--                              layout.itemR(lamp, "shadow_ray_samples_x", text="Samples")
--                              if (lamp.shadow_ray_sampling_method == 'ADAPTIVE_QMC'):
--                                      layout.itemR(lamp, "shadow_adaptive_threshold", text="Threshold")
--                              if (lamp.shadow_ray_sampling_method == 'CONSTANT_JITTERED'):
--                                      layout.itemR(lamp, "umbra")
--                                      layout.itemR(lamp, "dither")
--                                      layout.itemR(lamp, "jitter")    
--              
--              if (lamp.shadow_method == 'BUFFER_SHADOW'):
--                      layout.row()
--                      layout.itemR(lamp, "shadow_buffer_type")
++                      if lamp.type == 'AREA':
++                              flow = layout.column_flow()
++                              flow.itemR(lamp, "shadow_ray_samples_x", text="Samples")
++                              if lamp.shadow_ray_sampling_method == 'ADAPTIVE_QMC':
++                                      flow.itemR(lamp, "shadow_adaptive_threshold", text="Threshold")
++                              if lamp.shadow_ray_sampling_method == 'CONSTANT_JITTERED':
++                                      flow.itemR(lamp, "umbra")
++                                      flow.itemR(lamp, "dither")
++                                      flow.itemR(lamp, "jitter")      
++      
++              if lamp.shadow_method == 'BUFFER_SHADOW':
++                      col = layout.column()
++                      col.itemL(text="Buffer Type:")
++                      col.row().itemR(lamp, "shadow_buffer_type", expand=True)
  
--                      if (lamp.shadow_buffer_type in ('REGULAR', 'HALFWAY')):
--                              layout.column_flow()
--                              layout.itemL(text="Sample Buffers:")
--                              layout.itemR(lamp, "shadow_sample_buffers", text="")
--                              layout.itemL(text="Filter Type:")
--                              layout.itemR(lamp, "shadow_filter_type", text="")
--                              layout.column_flow()
--                              layout.itemR(lamp, "shadow_buffer_size", text="Size")
--                              layout.itemR(lamp, "shadow_buffer_samples", text="Samples")
--                              layout.itemR(lamp, "shadow_buffer_bias", text="Bias")
--                              layout.itemR(lamp, "shadow_buffer_soft", text="Soft")
++                      if lamp.shadow_buffer_type in ('REGULAR', 'HALFWAY'):
++                              flow = layout.column_flow()
++                              flow.itemL(text="Sample Buffers:")
++                              flow.itemR(lamp, "shadow_sample_buffers", text="")
++                              flow.itemL(text="Filter Type:")
++                              flow.itemR(lamp, "shadow_filter_type", text="")
                                
--                      if (lamp.shadow_buffer_type == 'IRREGULAR'):
--                              layout.row()
--                              layout.itemR(lamp, "shadow_buffer_bias", text="Bias")
++                              flow = layout.column_flow()
++                              flow.itemR(lamp, "shadow_buffer_size", text="Size")
++                              flow.itemR(lamp, "shadow_buffer_samples", text="Samples")
++                              flow.itemR(lamp, "shadow_buffer_bias", text="Bias")
++                              flow.itemR(lamp, "shadow_buffer_soft", text="Soft")
                                
--                      layout.row()
--                      layout.itemR(lamp, "auto_clip_start", text="Autoclip Start")
++                      if (lamp.shadow_buffer_type == 'IRREGULAR'):
++                              row = layout.row()
++                              row.itemR(lamp, "shadow_buffer_bias", text="Bias")
++                      
++                      row = layout.row()
++                      row.itemR(lamp, "auto_clip_start", text="Autoclip Start")
                        if not (lamp.auto_clip_start):
--                              layout.itemR(lamp, "shadow_buffer_clip_start", text="Clip Start")
--                      layout.row()
--                      layout.itemR(lamp, "auto_clip_end", text="Autoclip End")
++                              row.itemR(lamp, "shadow_buffer_clip_start", text="Clip Start")
++                      row = layout.row()
++                      row.itemR(lamp, "auto_clip_end", text="Autoclip End")
                        if not (lamp.auto_clip_end):
--                              layout.itemR(lamp, "shadow_buffer_clip_end", text=" Clip End")
--              
--              if (lamp.shadow_method in ('BUFFER_SHADOW', 'RAY_SHADOW')):
--              
--                      layout.split(number=2)
--                      
--                      sub = layout.sub(0)
--                      sub.column()
--                      sub.itemL(text="Display:")
--                      sub.itemR(lamp, "only_shadow")
--                      sub.itemR(lamp, "shadow_layer")
--                      
--                      sub = layout.sub(1)
--                      sub.column()
--                      sub.itemR(lamp, "shadow_color")
--              
++                              row.itemR(lamp, "shadow_buffer_clip_end", text=" Clip End")
++
  class DATA_PT_spot(DataButtonsPanel):
        __idname__ = "DATA_PT_spot"
        __label__ = "Spot"
        
        def poll(self, context):
                ob = context.active_object
--              lamp = context.main.lamps[0]
--              return (ob.type == 'LAMP' and lamp.type == 'SPOT')
++              return (ob.type == 'LAMP' and ob.data.type == 'SPOT')
  
        def draw(self, context):
--              lamp = context.main.lamps[0]
++              lamp = context.active_object.data
                layout = self.layout
  
                if not lamp:
                        return
                
--              layout.split(number=2)
++              split = layout.split()
                
--              sub = layout.sub(0)
--              sub.column()
++              sub = split.column()
++              sub.itemR(lamp, "spot_size", text="Size")
++              sub.itemR(lamp, "spot_blend", text="Blend")
                sub.itemR(lamp, "square")
--              sub.itemR(lamp, "spot_size")
--              sub.itemR(lamp, "spot_blend")
                
--              sub = layout.sub(1)
--              sub.column()
++              sub = split.column()
                sub.itemR(lamp, "halo")
--              if (lamp.halo):
--                      sub.itemR(lamp, "halo_intensity")
--                      if (lamp.shadow_method == 'BUFFER_SHADOW'):
--                              sub.itemR(lamp, "halo_step")
++              if lamp.halo:
++                      sub.itemR(lamp, "halo_intensity", text="Intensity")
++                      if lamp.shadow_method == 'BUFFER_SHADOW':
++                              sub.itemR(lamp, "halo_step", text="Step")
  
  bpy.types.register(DATA_PT_lamp)
  bpy.types.register(DATA_PT_shadow)
index cf2053ae495af3d6491e040da9d2128a7bb93a10,cf2053ae495af3d6491e040da9d2128a7bb93a10..c7d5b9cfe4a255bd294f050a828a0cb4ba966231
@@@ -15,26 -15,26 +15,26 @@@ class DATA_PT_lattice(DataButtonsPanel)
        __label__ = "Lattice"
  
        def draw(self, context):
--              lat = context.main.lattices[0]
++              lat = context.active_object.data
                layout = self.layout
  
                if not lat:
                        return
                
--              layout.row()
--              layout.itemR(lat, "points_u")
--              layout.itemR(lat, "interpolation_type_u", expand=True)
++              row = layout.row()
++              row.itemR(lat, "points_u")
++              row.itemR(lat, "interpolation_type_u", expand=True)
                
--              layout.row()
--              layout.itemR(lat, "points_v")
--              layout.itemR(lat, "interpolation_type_v", expand=True)
++              row = layout.row()
++              row.itemR(lat, "points_v")
++              row.itemR(lat, "interpolation_type_v", expand=True)
                
--              layout.row()
--              layout.itemR(lat, "points_w")
--              layout.itemR(lat, "interpolation_type_w", expand=True)
++              row = layout.row()
++              row.itemR(lat, "points_w")
++              row.itemR(lat, "interpolation_type_w", expand=True)
                
--              layout.row()
--              layout.itemR(lat, "outside")
--              layout.itemR(lat, "shape_keys")
++              row = layout.row()
++              row.itemR(lat, "outside")
++              row.itemR(lat, "shape_keys")
  
--bpy.types.register(DATA_PT_lattice)
++bpy.types.register(DATA_PT_lattice)
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..e52bc8cb9570a222d41ceef9043413c42c224c2e
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,35 @@@
++              
++import bpy
++
++class DataButtonsPanel(bpy.types.Panel):
++      __space_type__ = "BUTTONS_WINDOW"
++      __region_type__ = "WINDOW"
++      __context__ = "data"
++      
++      def poll(self, context):
++              ob = context.active_object
++              return (ob and ob.type == 'MESH')
++      
++
++class DATA_PT_surface(DataButtonsPanel):
++              __idname__ = "DATA_PT_surface"
++              __label__ = "Surface"
++
++              def draw(self, context):
++                      mesh = context.main.meshes[0]
++                      layout = self.layout
++
++                      if not mesh:
++                              return
++                      split = layout.split()
++              
++                      sub = split.column()
++                      sub.itemR(mesh, "autosmooth")
++                      sub.itemR(mesh, "autosmooth_angle", text="Angle")
++                      sub = split.column()
++                      sub.itemR(mesh, "vertex_normal_flip")
++                      sub.itemR(mesh, "double_sided")
++                      row = layout.row()
++                      row.itemR(mesh, "texco_mesh")                   
++                                              
++bpy.types.register(DATA_PT_surface)           
index f07a6cc48822c8829a25fd56f40c0f53e072370a,f07a6cc48822c8829a25fd56f40c0f53e072370a..7167727ea530c1c7520532357e3c33c0f3abfae1
@@@ -4,7 -4,7 +4,7 @@@ import bp
  class DataButtonsPanel(bpy.types.Panel):
        __space_type__ = "BUTTONS_WINDOW"
        __region_type__ = "WINDOW"
--      __context__ = "data"
++      __context__ = "modifier"
  
        def poll(self, context):
                ob = context.active_object
@@@ -21,41 -21,41 +21,367 @@@ class DATA_PT_modifiers(DataButtonsPane
                if not ob:
                        return
  
--              layout.row()
--              layout.item_menu_enumO("OBJECT_OT_modifier_add", "type")
++              row = layout.row()
++              row.item_menu_enumO("OBJECT_OT_modifier_add", "type")
++              row.itemL();
  
                for md in ob.modifiers:
--                      sub = layout.box()
--
--                      sub.row()
--                      sub.itemR(md, "expanded", text="")
--                      sub.itemR(md, "name", text="")
--
--                      sub.itemR(md, "render", text="")
--                      sub.itemR(md, "realtime", text="")
--                      sub.itemR(md, "editmode", text="")
--                      sub.itemR(md, "on_cage", text="")
--
--                      if (md.expanded):
--                              sub.row()
--                              sub.itemS()
--
--                              if (md.type == 'ARMATURE'):
--                                      self.armature(sub, md)
++                      box = layout.template_modifier(context, md)
  
++                      if md.expanded:
++                              if md.type == 'ARMATURE':
++                                      self.armature(box, md)
++                              if md.type == 'ARRAY':
++                                      self.array(box, md)
++                              if md.type == 'BEVEL':
++                                      self.bevel(box, md)
++                              if md.type == 'BOOLEAN':
++                                      self.boolean(box, md)
++                              if md.type == 'BUILD':
++                                      self.build(box, md)
++                              if md.type == 'CAST':
++                                      self.cast(box, md)
++                              if md.type == 'CLOTH':
++                                      self.cloth(box, md)
++                              if md.type == 'COLLISION':
++                                      self.collision(box, md)
++                              if md.type == 'CURVE':
++                                      self.curve(box, md)
++                              if md.type == 'DECIMATE':
++                                      self.decimate(box, md)
++                              if md.type == 'DISPLACE':
++                                      self.displace(box, md)
++                              if md.type == 'EDGE_SPLIT':
++                                      self.edgesplit(box, md)
++                              if md.type == 'EXPLODE':
++                                      self.explode(box, md)
++                              if md.type == 'FLUID_SIMULATION':
++                                      self.fluid(box, md)
++                              if md.type == 'HOOK':
++                                      self.hook(box, md)
++                              if md.type == 'LATTICE':
++                                      self.lattice(box, md)
++                              if md.type == 'MASK':
++                                      self.mask(box, md)
++                              if md.type == 'MESH_DEFORM':
++                                      self.meshdeform(box, md)
++                              if md.type == 'MIRROR':
++                                      self.mirror(box, md)
++                              if md.type == 'MULTIRES':
++                                      self.multires(box, md)
++                              if md.type == 'PARTICLE_INSTANCE':
++                                      self.particleinstance(box, md)
++                              if md.type == 'PARTICLE_SYSTEM':
++                                      self.particlesystem(box, md)
++                              if md.type == 'SHRINKWRAP':
++                                      self.shrinkwrap(box, md)
++                              if md.type == 'SIMPLE_DEFORM':
++                                      self.simpledeform(box, md)
++                              if md.type == 'SMOOTH':
++                                      self.smooth(box, md)
++                              if md.type == 'SOFTBODY':
++                                      self.softbody(box, md)
++                              if md.type == 'SUBSURF':
++                                      self.subsurf(box, md)
++                              if md.type == 'UV_PROJECT':
++                                      self.uvproject(box, md)
++                              if md.type == 'WAVE':
++                                      self.wave(box, md)
++                                                      
        def armature(self, layout, md):
--              layout.column()
                layout.itemR(md, "object")
--              layout.row()
++              row = layout.row()
++              row.itemR(md, "vertex_group")
++              row.itemR(md, "invert")
++              flow = layout.column_flow()
++              flow.itemR(md, "use_vertex_groups", text="Vertex Groups")
++              flow.itemR(md, "use_bone_envelopes", text="Bone Envelopes")
++              flow.itemR(md, "quaternion")
++              flow.itemR(md, "multi_modifier")
++              
++      def array(self, layout, md):
++              layout.itemR(md, "fit_type")
++              if md.fit_type == 'FIXED_COUNT':
++                      layout.itemR(md, "count")
++              if md.fit_type == 'FIT_LENGTH':
++                      layout.itemR(md, "length")
++              if md.fit_type == 'FIT_CURVE':
++                              layout.itemR(md, "curve")
++              
++              split = layout.split()
++              
++              col = split.column()
++              sub = col.column()
++              sub.itemR(md, "constant_offset")
++              sub.itemR(md, "constant_offset_displacement", text="Displacement")
++              sub = col.column()
++              sub = col.row().itemR(md, "merge_adjacent_vertices", text="Merge")
++              sub = col.row().itemR(md, "merge_end_vertices", text="First Last")
++              sub = col.itemR(md, "merge_distance", text="Distance")
++              
++              col = split.column()
++              sub = col.column()
++              sub.itemR(md, "relative_offset")
++              sub.itemR(md, "relative_offset_displacement", text="Displacement")
++              sub = col.column()
++              sub.itemR(md, "add_offset_object")
++              sub.itemR(md, "offset_object")
++              
++              col = layout.column()
++              col.itemR(md, "start_cap")
++              col.itemR(md, "end_cap")
++      
++      def bevel(self, layout, md):
++              row = layout.row()
++              row.itemR(md, "width")
++              row.itemR(md, "only_vertices")
++              
++              layout.itemL(text="Limit Method:")
++              row = layout.row()
++              row.itemR(md, "limit_method", expand=True)
++              if md.limit_method == 'ANGLE':
++                      row = layout.row()
++                      row.itemR(md, "angle")
++              if md.limit_method == 'WEIGHT':
++                      row = layout.row()
++                      row.itemR(md, "edge_weight_method", expand=True)
++                      
++      def boolean(self, layout, md):
++              layout.itemR(md, "operation")
++              layout.itemR(md, "object")
++              
++      def build(self, layout, md):
++              layout.itemR(md, "start")
++              layout.itemR(md, "length")
++              layout.itemR(md, "randomize")
++              if md.randomize:
++                      layout.itemR(md, "seed")
++                      
++      def cast(self, layout, md):
++              layout.itemR(md, "cast_type")
++              col = layout.column_flow()
++              col.itemR(md, "x")
++              col.itemR(md, "y")
++              col.itemR(md, "z")
++              col.itemR(md, "factor")
++              col.itemR(md, "radius")
++              col.itemR(md, "size")
++              layout.itemR(md, "vertex_group")
++              #Missing: "OB" and "From Radius"
++              
++      def cloth(self, layout, md):
++              layout.itemL(text="See Cloth panel.")
++              
++      def collision(self, layout, md):
++              layout.itemL(text="See Collision panel.")
++              
++      def curve(self, layout, md):
++              layout.itemR(md, "curve")
++              layout.itemR(md, "vertex_group")
++              layout.itemR(md, "deform_axis")
++              
++      def decimate(self, layout, md):
++              layout.itemR(md, "ratio")
++              layout.itemR(md, "face_count")
++              
++      def displace(self, layout, md):
++              layout.itemR(md, "vertex_group")
++              layout.itemR(md, "texture")
++              layout.itemR(md, "midlevel")
++              layout.itemR(md, "strength")
++              layout.itemR(md, "texture_coordinates")
++              if md.texture_coordinates == 'OBJECT':
++                      layout.itemR(md, "texture_coordinate_object", text="Object")
++              if md.texture_coordinates == 'UV':
++                      layout.itemR(md, "uv_layer")
++      
++      def edgesplit(self, layout, md):
++              layout.itemR(md, "use_edge_angle", text="Edge Angle")
++              if (md.use_edge_angle):
++                      layout.itemR(md, "split_angle")
++              layout.itemR(md, "use_sharp", text="Sharp Edges")
++              
++      def explode(self, layout, md):
++              layout.itemR(md, "vertex_group")
++              layout.itemR(md, "protect")
++              layout.itemR(md, "split_edges")
++              layout.itemR(md, "unborn")
++              layout.itemR(md, "alive")
++              layout.itemR(md, "dead")
++              # Missing: "Refresh" and "Clear Vertex Group" ?
++              
++      def fluid(self, layout, md):
++              layout.itemL(text="See Fluidsim panel.")
++              
++      def hook(self, layout, md):
++              layout.itemR(md, "falloff")
++              layout.itemR(md, "force", slider=True)
++              layout.itemR(md, "object")
++              layout.itemR(md, "vertex_group")
++              # Missing: "Reset" and "Recenter"
++              
++      def lattice(self, layout, md):
++              layout.itemR(md, "lattice")
++              layout.itemR(md, "vertex_group")
++              
++      def mask(self, layout, md):
++              layout.itemR(md, "mode")
++              if md.mode == 'ARMATURE':
++                      layout.itemR(md, "armature")
++              if md.mode == 'VERTEX_GROUP':
++                      layout.itemR(md, "vertex_group")
++              layout.itemR(md, "inverse")
++              
++      def meshdeform(self, layout, md):
++              layout.itemR(md, "mesh")
                layout.itemR(md, "vertex_group")
                layout.itemR(md, "invert")
--              layout.column_flow()
--              layout.itemR(md, "use_vertex_groups")
--              layout.itemR(md, "use_bone_envelopes")
--              layout.itemR(md, "quaternion")
--              layout.itemR(md, "b_bone_rest")
--              layout.itemR(md, "multi_modifier")
++              layout.itemR(md, "precision")
++              layout.itemR(md, "dynamic")
++              # Missing: "Bind"
                
--bpy.types.register(DATA_PT_modifiers)
++      def mirror(self, layout, md):
++              layout.itemR(md, "merge_limit")
++              split = layout.split()
++              
++              sub = split.column()
++              sub.itemR(md, "x")
++              sub.itemR(md, "y")
++              sub.itemR(md, "z")
++              sub = split.column()
++              sub.itemR(md, "mirror_u")
++              sub.itemR(md, "mirror_v")
++              sub = split.column()
++              sub.itemR(md, "clip", text="Do Clipping")
++              sub.itemR(md, "mirror_vertex_groups", text="Vertex Group")
++              
++              layout.itemR(md, "mirror_object")
++              
++      def multires(self, layout, md):
++              layout.itemR(md, "subdivision_type")
++              layout.itemO("OBJECT_OT_multires_subdivide", text="Subdivide")
++              layout.itemR(md, "level")
++      
++      def particleinstance(self, layout, md):
++              layout.itemR(md, "object")
++              layout.itemR(md, "particle_system_number")
++              
++              col = layout.column_flow()
++              col.itemR(md, "normal")
++              col.itemR(md, "children")
++              col.itemR(md, "path")
++              col.itemR(md, "unborn")
++              col.itemR(md, "alive")
++              col.itemR(md, "dead")
++              
++      def particlesystem(self, layout, md):
++              layout.itemL(text="See Particle panel.")
++              
++      def shrinkwrap(self, layout, md):
++              layout.itemR(md, "target")
++              layout.itemR(md, "vertex_group")
++              layout.itemR(md, "offset")
++              layout.itemR(md, "subsurf_levels")
++              layout.itemR(md, "mode")
++              if md.mode == 'PROJECT':
++                      layout.itemR(md, "subsurf_levels")
++                      layout.itemR(md, "auxiliary_target")
++              
++                      row = layout.row()
++                      row.itemR(md, "x")
++                      row.itemR(md, "y")
++                      row.itemR(md, "z")
++              
++                      col = layout.column_flow()
++                      col.itemR(md, "negative")
++                      col.itemR(md, "positive")
++                      col.itemR(md, "cull_front_faces")
++                      col.itemR(md, "cull_back_faces")
++              if md.mode == 'NEAREST_SURFACEPOINT':
++                      layout.itemR(md, "keep_above_surface")
++              # To-Do: Validate if structs
++              
++      def simpledeform(self, layout, md):
++              layout.itemR(md, "mode")
++              layout.itemR(md, "vertex_group")
++              layout.itemR(md, "origin")
++              layout.itemR(md, "relative")
++              layout.itemR(md, "factor")
++              layout.itemR(md, "limits")
++              if md.mode in ('TAPER', 'STRETCH'):
++                      layout.itemR(md, "lock_x_axis")
++                      layout.itemR(md, "lock_y_axis")
++      
++      def smooth(self, layout, md):
++              split = layout.split()
++              sub = split.column()
++              sub.itemR(md, "x")
++              sub.itemR(md, "y")
++              sub.itemR(md, "z")
++              sub = split.column()
++              sub.itemR(md, "factor")
++              sub.itemR(md, "repeat")
++              
++              layout.itemR(md, "vertex_group")
++              
++      def softbody(self, layout, md):
++              layout.itemL(text="See Softbody panel.")
++      
++      def subsurf(self, layout, md):
++              layout.itemR(md, "subdivision_type")
++              col = layout.column_flow()
++              col.itemR(md, "levels")
++              col.itemR(md, "render_levels")
++              col.itemR(md, "optimal_draw")
++              col.itemR(md, "subsurf_uv")
++      
++      def uvproject(self, layout, md):
++              layout.itemR(md, "uv_layer")
++              layout.itemR(md, "projectors")
++              layout.itemR(md, "image")
++              layout.itemR(md, "horizontal_aspect_ratio")
++              layout.itemR(md, "vertical_aspect_ratio")
++              layout.itemR(md, "override_image")
++              #"Projectors" don't work.
++              
++      def wave(self, layout, md):
++              split = layout.split()
++              
++              sub = split.column()
++              sub.itemL(text="Motion:")
++              sub.itemR(md, "x")
++              sub.itemR(md, "y")
++              sub.itemR(md, "cyclic")
++              
++              sub = split.column()
++              sub.itemR(md, "normals")
++              if md.normals:
++                      sub.itemR(md, "x_normal", text="X")
++                      sub.itemR(md, "y_normal", text="Y")
++                      sub.itemR(md, "z_normal", text="Z")
++              
++              col = layout.column_flow()
++              col.itemR(md, "time_offset")
++              col.itemR(md, "lifetime")
++              col.itemR(md, "damping_time")
++              col.itemR(md, "falloff_radius")
++              col.itemR(md, "start_position_x")
++              col.itemR(md, "start_position_y")
++              
++              layout.itemR(md, "start_position_object")
++              layout.itemR(md, "vertex_group")
++              layout.itemR(md, "texture")
++              layout.itemR(md, "texture_coordinates")
++              if md.texture_coordinates == 'MAP_UV':
++                      layout.itemR(md, "uv_layer")
++              if md.texture_coordinates == 'OBJECT':
++                      layout.itemR(md, "texture_coordinates_object")
++              
++              col = layout.column_flow()
++              col.itemR(md, "speed", slider=True)
++              col.itemR(md, "height", slider=True)
++              col.itemR(md, "width", slider=True)
++              col.itemR(md, "narrowness", slider=True)
  
++bpy.types.register(DATA_PT_modifiers)
  
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..8db1d0316a9ed49f16df9819b2ed2708ecf80124
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,135 @@@
++
++import bpy
++
++class DataButtonsPanel(bpy.types.Panel):
++      __space_type__ = "BUTTONS_WINDOW"
++      __region_type__ = "WINDOW"
++      __context__ = "data"
++      
++      def poll(self, context):
++              ob = context.active_object
++              return (ob and ob.type == 'TEXT')
++              
++class DATA_PT_shape_text(DataButtonsPanel):
++              __idname__ = "DATA_PT_shape_text"
++              __label__ = "Shape"
++
++              def draw(self, context):
++                      curve = context.main.curves[0]
++                      layout = self.layout
++
++                      if not curve:
++                              return
++                      row = layout.row()
++                      row.itemR(curve, "curve_2d")                    
++                                                      
++                      split = layout.split()
++              
++                      sub = split.column()
++                      sub.itemL(text="Caps:")
++                      sub.itemR(curve, "front")
++                      sub.itemR(curve, "back")
++                      
++                      sub.itemL(text="Textures:")
++                      sub.itemR(curve, "uv_orco")
++                      sub.itemR(curve, "auto_texspace")
++                      
++                      sub = split.column()    
++                      sub.itemL(text="Resolution:")
++                      sub.itemR(curve, "resolution_u", text="Preview U")
++                      sub.itemR(curve, "resolution_v", text="Preview V")
++                      sub.itemR(curve, "render_resolution_u", text="Render U")
++                      sub.itemR(curve, "render_resolution_v", text="Render V")
++
++                      sub.itemL(text="Display:")
++                      sub.itemR(curve, "fast")
++                      
++
++class DATA_PT_font(DataButtonsPanel):
++      __idname__ = "DATA_PT_font"
++      __label__ = "Font"
++
++      def draw(self, context):
++              text = context.main.curves[0]
++              layout = self.layout
++
++              if not text:
++                      return
++              
++              layout.row()
++              layout.itemR(text, "font")
++              
++              split = layout.split()
++              
++              sub = split.column()    
++
++      #       sub.itemR(text, "style")
++              sub.itemR(text, "bold")
++              sub.itemR(text, "italic")
++              sub.itemR(text, "underline")
++              sub.itemR(text, "text_size")            
++              sub.itemR(text, "shear")
++
++              sub = split.column()
++
++              sub.itemR(text, "text_on_curve")
++              sub.itemR(text, "family")
++              sub.itemL(text="Underline:")
++              sub.itemR(text, "ul_position", text="Position")
++              sub.itemR(text, "ul_height", text="Height")
++
++      #       sub.itemR(text, "edit_format")
++
++
++
++
++              
++class DATA_PT_paragraph(DataButtonsPanel):
++      __idname__ = "DATA_PT_paragraph"
++      __label__ = "Paragraph"
++
++      def draw(self, context):
++              text = context.main.curves[0]
++              layout = self.layout
++
++              if not text:
++                      return
++                      
++              row = layout.row()
++              row.itemL(text="Align:")
++              row = layout.row()
++              row.itemR(text, "spacemode", expand=True)
++
++              split = layout.split()
++              
++              sub = split.column()    
++
++              sub.itemL(text="Spacing:")
++              sub.itemR(text, "spacing", text="Character")
++              sub.itemR(text, "word_spacing", text="Word")
++              sub.itemR(text, "line_dist", text="Line")
++
++              sub = split.column()
++              sub.itemL(text="Offset:")
++              sub.itemR(text, "x_offset", text="X")
++              sub.itemR(text, "y_offset", text="Y")
++              sub.itemR(text, "wrap")
++                      
++class DATA_PT_textboxes(DataButtonsPanel):
++              __idname__ = "DATA_PT_textboxes"
++              __label__ = "Text Boxes"
++
++              def draw(self, context):
++                      text = context.main.curves[0]
++                      layout = self.layout
++
++                      if not text:
++                              return
++                              
++
++                      
++bpy.types.register(DATA_PT_shape_text)        
++bpy.types.register(DATA_PT_font)
++bpy.types.register(DATA_PT_paragraph)
++bpy.types.register(DATA_PT_textboxes)
++
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..63e1624d6db58f1593ccb5d2035dbac6954fd16f
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,196 @@@
++
++import bpy
++
++class MaterialButtonsPanel(bpy.types.Panel):
++      __space_type__ = "BUTTONS_WINDOW"
++      __region_type__ = "WINDOW"
++      __context__ = "material"
++
++      def poll(self, context):
++              ob = context.active_object
++              return (ob and ob.active_material)
++      
++class MATERIAL_PT_material(MaterialButtonsPanel):
++      __idname__= "MATERIAL_PT_material"
++      __label__ = "Material"
++
++      def draw(self, context):
++              layout = self.layout
++              mat = context.active_object.active_material
++      
++              row = layout.row()
++              row.itemR(mat, "type", expand=True)
++
++              row = layout.row()
++              row.column().itemR(mat, "diffuse_color")
++              row.column().itemR(mat, "specular_color")
++              row.column().itemR(mat, "mirror_color")
++              
++              row = layout.row()
++              row.itemR(mat, "alpha", slider=True)
++                      
++class MATERIAL_PT_sss(MaterialButtonsPanel):
++      __idname__= "MATERIAL_PT_sss"
++      __label__ = "Subsurface Scattering"
++
++      def poll(self, context):
++              ob = context.active_object
++              return (ob and ob.active_material and ob.active_material.type == "SURFACE")
++
++      def draw_header(self, context):
++              sss = context.active_object.active_material.subsurface_scattering
++
++              layout = self.layout
++              layout.itemR(sss, "enabled", text="")
++      
++      def draw(self, context):
++              layout = self.layout
++              sss = context.active_object.active_material.subsurface_scattering
++              
++              flow = layout.column_flow()
++              flow.itemR(sss, "error_tolerance")
++              flow.itemR(sss, "ior")
++              flow.itemR(sss, "scale")
++              
++              row = layout.row()
++              row.column().itemR(sss, "color")
++              row.column().itemR(sss, "radius")
++              
++              flow = layout.column_flow()
++              flow.itemR(sss, "color_factor", slider=True)
++              flow.itemR(sss, "texture_factor", slider=True)
++              flow.itemR(sss, "front")
++              flow.itemR(sss, "back")
++              
++class MATERIAL_PT_raymir(MaterialButtonsPanel):
++      __idname__= "MATERIAL_PT_raymir"
++      __label__ = "Ray Mirror"
++      
++      def poll(self, context):
++              ob = context.active_object
++              return (ob and ob.active_material and ob.active_material.type == "SURFACE")
++      
++      def draw_header(self, context):
++              raym = context.active_object.active_material.raytrace_mirror
++
++              layout = self.layout
++              layout.itemR(raym, "enabled", text="")
++      
++      def draw(self, context):
++              layout = self.layout
++              raym = context.active_object.active_material.raytrace_mirror
++
++              split = layout.split()
++              
++              sub = split.column()
++              sub.itemR(raym, "reflect", text="RayMir", slider=True)
++              sub.itemR(raym, "fresnel")
++              sub.itemR(raym, "fresnel_fac", text="Fac", slider=True)
++              
++              sub = split.column()
++              sub.itemR(raym, "gloss", slider=True)
++              sub.itemR(raym, "gloss_threshold", slider=True)
++              sub.itemR(raym, "gloss_samples")
++              sub.itemR(raym, "gloss_anisotropic", slider=True)
++              
++              flow = layout.column_flow()
++              flow.itemR(raym, "distance", text="Max Dist")
++              flow.itemR(raym, "depth")
++              flow.itemR(raym, "fade_to")
++              
++class MATERIAL_PT_raytransp(MaterialButtonsPanel):
++      __idname__= "MATERIAL_PT_raytransp"
++      __label__= "Ray Transparency"
++      
++      def poll(self, context):
++              ob = context.active_object
++              return (ob and ob.active_material and ob.active_material.type == "SURFACE")
++
++      def draw_header(self, context):
++              rayt = context.active_object.active_material.raytrace_transparency
++
++              layout = self.layout
++              layout.itemR(rayt, "enabled", text="")
++
++      def draw(self, context):
++              layout = self.layout
++              rayt = context.active_object.active_material.raytrace_transparency
++              
++              split = layout.split()
++              
++              sub = split.column()
++              sub.itemR(rayt, "ior")
++              sub.itemR(rayt, "fresnel")
++              sub.itemR(rayt, "fresnel_fac", text="Fac", slider=True)
++              
++              sub = split.column()
++              sub.itemR(rayt, "gloss", slider=True)
++              sub.itemR(rayt, "gloss_threshold", slider=True)
++              sub.itemR(rayt, "gloss_samples")
++              
++              flow = layout.column_flow()
++              flow.itemR(rayt, "filter", slider=True)
++              flow.itemR(rayt, "limit")
++              flow.itemR(rayt, "falloff")
++              flow.itemR(rayt, "specular_opacity", slider=True)
++              flow.itemR(rayt, "depth")
++              
++class MATERIAL_PT_halo(MaterialButtonsPanel):
++      __idname__= "MATERIAL_PT_halo"
++      __label__= "Halo"
++      
++      def poll(self, context):
++              ob = context.active_object
++              return (ob and ob.active_material and ob.active_material.type == "HALO")
++      
++      def draw(self, context):
++              layout = self.layout
++              mat = context.active_object.active_material
++              halo = mat.halo
++
++              split = layout.split()
++              
++              col = split.column(align=True)
++              col.itemL(text="General Settings:")
++              col.itemR(halo, "size")
++              col.itemR(halo, "hardness")
++              col.itemR(halo, "add", slider=True)
++              
++              col.itemL(text="Options:")
++              col.itemR(halo, "use_texture", text="Texture")
++              col.itemR(halo, "use_vertex_normal", text="Vertex Normal")
++              col.itemR(halo, "xalpha")
++              col.itemR(halo, "shaded")
++              col.itemR(halo, "soft")
++
++              col = split.column()
++              sub = col.column(align=True)
++              sub.itemL(text="Elements:")
++              sub.itemR(halo, "ring")
++              sub.itemR(halo, "lines")
++              sub.itemR(halo, "star")
++              sub.itemR(halo, "flare_mode")
++              
++              sub = col.column()
++              if (halo.ring):
++                      sub.itemR(halo, "rings")
++              if (halo.lines):
++                      sub.itemR(halo, "line_number")
++              if (halo.ring or halo.lines):
++                      sub.itemR(halo, "seed")
++              if (halo.star):
++                      sub.itemR(halo, "star_tips")
++              if (halo.flare_mode):
++                      sub = col.column(align=True)
++                      sub.itemL(text="Flare:")
++                      sub.itemR(halo, "flare_size", text="Size")
++                      sub.itemR(halo, "flare_subsize", text="Subsize")
++                      sub.itemR(halo, "flare_boost", text="Boost")
++                      sub.itemR(halo, "flare_seed", text="Seed")
++                      sub.itemR(halo, "flares_sub", text="Sub")
++                              
++bpy.types.register(MATERIAL_PT_material)
++bpy.types.register(MATERIAL_PT_raymir)
++bpy.types.register(MATERIAL_PT_raytransp)
++bpy.types.register(MATERIAL_PT_sss)
++bpy.types.register(MATERIAL_PT_halo)
index 8e76bf5083732d6631b51601deddf6fe7cbac7e0,8e76bf5083732d6631b51601deddf6fe7cbac7e0..c0e1f439df81ba14db25d3e495bb57b840448eaa
@@@ -17,10 -17,10 +17,10 @@@ class OBJECT_PT_transform(ObjectButtons
                ob = context.active_object
                layout = self.layout
  
--              layout.row()
--              layout.itemR(ob, "location")
--              layout.itemR(ob, "rotation")
--              layout.itemR(ob, "scale")
++              row = layout.row()
++              row.column().itemR(ob, "location")
++              row.column().itemR(ob, "rotation")
++              row.column().itemR(ob, "scale")
  
  class OBJECT_PT_groups(ObjectButtonsPanel):
        __idname__ = "OBJECT_PT_groups"
                ob = context.active_object
                layout = self.layout
  
--              layout.row()
--              layout.itemR(ob, "pass_index")
--              layout.itemR(ob, "parent")
++              row = layout.row()
++              row.itemR(ob, "pass_index")
++              row.itemR(ob, "parent")
  
                # layout.left_right()
                # layout.itemO("OBJECT_OT_add_group");
  
                for group in bpy.data.groups:
                        if ob in group.objects:
--                              sub = layout.box()
++                              box = layout.box()
  
--                              sub.split(number=2, lr=True)
--                              sub.sub(0).itemR(group, "name")
--                              # sub.sub(1).itemO("OBJECT_OT_remove_group")
++                              row = box.row()
++                              row.itemR(group, "name")
++                              #row.itemO("OBJECT_OT_remove_group")
  
--                              sub.row()
--                              sub.itemR(group, "layer")
--                              sub.itemR(group, "dupli_offset")
++                              row = box.row()
++                              row.column().itemR(group, "layer")
++                              row.column().itemR(group, "dupli_offset")
  
  class OBJECT_PT_display(ObjectButtonsPanel):
        __idname__ = "OBJECT_PT_display"
                ob = context.active_object
                layout = self.layout
                        
--              layout.row()
--              layout.itemR(ob, "max_draw_type", text="Type")
--              layout.itemR(ob, "draw_bounds_type", text="Bounds")
--
--              layout.column_flow()
--              layout.itemR(ob, "draw_name", text="Name")
--              layout.itemR(ob, "draw_axis", text="Axis")
--              layout.itemR(ob, "draw_wire", text="Wire")
--              layout.itemR(ob, "draw_texture_space", text="Texture Space")
--              layout.itemR(ob, "x_ray", text="X-Ray")
--              layout.itemR(ob, "draw_transparent", text="Transparency")
++              row = layout.row()
++              row.itemR(ob, "max_draw_type", text="Type")
++              row.itemR(ob, "draw_bounds_type", text="Bounds")
++
++              flow = layout.column_flow()
++              flow.itemR(ob, "draw_name", text="Name")
++              flow.itemR(ob, "draw_axis", text="Axis")
++              flow.itemR(ob, "draw_wire", text="Wire")
++              flow.itemR(ob, "draw_texture_space", text="Texture Space")
++              flow.itemR(ob, "x_ray", text="X-Ray")
++              flow.itemR(ob, "draw_transparent", text="Transparency")
  
  class OBJECT_PT_duplication(ObjectButtonsPanel):
        __idname__ = "OBJECT_PT_duplication"
                ob = context.active_object
                layout = self.layout
  
--              layout.column()
--              layout.itemR(ob, "dupli_type", text="", expand=True)
++              row = layout.row()
++              row.itemR(ob, "dupli_type", expand=True)
  
                if ob.dupli_type == "FRAMES":
--                      layout.column_flow()
--                      layout.itemR(ob, "dupli_frames_start", text="Start")
--                      layout.itemR(ob, "dupli_frames_end", text="End")
--                      layout.itemR(ob, "dupli_frames_on", text="On")
--                      layout.itemR(ob, "dupli_frames_off", text="Off")
++                      split = layout.split()
++                      
++                      sub = split.column(align=True)
++                      sub.itemR(ob, "dupli_frames_start", text="Start")
++                      sub.itemR(ob, "dupli_frames_end", text="End")
++                      
++                      sub = split.column(align=True)
++                      sub.itemR(ob, "dupli_frames_on", text="On")
++                      sub.itemR(ob, "dupli_frames_off", text="Off")
++                      
++                      split = layout.split()
++                      sub = split.column()
++                      sub.itemR(ob, "dupli_frames_no_speed", text="No Speed")
++
++              elif ob.dupli_type == "VERTS":
++                      split = layout.split()
++                      
++                      sub = split.column(align=True)
++                      sub.itemR(ob, "dupli_verts_rotation", text="Rotation")
++
++              elif ob.dupli_type == "FACES":
++                      split = layout.split()
++                      
++                      sub = split.column()
++                      sub.itemR(ob, "dupli_faces_scale", text="Scale")
++                      sub = split.column()
++                      sub.itemR(ob, "dupli_faces_inherit_scale", text="Inherit Scale")
++
++              elif ob.dupli_type == "GROUP":
++                      split = layout.split()
++                      
++                      sub = split.column(align=True)
++                      sub.itemR(ob, "dupli_group", text="Group")
  
  class OBJECT_PT_animation(ObjectButtonsPanel):
        __idname__ = "OBJECT_PT_animation"
                ob = context.active_object
                layout = self.layout
  
--              layout.split(number=2)
++              row = layout.row()
                
--              sub = layout.sub(0)
--              sub.column()
++              sub = row.column()
                sub.itemL(text="Time Offset:")
                sub.itemR(ob, "time_offset_edit", text="Edit")
                sub.itemR(ob, "time_offset_particle", text="Particle")
                sub.itemR(ob, "slow_parent")
                sub.itemR(ob, "time_offset", text="Offset")
                
--              sub = layout.sub(1)
--              sub.column()
++              sub = row.column()
                sub.itemL(text="Tracking:")
                sub.itemR(ob, "track_axis", text="Axis")
                sub.itemR(ob, "up_axis", text="Up Axis")
index 6b3c7dca49dc471d914bca071c87e2583dff3622,6b3c7dca49dc471d914bca071c87e2583dff3622..9682eabbccf441afd91daf9ca5837f826efdc0e4
@@@ -15,72 -15,72 +15,85 @@@ class RENDER_PT_shading(RenderButtonsPa
  
                rd = scene.render_data
                
--              layout.split(number=2)
++              split = layout.split()
                
--              sub = layout.sub(0)
--              sub.column()
++              sub = split.column()
                sub.itemR(rd, "render_shadows", text="Shadows")
--              sub.itemR(rd, "render_sss", text="SSS")
--              sub.itemR(rd, "render_envmaps", text="EnvMap")
--              sub.itemR(rd, "render_radiosity", text="Radio")
--              
--              sub = layout.sub(1)
--              subsub = sub.box()
--              subsub.column()
--              subsub.itemR(rd, "render_raytracing", text="Ray Tracing")
++              sub.itemR(rd, "render_sss", text="Subsurface Scattering")
++              sub.itemR(rd, "render_envmaps", text="Environment Map")
++              #       sub.itemR(rd, "render_radiosity", text="Radio")
++              
++              sub = split.column()
++              sub.itemR(rd, "render_raytracing", text="Ray Tracing")
                if (rd.render_raytracing):
--                      subsub.itemR(rd, "octree_resolution", text="Octree")
--              sub.row()
--              sub.itemR(rd, "alpha_mode")
++                      sub.itemR(rd, "octree_resolution", text="Octree")
                
--class RENDER_PT_image(RenderButtonsPanel):
--      __label__ = "Image"
++class RENDER_PT_output(RenderButtonsPanel):
++      __label__ = "Output"
  
        def draw(self, context):
                scene = context.scene
                layout = self.layout
  
                rd = scene.render_data
--
--              layout.column_flow()
--              layout.itemR(rd, "resolution_x", text="SizeX")
--              layout.itemR(rd, "resolution_y", text="SizeY")
--              layout.itemR(rd, "pixel_aspect_x", text="AspX")
--              layout.itemR(rd, "pixel_aspect_y", text="AspY")
--
--              sub = layout.box()
--              sub.row()
++              
++              col = layout.column()
++              col.itemR(rd, "output_path")
++              
++              split = layout.split()
++              
++              sub = split.column()
                sub.itemR(rd, "image_type")
--              sub.row()
--              sub.itemR(rd, "file_extensions")
--              sub.itemR(rd, "color_mode")
                if rd.image_type in ("AVIJPEG", "JPEG"):
--                      sub.row()
--                      sub.itemR(rd, "quality")
++                      sub.itemR(rd, "quality", slider=True)
++              
++              sub = split.column()
++              sub.itemR(rd, "color_mode")
++              sub.itemR(rd, "alpha_mode")
++              
++              split = layout.split()
++              
++              sub = split.column()
++              sub.itemL(text="Distributed Rendering:")
++              sub.itemR(rd, "placeholders")
++              sub.itemR(rd, "no_overwrite")
++              
++              sub = split.column()
++              sub.itemL(text="Settings:")
++              sub.itemR(rd, "file_extensions")
++              sub.itemR(rd, "fields", text="Fields")
++              if rd.fields:
++                      sub.itemR(rd, "fields_still", text="Still")
++                      sub.row().itemR(rd, "field_order", expand=True)
++              
        
  class RENDER_PT_antialiasing(RenderButtonsPanel):
        __label__ = "Anti-Aliasing"
  
++      def draw_header(self, context):
++              rd = context.scene.render_data
++
++              layout = self.layout
++              layout.itemR(rd, "antialiasing", text="")
++
        def draw(self, context):
                scene = context.scene
                layout = self.layout
  
                rd = scene.render_data
  
--              layout.row()
--              layout.itemR(rd, "antialiasing", text="Enable")
--              if (rd.antialiasing):
--                      layout.row()
--                      layout.itemL(text="Samples:")
--                      layout.itemR(rd, "antialiasing_samples", expand=True)
--                      layout.row()
--                      layout.itemR(rd, "pixel_filter")
--                      layout.itemR(rd, "filter_size")
--
--                      layout.row()
--                      layout.itemR(rd, "save_buffers")
--                      if (rd.save_buffers):
--                              layout.itemR(rd, "full_sample")
++              split = layout.split()
++              
++              sub = split.column()
++              sub.itemL(text="Samples:")
++              sub.row().itemR(rd, "antialiasing_samples", expand=True)
++
++              sub = split.column()
++              sub.itemR(rd, "pixel_filter")
++              sub.itemR(rd, "filter_size", text="Size", slider=True)
++              sub.itemR(rd, "save_buffers")
++              if rd.save_buffers:
++                      sub.itemR(rd, "full_sample")
  
  class RENDER_PT_render(RenderButtonsPanel):
        __label__ = "Render"
  
                rd = scene.render_data
  
--              layout.row()
--              layout.itemO("SCREEN_OT_render", text="RENDER", icon=0) # ICON_SCENE
--              #layout.itemO("SCREEN_OT_render", text="ANIM", icon=0) # "anim", 1
--
--              layout.row()
--              layout.itemR(scene, "start_frame", text="Start")
--              layout.itemR(rd, "fps")
--              layout.itemR(scene, "current_frame", text="Frame")
++              row = layout.row()
++              row.itemO("SCREEN_OT_render", text="Render Still", icon=109)
++              row.item_booleanO("SCREEN_OT_render", "anim", True, text="Render Animation", icon=111)
                
--              layout.row()
--              layout.itemR(scene, "end_frame", text="End")
--              layout.itemR(rd, "fps_base",text="/")
--              layout.itemR(scene, "frame_step", text="Step")
--
--              layout.row()
--              layout.itemR(rd, "do_composite")
--              layout.itemR(rd, "do_sequence")
++              row = layout.row()
++              row.itemR(rd, "do_composite")
++              row.itemR(rd, "do_sequence")
++              if rd.do_composite:
++                      row = layout.row()
++                      row.itemR(rd, "free_image_textures")
++
++              split = layout.split()
++              
++              sub = split.column(align=True)
++              sub.itemL(text="Threads:")
++              sub.row().itemR(rd, "threads_mode", expand=True)
++              if rd.threads_mode == 'THREADS_FIXED':
++                      sub.itemR(rd, "threads")
++              
++              sub = split.column(align=True)
++              sub.itemL(text="Tiles:")
++              sub.itemR(rd, "parts_x", text="X")
++              sub.itemR(rd, "parts_y", text="Y")
++              
++              row = layout.row()
++              row.itemR(rd, "panorama")
++              row.itemR(rd, "dither_intensity", text="Dither", slider=True)
++              #       row.itemR(rd, "backbuf")
++                      
++class RENDER_PT_dimensions(RenderButtonsPanel):
++      __label__ = "Dimensions"
  
--              layout.row()
--              layout.itemL(text="General:")
++      def draw(self, context):
++              scene = context.scene
++              layout = self.layout
  
--              layout.column_flow()
--              layout.itemR(rd, "resolution_percentage", text="Size ")
--              layout.itemR(rd, "dither_intensity")
--              layout.itemR(rd, "parts_x")
--              layout.itemR(rd, "parts_y")
++              rd = scene.render_data
                
--              layout.split(number=2)
++              split = layout.split()
++              
++              col = split.column()
++              sub = col.column(align=True)
++              sub.itemL(text="Resolution:")
++              sub.itemR(rd, "resolution_x", text="X")
++              sub.itemR(rd, "resolution_y", text="Y")
++              sub.itemR(rd, "resolution_percentage", text="")
++              
++              sub.itemL(text="Aspect Ratio:")
++              sub.itemR(rd, "pixel_aspect_x", text="X")
++              sub.itemR(rd, "pixel_aspect_y", text="Y")
++              
++              sub = col.column(align=False)
++              sub.itemR(rd, "border", text="Border")
++              if rd.border:
++                      sub.itemR(rd, "crop_to_border")
++
++              col = split.column(align=True)
++              col.itemL(text="Frame Range:")
++              col.itemR(scene, "start_frame", text="Start")
++              col.itemR(scene, "end_frame", text="End")
++              col.itemR(scene, "frame_step", text="Step")
++              
++              col.itemL(text="Frame Rate:")
++              col.itemR(rd, "fps")
++              col.itemR(rd, "fps_base",text="/")
                
--              sub = layout.sub(0)
--              subsub = sub.box()
--              subsub.column()
--              subsub.itemL(text="Threads Mode:")
--              subsub.itemR(rd, "threads_mode", expand=True)
--              if rd.threads_mode == 'THREADS_FIXED':
--                      subsub.itemR(rd, "threads")
--              
--              subsub = sub.box()
--              subsub.column()
--              subsub.itemL(text="Distributed Rendering:")
--              subsub.itemR(rd, "placeholders")
--              subsub.itemR(rd, "no_overwrite")
--              subsub = sub.box()
--              subsub.column()
--              subsub.itemR(rd, "fields", text="Fields")
--              if (rd.fields):
--                      subsub.itemR(rd, "fields_still", text="Still")
--                      subsub.itemR(rd, "field_order", text="Order")
--              
--              sub = layout.sub(1)
--              subsub = sub.box()
--              subsub.column()
--              subsub.itemL(text="Extra:")
--              subsub.itemR(rd, "panorama")
--              subsub.itemR(rd, "backbuf")
--              subsub.itemR(rd, "free_image_textures")
--              
--              subsub = sub.box()
--              subsub.column()
--              subsub.itemL(text="Border:")
--              subsub.itemR(rd, "border", text="Border Render")
--              if (rd.border):
--                      subsub.itemR(rd, "crop_to_border")
--
  bpy.types.register(RENDER_PT_render)
++bpy.types.register(RENDER_PT_dimensions)
  bpy.types.register(RENDER_PT_antialiasing)
  bpy.types.register(RENDER_PT_shading)
--bpy.types.register(RENDER_PT_image)
++bpy.types.register(RENDER_PT_output)
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..b00afe2ccfd85b51a7c064b43b30c8bd66187077
new file mode 100644 (file)
--- /dev/null
--- /dev/null
@@@ -1,0 -1,0 +1,336 @@@
++
++import bpy
++
++class TextureButtonsPanel(bpy.types.Panel):
++      __space_type__ = "BUTTONS_WINDOW"
++      __region_type__ = "WINDOW"
++      __context__ = "texture"
++      
++      def poll(self, context):
++              ob = context.active_object
++              return (ob and ob.active_material.active_texture.texture)
++
++class TEXTURE_PT_texture(TextureButtonsPanel):
++      __idname__= "TEXTURE_PT_texture"
++      __label__ = "Texture"
++
++      def draw(self, context):
++              layout = self.layout
++              tex = context.active_object.active_material.active_texture.texture
++              
++              layout.itemR(tex, "type")
++
++class TEXTURE_PT_clouds(TextureButtonsPanel):
++      __idname__= "TEXTURE_PT_clouds"
++      __label__ = "Clouds"
++      
++      def poll(self, context):
++              tex = context.active_object.active_material.active_texture.texture
++              return (tex and tex.type == "CLOUDS")   
++
++      def draw(self, context):
++              layout = self.layout
++              tex = context.active_object.active_material.active_texture.texture
++              
++              layout.itemR(tex, "stype", expand=True)
++              layout.itemL(text="Noise:")
++              layout.itemR(tex, "noise_basis", text="Basis")
++              layout.itemR(tex, "noise_type", text="Type", expand=True)
++              
++              col = layout.column_flow()
++              col.itemR(tex, "noise_size", text="Size")
++              col.itemR(tex, "noise_depth", text="Depth")
++              col.itemR(tex, "nabla", text="Nabla")
++
++class TEXTURE_PT_wood(TextureButtonsPanel):
++      __idname__= "TEXTURE_PT_wood"
++      __label__ = "Wood"
++      
++      def poll(self, context):
++              tex = context.active_object.active_material.active_texture.texture
++              return (tex and tex.type == "WOOD")     
++
++      def draw(self, context):
++              layout = self.layout
++              tex = context.active_object.active_material.active_texture.texture
++              
++              layout.itemR(tex, "noisebasis2", expand=True)
++              layout.itemR(tex, "stype", expand=True)
++              layout.itemL(text="Noise:")
++              layout.itemR(tex, "noise_basis", text="Basis")
++              layout.itemR(tex, "noise_type", text="Type", expand=True)
++              
++              col = layout.column_flow()
++              col.itemR(tex, "noise_size", text="Size")
++              col.itemR(tex, "turbulence")
++              col.itemR(tex, "nabla")
++              
++class TEXTURE_PT_marble(TextureButtonsPanel):
++      __idname__= "TEXTURE_PT_marble"
++      __label__ = "Marble"
++      
++      def poll(self, context):
++              tex = context.active_object.active_material.active_texture.texture
++              return (tex and tex.type == "MARBLE")   
++
++      def draw(self, context):
++              layout = self.layout
++              tex = context.active_object.active_material.active_texture.texture
++              
++              layout.itemR(tex, "stype", expand=True)
++              layout.itemR(tex, "noisebasis2", expand=True)
++              layout.itemL(text="Noise:")
++              layout.itemR(tex, "noise_basis", text="Basis")
++              layout.itemR(tex, "noise_type", text="Type", expand=True)
++              
++              col = layout.column_flow()      
++              col.itemR(tex, "noise_size", text="Size")
++              col.itemR(tex, "noise_depth", text="Depth")
++              col.itemR(tex, "turbulence")
++              col.itemR(tex, "nabla")
++
++class TEXTURE_PT_magic(TextureButtonsPanel):
++      __idname__= "TEXTURE_PT_magic"
++      __label__ = "Magic"
++      
++      def poll(self, context):
++              tex = context.active_object.active_material.active_texture.texture
++              return (tex and tex.type == "MAGIC")    
++
++      def draw(self, context):
++              layout = self.layout
++              tex = context.active_object.active_material.active_texture.texture
++                      
++              row = layout.row()
++              row.itemR(tex, "noise_depth", text="Depth")
++              row.itemR(tex, "turbulence")
++
++class TEXTURE_PT_blend(TextureButtonsPanel):
++      __idname__= "TEXTURE_PT_blend"
++      __label__ = "Blend"
++      
++      def poll(self, context):
++              tex = context.active_object.active_material.active_texture.texture
++              return (tex and tex.type == "BLEND")    
++
++      def draw(self, context):
++              layout = self.layout
++              tex = context.active_object.active_material.active_texture.texture
++
++              layout.itemR(tex, "progression")
++              layout.itemR(tex, "flip_axis")
++                      
++class TEXTURE_PT_stucci(TextureButtonsPanel):
++      __idname__= "TEXTURE_PT_stucci"
++      __label__ = "Stucci"
++      
++      def poll(self, context):
++              tex = context.active_object.active_material.active_texture.texture
++              return (tex and tex.type == "STUCCI")   
++
++      def draw(self, context):
++              layout = self.layout
++              tex = context.active_object.active_material.active_texture.texture
++              
++              layout.itemR(tex, "stype", expand=True)
++              layout.itemL(text="Noise:")
++              layout.itemR(tex, "noise_basis", text="Basis")
++              layout.itemR(tex, "noise_type", text="Type", expand=True)
++              
++              row = layout.row()
++              row.itemR(tex, "noise_size", text="Size")
++              row.itemR(tex, "turbulence")
++              
++class TEXTURE_PT_image(TextureButtonsPanel):
++      __idname__= "TEXTURE_PT_image"
++      __label__ = "Image/Movie"
++      
++      def poll(self, context):
++              tex = context.active_object.active_material.active_texture.texture
++              return (tex and tex.type == "IMAGE")    
++
++      def draw(self, context):
++              layout = self.layout
++              tex = context.active_object.active_material.active_texture.texture
++              
++              split = layout.split()
++              
++              sub = split.column()            
++              sub.itemR(tex, "flip_axis")
++              sub.itemR(tex, "normal_map")
++              sub.itemL(text="Filter:")
++              sub.itemR(tex, "mipmap")
++              sub.itemR(tex, "mipmap_gauss")
++              sub.itemR(tex, "interpolation")
++              sub = split.column() 
++              sub.itemL(text="Alpha:")
++              sub.itemR(tex, "use_alpha")
++              sub.itemR(tex, "calculate_alpha")
++              sub.itemR(tex, "invert_alpha")
++
++class TEXTURE_PT_mapping(TextureButtonsPanel):
++      __idname__= "TEXTURE_PT_mapping"
++      __label__ = "Mapping"
++      
++      def poll(self, context):
++              tex = context.active_object.active_material.active_texture.texture
++              return (tex and tex.type == "IMAGE")    
++
++      def draw(self, context):
++              layout = self.layout
++              tex = context.active_object.active_material.active_texture.texture
++                              
++              split = layout.split()
++              
++              sub = split.column()
++              #sub.itemR(tex, "crop_rectangle")
++              sub.itemL(text="Crop Minimum:")
++              sub.itemR(tex, "crop_min_x", text="X")
++              sub.itemR(tex, "crop_min_y", text="Y")
++              sub = split.column()
++              sub.itemL(text="Crop Maximum:")
++              sub.itemR(tex, "crop_max_x", text="X")
++              sub.itemR(tex, "crop_max_y", text="Y")
++              
++              layout.itemR(tex, "extension")
++              
++              split = layout.split()
++              
++              sub = split.column()
++              if tex.extension == 'REPEAT': 
++                      sub.itemL(text="Repeat:")
++                      sub.itemR(tex, "repeat_x", text="X")
++                      sub.itemR(tex, "repeat_y", text="Y")
++                      sub = split.column()
++                      sub.itemL(text="Mirror:")
++                      sub.itemR(tex, "mirror_x", text="X")
++                      sub.itemR(tex, "mirror_y", text="Y")
++              elif tex.extension == 'CHECKER': 
++                      sub.itemR(tex, "checker_even", text="Even")
++                      sub.itemR(tex, "checker_odd", text="Odd")
++                      sub = split.column()
++                      sub.itemR(tex, "checker_distance", text="Distance")
++      
++class TEXTURE_PT_plugin(TextureButtonsPanel):
++      __idname__= "TEXTURE_PT_plugin"
++      __label__ = "Plugin"
++      
++      def poll(self, context):
++              tex = context.active_object.active_material.active_texture.texture
++              return (tex and tex.type == "PLUGIN")   
++
++      def draw(self, context):
++              layout = self.layout
++              tex = context.active_object.active_material.active_texture.texture
++              
++              layout.itemL(text="Nothing yet")
++              
++class TEXTURE_PT_envmap(TextureButtonsPanel):
++      __idname__= "TEXTURE_PT_envmap"
++      __label__ = "Environment Map"
++      
++      def poll(self, context):
++              tex = context.active_object.active_material.active_texture.texture
++              return (tex and tex.type == "ENVIRONMENT_MAP")  
++
++      def draw(self, context):
++              layout = self.layout
++              tex = context.active_object.active_material.active_texture.texture
++              
++              layout.itemL(text="Nothing yet")
++              
++class TEXTURE_PT_musgrave(TextureButtonsPanel):
++      __idname__= "TEXTURE_PT_musgrave"
++      __label__ = "Musgrave"
++      
++      def poll(self, context):
++              tex = context.active_object.active_material.active_texture.texture
++              return (tex and tex.type == "MUSGRAVE") 
++
++      def draw(self, context):
++              layout = self.layout
++              tex = context.active_object.active_material.active_texture.texture
++              
++              split = layout.split()
++              
++              sub = split.column()   
++              sub.itemR(tex, "highest_dimension", text="Dimension")
++              sub.itemR(tex, "lacunarity")
++              sub.itemR(tex, "octaves")
++              sub = split.column() 
++              if (tex.musgrave_type in ('HETERO_TERRAIN', 'RIDGED_MULTIFRACTAL', 'HYBRID_MULTIFRACTAL')):
++                      sub.itemR(tex, "offset")
++              if (tex.musgrave_type in ('RIDGED_MULTIFRACTAL', 'HYBRID_MULTIFRACTAL')):
++                      sub.itemR(tex, "gain")
++                      sub.itemR(tex, "noise_intensity", text="Intensity")
++              
++              layout.itemL(text="Noise:")
++              layout.itemR(tex, "noise_basis", text="Basis")
++              layout.itemR(tex, "musgrave_type")      
++              
++              row = layout.row()
++              row.itemR(tex, "noise_size", text="Size")
++              row.itemR(tex, "nabla")
++
++class TEXTURE_PT_voronoi(TextureButtonsPanel):
++      __idname__= "TEXTURE_PT_voronoi"
++      __label__ = "Voronoi"
++      
++      def poll(self, context):
++              tex = context.active_object.active_material.active_texture.texture
++              return (tex and tex.type == "VORONOI")  
++
++      def draw(self, context):
++              layout = self.layout
++              tex = context.active_object.active_material.active_texture.texture
++      
++              layout.itemR(tex, "distance_metric")
++              layout.itemR(tex, "color_type")
++              
++              split = layout.split()
++              
++              sub = split.column()   
++              sub.itemR(tex, "minkovsky_exponent", text="Minkovsky")
++              sub.itemR(tex, "noise_intensity", text="Intensity")
++              sub = split.column()
++              sub.itemR(tex, "feature_weights", slider=True)
++              
++              layout.itemL(text="Noise:")
++              
++              row = layout.row()
++              row.itemR(tex, "noise_size", text="Size")
++              row.itemR(tex, "nabla")
++                      
++class TEXTURE_PT_distortednoise(TextureButtonsPanel):
++      __idname__= "TEXTURE_PT_distortednoise"
++      __label__ = "Distorted Noise"
++      
++      def poll(self, context):
++              tex = context.active_object.active_material.active_texture.texture
++              return (tex and tex.type == "DISTORTED_NOISE")  
++
++      def draw(self, context):
++              layout = self.layout
++              tex = context.active_object.active_material.active_texture.texture
++ 
++              layout.itemR(tex, "noise_distortion")
++              layout.itemR(tex, "noise_basis", text="Basis")
++              
++              row = layout.row()
++              row.itemR(tex, "noise_size", text="Size")
++              row.itemR(tex, "nabla") 
++
++bpy.types.register(TEXTURE_PT_texture)
++bpy.types.register(TEXTURE_PT_clouds)
++bpy.types.register(TEXTURE_PT_wood)
++bpy.types.register(TEXTURE_PT_marble)
++bpy.types.register(TEXTURE_PT_magic)
++bpy.types.register(TEXTURE_PT_blend)
++bpy.types.register(TEXTURE_PT_stucci)
++bpy.types.register(TEXTURE_PT_image)
++bpy.types.register(TEXTURE_PT_mapping)
++bpy.types.register(TEXTURE_PT_plugin)
++bpy.types.register(TEXTURE_PT_envmap)
++bpy.types.register(TEXTURE_PT_musgrave)
++bpy.types.register(TEXTURE_PT_voronoi)
++bpy.types.register(TEXTURE_PT_distortednoise)
index 44ce472bf5d4682e14d3df45dc609a3d7df9da78,44ce472bf5d4682e14d3df45dc609a3d7df9da78..0bcd466366a3efa3538c104bb4a42a7756a18364
@@@ -16,15 -16,15 +16,15 @@@ class WORLD_PT_world(WorldButtonsPanel)
                world = context.scene.world
                layout = self.layout
                
--              layout.row()
--              layout.itemR(world, "blend_sky")
--              layout.itemR(world, "paper_sky")
--              layout.itemR(world, "real_sky")
++              row = layout.row()
++              row.itemR(world, "blend_sky")
++              row.itemR(world, "paper_sky")
++              row.itemR(world, "real_sky")
                
--              layout.row()
--              layout.itemR(world, "horizon_color")
--              layout.itemR(world, "zenith_color")
--              layout.itemR(world, "ambient_color")
++              row = layout.row()
++              row.column().itemR(world, "horizon_color")
++              row.column().itemR(world, "zenith_color")
++              row.column().itemR(world, "ambient_color")
                
  class WORLD_PT_color_correction(WorldButtonsPanel):
        __label__ = "Color Correction"
                world = context.scene.world
                layout = self.layout
  
--              layout.row()
--              layout.itemR(world, "exposure")
--              layout.itemR(world, "range")
++              row = layout.row()
++              row.itemR(world, "exposure")
++              row.itemR(world, "range")
        
  class WORLD_PT_mist(WorldButtonsPanel):
        __label__ = "Mist"
  
++      def draw_header(self, context):
++              world = context.scene.world
++
++              layout = self.layout
++              layout.itemR(world.mist, "enabled", text="")
++
        def draw(self, context):
                world = context.scene.world
                layout = self.layout
  
--              layout.row()
--              layout.itemR(world.mist, "enabled", text="Enable")
--              if (world.mist.enabled):
--      
--                      layout.column_flow()
--                      layout.itemR(world.mist, "start")
--                      layout.itemR(world.mist, "depth")
--                      layout.itemR(world.mist, "height")
--                      layout.itemR(world.mist, "intensity")
--                      layout.column()
--                      layout.itemL(text="Fallof:")
--                      layout.itemR(world.mist, "falloff", expand=True)
++              flow = layout.column_flow()
++              flow.itemR(world.mist, "start")
++              flow.itemR(world.mist, "depth")
++              flow.itemR(world.mist, "height")
++              flow.itemR(world.mist, "intensity")
++              col = layout.column()
++              col.itemL(text="Fallof:")
++              col.row().itemR(world.mist, "falloff", expand=True)
                
  class WORLD_PT_stars(WorldButtonsPanel):
        __label__ = "Stars"
  
--      def draw(self, context):
++      def draw_header(self, context):
                world = context.scene.world
++
                layout = self.layout
++              layout.itemR(world.stars, "enabled", text="")
  
--              layout.row()
--              layout.itemR(world.stars, "enabled", text="Enable")
--              if (world.stars.enabled):
++      def draw(self, context):
++              world = context.scene.world
++              layout = self.layout
  
--                      layout.column_flow()
--                      layout.itemR(world.stars, "size")
--                      layout.itemR(world.stars, "min_distance", text="MinDist")
--                      layout.itemR(world.stars, "average_separation", text="StarDist")
--                      layout.itemR(world.stars, "color_randomization", text="Colnoise")
++              flow = layout.column_flow()
++              flow.itemR(world.stars, "size")
++              flow.itemR(world.stars, "min_distance", text="Min. Dist")
++              flow.itemR(world.stars, "average_separation", text="Separation")
++              flow.itemR(world.stars, "color_randomization", text="Random:")
                
  class WORLD_PT_ambient_occlusion(WorldButtonsPanel):
        __label__ = "Ambient Occlusion"
  
++      def draw_header(self, context):
++              world = context.scene.world
++
++              layout = self.layout
++              layout.itemR(world.ambient_occlusion, "enabled", text="")
++
        def draw(self, context):
                world = context.scene.world
                layout = self.layout
  
                ao = world.ambient_occlusion
                
--              layout.row()
--              layout.itemR(ao, "enabled", text="Enable")
--              if (ao.enabled):
--
--                      layout.row()
--                      layout.itemR(ao, "gather_method", expand=True)
++              row = layout.row()
++              row.itemR(ao, "gather_method", expand=True)
++              
++              if ao.gather_method == 'RAYTRACE':
++                      row = layout.row()
++                      row.itemR(ao, "samples")
++                      row.itemR(ao, "distance")
                        
--                      if ao.gather_method == 'RAYTRACE':
--                              layout.row()
--                              layout.itemR(ao, "samples")
--                              layout.itemR(ao, "distance")
--                              
--                              layout.row()
--                              layout.itemR(ao, "sample_method")
--                              if ao.sample_method == 'ADAPTIVE_QMC':
--                                      layout.row()
--                                      layout.itemR(ao, "threshold")
--                                      layout.itemR(ao, "adapt_to_speed")
--                                      
--                              if ao.sample_method == 'CONSTANT_JITTERED':
--                                      layout.row()
--                                      layout.itemR(ao, "bias")
--                                                      
--                      if ao.gather_method == 'APPROXIMATE':
--                              layout.row()
--                              layout.itemR(ao, "passes")
--                              layout.itemR(ao, "error_tolerance")
++                      row = layout.row()
++                      row.itemR(ao, "sample_method")
++                      if ao.sample_method == 'ADAPTIVE_QMC':
++                              row = layout.row()
++                              row.itemR(ao, "threshold")
++                              row.itemR(ao, "adapt_to_speed")
                                
--                              layout.row()
--                              layout.itemR(ao, "correction")
--                              layout.itemR(ao, "pixel_cache")
++                      if ao.sample_method == 'CONSTANT_JITTERED':
++                              row = layout.row()
++                              row.itemR(ao, "bias")
++                                              
++              if ao.gather_method == 'APPROXIMATE':
++                      row = layout.row()
++                      row.itemR(ao, "passes")
++                      row.itemR(ao, "error_tolerance", text="Error")
++                      
++                      row = layout.row()
++                      row.itemR(ao, "correction")
++                      row.itemR(ao, "pixel_cache")
  
--                      layout.row()
--                      layout.itemS()
--                              
--                      layout.row()
--                      layout.itemR(ao, "falloff")     
--                      layout.itemR(ao, "strength")
++              row = layout.row()
++              row.itemS()
                        
--                      layout.column()
--                      layout.itemR(ao, "blend_mode", expand=True)
--                      layout.itemR(ao, "color", expand=True)
--                      layout.itemR(ao, "energy")
++              row = layout.row()
++              row.itemR(ao, "falloff")        
++              row.itemR(ao, "strength")
++              
++              col = layout.column()
++              col.row().itemR(ao, "blend_mode", expand=True)
++              col.row().itemR(ao, "color", expand=True)
++              col.itemR(ao, "energy")
        
  bpy.types.register(WORLD_PT_world)
++bpy.types.register(WORLD_PT_ambient_occlusion)
  bpy.types.register(WORLD_PT_mist)
  bpy.types.register(WORLD_PT_stars)
--bpy.types.register(WORLD_PT_ambient_occlusion)
  bpy.types.register(WORLD_PT_color_correction)
  
index a3d27370ffa5b33f1e55a3b58fdc9dfd6940e367,a3d27370ffa5b33f1e55a3b58fdc9dfd6940e367..d4187c10b69beb752ad3938705f2059efcf234f1
@@@ -18,38 -18,38 +18,40 @@@ class TEXT_HT_header(bpy.types.Header)
                text = st.text
                layout = self.layout
  
--              layout.template_header()
--              layout.itemM("TEXT_MT_text")
--              if text:
--                      layout.itemM("TEXT_MT_edit")
--                      layout.itemM("TEXT_MT_format")
++              layout.template_header(context)
++
++              if context.area.show_menus:
++                      row = layout.row(align=True)
++                      row.itemM(context, "TEXT_MT_text")
++                      if text:
++                              row.itemM(context, "TEXT_MT_edit")
++                              row.itemM(context, "TEXT_MT_format")
  
                if text and text.modified:
--                      layout.row()
--                      # layout.color(redalert)
--                      layout.itemO("TEXT_OT_resolve_conflict", text="", icon=ICON_HELP)
++                      row = layout.row()
++                      # row.color(redalert)
++                      row.itemO("TEXT_OT_resolve_conflict", text="", icon=ICON_HELP)
  
--              layout.row()
--              layout.itemR(st, "line_numbers", text="", icon=ICON_LINENUMBERS_OFF)
--              layout.itemR(st, "word_wrap", text="", icon=ICON_WORDWRAP_OFF)
--              layout.itemR(st, "syntax_highlight", text="", icon=ICON_SYNTAX_OFF)
--              # layout.itemR(st, "do_python_plugins", text="", icon=ICON_SCRIPTPLUGINS)
++              row = layout.row(align=True)
++              row.itemR(st, "line_numbers", text="", icon=ICON_LINENUMBERS_OFF)
++              row.itemR(st, "word_wrap", text="", icon=ICON_WORDWRAP_OFF)
++              row.itemR(st, "syntax_highlight", text="", icon=ICON_SYNTAX_OFF)
++              # row.itemR(st, "do_python_plugins", text="", icon=ICON_SCRIPTPLUGINS)
  
--              layout.row()
--              layout.template_header_ID(st, "text", new="TEXT_OT_new", open="TEXT_OT_open", unlink="TEXT_OT_unlink")
++              layout.template_header_ID(context, st, "text", new="TEXT_OT_new", open="TEXT_OT_open", unlink="TEXT_OT_unlink")
  
                if text:
--                      layout.row()
++                      row = layout.row()
                        if text.filename != "":
                                if text.dirty:
--                                      layout.itemL(text="File: *" + text.filename + " (unsaved)")
++                                      row.itemL(text="File: *" + text.filename + " (unsaved)")
                                else:
--                                      layout.itemL(text="File: " + text.filename)
++                                      row.itemL(text="File: " + text.filename)
                        else:
                                if text.library:
--                                      layout.itemL(text="Text: External")
++                                      row.itemL(text="Text: External")
                                else:
--                                      layout.itemL(text="Text: Internal")
++                                      row.itemL(text="Text: Internal")
  
  class TEXT_PT_properties(bpy.types.Panel):
        __space_type__ = "TEXT_EDITOR"
                st = context.space_data
                layout = self.layout
  
--              layout.column_flow()
--              layout.itemR(st, "line_numbers", icon=ICON_LINENUMBERS_OFF)
--              layout.itemR(st, "word_wrap", icon=ICON_WORDWRAP_OFF)
--              layout.itemR(st, "syntax_highlight", icon=ICON_SYNTAX_OFF)
++              flow = layout.column_flow()
++              flow.itemR(st, "line_numbers", icon=ICON_LINENUMBERS_OFF)
++              flow.itemR(st, "word_wrap", icon=ICON_WORDWRAP_OFF)
++              flow.itemR(st, "syntax_highlight", icon=ICON_SYNTAX_OFF)
  
--              layout.column_flow()
--              layout.itemR(st, "font_size")
--              layout.itemR(st, "tab_width")
++              flow = layout.column_flow()
++              flow.itemR(st, "font_size")
++              flow.itemR(st, "tab_width")
  
  class TEXT_PT_find(bpy.types.Panel):
        __space_type__ = "TEXT_EDITOR"
                layout = self.layout
  
                # find
--              layout.row()
--              layout.itemR(st, "find_text", text="")
--              layout.itemO("TEXT_OT_find_set_selected", text="", icon=ICON_TEXT)
--              layout.column()
--              layout.itemO("TEXT_OT_find")
++              col = layout.column(align=True)
++              row = col.row()
++              row.itemR(st, "find_text", text="")
++              row.itemO("TEXT_OT_find_set_selected", text="", icon=ICON_TEXT)
++              col.itemO("TEXT_OT_find")
  
                # replace
--              layout.row()
--              layout.itemR(st, "replace_text", text="")
--              layout.itemO("TEXT_OT_replace_set_selected", text="", icon=ICON_TEXT)
--              layout.column()
--              layout.itemO("TEXT_OT_replace")
++              col = layout.column(align=True)
++              row = col.row()
++              row.itemR(st, "replace_text", text="")
++              row.itemO("TEXT_OT_replace_set_selected", text="", icon=ICON_TEXT)
++              col.itemO("TEXT_OT_replace")
  
                # mark
--              layout.column()
                layout.itemO("TEXT_OT_mark_all")
  
                # settings
--              layout.row()
--              layout.itemR(st, "find_wrap", text="Wrap")
--              layout.itemR(st, "find_all", text="All")
++              row = layout.row()
++              row.itemR(st, "find_wrap", text="Wrap")
++              row.itemR(st, "find_all", text="All")
  
  class TEXT_MT_text(bpy.types.Menu):
        __space_type__ = "TEXT_EDITOR"
index 10bbdb4851b21a9cc10e7a597d7ca750998e3338,10bbdb4851b21a9cc10e7a597d7ca750998e3338..14bc6a33b72e903de1f24986f6e53364e642feff
@@@ -138,7 -138,7 +138,7 @@@ int BLF_load(char *name
  
        filename= blf_dir_search(name);
        if (!filename) {
--              printf("Can't found font: %s\n", name);
++              printf("Can't find font: %s\n", name);
                return(-1);
        }
  
index 555b467b1d6ae44a91be12fd381803f117185461,555b467b1d6ae44a91be12fd381803f117185461..6f6c4a834dfcdde78761485ce4731d816a7bd805
@@@ -58,6 -58,6 +58,7 @@@ void                          curvemapping_premultiply(struc
  int                                   curvemapping_RGBA_does_something(struct CurveMapping *cumap);
  void                          curvemapping_initialize(struct CurveMapping *cumap);
  void                          curvemapping_table_RGBA(struct CurveMapping *cumap, float **array, int *size);
++void                          colorcorrection_do_ibuf(struct ImBuf *ibuf, const char *profile);
  
  #endif
  
index 3b0ff2db6f46292bfd328c3f06558db5c972dbd9,3b0ff2db6f46292bfd328c3f06558db5c972dbd9..29a522d711fce399e7f5de37d3d7f6384ba01ed2
@@@ -60,12 -60,12 +60,12 @@@ void multires_force_update(struct Objec
  struct DerivedMesh *multires_dm_create_from_derived(struct MultiresModifierData*, struct DerivedMesh*,
                                                    struct Mesh *, int, int);
  
++struct MultiresModifierData *find_multires_modifier(struct Object *ob);
  int multiresModifier_switch_level(struct Object *, const int);
  void multiresModifier_join(struct Object *);
  void multiresModifier_del_levels(struct MultiresModifierData *, struct Object *, int direction);
  void multiresModifier_subdivide(struct MultiresModifierData *mmd, struct Object *ob, int distance,
                                int updateblock, int simple);
--void multiresModifier_setLevel(void *mmd_v, void *ob_v);
  int multiresModifier_reshape(struct MultiresModifierData *mmd, struct Object *dst, struct Object *src);
  
  /* Related to the old multires */
index 2af72d987013c3e3aa13a448c6c76e9e7e1c1798,2af72d987013c3e3aa13a448c6c76e9e7e1c1798..3d71193f37a5ea6bb4384a9ddc0a3ec69f42d736
@@@ -85,6 -85,6 +85,7 @@@ struct Object *add_object(struct Scene 
  struct Object *copy_object(struct Object *ob);
  void expand_local_object(struct Object *ob);
  void make_local_object(struct Object *ob);
++int object_data_is_libdata(struct Object *ob);
  void set_mblur_offs(float blur);
  void set_field_offs(float field);
  void disable_speed_curve(int val);
index 4797616a471f2c8c802c382d0a23d6b1235ce820,4797616a471f2c8c802c382d0a23d6b1235ce820..9b5d99f6ae6eff043cc965023aedb95f14e94dde
@@@ -159,6 -159,6 +159,8 @@@ typedef struct PanelType 
  
        /* verify if the panel should draw or not */
        int                     (*poll)(const struct bContext *, struct PanelType *);
++      /* draw header (optional) */
++      void            (*draw_header)(const struct bContext *, struct Panel *);        
        /* draw entirely, view changes should be handled here */
        void            (*draw)(const struct bContext *, struct Panel *);       
  
index 19d150b34a84315289c7957c73c5ecb7af5c5655,19d150b34a84315289c7957c73c5ecb7af5c5655..dbc990d06137ff52d3613dfd678b076876898f2d
@@@ -55,6 -55,6 +55,9 @@@ if env['WITH_BF_BULLET']
  if env['BF_NO_ELBEEM']:
        defs.append('DISABLE_ELBEEM')
  
++if env['WITH_BF_LCMS']:
++      defs.append('WITH_LCMS')
++      
  if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc'):
      incs += ' ' + env['BF_PTHREADS_INC']
  
index 1bc34aea9a135896dab31ad276db682ba8a10372,1bc34aea9a135896dab31ad276db682ba8a10372..e8716aba296fb3b47f51cfeacb68d57f27678336
  #include <stdlib.h>
  #include <float.h>
  
++#ifdef WITH_LCMS
++#include <lcms.h>
++#endif
++
  #include "MEM_guardedalloc.h"
  
  #include "DNA_color_types.h"
@@@ -650,6 -650,6 +654,38 @@@ void curvemapping_evaluate_premulRGBF(C
        vecout[2]= curvemap_evaluateF(cumap->cm+2, fac);
  }
  
++void colorcorrection_do_ibuf(ImBuf *ibuf, const char *profile)
++{
++      if (ibuf->crect == NULL)
++      {
++#ifdef WITH_LCMS
++              cmsHPROFILE imageProfile, proofingProfile;
++              cmsHTRANSFORM hTransform;
++              
++              ibuf->crect = MEM_mallocN(ibuf->x*ibuf->y*sizeof(int), "imbuf crect");
++
++              imageProfile  = cmsCreate_sRGBProfile();
++              proofingProfile = cmsOpenProfileFromFile(profile, "r");
++              
++              cmsErrorAction(LCMS_ERROR_SHOW);
++      
++              hTransform = cmsCreateProofingTransform(imageProfile, TYPE_RGBA_8, imageProfile, TYPE_RGBA_8, 
++                                                proofingProfile,
++                                                INTENT_ABSOLUTE_COLORIMETRIC,
++                                                INTENT_ABSOLUTE_COLORIMETRIC,
++                                                cmsFLAGS_SOFTPROOFING);
++      
++              cmsDoTransform(hTransform, ibuf->rect, ibuf->crect, ibuf->x * ibuf->y);
++      
++              cmsDeleteTransform(hTransform);
++              cmsCloseProfile(imageProfile);
++              cmsCloseProfile(proofingProfile);
++#else
++              ibuf->crect = ibuf->rect;
++#endif
++      }
++}
++
  
  void curvemapping_do_ibuf(CurveMapping *cumap, ImBuf *ibuf)
  {
index cade555a07ab87adae3e0828217414213c39db4f,cade555a07ab87adae3e0828217414213c39db4f..fed5ffc2ebdb7ced01104bebe58b14870f92785b
@@@ -210,8 -210,8 +210,10 @@@ void calc_fcurve_bounds (FCurve *fcu, f
                                BezTriple *bezt;
                                
                                for (bezt=fcu->bezt, i=0; i < fcu->totvert; bezt++, i++) {
--                                      yminv= MIN2(yminv, bezt->vec[1][1]);
--                                      ymaxv= MAX2(ymaxv, bezt->vec[1][1]);
++                                      if (bezt->vec[1][1] < yminv)
++                                              yminv= bezt->vec[1][1];
++                                      if (bezt->vec[1][1] > ymaxv)
++                                              ymaxv= bezt->vec[1][1];
                                }
                        }
                }
                                FPoint *fpt;
                                
                                for (fpt=fcu->fpt, i=0; i < fcu->totvert; fpt++, i++) {
--                                      yminv= MIN2(yminv, fpt->vec[1]);
--                                      ymaxv= MAX2(ymaxv, fpt->vec[1]);
++                                      if (fpt->vec[1] < yminv)
++                                              yminv= fpt->vec[1];
++                                      if (fpt->vec[1] > ymaxv)
++                                              ymaxv= fpt->vec[1];
                                }
                        }
                }
index 43791e32b3805693ed49edbf563d69afd018d04f,43791e32b3805693ed49edbf563d69afd018d04f..6a01311f6fc28795a2e6a3466e952ef200f895ad
@@@ -160,7 -160,7 +160,7 @@@ static AdrBit2Path ma_mode_bits[]= 
  //    ...
        {MA_RAYTRANSP, "raytrace_transparency.enabled", 0},
        {MA_RAYMIRROR, "raytrace_mirror.enabled", 0},
--      {MA_HALO, "halo.enabled", 0}
++//    {MA_HALO, "type", MA_TYPE_HALO}
  };
  
  /* ----------------- */
index 6578feeeed17d8c985c7baeaab39473830eb317a,6578feeeed17d8c985c7baeaab39473830eb317a..d02b660d99262c2361191838137e7d3aaa3171ee
@@@ -4058,17 -4058,17 +4058,15 @@@ static void decimateModifier_copyData(M
        tdmd->percent = dmd->percent;
  }
  
--//XXX
--#if 0 
  static DerivedMesh *decimateModifier_applyModifier(
                ModifierData *md, Object *ob, DerivedMesh *derivedData,
    int useRenderParams, int isFinalCalc)
  {
--      DecimateModifierData *dmd = (DecimateModifierData*) md;
++      // DecimateModifierData *dmd = (DecimateModifierData*) md;
        DerivedMesh *dm = derivedData, *result = NULL;
        MVert *mvert;
        MFace *mface;
--      LOD_Decimation_Info lod;
++      // LOD_Decimation_Info lod;
        int totvert, totface;
        int a, numTris;
  
                goto exit;
        }
  
++      // XXX
++#if 0
        lod.vertex_buffer= MEM_mallocN(3*sizeof(float)*totvert, "vertices");
        lod.vertex_normal_buffer= MEM_mallocN(3*sizeof(float)*totvert, "normals");
        lod.triangle_index_buffer= MEM_mallocN(3*sizeof(int)*numTris, "trias");
        MEM_freeN(lod.vertex_buffer);
        MEM_freeN(lod.vertex_normal_buffer);
        MEM_freeN(lod.triangle_index_buffer);
++#else
++      modifier_setError(md, "Modifier not working yet in 2.5.");
++      goto exit;
++#endif
  
  exit:
                return result;
  }
--#endif
  
  /* Smooth */
  
@@@ -8271,7 -8271,7 +8274,7 @@@ ModifierTypeInfo *modifierType_getInfo(
                mti->flags = eModifierTypeFlag_AcceptsMesh;
                mti->initData = decimateModifier_initData;
                mti->copyData = decimateModifier_copyData;
--              //XXX mti->applyModifier = decimateModifier_applyModifier;
++              mti->applyModifier = decimateModifier_applyModifier;
  
                mti = INIT_TYPE(Smooth);
                mti->type = eModifierTypeType_OnlyDeform;
index dfd83a7b42ef4e88f4b6670046d6076d1190d0a3,dfd83a7b42ef4e88f4b6670046d6076d1190d0a3..244c2711e63c33d5c26659087450cae5e9cd001f
@@@ -59,16 -59,16 +59,26 @@@ static const int multires_max_levels = 
  static const int multires_quad_tot[] = {4, 9, 25, 81, 289, 1089, 4225, 16641, 66049, 263169, 1050625, 4198401, 16785409};
  static const int multires_side_tot[] = {2, 3, 5,  9,  17,  33,   65,   129,   257,   513,    1025,    2049,    4097};
  
--int multiresModifier_switch_level(Object *ob, const int distance)
++MultiresModifierData *find_multires_modifier(Object *ob)
  {
--      ModifierData *md = NULL;
++      ModifierData *md;
        MultiresModifierData *mmd = NULL;
  
        for(md = ob->modifiers.first; md; md = md->next) {
--              if(md->type == eModifierType_Multires)
++              if(md->type == eModifierType_Multires) {
                        mmd = (MultiresModifierData*)md;
++                      break;
++              }
        }
  
++      return mmd;
++
++}
++
++int multiresModifier_switch_level(Object *ob, const int distance)
++{
++      MultiresModifierData *mmd = find_multires_modifier(ob);
++
        if(mmd) {
                mmd->lvl += distance;
                if(mmd->lvl < 1) mmd->lvl = 1;
index b913651d8561e1bd25064d56d139f9b4aa8d8598,b913651d8561e1bd25064d56d139f9b4aa8d8598..d7619010808a4f4f8ecfcd2f3e69860ac57443bb
@@@ -1320,6 -1320,6 +1320,18 @@@ void make_local_object(Object *ob
        expand_local_object(ob);
  }
  
++/* returns true if the Object data is a from an external blend file (libdata) */
++int object_data_is_libdata(Object *ob)
++{
++      if(!ob) return 0;
++      if(ob->proxy) return 0;
++      if(ob->id.lib) return 1;
++      if(!ob->data) return 0;
++      if(((ID *)ob->data)->lib) return 1;
++
++      return 0;
++}
++
  /* *************** PROXY **************** */
  
  /* when you make proxy, ensure the exposed layers are extern */
index 676a7e32333b7a2325ee5794e33c010babd94db9,676a7e32333b7a2325ee5794e33c010babd94db9..ffebd05f2f607f722e509389f4d9eeb4c3dfff2f
@@@ -153,7 -153,7 +153,7 @@@ int BLI_is_writable(char *filename
  {
        int file;
        
--      file = open(filename, O_BINARY | O_RDWR | O_CREAT | O_TRUNC, 0666);
++      file = open(filename, O_BINARY | O_RDWR, 0666);
        
        if (file < 0)
                return 0;
index fd9da2059e1ea55a2cc4c58a40fde9705b586fa6,fd9da2059e1ea55a2cc4c58a40fde9705b586fa6..9c5735a3020150f5103d80cc99b7bc7ab9e94d5c
@@@ -2176,9 -2176,9 +2176,12 @@@ static void direct_link_constraints(Fil
                
                if (cons->type == CONSTRAINT_TYPE_PYTHON) {
                        bPythonConstraint *data= cons->data;
++                      
                        link_list(fd, &data->targets);
++                      
                        data->prop = newdataadr(fd, data->prop);
--                      IDP_DirectLinkProperty(data->prop, (fd->flags & FD_FLAGS_SWITCH_ENDIAN), fd);
++                      if (data->prop)
++                              IDP_DirectLinkProperty(data->prop, (fd->flags & FD_FLAGS_SWITCH_ENDIAN), fd);
                }
        }
  }
@@@ -3417,7 -3417,7 +3420,13 @@@ static void direct_link_pose(FileData *
                pchan->bone= NULL;
                pchan->parent= newdataadr(fd, pchan->parent);
                pchan->child= newdataadr(fd, pchan->child);
++              
                direct_link_constraints(fd, &pchan->constraints);
++              
++              pchan->prop = newdataadr(fd, pchan->prop);
++              if (pchan->prop)
++                      IDP_DirectLinkProperty(pchan->prop, (fd->flags & FD_FLAGS_SWITCH_ENDIAN), fd);
++              
                pchan->iktree.first= pchan->iktree.last= NULL;
                pchan->path= NULL;
        }
@@@ -5641,7 -5641,7 +5650,6 @@@ static void area_add_window_regions(Scr
                        {
                                SpaceButs *sbuts= (SpaceButs *)sl;
                                memcpy(&ar->v2d, &sbuts->v2d, sizeof(View2D));
--                              ar->v2d.keepzoom |= V2D_KEEPASPECT;
                                break;
                        }
                        case SPACE_FILE:
@@@ -8904,6 -8904,6 +8912,7 @@@ static void do_versions(FileData *fd, L
           bump the version (or sub-version.) */
        {
                Object *ob;
++              Material *ma;
                int i;
  
                for(ob = main->object.first; ob; ob = ob->id.next) {
                                ob->data = olddata;
                        }
                }
++
++              for(ma = main->mat.first; ma; ma = ma->id.next) {
++                      if(ma->mode & MA_HALO) {
++                              ma->material_type= MA_TYPE_HALO;
++                              ma->mode &= ~MA_HALO;
++                      }
++              }
        }
  
        /* WATCH IT!!!: pointers from libdata have not been converted yet here! */
index b690c708dc37853232e6a9ff0ff7d70cb8adc6aa,b690c708dc37853232e6a9ff0ff7d70cb8adc6aa..943e23861adc2c086468a351837d355af380084b
@@@ -956,6 -956,6 +956,11 @@@ static void write_pose(WriteData *wd, b
  
        /* Write channels */
        for (chan=pose->chanbase.first; chan; chan=chan->next) {
++              /* Write ID Properties -- and copy this comment EXACTLY for easy finding
++               of library blocks that implement this.*/
++              if (chan->prop)
++                      IDP_WriteProperty(chan->prop, wd);
++              
                write_constraints(wd, &chan->constraints);
                
                /* prevent crashes with autosave, when a bone duplicated in editmode has not yet been assigned to its posechannel */
index 67f89b3358df22952356d2770964a687ecac4fb6,67f89b3358df22952356d2770964a687ecac4fb6..afad396607bfb6991b23d388d649e27cb82863ad
@@@ -754,7 -754,7 +754,17 @@@ static int animdata_filter_dopesheet_ma
                Material *ma= give_current_material(ob, a);
                
                /* for now, if no material returned, skip (this shouldn't confuse the user I hope) */
--              if (ELEM3(NULL, ma, ma->adt, ma->adt->action)) continue;
++              if (ELEM(NULL, ma, ma->adt)) 
++                      continue;
++              
++              if ((ads->filterflag & ADS_FILTER_ONLYDRIVERS)==0) {
++                      if (ANIMDATA_HAS_KEYS(ma) == 0)
++                              continue;
++              }
++              else {
++                      if (ANIMDATA_HAS_DRIVERS(ma) == 0)
++                              continue;
++              }
                
                /* make a temp list elem for this */
                ld= MEM_callocN(sizeof(LinkData), "DopeSheet-MaterialCache");
                                }
                        }
                        
--                      /* add material's F-Curve channels? */
++                      /* add material's F-Curve or Driver channels? */
                        if (FILTER_MAT_OBJD(ma) || (filter_mode & ANIMFILTER_CURVESONLY)) {
++                              if ((ads->filterflag & ADS_FILTER_ONLYDRIVERS)==0) {
                                        // XXX the 'owner' info here is still subject to improvement
--                              items += animdata_filter_action(anim_data, ma->adt->action, filter_mode, ma, ANIMTYPE_DSMAT, (ID *)ma);
++                                      items += animdata_filter_action(anim_data, ma->adt->action, filter_mode, ma, ANIMTYPE_DSMAT, (ID *)ma);
++                              }
++                              else {
++                                      // need to make the ownertype normal object here... (maybe type should be a separate one for clarity?)
++                                      items += animdata_filter_fcurves(anim_data, ma->adt->drivers.first, NULL, ma, ANIMTYPE_DSMAT, filter_mode, (ID *)ma);
++                              }       
                        }
                }
        }
index 4d4079a260ad3f2363d1598b9376be2c190d1ceb,4d4079a260ad3f2363d1598b9376be2c190d1ceb..c2a1199f6c69029b58c624c2800e07292642da2a
@@@ -148,12 -148,12 +148,6 @@@ void getname_anim_fcurve(char *name, I
                        
                        /* Array Index - only if applicable */
                        if (RNA_property_array_length(prop)) {
--                                      // XXX the format of these is not final... we don't know how this will go yet
--                                      // format 1 style
--                              //static char *vectoritem[4]= {".X", ".Y", ".Z", ".W"};
--                              //static char *quatitem[4]= {".W", ".X", ".Y", ".Z"};
--                              //static char *coloritem[4]= {".R", ".G", ".B", ".A"};
--                                      // format 2 style
                                static char *vectoritem[4]= {"X ", "Y ", "Z ", "W "};
                                static char *quatitem[4]= {"W ", "X ", "Y ", "Z "};
                                static char *coloritem[4]= {"R ", "G ", "B ", "A "};
                        
                        /* putting this all together into the buffer */
                        // XXX we need to check for invalid names...
--                      //BLI_snprintf(name, 128, "%s.%s%s", structname, propname, arrayname);  // format 1
--                      BLI_snprintf(name, 128, "%s%s (%s)", arrayname, propname, structname);  // format 2
++                      BLI_snprintf(name, 128, "%s%s (%s)", arrayname, propname, structname); 
                        
                        /* free temp name if nameprop is set */
                        if (nameprop)
  
  /* ------------------------------- Color Codes for F-Curve Channels ---------------------------- */
  
++#if 0
  /* used for FCURVE_COLOR_AUTO_RAINBOW */
  // XXX this still doesn't work too great when there are more than 32 curves (which happens most of the time)
  void ipo_rainbow (int cur, int tot, float *out)
        dfac= (float)(1.0/( (float)tot+1.0));
        
        /* this calculation makes 2 or 4 different cycles of rainbow colors */
++              // 2 different cycles - for hue
        if(cur< tot/2) fac= (float)(cur*2.0f*dfac);
        else fac= (float)((cur-tot/2)*2.0f*dfac +dfac);
++      
++              // third cycle with altered hue
        if(tot > 32) fac= fac*1.95f;
++              // clamping for excessive ranges
        if(fac>1.0f) fac-= 1.0f;
        
++              // saturation adjustments for more visible range
        if(fac>0.5f && fac<0.8f) sat= 0.5f;
        else sat= 0.6f;
        
--      //return hsv_to_cpack(fac, sat, 1.0f);
        hsv_to_rgb(fac, sat, 1.0f, out, out+1, out+2);
  }
++#endif
++
++/* step between the major distinguishable color bands of the primary colors */
++#define HSV_BANDWIDTH 0.3f
++
++/* testbed for FCURVE_COLOR_AUTO_RAINBOW determination methods */
++//void fcurve_rainbow (unsigned int cur, unsigned int tot, float *out)
++void ipo_rainbow (int cur, int tot, float *out)
++{
++      float hue, val, sat, fac;
++      int grouping;
++      
++      /* we try to divide the colours into groupings of n colors,
++       * where n is:
++       *      3 - for 'odd' numbers of curves - there should be a majority of triplets of curves
++       *      4 - for 'even' numbers of curves - there should be a majority of quartets of curves
++       * so the base color is simply one of the three primary colors
++       */
++      grouping= (4 - (tot % 2));
++      hue= HSV_BANDWIDTH * (float)(cur % grouping);
++      
++      /* 'Value' (i.e. darkness) needs to vary so that larger sets of three will be 
++       * 'darker' (i.e. smaller value), so that they don't look that similar to previous ones.
++       * However, only a range of 0.3 to 1.0 is really usable to avoid clashing
++       * with some other stuff 
++       */
++      fac = ((float)cur / (float)tot) * 0.7f;
++      
++      /* the base color can get offset a bit so that the colors aren't so identical */
++      hue += fac * HSV_BANDWIDTH; 
++      if (hue > 1.0f) hue= fmod(hue, 1.0f);
++      
++      /* saturation adjustments for more visible range */
++      if ((hue > 0.5f) && (hue < 0.8f)) sat= 0.5f;
++      else sat= 0.6f;
++      
++      /* value is fixed at 1.0f, otherwise we cannot clearly see the curves... */
++      val= 1.0f;
++      
++      /* finally, conver this to RGB colors */
++      hsv_to_rgb(hue, sat, val, out, out+1, out+2); 
++}
index b09cc3b78e196135849fcf605517cac676e2cc83,b09cc3b78e196135849fcf605517cac676e2cc83..9a40fb44f475fd785aa25b1342ae58863abe92b9
@@@ -29,6 -29,6 +29,7 @@@
  #include "BKE_action.h"
  #include "BKE_constraint.h"
  #include "BKE_fcurve.h"
++#include "BKE_global.h"
  #include "BKE_utildefines.h"
  #include "BKE_context.h"
  #include "BKE_report.h"
@@@ -68,6 -68,6 +69,7 @@@ bAction *verify_adt_action (ID *id, sho
                adt= BKE_id_add_animdata(id);
        if (adt == NULL) { 
                /* if still none (as not allowed to add, or ID doesn't have animdata for some reason) */
++              printf("ERROR: Couldn't add AnimData (ID = %s) \n", (id) ? (id->name) : "<None>");
                return NULL;
        }
                
@@@ -793,6 -793,6 +795,9 @@@ short insert_keyframe (ID *id, bAction 
                }
        }
        
++      /* no F-Curve to add keyframes to */
++      printf("ERROR: no F-Curve to add keyframes to \n");
++      
        /* return failure */
        return 0;
  }
@@@ -993,7 -993,7 +998,7 @@@ static int insert_key_menu_invoke (bCon
        uiLayout *layout;
        int i = 0;
        
--      pup= uiPupMenuBegin("Insert Keyframe", 0);
++      pup= uiPupMenuBegin(C, "Insert Keyframe", 0);
        layout= uiPupMenuLayout(pup);
        
        /* active Keying Set */
@@@ -1203,11 -1203,11 +1208,11 @@@ static int insert_key_button_exec (bCon
        memset(&ptr, 0, sizeof(PointerRNA));
        uiAnimContextProperty(C, &ptr, &prop, &index);
        
--      if(ptr.data && prop && RNA_property_animateable(&ptr, prop)) {
++      if ((ptr.data && prop) && RNA_property_animateable(&ptr, prop)) {
                path= RNA_path_from_ID_to_property(&ptr, prop);
                
--              if(path) {
--                      if(all) {
++              if (path) {
++                      if (all) {
                                length= RNA_property_array_length(prop);
                                
                                if(length) index= 0;
                        else
                                length= 1;
                        
--                      for(a=0; a<length; a++)
++                      for (a=0; a<length; a++)
                                success+= insert_keyframe(ptr.id.data, NULL, NULL, path, index+a, cfra, 0);
                        
                        MEM_freeN(path);
                }
++              else {
++                      if (G.f & G_DEBUG)
++                              printf("Button Insert-Key: no path to property \n");
++                      BKE_report(op->reports, RPT_WARNING, "Failed to resolve path to property. Try using a Keying Set instead.");
++              }
++      }
++      else if (G.f & G_DEBUG) {
++              printf("ptr.data = %p, prop = %p,", ptr.data, prop);
++              printf("animateable = %d \n", RNA_property_animateable(&ptr, prop));
        }
        
--      if(success) {
++      if (success) {
                /* send updates */
                ED_anim_dag_flush_update(C);    
                
@@@ -1267,11 -1267,11 +1281,11 @@@ static int delete_key_button_exec (bCon
        memset(&ptr, 0, sizeof(PointerRNA));
        uiAnimContextProperty(C, &ptr, &prop, &index);
  
--      if(ptr.data && prop) {
++      if (ptr.data && prop) {
                path= RNA_path_from_ID_to_property(&ptr, prop);
                
--              if(path) {
--                      if(all) {
++              if (path) {
++                      if (all) {
                                length= RNA_property_array_length(prop);
                                
                                if(length) index= 0;
                        else
                                length= 1;
                        
--                      for(a=0; a<length; a++)
++                      for (a=0; a<length; a++)
                                success+= delete_keyframe(ptr.id.data, NULL, NULL, path, index+a, cfra, 0);
                        
                        MEM_freeN(path);
                }
++              else if (G.f & G_DEBUG)
++                      printf("Button Delete-Key: no path to property \n");
++      }
++      else if (G.f & G_DEBUG) {
++              printf("ptr.data = %p, prop = %p \n", ptr.data, prop);
        }
        
        
index 98f51a4015d0aa247c00e955ee6697b6edb17d66,98f51a4015d0aa247c00e955ee6697b6edb17d66..1c113c25720651d8ebec08d9b0e0cf3a6a556c9e
@@@ -3461,7 -3461,7 +3461,7 @@@ static int armature_subdivs_invoke(bCon
        uiPopupMenu *pup;
        uiLayout *layout;
  
--      pup= uiPupMenuBegin("Subdivision Type", 0);
++      pup= uiPupMenuBegin(C, "Subdivision Type", 0);
        layout= uiPupMenuLayout(pup);
        uiItemsEnumO(layout, "ARMATURE_OT_subdivs", "type");
        uiPupMenuEnd(C, pup);
@@@ -3744,7 -3744,7 +3744,7 @@@ static int armature_parent_set_exec(bCo
  static int armature_parent_set_invoke(bContext *C, wmOperator *op, wmEvent *event)
  {
        EditBone *actbone = CTX_data_active_bone(C);
--      uiPopupMenu *pup= uiPupMenuBegin("Make Parent ", 0);
++      uiPopupMenu *pup= uiPupMenuBegin(C, "Make Parent ", 0);
        uiLayout *layout= uiPupMenuLayout(pup);
        int allchildbones = 0;
        
index 43590346299ee3e4f20aa4054dbeaa365ddfe6fd,43590346299ee3e4f20aa4054dbeaa365ddfe6fd..dec4847f12596e975b9a52e7d128e64699a225e7
@@@ -326,7 -326,7 +326,7 @@@ static int poselib_add_menu_invoke (bCo
                return OPERATOR_CANCELLED;
        
        /* start building */
--      pup= uiPupMenuBegin(op->type->name, 0);
++      pup= uiPupMenuBegin(C, op->type->name, 0);
        layout= uiPupMenuLayout(pup);
        uiLayoutContext(layout, WM_OP_EXEC_DEFAULT);
        
@@@ -460,7 -460,7 +460,7 @@@ static int poselib_stored_pose_menu_inv
                return OPERATOR_CANCELLED;
        
        /* start building */
--      pup= uiPupMenuBegin(op->type->name, 0);
++      pup= uiPupMenuBegin(C, op->type->name, 0);
        layout= uiPupMenuLayout(pup);
        uiLayoutContext(layout, WM_OP_EXEC_DEFAULT);
        
index 49d86d08db22470df61465da7e1c06219ebf14db,49d86d08db22470df61465da7e1c06219ebf14db..5292d86d3c9ab1385a0e6f63f2a98bc8151845c9
@@@ -70,7 -70,7 +70,7 @@@ static int specials_menu_invoke(bContex
        uiPopupMenu *pup;
        uiLayout *layout;
  
--      pup= uiPupMenuBegin("Specials", 0);
++      pup= uiPupMenuBegin(C, "Specials", 0);
        layout= uiPupMenuLayout(pup);
        uiItemO(layout, NULL, 0, "CURVE_OT_subdivide");
        uiItemO(layout, NULL, 0, "CURVE_OT_switch_direction");
index c60007680baf335e4d868deaff3b5003a560a757,c60007680baf335e4d868deaff3b5003a560a757..45b9a589bd51d5f32ba2928e4b2f0143471d373a
@@@ -3567,7 -3567,7 +3567,7 @@@ static int toggle_cyclic_invoke(bContex
        for(nu= editnurb->first; nu; nu= nu->next) {
                if(nu->pntsu>1 || nu->pntsv>1) {
                        if(nu->type==CU_NURBS) {
--                              pup= uiPupMenuBegin("Direction", 0);
++                              pup= uiPupMenuBegin(C, "Direction", 0);
                                layout= uiPupMenuLayout(pup);
                                uiItemsEnumO(layout, op->type->idname, "direction");
                                uiPupMenuEnd(C, pup);
@@@ -4511,14 -4511,14 +4511,14 @@@ static int delete_invoke(bContext *C, w
        uiLayout *layout;
  
        if(obedit->type==OB_SURF) {
--              pup= uiPupMenuBegin("Delete", 0);
++              pup= uiPupMenuBegin(C, "Delete", 0);
                layout= uiPupMenuLayout(pup);
                uiItemEnumO(layout, NULL, 0, op->type->idname, "type", 0);
                uiItemEnumO(layout, NULL, 0, op->type->idname, "type", 2);
                uiPupMenuEnd(C, pup);
        }
        else {
--              pup= uiPupMenuBegin("Delete", 0);
++              pup= uiPupMenuBegin(C, "Delete", 0);
                layout= uiPupMenuLayout(pup);
                uiItemsEnumO(layout, op->type->idname, "type");
                uiPupMenuEnd(C, pup);
index e3fdee554f7432d8e7bc26935d24a6c39b332210,e3fdee554f7432d8e7bc26935d24a6c39b332210..00b7a5057e4685b64051c1308b14872d9a01cb49
  /* DataToC output of file <blenderbuttons> */
  
--int datatoc_blenderbuttons_size= 146052;
++int datatoc_blenderbuttons_size= 176721;
  char datatoc_blenderbuttons[]= {
--137, 80, 78, 71,
-- 13, 10, 26, 10,  0,  0,  0, 13, 73, 72, 68, 82,  0,  0,  2, 88,  0,  0,  2,  0,  8,  6,  0,  0,  0, 94,187, 18, 70,  0,  0,  0,
--  4,115, 66, 73, 84,  8,  8,  8,  8,124,  8,100,136,  0,  0,  0,  9,112, 72, 89,115,  0,  0, 13,215,  0,  0, 13,215,  1, 66, 40,
--155,120,  0,  0,  0, 25,116, 69, 88,116, 83,111,102,116,119, 97,114,101,  0,119,119,119, 46,105,110,107,115, 99, 97,112,101, 46,
--111,114,103,155,238, 60, 26,  0,  0, 32,  0, 73, 68, 65, 84,120,156,236,157,119,120, 20,213,254,198,223, 51,101,251,166,147, 30,
-- 58,  4,129,208,  3, 74,  2,130,116, 17, 69,184,162,128,160,226,245, 94, 44,168, 88,126,130,  5, 21,  5,162, 94, 21, 69, 17,229,
-- 90, 16, 68,175,168, 32,241, 42, 77,  1, 41, 82, 69, 18,138, 92, 74,164,133,146, 72,250,246,153,243,251, 99,119,134,205,102, 91,
-- 96,163,128,231,243, 60,243,236, 78,123,231,156,169,239,124, 79, 25, 66, 41, 69, 67, 65,  8,233, 64, 41, 45, 96,154, 76,147,105,
-- 50, 77,166,201, 52,153, 38,211,252, 43,193,213,119,  5, 66, 72,196, 29, 25, 33,132,122,134, 62,151,186,102,164,180,188, 53,149,
-- 33,130,154,125, 60,154,207, 69, 80,179, 33,211,217,231, 82,213, 84,242, 27, 73, 93,239,125, 24,169,253,233,149,206,136,157,247,
-- 13,173,121,177, 90,254, 52, 35,117,142,250, 57,238,207, 69, 80,179, 33,211,217,231, 82,211,244, 61,127, 34,161,235,239,156,188,
--216,253,233, 39,157, 23,125,222,255, 81,154, 23,170, 21, 70, 58, 35,189, 79, 35,254,108,186,148, 17,234,179,112, 67, 24, 12,  0,
--160,148, 18, 47,125,114,169,106, 42, 16, 66,168,162, 31,  9, 34,169,229, 97,109,164, 53,125,246,103,164,120,142, 82, 74,  8, 33,
--235,  0,244,137,144,230, 90,143,230, 69, 31,119,159,188, 70, 68,183, 33,205, 21, 16,185,243,190,161, 53,189,167, 93,204,185,234,
--171, 25,137,243,222,223,113,143,164,102,164,174, 37,159,245, 35,114, 45, 53,196, 57,239,231,252,185,104, 93, 95,205, 72, 92, 75,
--190,154,145, 56,239,255,  8, 77,101,250,197, 92, 75,254, 52, 35,113,222,  7, 58,246, 23,171,123,185, 80,175,  8, 86, 67,238, 24,
--207,  1,232, 27,105,205, 72,167,185, 33, 76,102,164,163, 56, 13,169,137,200, 30,163,231, 60,154,207, 69, 80,179,111,164,142,145,
--239,185, 19,137,183, 46,111,205, 72,157,155,126,210,121,209,199,201,159,230,197,166, 55, 64, 58, 47, 10,127,154, 23,123,222,255,
-- 81,154,136,236, 49,138,200,181,228,163, 25,177,107,201, 55,191, 17,140,  8,246,  5, 34,119, 45,249, 73,231, 69, 31, 39,127,154,
-- 23,155,222,  0,233,188, 40,252,105, 70, 48, 34, 26,113,221,203,129,122, 69,176, 26,138,134, 48, 66,128,251,162,139,164,118, 67,
-- 68,113, 26, 42,210, 22,169, 40,142, 31,221,117, 17,148,139, 88,180, 73,193,147,190,136,188,209,250,209,126,142, 16,242,108,164,
--117, 35,  9,187,150,216,181,132, 75,236, 90,242,119,222, 92,236,181,212, 80, 47,207,222,154,145, 50, 66,126,242,126, 81,215,146,
--239,186,145,184,150, 66,104, 94, 84,132, 57, 80,254, 47, 70,247,114,161,222,117,176, 26,138, 72,148,247,  6,208,139,104, 84, 44,
--210, 52, 80, 58,251, 94, 14,121, 71,  3,164,147, 16,242, 92,  3,229,253,114,217,167,236, 90, 98,215, 82, 68,136,228,181,228,115,
-- 78, 70, 36,173,145, 62,207,253,105, 70, 98, 27,222, 26,145, 58, 71, 27, 58,239,145,188,150, 26,226,216, 95, 46,212, 59,130,213,
-- 80,111,199,151,131,102, 67,104, 55, 80,222,215,161,  1,222, 14, 26,160, 94,215, 58, 68, 62, 42,240, 28, 34, 88,228,168,228, 57,
--146,105,109,200, 98,194,134, 56, 55, 27,242,124,143,100, 61,143,  6,202,251, 58, 92, 30,199,125, 29, 34,156,206, 72, 93, 75,126,
--142,249, 58, 92,100, 90,253,237,191, 72, 23, 97, 71,242,220,108, 72,205, 72,104, 55, 68, 58,  3,232,174,195, 95, 32,114,165, 64,
--104,  3,118,211,192, 96, 48, 24, 12,  6,131,241, 87, 36, 96,  4,171,107,215,174,249,122,189,190, 85,160,249, 53, 53, 53,197,187,
--118,237,186,174, 97,146,197, 96, 48,174, 36,  8, 33, 28,206, 87, 73,144,  1, 80,202,222,238, 24, 12,198, 21, 76, 64,131,165,209,
--104, 90,172, 95,191, 62, 83,150,101,184, 92, 46, 72,146,  4, 73,146,224,114,185, 96,183,219,241,183,191,253,173,222,197,139,157,
-- 59,119, 94,207,113, 92,179,250,172, 35, 73,210,209, 95,126,249,165, 87,160,249,201,201,201,155,  0,180, 32,228,124,212,145, 16,
--  2,101,220,123, 58,199,169, 85,206, 78, 30, 59,118,172,107, 48, 77, 66, 72, 11,111, 61, 95, 45, 63,186, 65, 53,175,186,234,170,
--237,130, 32,100,248, 91, 63,144,182, 44,203,135, 11, 10, 10,114,  2,105, 50, 34, 75,231,206,157,215,243, 60, 95,239,243,115,215,
--174, 93,  1,207,207, 14, 29, 58,252,204,113, 92, 26, 80,247, 24,  7, 56,159,120, 73,146,126,253,229,151, 95,122,  5, 50, 32,169,
--169,169,155, 40,165, 45,194, 60, 47, 21,142, 31, 59,118, 44, 59, 80, 58,149,235, 40, 88, 58,253,104,  7,213,244,210,224,210,211,
--211,243, 18, 19, 19,239,173,169,169,177,  2,160, 28,199,209,118,237,218,213,210,151, 36,233,236,190,125,251, 58,132,210, 99, 48,
-- 24,140,203,129,128, 38, 73,150,101,206,102,179,225,192,129,  3,240,119,159,231, 56, 78,170,239,198, 40,165,153,107, 22, 47, 76,
-- 50, 36, 38, 67,114,216,161,107,148,164,106,151,237, 45,128,228,112, 64,118, 58,208, 40,251, 26, 37, 13,232,219,183, 47, 31, 66,
-- 54, 99,242,228,201, 73, 81, 81, 81,176, 90,173,176, 90,173,176,217,108,176,217,108,176,219,237,176,219,237,112, 56, 28,112, 56,
-- 28,112, 58,157,176,217,108, 40, 40, 40,  8,154,118, 66, 72,198,131, 15, 62,168,106,218,108, 54, 88,173, 86, 85,203,102,179,169,
--154,118,187, 29, 54,155, 13,123,246,236,  9,170, 41,  8, 66,198,206,157, 59,147, 52, 26, 13, 40,165,144,101, 25,148,210, 90,131,
--207,190, 66,110,110,174, 35,212, 62,101, 68,148,204,165, 47,205, 72,210, 37, 52,130,236,116, 34,161,115, 55,  0,238, 99,113, 98,
--205,119,144,157, 78,200, 78, 39,154,222, 56, 82,157,222,167, 79,159, 80,231,103,211, 47,166, 77,141,213, 68, 69,193,101,181,162,
--249,176, 17,234,140,194,119, 94,  7,117, 58, 65, 93, 14,116,124,228,105,  0, 64, 73, 73,137,165,109,219,182, 39,225,174,167, 16,
-- 40,194,147,113,228,200,145, 36, 37, 13,222, 16, 66,192,113, 92,173, 97,195,134, 13, 24, 55,110, 92,168,188,103, 60,245,212, 83,
-- 73,202, 53,226,125,174, 59,157, 78,245,250,113,185, 92,112, 58,157,176,219,237,248,249,231,159, 67,105,130, 16,194,165,166,166,
--190,212,187,119,239,  9,139, 22, 45, 50,125,245,213, 87,166,230,205,155, 67,163,209,128,231,121,240, 60, 15,142,227,192,243, 60,
--134, 15, 31,254,151,169,155,193, 96, 48,174,124,  2, 26, 44,135,195,113,100,208,160, 65, 20,  0,236,118,123,186, 86,171,213,120,
--207,151,101, 57, 45, 55, 55,247, 87,223,245, 66, 21, 29, 26, 18,147,241, 65,243,120,  0,192,168, 67,165,  0,220, 15,133, 37,215,
--118, 81,151, 25,243, 91,185,123, 89,131,  1, 28,199,  5,189,233, 18, 66, 96, 54,155, 49,104,208, 32,104,181, 90,116,235,214, 13,
-- 26,141,  6,162, 40,  6, 28,194,193,100, 50,225,249,231,159,  7,  0,  8,130,  0,147, 94,135,251,122, 95,  3, 61,161,248,224,151,
--253,176, 73, 50,  4, 65,128, 32,  8, 16, 69,177, 78, 68,202, 31, 26,141,  6,  5,  5,  5,224,121, 30,130, 32,212,250,229,121, 30,
--203,151, 47,199, 45,183,220,  2,158,231, 97, 52, 26,129,191, 80,101,192, 75,  5, 93, 66, 35,124,209,199, 29,136,188,253, 88,165,
-- 58,253,187,209, 55,170,255,199,159,168,  6, 33,  4, 26,141, 38,188,227, 30, 21,133,255,222,114, 61,  0, 96,228,129, 51,234, 57,
--179,251,245, 25, 16,181, 90,  8,162,  6, 29, 38, 63,133,146,146, 18,203,200,145, 35, 55,232,245,250, 21,161, 52, 41,165, 56,122,
--244,168,170, 37,138, 98,157,243,158,227, 56,124,248,225,135,248,237,183,223,194,202,187,197, 98,193,204,153, 51,213,188,249,211,
--245,254, 31, 42,239,132, 16, 46, 37, 37,229,197,222,189,123,143, 91,180,104, 81, 28, 33,  4,115,231,206,133, 32,  8,184,225,134,
-- 27,144,144,144,128,149, 43, 87, 66,163,209,224,241,199, 31, 15, 43,141, 12,  6,131,113,185, 16,208, 96,237,218,181,235,122,229,
--255, 53,215, 92,179,111,195,134, 13, 87,121,133,242,225,114,185, 52, 46,151, 43, 83, 41, 54,116,185, 92,176,217,108, 24, 51,102,
-- 76,208, 55,122,201, 97,175, 53, 30,232, 38, 29,206,131, 75,193,110,183, 99,212,168, 81,  0, 16,210, 92,133,249, 96,128,205,102,
--131, 32,  8,104,217, 36, 17, 79,143,202, 70, 46, 79, 97, 41,  5, 80, 82,141, 59, 83,  5,236,202,200,196,156,163,165,248,173,162,
-- 10,130, 16, 94,105,169, 44,203,181, 12,149,239,255,121,243,230, 97,244,232,209,224,121,190, 78, 17, 18,227,143, 65,118, 58,107,
--141,251, 59,  6,245, 61, 54, 46,171, 21,  0,192,123, 25,114, 81, 20,161,213,235,193,139, 34,  4,173,  6, 37, 37, 37,150,129,  3,
--  7,254,100, 48, 24, 22,164,164,164,156, 56,126,252,120, 64, 61, 66,  8, 40,165, 16, 69, 17,130, 32,  4, 60,231, 63,252,240, 67,
-- 44, 92,184, 16, 61,122,244,  8,235,156,183,219,237,208,104, 52,152, 49, 99, 70,157,249,239,188,243, 78, 29,131, 21, 66,143,  0,
--224,146,147,147,239, 91,188,120,113,180,178,253,132,132,  4,136,162,136,172,172, 44, 68, 69, 69, 97,195,134, 13,144, 36, 41,108,
--179,202, 96, 48,254,178,136,  0, 58,  3, 72,  4, 32,  1,168,  4, 16,235, 53,255,172,231, 55,209,107,124,155, 31,157,238,158,101,
--148,249,202,184, 29,128,214,207,244, 82,  0,  6,207, 96,  3,176,  9, 64,150,215,118,148,245,188,211,177, 13,240, 24, 44,226,238,
-- 85,117, 45,128,190,254, 58,191, 83,138, 11,247,239,223,239,183,184,208,155, 80,205, 59,117,141,146,212,200,213,231, 45, 19,212,
--233,163,139,202,212, 27,236,127,123,180,134,206,108, 66,246,115,175,  4,221,150, 39,237,176,219,237, 56,115,230, 76,157, 55,239,
-- 11, 53, 88,  0,224,116, 58, 97, 48,232,240,195,187,215,162,248,176, 11, 51,242,143, 97,217,214, 35, 16,  4,  1,195,174,106,141,
--191,185,128,188,120, 61,254,233,146,224,144,105, 88, 15, 48, 74,105, 29,115,229,109,178,  8, 33,234, 52,246,176,249,115, 72,232,
--220, 77,141, 92, 45,106, 28,165, 78, 87,162, 86,  0,176,172, 75, 51,232,163,204,200,122,104, 74, 72, 61, 66,  8,154, 15, 27,161,
-- 70,174,190,233,214,  2,130, 70,  3, 81,167,197,223,126, 57,  6,192, 93, 44,216,175, 99,187,117,101,188,246,163, 59,238,184,227,
--240,154, 53,107,140,225,164, 85,163,209,212, 50,108,254,204,149, 32,  8,112,250,152,198, 64,233,180,217,108,  1,141,147,114, 93,
--213, 39,130,  5,  0, 53, 53, 53,246,101,203,150, 97,206,156, 57, 72, 72, 72,192,160, 65,131,144,146,146,130, 37, 75,150,128, 82,
--138,  7, 30,120,  0,  6,131,  1,  6,131,129,157,243, 12,198, 95,156, 16, 94,228,218,169, 83,167,102,231,229,229,205,236,217,179,
--231,167,155, 54,109, 90, 76,  8,201, 87,102, 82, 74,135,121, 52,242,189,198,187,163,182,201, 18,  1, 36, 18, 66,242,149,229,189,
--199,189,166, 15,  0,160, 85,198,167, 78,157,154,149,151,151, 55,115,202,148, 41, 79,206,154, 53, 75, 51,117,234,212,142,121,121,
--121, 51,149,237,248, 75,  7,112, 62,130, 21,180, 23, 96,135,195,113,100,192,128,  1, 97,181,248,177, 88, 44,167,130,205, 87, 12,
--154,191, 74,222,202, 52, 93,148, 25,134,168, 40,144,224,165,131, 42, 78,167, 19,130, 32,128,227, 56,172, 90,181, 10,  6,131,  1,
-- 67,135, 14,189,224, 34, 66,197,180,105,181, 26,  8,177, 28,238,120,109, 59,206,158,171, 81,139,  4, 87, 23, 29,195, 86,131,  1,
-- 79,183,235,  8,115, 85, 17, 42,108,246,144,154, 64,224,  8,214,232,209,163, 97,181, 90,193,113,156, 58,141,227,184,  6,237,203,
--139, 17,156, 64,141, 16,  8, 33,208, 71, 71, 65,111, 54,131, 23, 66, 85,191,114, 67, 41, 61,111,132,180, 90,136, 58, 45,  4,141,
--187,196, 93,137, 92,149,241,218,143, 78,156, 56,241, 19,  0,125,184,  6, 75,137, 96,  5, 51, 87,130, 32,192,225,112,132,101, 94,
--108, 54, 27, 52,154,243, 53,  1,142, 30, 61,170,254,247,103,176, 66,228,153, 18, 66,100, 66,136,220,162, 69, 11,117,157,228,228,
--100,196,198,198, 66,150,101,200,178, 12,189, 94, 15,131,193, 80,107,187, 12,  6,227, 47, 75, 48, 47,162,203,203,203,155,233,109,
-- 96,128,218,134,198,219, 56,249,152, 40,133,107,167, 78,157,154, 21, 44,  1,222,102, 75,153,166,108,151, 16,146, 63,107,214,172,
-- 97, 33,210,161, 68,210,206, 23, 17,  6,235, 21,214,187,184, 48, 18,248, 43, 98,241,126,128, 25, 98,162,161, 53,153,224,169,126,
-- 21,212,216, 17, 66,224,112, 56,212, 58, 39,247,222,123,111,192,183,122,239,186, 41,161,176,219,237,224, 57, 30,208, 53,135,140,
-- 45,234,195, 74, 29, 52, 26, 20, 53,233,  4,114,234,  4,  4, 33,188,250,254, 74,  4, 75, 49, 81, 15, 60,240,  0,230,207,159,175,
-- 86, 76,  6,  0,158,231,209,166, 77, 27, 28, 58,116, 40, 44, 77, 70,100,161, 52,112, 52, 82,153,174,143,142,130,206,108,  6, 31,
-- 70,164, 81,153,175,214, 97,210,235,192,107, 52, 16, 52,238, 98,193,155,110,186,105, 93, 89, 89,217, 71,237,219,183,255, 31,220,
--221, 24,132,116, 66,202,245,227,239, 60,255,232,163,143,106,153,171,250, 68,176,148,235,200, 27,127,197,133, 35, 71,142, 12, 55,
--130, 69,  9, 33, 84, 20, 69, 12, 24, 48,  0, 29, 59,118,196,178,101,203, 32,203, 50,238,191,255,126, 24, 12,  6,204,158, 61, 27,
-- 46,151, 11,121,121,121, 44,130,197, 96, 48,130,121, 17,203,148, 41, 83,158, 36,132,228,123, 34, 73,133,158,229,253, 25, 41,127,
--116, 71,109,147,118,214,223, 66,222,145, 44,111,147,229,253, 95, 97,234,212,169, 89,126,210,161, 70,204, 84,131,229,229, 26, 27,
--148,178,189,  5,106,133,118,165, 88,144, 16,130,239,114,174,130,214,108,130,222,108, 70,175,165, 63,  2,112,191, 53,227,197, 87,
-- 67,106, 58,157, 78,213, 56,149,150,150,134, 44, 34, 12,  7,167,211,  9, 94, 35,226, 39,179,  8, 42,242,181, 30, 88,162, 40,130,
-- 19, 68, 20, 37,102,130,  8, 43, 33, 72,174,176, 30, 14, 74, 36,195,187,245,212, 29,119,220,  1,142,227, 84,147,213,165, 75, 23,
--239, 85,216, 19,231, 15,230,228,247, 43,240,237,109,238,107,213,187, 88, 48,191, 71, 43,232,162,204,208,153, 76,232,179,124,147,
-- 90,156,139,217,239,133,212,220,255,254,219, 40,124, 99, 22,  4, 81,196,136,157, 69,  0,220,145,171,220,171, 90,255,100, 55, 69,
--127,116,244,232,209,159,  0,112,183,221,118, 91,108,215,174, 93,195, 10,139, 17, 66,106, 85, 60, 23,  4,193,175,185, 18,  4,  1,
-- 46,151, 43,172,188, 59, 28,142,176, 34, 73, 74, 20, 43, 20,148, 82,218,182,109, 91,240, 60,143,152,152, 24, 68, 69, 69,169, 45,
--104,149,200,149, 82,127, 51,220,235,146,193, 96, 92,217,  4,241, 34,182, 89,179,102, 21,206,154, 53, 75,141, 36,121,150, 15,101,
--174,110,128,219, 76, 37, 42,230, 12,238,186, 84,254,234,103, 41,105,168,163,233,107,184,  0,119,100,203, 79, 58,212, 98, 73,191,
--181,179, 59,119,238,252,173,209,104,108, 30, 34,209, 42,245,233,116, 84,114,156,239,121, 64, 49, 87,132, 16,232,205,102,104,163,
--204,208,153,205,181,230,133,130, 16,162, 22, 17,242, 60,175, 62,116, 22, 44, 88,  0,179,217,140,187,238,186,235,130, 42,185,187,
-- 13, 22,143,175, 53,  7,  0,141, 80,231,161,197,139, 34,142,198, 52,  6, 39,138, 16,164,240, 34,  4,229,229,229,224,121, 30,207,
-- 62,251, 44,242,242,242,212,102,244,222, 77,235,149,101, 25,127, 14,222,149,220,107, 69, 85,163,162,212,243,211,123,122,168, 58,
--137,132, 16, 64,114,185, 91, 11,234,220,245, 32,149,200,149,221, 20,253,209, 85, 87, 93,165, 68,174, 56,163,209, 24,178,213,172,
--162,233, 93,223,208,215, 92, 41, 81, 82,229,191,211,233, 12,235,156, 87, 12,214,252,249,243,131,190,140, 40,219, 13,247, 60,229,
-- 56, 14,235,215,175,199,206,157, 59,113,239,189,247,194, 96, 48,224,205, 55,223,132,203,229,194,244,233,211, 97, 48, 24,160,213,
--106, 67, 11, 49, 24,140,191, 50,113,138,193,241,152, 36,  0,181,235, 92,121,155,160, 64, 69,133,158,136,211,250, 16,219,250,  6,
--110, 99,230, 23, 37,146,230, 61,205,119,187,128,199, 96,249,126,203, 75,171,213, 54,223,184,113, 99,166, 44,203,144, 36,  9,193,
--126,237,118, 59,110,189,245,214,176, 59, 29,149,157,110,131,197,249,180,148,211, 69, 71, 65,107, 62,255,  0,243,122,136,133,188,
--139, 43, 17, 44,111,131,245,236,179,207, 66, 16,  4,204,159, 63, 31,  0,240,216, 99,143,213, 59,130, 69,101, 96,147,180, 22,105,
--115, 59,129,126,164,199,233,245,251, 32,138, 34, 82,122, 12,132,156,253, 55,148,106,163, 97,242,212,171, 10,167,216,177,180,180,
-- 20,191,253,246, 27,  8, 33,120,228,145, 71,130,154,171, 85,171, 86,177, 58, 88,127,  2,138,193,226,120,119, 32,201,223,249,233,
-- 61, 61,156,243,147,186, 92, 16,117,186, 90,173,  5,203,202,202, 62, 58,122,244,232, 22,  0,100,220,184,113,177, 70,163, 17,239,
--191,255,126, 13,  0,205,210,165, 75, 13,161, 52,189,235,241,249, 70,174,124, 13,150, 36,133, 46,194, 86, 94, 42,194,137,246,214,
--199, 96, 41,231, 55, 33,  4,146, 36,169,145, 43,167,211,169,142,235,116,186,144, 58, 12,  6,227,202, 39,196,119, 69,207,250,212,
--115, 34, 62,145,166,179,158,117,107, 25, 43,239,226, 64,175,255,222, 81, 17, 69,215,238, 83,116,232, 59, 93,249, 45,157, 53,107,
--214, 15, 74,228,202,107,122,173,116,  0,  1, 34, 88, 28,199,193,102,179, 97,239,222,189,193,247,198,249,229,195,238,116, 52,161,
--219,213, 24,243, 91, 57,  8, 33, 88,217,187, 61,244,102, 51, 52,102, 19,114,190, 88,171,222,176,139,242, 30,135,198,100, 70, 66,
--175,129, 33,245,148, 27,183,175,193, 42, 43, 43,131, 40,138,120,241,197, 23,193,113, 28, 94,122,233, 37,164,167,167,163,184,184,
-- 24,125,250,244,  9,169,233,116, 58,193,201, 28,244,119,198, 67,255,207, 40,112,247,182, 66,214,141,255, 68,121,101, 51,236,182,
--155,208,182,250,  0,226,190,127, 14, 14,217, 21, 86, 55, 13,132, 16,184, 92, 46,252,240,195, 15, 16, 69, 17, 46,151, 75,125,248,
-- 80, 74,213, 94,242,149, 78, 29, 95,122,233,165,176,246, 39, 35,178, 52,190,225,102,220,113,178,  6,  0,240,109,206, 85,208,153,
-- 76,208, 70,153,209,235,171,245,234,249,121,120,230,163,208,152,204,136,237,222, 59, 44,205,118,247, 63,134,182,247, 61,138,146,
--146, 18,203,128, 46, 89,235,203,121,221,135, 29, 58,116, 80,235, 92, 25,141, 70,232,245,122,226, 25, 15,233,212,189, 77,121, 40,
--115,165,252, 15,  7,167,211, 89,167, 21,174, 63,194, 45, 34, 84,224, 56, 14,119,221,117, 23, 82, 83, 83, 49,103,206,156, 90,145,
--171, 39,159,124, 18, 78,167, 19,179,103,207, 14, 91,143,193, 96,252, 37,  9, 88,164,231,135,238, 94,102, 41,212,122,129,230,215,
--103,123,126,241,123,231,181,217,108, 69,253,251,247,247,187,130,205,102, 75,215,233,116,181,238,174, 74,167,163,190, 69,133,132,
--144, 14,148,210,  2,239,101,149, 74,196, 74,107, 44,157,217, 12,173, 79,177,139,214, 28,  5,209,100,  6,231,231, 38,238, 79,211,
-- 95,  4, 75, 41, 58, 41, 47, 47,135, 40,138,152, 51,103, 14,162,163,163, 97,179,217,252, 85,176,247,171,201,243, 60,106,126,171,
--193,145,103,118, 67,103, 58,136, 54,  3,163, 16, 37, 30, 66,235, 31,151,194,229,178,  3, 94, 69,134,225,104,182,105,211,  6,207,
-- 62,251,108,157,238, 25,  2,209,173, 91,183,144,154, 23, 11,211,244,175, 73,  8,129, 46,202, 12,125, 84, 84,192,243, 83,240,211,
--119,147,175,166, 50, 95,137, 92, 85,105,140, 31, 30, 61,114,100, 11,  0,110,220,184,113, 49, 70,163, 17,243,230,205,171,  1,192,
--189,240,194, 11,198,166, 77,155,214, 57, 33,252,165,147,227, 56, 44, 88,176,160, 78,157,171, 64,  6, 43,156,116,186, 92,174, 58,
--  6,107,212,168, 81,117, 58, 26, 13, 20,193,242,151, 78,165,174, 90,163, 70,141, 96, 52, 26,213,207,110,233,245,122,232,245,122,
--181,119,248, 64, 69,173, 87,194,185,196, 52,153, 38,211,252,195,185,104,115, 20,  9,252, 26,172,159,127,254,121, 72,160, 21,114,
--115,115, 15,108,220,184,177,181,247,183,  9, 93, 46,151,198,102,179,101, 14, 31, 62, 60,228,171,178, 44,203,208,233,116,160,148,
--162,243,211,121,238, 87,120,238,124,145, 32,165, 20,177,185,  3, 64,120, 30,146, 36,195,233,116,134,108, 69,104,181, 90,107, 85,
-- 64,247,215,124,189,170,170, 42,104, 63, 63,190,154, 22,139,165, 86,189, 46, 34, 81, 28, 94,189,164,110,107, 66,207,118,194, 69,
--175,215,215, 42, 54,  9,149,148,176,133, 25, 17, 65,233,192,147, 82,138,172,  7,167,184, 35, 69, 60, 87,107,126, 76,247,222, 32,
--130,  8,217, 93,111, 41, 84,195, 16,114,246,236, 89,203, 77, 55,221,180,142, 82,250,193,240,225,195,127,133,187,130, 37, 53,155,
--205, 58, 81, 20,101,  0,191,  3,160,231,206,157,139, 57,113,226,132,108,181, 90,155,132, 74,231,250,245,235,113,240,224, 65,116,
--237,218, 85,141,124, 42,131, 82,124,127, 33, 17, 44,223,174, 24,124,199,195,237,166,193, 27,142,227, 16, 19, 19,  3,173, 86,139,
-- 23, 95,124, 17, 26,141,  6,  6,131,187, 20,116,246,236,217,234, 62,103, 48, 24,140, 43,137,122,127,176, 89,150,101, 62, 80,241,
-- 97,168,162, 66, 73,146,142, 95,125,245,213,245,221,222,233, 96,243, 41,165,199,127,252,241, 71,141,119,132,193,251, 55,192,180,
--144,154,219,182,109, 83,155, 83,  5,211,244,250, 31, 84,211, 55,239,225,212, 95,113,185, 92, 39, 66, 46,196,136, 24, 46,151,235,
--120,143, 30, 61,252,207,124,214,127,145,173, 36, 73, 65,143,187,211,233,252, 95,102,102,230, 73,179,217,252, 77,114,114,114,233,
--198,141, 27, 19,186,119,239,158,224,189, 76,247,238,221, 83,125, 86,179, 35, 72,247, 36,132,144,227,119,220,113,135, 38,196,249,
--232,251, 63,112,215,240, 30,205,194,194, 66,141,247, 58,161,126, 41,165, 65, 53, 61,252,118,253,245,215,115,254,174, 33, 95, 36,
-- 73,242,219,108,154,193, 96, 48, 46, 71,234,109,176,172, 86,235,177,254,253,251,251,109,247, 93, 83, 83,115,212,223,116,133,194,
--194,194,236,250,110, 47, 20,199,143, 31,207,185, 28, 52, 27, 34,239,140,200,210, 16,199,168,176,176, 48,128, 99,187,112,142, 30,
-- 61, 26,241,243,179, 33, 52,  1, 96,207,158, 61, 61, 27, 66,151,193, 96, 48, 46,117,234,109,176,194,237,142,129,193, 96, 48, 24,
-- 12,  6,227,175, 74,232,190,  5, 24, 12,  6,131,193, 96, 48, 24,245,130,  0,232,224,111, 70,125, 90,  7, 16, 66,252,106,  4, 35,
--148, 62,211,100,154, 76,147,105, 50, 77,166,201, 52,175, 60,205, 80,218,151,112,235,196,122, 65, 66,245, 68,125, 81,226,151, 73,
--211, 80,166,201, 52,153, 38,211,100,154, 76,147,105,254,185,154, 87, 26,172,136,144,193, 96, 48, 24, 12,  6, 35,194,212,187,146,
-- 59, 35, 50, 16, 66,120, 74,105,216, 61,224,135, 65, 44,128, 64, 31,116,179,  3, 40,187, 64, 93, 45,  0,209, 51,  0,238, 79, 12,
-- 56, 61,154, 12,  6,227, 10, 34, 59, 59,123,  2,165,116,  6,220, 95,129,122,113,251,246,237,111,253,217,105, 98, 48, 46, 87,  2,
-- 26,172, 86,173, 90,109,231, 56, 46,195,223,  7,136,  3,245,139, 35, 73,210,241,125,251,246,133,213,212,157, 16, 34,164,166,166,
--142, 50,153, 76,215,241, 60,159,235, 89,127, 99,117,117,245, 15,197,197,197,159, 83, 74,253,118,  5, 17,138, 22, 45, 90, 68, 91,
--173,214, 91,  9, 33, 99,  1,128, 82,250,137, 94,175,255,207,225,195,135, 43, 46, 68,143, 16,210, 42, 37, 37,229, 19, 81, 20,249,
-- 99,199,142, 93,  7,  0,141, 27, 55,254,193,110,183, 75,103,206,156, 25, 75, 41, 61, 88, 79, 61, 78,163,209,228,245,238,221,187,
-- 23, 33,228, 99, 74,233, 59, 23,146, 46, 63,232, 56,142,251,205,223, 12, 89,150,155, 94,128,158,  6, 64,204,236,217,179,227, 23,
-- 46, 92,216,165,184,184,184, 35,  0,164,166,166,238, 30, 55,110,220,207, 15, 63,252,240,239,  0,202,  1, 56,130,170, 48, 46,121,
-- 50, 51, 51,183,115, 28,151, 81,159,190,228,136,251, 19, 85,199,247,236,217,227,247,122,207,204,204,220,206,243,124, 70, 48, 13,
--127,255,101, 89, 62, 92, 88, 88,232,183,203,136, 54,109,218,108,230,121,190,121,168,180,249, 75,103,160, 46, 56,218,180,105,179,
--157,231,249,140,250,106,202,178,124,184,160,160, 32, 80, 58, 47, 72,243,143, 78, 39,  0,244,237,219, 87, 87, 93, 93,253,137,217,
--108,238, 84, 93, 93, 61,129, 82, 58,109,237,218,181,201, 28,199, 97,192,128,  1,211,178,179,179,143,232,116,186,185, 86,171,245,
--103,179,217, 60,102,237,218,181,182, 64, 90, 12,  6,163, 54,  1, 13, 22,199,113, 25, 59,119,238, 76, 50,153, 76,  0,160,126, 47,
-- 79,233, 37, 90, 25, 40,165,160,148,194,229,114,161,111,223,190, 97,109, 52, 35, 35,163, 67,155, 54,109,150, 60,240,192,  3, 77,
--110,188,241, 70,109,114,114, 50,  8, 33, 56,117,234, 84,102,126,126,254,237,115,230,204,121, 54, 35, 35,227,150,227,199,143,135,
-- 91, 81,142, 75, 77, 77,237, 15,224,206, 14, 29, 58,140,124,236,177,199, 52,185,185,185,144, 36,  9,223,127,255,125,239,215, 95,
--127,125, 78, 90, 90,218,151,  0, 62, 42, 46, 46, 94, 67, 41,149,195,212,237,210,188,121,243,255,172, 95,191,190,121, 81, 81,145,
-- 52, 98,196,136,143,  1, 96,227,198,141,157, 40,165, 36, 55, 55,247, 91, 66,200,173,148,210,159,195,202,184,155,225,147, 38, 77,
--186,229,254,251,239, 79,156, 48, 97,194, 56,  0,239,120,182,165,124,228,178,190,149,226,212,200, 21,165, 84, 19,100,185,100,132,
-- 31,201, 50, 29, 62,124, 56, 54, 55, 55,247,254, 51,103,206, 76,246,214, 61,125,250, 52,118,237,218,229,120,233,165,151, 94,223,
--184,113,227,219, 45, 90,180, 40,  3, 80, 93,207, 52, 51, 46, 33,120,158, 79,223,190,125,123,146,209,104, 84, 63,228,238,125,157,
-- 43,215,184,247,169, 73, 41,197,181,215, 94, 27, 76, 51, 99,199,142, 29, 73,  6,131, 65,189,119,  4,211,243,210, 12,104,216, 57,
--142,107,186,109,219,182, 36,163,209,  8, 74,105, 72, 61, 66,  8, 40,165, 65,191, 61,170,164, 83,175,215,135,165,169,144,155,155,
-- 27, 48,250, 92, 95, 77, 37,157, 61,123,246, 12,120,237,243, 60,159,177,115,231,206, 36,229, 43, 24,245, 72,103,208, 23,160,234,
--234,234, 79, 62,255,252,243, 17,201,201,201, 24, 62,124,248,202,246,237,219,107,141, 70, 35,190,253,246, 91,100,100,100, 52,138,
--142,142,254,239,172, 89,179,240,234,171,175, 54, 89,181,106,213, 98,  0, 35,130,233, 49, 24,140,243,  4, 51, 88, 48,153, 76,248,
--244,211, 79,253,126,126,198,247,127,211,166, 77,195,218, 96, 74, 74, 74,118,179,102,205,214, 45, 93,186,212,144,148,148,164, 78,
--119, 56, 28,136,142,142,198, 93,119,221,165, 29, 48, 96, 64,235,219,111,191,253,167,148,148,148, 62,167, 78,157,218, 30, 76, 47,
-- 53, 53,117,100, 86, 86,214, 91,147, 39, 79, 78,190,233,166,155, 16, 23, 23, 87,107,254,176, 97,195, 48,116,232, 80,205,225,195,
--135, 71,127,254,249,231,163, 63,254,248,227, 83,169,169,169,147,138,139,139,191, 12,166,107, 50,153,  6,116,238,220,249,253, 53,
--107,214,100,196,198,198, 34, 45, 45,141,123,230,153,103, 58,180,108,217,210,144,154,154,202,157, 60,121, 18, 95,126,249,101,203,
--113,227,198, 45,211,235,245, 19,172, 86,235,154, 80,121, 39,132,104,227,227,227, 31,255,231, 63,255,153, 80, 89, 89,233,218,185,
--115,231, 65,101,186, 78,167,155,118,205, 53,215,116, 37,132,124, 70, 41,253, 40,148,150, 23,106,228,138, 82, 90,129,243, 69,121,
-- 10, 78,101,126,152,145, 44,237,206,157, 59,227,114,115,115,191,178,217,108, 93,255,254,247,191,159,120,229,149, 87,180,209,209,
--209,209,  0, 72, 89, 89,217,185,231,159,127, 94,122,243,205, 55,159,104,223,190,125,255,141, 27, 55,142,232,218,181, 43, 43, 50,
--188,204, 49, 26,141, 88,190,124,185,223,207, 76,249,187,230, 99, 99, 99, 67,126,141,192, 96, 48, 96,213,170, 85,234,122,222,159,
--150,242,247, 63, 54, 54, 22,148,210,160,162,122,189, 30, 27, 54,108, 80, 63,  3, 20,232,190,164,252, 26,141, 70, 16, 66,130,214,
-- 53,213,235,245, 88,183,110, 93, 72, 45,229,215,108, 54,  3, 64,224,143,136,122,165, 51, 84,158,149,255, 38,147, 41,228,254,212,
--233,116,170,166,183, 70,160,113,207,203,113, 80, 81,131,193,208, 41, 57, 57, 25, 91,182,108,193,115,207, 61,167,205,202,202,194,
--129,  3,  7,192,113, 28, 38, 76,152,128,246,237,219,227,212,169, 83,104,223,190, 61, 54,108,216,208, 37,104,  2, 25, 12, 70, 45,
-- 66,214,193, 10,116,131,245,253, 15,212,253, 12,134,111, 11,131,102,205,154,233,204,102,243, 23,203,151, 47, 55, 36, 36,156,255,
-- 90,136,221,110, 71,101,101, 37,170,170,170, 80, 89, 89,  9,147,201,132,185,115,231, 26,198,142, 29,251, 69,179,102,205, 50,139,
--138,138,108,129, 52,  9, 33,175,239,218,181, 43,217,229,114, 65,171,245, 95,  5,137,227, 56,180,106,213, 10,147, 38, 77, 66,175,
-- 94,189, 82, 70,143, 30,253, 58,  0,213, 96,249,107,  9,145,154,154,250,246,198,141, 27, 51,180, 90, 45, 14, 28, 56,128,227,199,
--143, 99,226,196,137, 77,101, 89,198,177, 99,199,112,224,192,  1,156, 60,121, 18,239,189,247, 94,198,216,177, 99,231,  2,104, 29,
-- 44,239, 30,238,121,228,145, 71, 90,199,197,197,113,175,188,242, 74,121, 85, 85,213,123,158,233, 83,103,207,158, 61,166, 79,159,
-- 62,137,127,255,251,223, 41, 33,228, 83, 74,105, 29,195,226,163,233, 47,114, 37, 81, 74,247,249,172,214,214, 39,178,149, 12,247,
--183,240,202,253,104, 18,  0,209, 67,134, 12,121,212,102,179,117,253,241,199, 31, 15,246,234,213,171, 41,128, 98, 74,233, 89,  0,
--136,139,139, 51,189,241,198, 27,201,195,134, 13,251,117,192,128,  1, 93,135, 12, 25,242,232,217,179,103,103,  0, 40,129,231,243,
-- 46, 13,209,178,132,105, 54,156,166,167, 40,  9,130, 32,224,250,235,175,  7, 33,196,239,247, 54, 55,111,222,140,254,253,251, 67,
-- 20, 69,220,125,247,221, 97,107, 14, 30, 60, 24, 46,151,171,142,158,175,  1, 33,158,111,116,  6,203, 59,165,180,214, 55, 66,253,
--153, 11,239,193, 87,207,159,166, 44,203,126,181,  2,153, 44, 66, 72,208,123,157,119,222,195, 53,151,161,210,233,173, 41,138, 34,
--114,114,114,176,115,231,206,160,102, 43, 84, 58,  1,160,186,186,250,206,225,195,135,175,156, 56,113,162, 30,  0, 74, 74, 74,106,
--125,136,126,255,254,253,176,217,108, 88,180,104, 17,108, 54,219,189,117, 18,233, 71, 51, 18, 48,205,191,166,102,  8, 68,  0,157,
--  1, 36,  2,144,  0, 84,194,253, 28,180,195,253, 44, 44,  5, 96,240, 12, 54,  0, 85,  0, 26,121,214, 45,129,251,249,230,253,153,
--178,179,168,253, 81,232,238, 30,109,229,147, 93,137, 94,243,148,109,248,142,251,254,214,210,230,  0,128, 16, 66, 61, 67, 31,101,
--174, 18,182, 14,199, 92, 41, 55,199, 80, 80, 74, 31,152, 58,117,106,178,183,185,178,217,108,168,168,168, 64,101,101,165,250,123,
--224,192,  1,104,181, 90,140, 26, 53, 42,153, 82,250, 64,  8, 89, 13,207,243,216,185,115, 39,150, 46, 93,138, 35, 71,142,212, 89,
--224,208,161, 67,120,227,141, 55,240,234,171,175,162,162,162,  2,112,215, 47,242, 75,231,206,157,159, 27, 59,118,236, 79,125,251,
--246,213,  9,130,128, 93,187,118, 33, 51, 51, 19,155, 54,109,194,209,163, 71,113,238,220, 57,236,223,191, 31, 29, 58,116,192,193,
--131,  7, 81, 81, 81,129,172,172, 44, 93,183,110,221,126,108,214,172,217,115,129,116,  9, 33,154,244,244,244, 39,255,249,207,127,
--234,138,139,139,229,  5, 11, 22,108,164,148,110, 34,132, 76,124,234,169,167,198, 15, 30, 60, 56,113,223,190,125, 21,219,182,109,
--219,238,207, 92,249, 65,199,113,220, 81,142,227,126,163,148, 86, 80, 74, 45,112, 87, 62, 87,241, 20,221,218, 44, 22, 75,121,105,
--105,105,  9,199,113,191,113, 28,119,  0,128, 46,144,230,184,113,227, 90,150,148,148,220,255,240,195, 15, 31,233,213,171, 87, 83,
-- 74,233,126, 74,105, 41,220, 39,172,205,229,114,149,150,149,149,253,154,155,155,155, 58,102,204,152,131, 37, 37, 37,247,143, 27,
-- 55,174,101, 16, 77,198,165, 15,149, 36,  9,162, 40, 98,237,218,181,216,176, 97,  3, 54,108,216,128,141, 27, 55, 98,211,166, 77,
--216,188,121, 51, 54,111,222, 12, 65, 16,176,105,211, 38,108,218,180,  9,147, 38, 77, 10,121,205, 75,146,  4, 65, 16,176,110,221,
-- 58,108,221,186, 85, 29,182,109,219,134,173, 91,183,194, 96, 48,132, 52, 67,222,120,234, 41,  5, 52, 83,111,191,253,182,106, 14,
--149,123, 19,199,113, 65,163, 98,190,198,197,215,176, 52,109,214,172,206,188, 80,233,  4,160,106,254,251,223,255,198,137, 19, 39,
-- 48,103,206, 28, 28, 58,116,  8, 47,191,252, 50, 10, 11, 11, 49,125,250,116,108,219,182, 13, 83,167, 78,197,143, 63,254,168,124,
--252, 61,104,245,  0,197,  8,230,228,228,192,225,112,168,233,217,191,127, 63,102,206,156,137, 93,187,118, 97,218,180,105,216,188,
--121, 51, 30,127,252,113,240,124,208, 32, 27,178,179,179, 39, 16, 66, 62,111,211,166,141,174, 95,191,126, 16,  4,  1, 51,103,206,
--148,167, 77,155,118,230,169,167,158, 58,147,159,159, 79, 91,182,108,  9,187,221,142,168,168, 40, 80, 74, 63,202,206,206, 14,117,
-- 63,102, 48, 46, 24,127, 94,196,139,107,167, 78,157,218,143, 16,146,159,147,147, 51, 14, 64, 44, 33, 36, 31,128,214,243,155, 48,
--117,234,212, 30,132,144,252,169, 83,167,102,  3,104, 68,  8,201,247,140, 95,  7, 32, 65, 25,247, 44,239,109,160, 68,  0,137, 94,
--211, 19,125,150,213,250, 27,247,253,245,213, 86, 35, 88,148, 82,226,185,192,213,155,145,114,211, 13,215, 96,133,186,225,154,205,
--230,161, 67,134, 12, 81,205,141,205,102,171, 21,185, 82,126, 43, 43, 43,241,235,175,191,162, 67,135, 14, 26,179,217, 60, 20,192,
--191, 66, 29, 24, 65, 16,144,150,150,134,146,146, 18, 20, 20, 20,160,105,211,166,112, 58,157, 88,177, 98,  5,202,202,202,160,209,
--104,160,209,104, 96,183,  7,247, 46,109,219,182,189,126,225,194,133,217, 31,127,252,241, 57, 65, 16,176,127,255,126,124,242,201,
-- 39,160,148,162, 81,163, 70,168,169,169,193,153, 51,103,240,250,235,175,195,225,112,192,108, 54, 35, 61, 61, 93,255,192,  3, 15,
--244,122,254,249,231, 69,  0,207,  5,144,190,122,228,200,145,209, 81, 81, 81,120,232,161,135,100,135,195,241, 42, 33,228,154,145,
-- 35, 71, 62, 57,105,210,164,248,162,162, 34,251, 61,247,220,179,221,225,112,188, 14,  0,132, 16,145, 82,234, 12,160,  5, 32,120,
--228,202,229,114, 41,251,244, 72,101,101, 37,146,146,146,154, 80, 74, 53, 33,142,145,102,211,166, 77, 57,  0,248, 23, 94,120, 65,
-- 79, 41, 61, 13, 47,211,230,112, 56, 20, 77, 87,121,121,249,153,199, 31,127,220,181,120,241, 98,222,179,206, 94,  0,214, 96,226,
--140, 75, 19,197,184,136,162,136,235,175,191,190,150,161, 88,191,126, 61,134, 12, 25,162, 94,239, 26,141, 70, 93, 46,148,166,119,
-- 84, 76,137, 60, 41,186, 63,252,240, 67,157,200, 75,152, 47,105,106,132,197,159,241,241, 53, 93,202,139, 98, 48,252, 69,155,188,
-- 35,243,254, 34, 67,225,164, 83, 20, 69, 76,154, 52,  9,130, 32,224,241,199, 31,135, 40,138,232,220,185, 51,  4, 65, 64,207,158,
-- 61, 33,  8,  2,174,187,238,186,176, 95, 80,149,116,110,222,188, 25,221,186,117, 83,211,211,185,115,103,116,239,222, 29,130, 32,
--160,119,239,222, 16,  4,  1,131,  6, 13, 10,169,169, 84,104, 55,155,205,248,245,215, 95,193,243, 60,  8, 33,165, 59,118,236, 72,
--  6,128,231,158,123,174,196,106,181, 38, 88,173, 86,244,239,223, 31, 57, 57, 57,137,139, 23, 47,126,  6,  0,107, 89,200,104, 48,
--252,121, 17, 15,186,188,188,188,153,148,210, 97,129,214, 85,230, 19, 66,242,103,205,154, 53,204,163, 87,103,220,179,184,247,199,
--229,175,157, 58,117,106,150,215,248, 89,101, 61,239,237,  5,219,182,207,242,103,  1, 47,131,229,201, 80, 95,175,113,191,  6, 43,
--144,209, 10,231,  6, 97,181, 90, 59, 43,209, 43,171,213, 90,203, 80, 85, 85, 85,213, 50, 90,118,187, 29, 45, 90,180,128,213,106,
--237, 28, 82,216, 11, 66,  8, 82, 83, 83,225,112, 56, 48,127,254,124,213, 88, 41, 56, 28,193, 27,189,237,217,179,231,200, 79, 63,
--253,212,181, 91,183,110,113, 95,125,245,213,217,  1,  3,  6, 36, 14, 30, 60, 24,122,189, 30, 86,171, 21, 46,151, 11, 87, 95,125,
-- 53,218,182,109,139, 51,103,206,224,219,111,191, 45,201,204,204,108,180,101,203, 22,249,212,169, 83,191,  5,145,238,223,191,127,
--127, 16, 66,240,237,183,223,254, 78, 41,221, 97, 48, 24,190,156, 57,115,102,172,205,102,147,199,143, 31,127,236,247,223,127,127,
-- 28,128, 83,167,211,253,107,224,192,129, 87,243, 60,255,153, 36, 73,245,190,153,217,108,182, 90,251,182,178,178, 18, 70,163, 49,
--156, 46, 33,196,178,178,178,142,  0, 96, 52, 26,227,  1,168,249, 47, 19, 36,  0,  0, 32,  0, 73, 68, 65, 84, 45, 36, 45, 22,139,
--122,140, 60,199,199, 26, 31, 31,111,  2,  0,207, 58,190,117,191, 24,151, 17,202,195,123,237,218,181,181,174,111, 37,  2,229,123,
--205,107,181, 90, 44, 95,190, 60, 44, 77,111, 51, 21, 70,113, 94,208,104,147, 98,176,  4, 65,192,123,239,185, 75,216, 31,122,232,
-- 33,117,125,223,109,132,194, 59, 82, 47,  8,  2,218, 62, 43,  3,112,224,248,107,122,136,162,251,148,246, 77, 51,128,176,163, 98,
--115,230,204,193,176, 97,195,144,159,159, 31,244,119,232,208,161, 97,165, 83, 16,  4,232,116,238, 96,177,146,158, 93,187,118,249,
--213,157, 55,111, 94,200, 58,109,178, 44,227,155,111,190,  1,199,113,181, 34, 94,207, 60,243,204, 63,163,163,163,205,235,214,173,
--195,233,211,167, 81, 93, 93,141,170,170, 42,196,197,197,197, 14, 24, 48, 96,215,169, 83,167,138,246,236,217,195, 42,188, 51, 34,
--142,175, 23,241,194, 50,101,202,148, 39,  9, 33,249, 83,166, 76,121,114,214,172, 89,133,158,229,243,125,214,207,247,179,110,173,
--249, 30, 19,164, 20, 15,118, 71,109,243,166, 20, 29,222, 16,100, 93,187,143,161,242, 45, 34,220,  6,132,136, 96,249,214, 77,  8,
--246,223, 19,226, 14,150, 47,200,178, 44, 16, 66,234, 24,  0,127, 17, 44,167,211,137,210,210, 82,200,178, 28,209,190,186, 66, 25,
--172,130,130,130,187, 38, 76,152,112, 50, 38, 38,166, 83,105,105,105,177, 78,167,235,189,126,253,250,198, 78,167, 19,209,209,209,
--136,142,142,198,127,255,251, 95,196,196,196,224,225,135, 31, 62,106,177, 88, 54,153, 76,166,100,139,197,242,203,169, 83,167,158,
-- 14,164, 43,138, 98,255,222,189,123, 99,199,142, 29, 40, 43, 43,251,158, 16,210,233,239,127,255,251,160,198,141, 27,147, 25, 51,
--102, 88, 15, 30, 60,248, 22,128,179, 38,147,233,223, 11, 23, 46,236,211,181,107, 87,243,248,241,227, 65,  8,121,159, 82, 26,118,
--100,168,166,166,166,150,177, 82,246,105, 84, 84, 84, 88,125,110,121,246, 55, 37,132,168, 13, 26,189,141,149,151,  1,166, 60,207,
--203,  0,104,164,143, 17,227,143, 69, 49,  4,162, 40,226,198, 27,111,172, 83,185, 93,163,209, 96,229,202,149,184,249,230,155,213,
-- 23,150,110,221,186,133,212, 85, 12,193, 77, 55,221,  4,192,109,  8, 86,174, 92, 25,208, 96,133, 42,210,  2,106, 71,155, 30,124,
--240, 65,136,162,136,183,222,122, 11,147, 39, 79,  6,207,243,120,237,181,215,192,113, 28,158,121,230,153,176,243,239, 93, 68,120,
--228, 37,247,111,198, 35, 21, 40,125, 39, 25,  0, 16, 21, 29,237,206,143, 28, 86,227,227, 90,121, 15, 21,185,242, 54, 86,161,138,
--  8,189,163,128,  7, 14, 28, 80,255,247,236,217,179, 86,228, 74, 16,132,144,134,205,179,189,233,253,250,245,155,145,145,145,145,
-- 52,113,226, 68, 34,  8,  2,178,179,179, 27, 77,155, 54,173, 92, 20, 69,253, 99,143, 61,230,175, 42,133,  8,160, 83,187,118,237,
-- 76, 97,239, 12,  6,163, 30,  4,137, 96,217,102,205,154, 85, 56,107,214, 44,191, 17, 42,175,245,135,  5, 51, 89, 94, 81,168,238,
--112, 27,161, 68,197,180,193, 93, 21,102, 91, 24,235,106, 21,115,229, 27,229,242,198, 55,130,245,188,247,204,112, 13, 86, 56,245,
-- 39,  0,192,104, 52,238, 46, 41, 41,233,169,211,233, 80, 81, 81, 81,231,161,237,109, 10,120,158,199,153, 51,103, 96, 52, 26,119,
--135, 20,174,  7,161,138,  8, 61,102,230, 81,101,156, 16,210,125,212,168, 81,139, 63,251,236,179, 22,171, 87,175,198,150, 45, 91,
--208,168, 81, 35,204,156, 57,243,112, 81, 81,209, 24, 74,105,192,131,225, 77,203,150, 45,219,155,205,102,108,220,184, 17,  0,126,
--  4,112,231,125,247,221, 71, 28, 14,  7,230,206,157, 91,  3, 96,117, 76, 76,204,151, 75,150, 44,233,212,169, 83, 39,221,234,213,
--171, 43,183,108,217,178, 54, 76,115, 37, 81, 74,253, 26,171,202,202, 74, 84, 87, 87,195,108, 54,135, 99,176, 92,209,209,209,  5,
--149,149,149,183, 90, 44,150, 10,157, 78, 23, 85, 81, 81, 97,243,142, 48, 86, 85, 85,161,186,186, 26,130, 32,136,  7, 14, 28, 56,
--  9,160,101,116,116,116,  1,128, 11,234,183,140,241,231,195,113, 28, 85, 76,198,234,213,171,253, 94,235,162, 40, 98,197,138, 21,
--181,174,247,111,191,253, 54,160,166,119, 20, 71,105, 73, 24, 42,130,165,172, 26, 42,189,162, 40,130,231,121,188,243,206, 59,160,
--148,170,145, 43,142,227, 48,101,202, 20,232,116, 58,188,248,226,139,152, 50,101, 74, 88, 81, 44,239,168, 88,243, 39, 44,234,116,
--101, 93,135,221,238,142,210,115,156,183,201, 10, 43,210, 22,170,130,123,184,248, 70,218,116, 58, 93,192,202,237,190,171,  6,210,
--220,190,125,251,  7, 93,187,118, 61,152,152,152,184, 42, 39, 39, 71,183,125,251,118, 76,154, 52,137,216,108,182,232,213,171, 87,
--171,219,245,133, 82,138,234,234,106,125,216,137,103, 48,234,129, 63, 47,226, 33, 78, 49, 78, 30, 51, 20,174, 94,190,247,242,138,
--134,175, 41,242, 68,196,214,135,210,242,183,110, 32,  4,207,194,117,174, 34,223,155, 68, 40,163, 21,206,219,167,197, 98, 89,179,
--118,237,218,238, 55,223,124,179, 16,172,120,176,170,170, 10,201,201,201, 56,116,232,144,203, 98,177,132,236,254, 64,146,194,239,
-- 16, 61, 84,  4,203, 23, 74,233,182,172,172, 44,151,195,225, 64,235,214,173,145,158,158, 14,139,197,130, 55,222,120,195, 21,174,
--185, 34,132,104,178,179,179,121,  0, 40, 47, 47,  7,220,173, 29, 50, 51, 51, 51,177, 99,199, 14,156, 59,119,110, 25,128,254,207,
-- 63,255,124,151,107,174,185, 70,243,217,103,159,213,220,123,239,189,203,156, 78,231,140,112,244,101, 89,182,187, 92,174,230, 28,
--199, 57,202,202,202, 78,120, 27,171,228,228,228, 56,179,217,204,157, 57,115, 38,104,125, 46, 15,142,142, 29, 59,110, 61,126,252,
-- 56, 94,120,225,133,179, 51,103,206,204,172,172,172, 60, 87, 94, 94,238, 82,140, 85, 69, 69,  5, 44, 22, 11,151,152,152,168,155,
-- 55,111,158, 17,  0, 58,118,236,184, 21,172,195,209,203, 26,223,  6, 45,190,230, 42, 84,139,183, 64,154,130, 32, 96,248,240,225,
--117, 34, 98,202,176,100,201,146, 90,245,154, 66, 21,189, 41,154,111,191,253, 54, 30,122,232, 33,232,116, 58,204,158, 61,187, 86,
-- 29, 44,127,171,  6,211,  4,220,166,173,249, 19, 22,156,122, 51, 30,162, 40, 34,225,222,211,181,138,  8,253,228, 45, 44, 35, 56,
--115,230,204,136, 20, 17, 42,  8,194,249, 46,113,230,207,159,143, 81,163, 70,225,199, 31,127,188,224, 34,194,230,205,155, 47,124,
--227,141, 55,116,123,247,238, 69, 69, 69,  5,206,158, 61, 11,171,213,138, 99,199,142, 41,249,244,187, 94, 77, 77,141, 33,172,  4,
-- 51, 24,245, 32,196,249,122,214,167,254, 20,241, 46,174, 11,242,235,187, 60,188,166,121,235,158, 69,237,134, 98,222,211,125, 77,
--149,239, 54,188,151, 81,235,118,  5,125,133, 82, 34, 88,225, 26,172, 48,138,  8, 95,127,246,217,103,239,239,213,171, 87,124,116,
--116, 52, 78,158, 60,233, 55,130, 21, 29, 29, 13,135,195,129,181,107,215, 86,200,178,252,122, 80, 81,192,233,116, 58,145,148,148,
--132,146,146, 18,200,  1,194,248, 28,199,193, 96, 48,160,170,170, 10,240,105,109, 23, 10, 74, 41,156, 78, 39, 28, 14,  7, 28, 14,
--  7,156,206,122,173, 14,  0,  6,165,195,214,234,234,106,  0,168, 78, 75, 75,107,169,215,235,149, 86,143,  7,  0,244, 27, 60,120,
--176, 88, 90, 90, 74,239,185,231,158,205,148,210, 73, 52,120,111,246,246,181,107,215, 54,  3,  0,131,193,112,  0,  0,142, 29, 59,
--230, 44, 43, 43, 67, 85, 85,149, 26, 33, 52, 24, 12, 24, 49, 98, 68, 10,165, 20,107,215,174,109,166,209,104, 40,  2,155, 33, 91,
--126,126,254,158,152,152,152,197,121,121,121, 99,110,184,225,134,194,142, 29, 59, 54,175,170,170, 58, 83, 83, 83, 99,177, 88, 44,
-- 84, 16,  4, 77, 66, 66,130,110,213,170, 85,  7, 55,111,222, 60, 48, 58, 58,122,113,126,126,254, 30,184, 67,171,140,203, 16,223,
--186, 77,254, 76,149,119, 69,242,112, 53,  1,183, 33, 88,177, 98, 69,208, 40, 78,184,154, 10,130, 32,224,209, 71, 31,197,155,111,
--190, 89, 39,130, 53, 99,134,251,157,228,169,167,158,170, 87,132, 72, 16,  4,156,122, 51, 30, 41, 15,254, 94,107, 26,  0, 16, 79,
--250,234, 83, 68,168,172, 63,125,250,116,136,162,168, 22,225, 13, 28, 56,176, 86,209, 96,184,198,202, 91,243,204,153, 51, 16,  4,
--  1,241,241,241, 24, 51,102, 12,  6, 13, 26, 84, 71, 47, 92,221, 99,199,142,253,252,234,171,175, 54, 73, 79, 79,199,103,159,125,
--102, 55,153, 76,218,126,253,250,209,242,242,114,  2,  4,142, 96, 89, 44, 22, 22,193, 98,252,209,132, 21,208,136,160,238, 69,111,
-- 47,224, 29, 40, 18,221, 52, 16,159,175,109, 23, 21, 21,149,167,166,166,142, 29, 61,122,244, 87,239,188,243,142,161,101,203,150,
--216,191,127, 63,206,157, 59,  7,135,195,  1,141, 70,131,180,180, 52, 84, 85, 85,225,139, 47,190,168,169,169,169, 25, 91, 92, 92,
-- 92, 30, 76,147, 16,242,212,245,215, 95, 63,239,233,167,159,214,183,111,223, 30,231,206,157, 67, 85, 85,149,250,230, 69,  8, 65,
--116,116, 52,140, 70, 35, 10, 10, 10,176,121,243,102, 11, 33,228,169, 96,154,190,200,178,172, 26, 43,197,104,133,106,153,228,163,
--105, 50, 26,141,  0,220,117,164,  0,184,154, 52,105,146, 12, 64, 49, 88,191,181,104,209,226,233, 86,173, 90,145,133, 11, 23, 82,
-- 74,233,106,127,230,202, 71,243, 92,159, 62,125,202,  0, 36,219,237,118, 13,  0, 84, 84, 84, 56, 18, 18, 18,146,116, 58,157,172,
--211,233,100,189, 94, 47, 23, 23, 23,187, 92, 46,151,  6,  0,250,244,233, 99,  7,112, 26,158,254,170,252,104,202,  0, 42,231,206,
--157,251,220,157,119,222,217, 51, 55, 55, 55,235,158,123,238,217,123,239,189,247, 34, 61, 61, 61,174,170,170,202,122,224,192,129,
--178,119,222,121,199,186,117,235,214,129,162, 40,254, 54,119,238,220,231,224,238,143, 68, 14,160, 25, 17,152,102,195,105, 42,117,
--127,252, 25, 43,239,241, 48,186, 81,168,149, 78,197,180,221,122,235,173,106,235, 67,223,200, 85,125, 53,  1,168, 45,  8,255,239,
--255,254,175, 86,250,158,126, 58, 96, 21,200, 90, 55, 39,159,188, 67,201,187, 32,  8, 40,159,159, 94,203,252,133,107,170,252,105,
-- 10,130,128,105,211,166,133, 29,193,242,173,131, 21, 44,157,125,250,244, 65,117,117, 53, 68, 81,196,202,149, 43,  3, 70,176, 66,
--237, 79,131,193, 48,102,217,178,101,159,232,116,186,142,118,187,253,238,146,146,146,  5, 53, 53, 53, 77,202,202,220, 31,124,  8,
--116,159,179, 90,173,106,183, 44,151,227, 57,207, 52, 47, 77,205, 43,141,160,175,120, 46,151, 11,141, 27, 55,174,245,109, 43,165,
-- 50, 59,207,243,106,203,147,112, 90, 16, 42, 20, 23, 23,175, 76, 77, 77, 29, 57, 98,196,136, 69,119,222,121,103, 84,219,182,109,
--197,166, 77,155,194, 98,177,160,168,168,  8, 69, 69, 69,174,239,191,255,190,162,166,166,230,246,226,226,226,149,161,244, 78,156,
-- 56,241,113,114,114,242,138,113,227,198, 77,235,210,165,203,196,201,147, 39,243, 45, 90,180, 64,121,121, 57,226,226,226,144,152,
--152,136,162,162, 34,124,241,197, 23, 82, 89, 89,217, 60, 73,146,166,159, 62,125,250,108, 40, 93,159,253,192, 59,157, 78,140, 30,
-- 61, 26,178, 44, 99,246,236,217,112,185, 92,161,203, 68,207,227,112, 56, 28, 20,  0, 41, 41, 41,  1,128, 26,197,112,253,239,127,
--255,  3,128,163,205,154, 53, 51,  3,192,154, 53,107,  8,128, 77, 97,234, 82,120, 69,178,218,182,109, 91,  4,212,190, 41, 42,145,
-- 43,207,168, 29, 94,230, 42,  0,214, 49, 99,198,156,181,217,108,131, 31,121,228,145,105,243,231,207, 31, 51,127,254,252, 58, 11,
-- 69, 71, 71, 47,126,237,181,215,166,143, 25, 51,230, 44, 88,247, 12, 87,  4,190,209,170,250, 86,  1,  8,164,249,245,215, 95,251,
--141, 96,213, 55,114,165,116,  5,227,175, 69, 98,176,123, 80,168,151, 33, 37,157,190,186,245,185,175,249, 75,171, 32,  8,120,229,
--149, 87,212,200,149,119,229,243, 11,137, 96, 41,154,241,241,241,  0,  0,147,201,  4, 89,150, 49,116,232,208, 11,214,245,124, 91,
--112,164, 50,158,157,157, 61,253,211, 79, 63,157, 65, 41, 77,  0, 32,120,239,131,112,246, 35,131,193, 56, 79, 64,131, 37, 73,210,
--113,229,219,130,222,  6,203,251,215,247,191,203,229, 58, 30,206, 70,139,139,139, 87,180,104,209,162,197,252,249,243, 31, 50,153,
-- 76,  3,172, 86,107, 71,  0,208,235,245,187,171,171,171, 87,115, 28,247, 70,113,113,113,216, 31,103,246, 24,166,  7, 50, 50, 50,
--102,143, 27, 55,110, 70, 78, 78,206, 45,247,220,115, 15, 17,  4,  1,159,127,254, 57, 61,113,226,196, 18,142,227,158, 58,121,242,
--228,161,112, 53,189, 49, 26,141,191, 46, 89,178,164,229,215, 95,127, 13,167,211,137,121,243,230, 65,167,211,253, 26,238,250,148,
--210,179,130, 32, 44,202,205,205, 29,179,121,243,230,197,148,210,  2,157, 78,247,201,181,215, 94, 59,118,211,166, 77,255,161,148,
--238, 21,  4,225,147,156,156,156,177, 91,183,110,253,146, 82,250, 75, 61,146,167, 70,178, 92, 46,255, 37,138,254, 34, 87, 33,168,
--152, 48, 97,130, 99,194,132,  9,143,220,114,203, 45,243,119,236,216,113,181,210,125, 67,108,108,236,238,110,221,186,109, 89,178,
--100,201,126,184, 35, 87,204, 92, 93,230, 40, 21,210,227,226,226,192,113,156, 58, 40,189,121,215,215,  8, 41,154,148, 82,196,197,
--197,249,125, 49, 11,162, 25,212,213, 80, 74, 97, 54,155, 85,205, 48, 91, 47,135, 12, 67,153,205,230, 90,105, 12,131,128,215,146,
--146,119,223,116,134, 34, 88, 62, 20, 77,147,201,  4,135,195, 17,182, 38,194,104, 52,224,205,246,237,219, 63,  0,240, 65,235,214,
--173,255,  7,160, 21, 51, 85, 12,198,133, 19,208, 96,237,219,183,207,239, 87,221, 35,197,225,195,135, 43,  0, 76,247, 12, 17,225,
--248,241,227,135,  0,220,154,146,146,242,175, 77,155, 54, 61,  3,  0,178, 44,191, 16,234,123,134,161,248,229,151, 95,110, 22, 69,
--113,238, 71, 31,125,148, 67, 41, 69, 76, 76,204,166,131,  7, 15,222, 87, 31, 13,151,203, 53,145, 16, 50, 89,105, 21,104,179,217,
-- 38, 18, 66, 30,163,148, 86,123,205, 87,199,235,  9,133,187,178, 93,106,128,249,225, 68,174,124,177,  2,176, 47, 89,178,164, 10,
--192, 46,156,239,231,202,233, 25,108,240, 42, 22,100, 92,190,184, 92,174, 19,125,251,246, 21, 66,189, 64,249, 89, 47,224, 11,149,
-- 36, 73,199,123,247,238, 29,242,165,204, 95, 90,130, 36,245,183,156,156, 28, 46, 92, 45,  5,167,211,121, 38,208, 60, 89,150,143,
--247,236,217,211,111, 58,131, 17, 42,239, 61,123,246,172, 87, 26, 61,105,  9,152,247, 11,213, 12,177, 63,  3, 98,177, 88,206, 37,
-- 38, 38, 86, 89,173, 86,209,102,179,137,190, 17,123,131,193, 80,175, 82,  0,  6,227,175,200, 21,217,127,145,199, 80,221, 24, 41,
-- 61, 79,125,168,127, 68, 64,199,234, 51, 94, 29,108,188,158,156,187,136,117,  3, 33,  3,176,132, 92,138,113, 89, 83, 80, 80,112,
--117,164, 53,247,236,217, 19,241, 23,180,130,130,130,158,161,151,170, 31,133,133,133, 17, 79,231,229,162, 25,140, 19, 39, 78, 68,
--252,156, 96, 48,254,106,212, 63,246,207, 96, 48, 24, 12,  6,131,193,  8, 10,  1,208,193,223,140,250,180, 14, 32,132,248,213,  8,
-- 70, 40,125,166,201, 52,153, 38,211,100,154, 76,147,105, 94,121,154,161,180,175,148,214,137,164, 33, 43, 49, 94, 46, 77, 67,153,
-- 38,211,100,154, 76,147,105, 50, 77,166,249,231,106, 94,105,176, 34, 66,  6,131,193, 96, 48, 24,140,  8,195, 12, 22,131,193, 96,
-- 48, 24, 12, 70,132, 97,  6,139,193, 96, 48, 24, 12,  6, 35,194, 48,131,197, 96, 48, 24, 12,  6, 35,162, 16, 66, 72, 70, 70, 70,
--159,180,180,180,136,119,175,114,185,112, 69,246,131,197, 96, 48, 24, 12,  6,227,143,167, 73,147, 38,177,146, 36,221,153,150,150,
--118, 95,203,150, 45, 91,  2, 64,122,122,122,  1,165,244, 13,131,193,240,201,193,131,  7,237,127,118, 26,255, 40, 26,180, 21, 33,
--131,193, 96, 48, 24,140, 43,159,180,180,180, 46,  0,238, 51, 24, 12,183, 95,125,245,213,218,126,253,250, 33, 46, 46, 14, 46,151,
-- 11,197,197,197,248,254,251,239,177,107,215,174,223,157, 78,231, 92,167,211, 57,247,236,217,179,167,255,236, 52, 55, 52,170,193,
-- 34,132,172,  3,  0, 74,105,159, 63, 49, 61, 12,  6,131,193, 96, 48, 46, 35, 82, 83, 83, 95, 29, 50,100,200, 35,113,113,113,104,
--221,186, 53, 82, 82, 82, 96,179,217, 96,177, 88, 64, 41,133, 32,  8,160,148,162,178,178, 18,219,183,111,199,150, 45, 91, 92, 21,
-- 21, 21,139,  9, 33,111,156, 60,121,242,103,111,173, 43,201,139, 16, 74, 41,  8, 33, 20, 64, 95,  0,160,148,174,251,115,147,196,
-- 96, 48, 24, 12,  6,227,114, 33, 45, 45,237,244,154, 53,107,146, 36, 73, 66, 73, 73,  9,108, 54, 27,106,106,106, 84,131,197,243,
-- 60, 40,165,112,185, 92,  0,  0, 89,150,177,119,239, 94,108,222,188, 25,199,142, 29,123,173,184,184,248, 81,  0, 87,156, 23, 81,
-- 43,185, 83, 74,215, 93,  9, 25, 98, 48, 24, 12,  6,131,241,199, 98,179,217,176,112,225, 66,148,148,148,160,113,227,198, 72, 79,
-- 79, 71, 76, 76, 12,244,122, 61,  0,168,230, 10,  0, 56,142, 67, 86, 86, 22,198,142, 29, 11, 66,200, 88,111,157, 43,201,139,176,
-- 74,238, 12,  6,131,193, 96, 48, 46,  6,167,195,225, 64,118,118, 54,142, 28, 57,130, 29, 59,118,160,107,215,174,104,215,174, 29,
-- 74, 74, 74,112,242,228,201, 90, 11,111,221,186, 21, 59,119,238,196,181,215, 94,251, 39, 37,247,143, 65, 41, 34,124, 14, 64, 31,
--224,202, 40,247,100, 48, 24, 12,  6,131,241,199,144,158,158, 62, 62, 49, 49,241,157,113,227,198, 25, 58,119,238,140,227,199,143,
--227,196,137, 19, 56,119,238, 28,186,116,233,130,172,172, 44, 28, 58,116,  8, 43, 86,172,192,206,157, 59,161,211,233,144,145,145,
--  1,243,226, 79,241, 77, 90,234,137,147, 39, 79,102,  0,184,226,188,136,119, 37,247, 62,192,149, 81,238,201, 96, 48, 24, 12,  6,
--227,143, 35, 45, 45, 45,129, 16,242, 84, 90, 90,218,253,183,223,126,187,216,170, 85, 43, 28, 63,126, 28, 37, 37, 37, 56,119,238,
-- 28,126,250,233, 39,  0, 64,122,122, 58,210,211,211, 81, 84, 84,132,130,130,  2,139,205,102,187,247,196,137, 19, 31, 43, 58, 87,
--146, 23, 97,221, 52, 48, 24, 12,  6,131,193,136,  8,105,105,105,141,  1, 60,223,170, 85,171,241,163, 70,141,226,210,210,210,112,
--226,196,  9,124,255,253,247,104,217,178, 37,206,156, 57,131,237,219,183, 75, 21, 21, 21,243, 36, 73,154,126,250,244,233,179,127,
--118,154, 27,138,  6,237,201,157, 16,210,129,105, 50, 77,166,201, 52,153, 38,211,100,154,127, 13,205,147, 39, 79, 30, 59,121,242,
--228, 93,  7, 14, 28,200,154, 49, 99,198,178,119,222,121,  7, 60,207, 35, 45, 45, 13, 63,252,240,  3, 93,179,102,205,146,170,170,
--170, 54, 39, 79,158,124,224, 74, 54, 87,  0,171,228,206, 96, 48, 24, 12,  6, 35,194,156, 58,117,106, 31,128,155,211,211,211,175,
-- 46, 44, 44,124, 18,  0,100, 89,126,225,212,169, 83,219,255,228,164,253, 97, 48,131,197, 96, 48, 24, 12,  6,163, 65, 56,113,226,
--196, 22,  0, 55,254,217,233,248, 51, 96, 31,123,102, 48, 24, 12,  6,131,193,136, 48,204, 96, 49, 24, 12,  6,131,193, 96, 68, 24,
--102,176, 24, 12,  6,131,193, 96, 48, 34, 12,  1,224,183, 37,  0,165,180, 32,108,145, 11,104,161, 16, 74,159,105, 50, 77,166,201,
-- 52,153, 38,211,100,154, 87,158,102, 40,237,250,248,143, 75,153,176,250,193, 34,132, 16,122,  1, 29,102, 17, 66, 58, 68,122, 71,
-- 49, 77,166,201, 52,153, 38,211,108, 24,205, 11,185,215,251,211, 36,132, 16,229,175,231,151,  2, 64,184,218,127, 84, 58, 27, 66,
--179, 33,242,254, 87,209,188,210,  8,218,